commandline replace and running out of quotes

J

John Bagins

I am using the inplace edit of commandline perl in a per script.
How do I insert those doublequotes in the RHS?
system qq|perl -pi -e "s/(?=#FILE_MARKER)/" $var "/| file_name;

^ ^

Thanls

Eric Smith
 
J

John W. Krahn

John said:
I am using the inplace edit of commandline perl in a per script.
How do I insert those doublequotes in the RHS?
system qq|perl -pi -e "s/(?=#FILE_MARKER)/" $var "/| file_name;

Is that $file_name or 'file_name'?


You probably want something like this:

{ local ( $^I, @ARGV ) = ( '', 'file_name' );
s/(?=#FILE_MARKER)/" $var "/, print while <>;
}


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,204
Messages
2,571,065
Members
47,672
Latest member
svaraho

Latest Threads

Top