commandline replace and running out of quotes

commandline replace and running out of quotes

am 11.08.2007 23:47:06 von 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

Re: commandline replace and running out of quotes

am 12.08.2007 00:37:55 von Dummy

John Bagins wrote:
> 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
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall