Change:
my $totmem = $OVERALL_MEM =~ /(\d+)/;
to:
my ($totmem) = $OVERALL_MEM =~ /(\d+)/;
For example:
use warnings; use strict; my $OVERALL_MEM = 'MemTotal: 148704012 kB MemFree: 32165204 kB'; my ($totmem) = $OVERALL_MEM =~ /(\d+)/; print "totmem is : $totmem"; print "\n"; __END__ totmem is : 148704012
In reply to Re: Match and Assign Problem
by toolic
in thread Match and Assign Problem
by intoperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |