Perl glob one liner

Posted by user260826 on Stack Overflow See other posts from Stack Overflow or by user260826
Published on 2010-12-24T09:07:01Z Indexed on 2010/12/25 0:54 UTC
Read the original article Hit count: 491

Filed under:
|

Im working in a perl one liner to invert the contents of my file contents or perform operations, I was able to generate the script and one liner, but this one liner only works by entering file by file.

perl -i -ne '$a=reverse $_;print "$a\n"' <filename>

I want to change my one liner to get input from a range of files but when i do:

perl -i -ne '$a=reverse $_;print "$a\n"' | ls -al

I just get screen output of ls -al Not sure how to proceed.

Thanks

© Stack Overflow or respective owner

Related posts about perl

Related posts about glob