David Monarres writes ..


>I am alos fairly new with perl and completely new with perl one liners.
>I see how you can use regex's on the cmd line to edit a file (sort of
>sed ish). I tried this
>
>$ perl -pe 's/hello/reverse($1)/' -i test
>
>all it print's is reverse. I was wondering if you knew of a way to read
>in a word and reverse it's contents. Not critical but it has intrigued
>me.

  perl -pe 's/hello/reverse $&/e' -i test

perldoc references (type any of the following on the command line):

  perldoc perlre
  perldoc perlvar
  perldoc perlrun

-- 
  jason king

  In Norway, you may not spay your female dog or cat.  However, you may
  neuter the males of the species. - http://dumblaws.com/

Reply via email to