On Nov 13, 7:11 pm, [EMAIL PROTECTED] (Marco) wrote: > Hi... > > Can someone help me on this? Actually I can get the dara from the > system()...But it shows "0" when I print the $result...How can I > assign the system() to $result ?....Thanks... > > here below is the code... > > $inact = "cat /proc/meminfo | grep -w Inactive | sed 's/^.*Inactive: // > g' | sed 's/kB//'"; > $result = system(cat /proc/meminfo | grep -w Inactive | sed 's/ > ^.*Inactive: //g' | sed 's/kB//'); > print $result;
If you want to write Perl scripts, then learn its methods. If all you want is shell calls, then do shell scripting. #!/usr/bin/perl use strict; use warnings; use Linux::MemInfo; my %meminfo = get_mem_info; print $meminfo{'Inactive'}; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/