> > > Saurabh Singhvi wrote: > > HI all, > > Hello, > > > i want to write a perl script in linux that would get the file names > > in the directory i am running it in and then execute a system command > > for each file.(the encoding line). how should i go about it?? > > perl -mstrict -we 'for(`ls`) { chomp;print `grep foo $_`; }' >
Yikes, please don't shell out for this, and please don't suggest newbies should shell out for these calls. If you are going to write shell, why not just write shell. Your "script" is completely insufficient in terms of error handling, security, speed, etc. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>