这是我遇到困难的旧 Perl 脚本的一部分。
变量$h突然在内部定义if,我无法弄清楚它的含义。
#!/usr/bin/perl
use strict;
use warnings;
use Scalar::Util qw(looks_like_number);
if (open(LIST,"/proc/partitions"))
{
while (<LIST>)
{
my @a = split(/\s+/);
print "@a\n";
if (looks_like_number($a[3]) && $a[3] > 100000000)
{
if (open(IN, "/dev/$a[4]"))
{
my $h;
if (read(IN, $h, 4) == 4 && $h eq 'EFI')
{
print "/dev/$a[4]\n";
}
close(IN);
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
它实际上是代码的一部分。
无论如何,它运行良好,但据我所知,没有任何内容被保存到变量中$h并且只是定义了。
与 相关吗looks_like_number?
你能告诉我我想念什么吗?