(sorry joe, the earlier one to you was supposed to have been to the list instead) On Thu, 22 Dec 2005 10:10 , John Doe <[EMAIL PROTECTED]> sent:
>swayam panda am Donnerstag, 22. Dezember 2005 05.49: [ . . ] >> foreach ( system ls) { >> >> if (/1.pl/) { >> print ;}} >> Here the output is all the file of the CWD. > >Called this way, ls prints directly to STDOUT, and system returns the status >of the system call. Return values are *not* the file names. Yes, that's exactly what I was getting ie prints above the print statement and return value of 0 assigned -- the next code demonstrates. #!/usr/bin/perl -w use strict; my @ls_list = system("ls"); print "-------top--------\n"; print @ls_list, "\n----lslist-----\n\n"; # end -- Alan. ---- Msg sent via CWNet - http://www.cwnet.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>