use strict; use warnings; my $prtconfCmd = q{/usr/sbin/prtconf}; open my $prtconfFH, q{-|}, $prtconfCmd or die qq{fork: $prtconfCmd: $!\n}; my $memVal = q{}; while ( <$prtconfFH> ) { next unless m{^Mem.*?:\s+(\d+\s+\S+)}; $memVal = $1; last; } close $prtconfFH; print qq{Total memory is: $memVal\n};
I hope this is of use.
Cheers,
JohnGG
In reply to Re: File Handle qwerk?
by johngg
in thread File Handle qwerk?
by mbayer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |