Don't ask to ask, just ask | |
PerlMonks |
Re: new to perlby brx (Pilgrim) |
on Jul 13, 2012 at 14:09 UTC ( [id://981627]=note: print w/replies, xml ) | Need Help?? |
Quick and dirty answer: ls -l *.TMP | perl -anle 'print "Mypath\\MyPerl_2.pl $F[-1]"'You can replace 'print' by system to execute commands. Caveat: if a filename contains a whitespace, this oneliner is wrong. Here, the real code executed (oneliners are not easy for beginners):
As you can see, it use split. You could want to use open to open a file. http://perldoc.perl.org/perlop.html#I%2fO-Operators to understand while ( ... = <>) And see how regex works in perlretut...
In Section
Seekers of Perl Wisdom
|
|