P is for Practical | |
PerlMonks |
Re: Concatenation connected to find pipe behaves wierdly.by sfink (Deacon) |
on Jan 31, 2006 at 18:05 UTC ( [id://526829]=note: print w/replies, xml ) | Need Help?? |
find is giving you a list of filenames terminated by newlines. So when you print qq($_), you're printing out a newline after your filename. So all your foo are belong to us... dammit... all of your foo end up just after a newline, aka the beginning of the next line.
The quick fix isfind | perl -lne "print qq($_) . q(foo)" That will strip off the newline when reading each line in, and append a newline to the output of print.
In Section
Seekers of Perl Wisdom
|
|