Hi Monks - I have a prblem going for match and assign statement. The result i get in $totmem, $freemem and $memdiff is Zero '0'. The Variables $OVERALL_MEM, and $OVERALL_MEM_FREE has value in the form like below: MemTotal: 148704012 kB MemFree: 32165204 kB Please see the code snippet below to see what possible error i made :
my $totmem = $OVERALL_MEM =~ /(\d+)/; print "totmem is : $totmem"; my $freemem = $OVERALL_MEM_FREE =~ /(\ +d+)/; print "freemem is : $freemem"; my $memdiff = $totmem - $freemem; print "Memdiff is :$memdiff KB ";
In reply to Match and Assign Problem by intoperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |