in reply to o/p of system

Dear Monk,
Allow me to elaborate on what Corion has told you in the CB as well as here. Taking that line of code above I'd break it out as:

# $usr = system ("listusr | grep $_ | cut -d ' ' -f1,3"); # becomes: my @usr = map { (split(/[\t\n\s]+/,$_))[0,2] } grep /$_/,qx(listusr);
The problem with using system is, if you look at the documentation for the function call, is it does not return the IO stream of the execution like you think it might but it just executes the command and sends any output to STDOUT which you are not capturing in any way by using system. Using qx captures STDOUT and returns it as an array. See perlop for more info...

UPDATE: simplified the <code>map{ split(...)} stuff at Corion's suggestion. (Thanks Corion!)


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg