The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-22-2007
jingi1234 jingi1234 is offline
Registered User
 

Join Date: Mar 2005
Posts: 47
Problem with cat with PERL Substitute

system("cat FILENAME | perl -e 'while(<>) { print $_;}'");

system("cat FILENAME | perl -e 'while(<>) { $_ =~ s/XXX/YYY/g; print $_;}'");

First command works fine but second command gives the following error:

syntax error at -e line 1, near "{ =~"
syntax error at -e line 1, near ";}"
Execution of -e aborted due to compilation errors.


Any idea why?

- Jingi
Reply With Quote
Forum Sponsor