- or download this
my $cmd = '/usr/bin/strings /etc/passwd';
open my $handle, "$cmd |" or die "open: $cmd: $!\n";
...
}
close $handle or die "$cmd; exit code($?): $!\n";
- or download this
#!/usr/bin/perl
# vi:ts=4 sw=4 et:
...
}
__END__
- or download this
$ perl read2.pl
/bin/cat: 100/100 successful!
/usr/bin/less: 38/100 successful!
/bin/more: 31/100 successful!
/usr/bin/strings: 40/100 successful!
- or download this
$ perl read2.pl
/bin/cat: 100/100 successful!
/usr/bin/less: 16/100 successful!
/bin/more: 26/100 successful!
/usr/bin/strings: 32/100 successful!
- or download this
$ perl read2.pl
/bin/cat: 35/100 successful!
/usr/bin/less: 0/100 successful!
/bin/more: 41/100 successful!
/usr/bin/strings: 37/100 successful!
- or download this
$ perl read2.pl
/bin/cat: 100/100 successful!
/usr/bin/less: 100/100 successful!
/bin/more: 100/100 successful!
/usr/bin/strings: 100/100 successful!