Why isn't my perl one liner working?

Perl -pe 'm/\d Will simply perform a pattern match, the line printed will not be changed. If you want to only print the number, you need something like.

Perl -pe 'm/\d+/'; Will simply perform a pattern match, the line printed will not be changed. If you want to only print the number, you need something like: perl -pe 's/\D+//g' # change $_ or perl -nE 'say $1 if /(\d+)/' # only print the match But why not use all perl? Perl -nwE 'say $1 if /Failed.

*(\d+)/' paths.txt.

Thanks, it's been a long day and obvious answers were eluding me. Time for bed. – phileas fogg Sep 2 '11 at 3:07 BTW, I wasn't familiar with "say" before, nifty.

Thanks again. – phileas fogg Sep 2 '11 at 3:11 @phi - it's a new feature in Perl 5.10+ . Perldoc.perl.org/functions/say.html – DVK Sep 2 '11 at 3:15 @phil You are most welcome.

– TLP Sep 2 '11 at 3:40 Hmmm, the last example isn't working (I assume you meant a lower case 'e'). – phileas fogg Sep 2 '11 at 14:03.

Try using this instead: perl -ne '/\d+/ && print "$&\n.

Well, you need to do it only for the lines that match 'Failed'. – brian d foy Sep 2 '11 at 1:29.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions