When I am using "sed" in the command line then it is working but when the Pearl script is not included has been done.
An example sed 's / \ s + // g' aaa & gt; BBB But say I'm trying to call the same order via perl script The output file remains the same as the input file !!!! Please suggest. In Perl, backlit has only one escape and interpolation rules such as two quoted strings: a backslash Make the unknown escape code forget the backslash, eg Therefore, the Perl code output If you want to embed that code, then or with single quotes: which keeps backslash. However, this is unnecessary because the Perl replacement can apply itself. Use
$ gf = 'sed' s / S \ + //G 'AAA & gt; BBB`;
"\." Eq "." ".
print \ echo" 1 \ "` print 'echo \\ "1 \\" `; < / Code>
1 "1"
Sed command in Pearl, you must avoid backslash so that they
sh alay:
$ gf = 'sed' s / \\ s \\ Actually, you will not get any output in
$ gf because you can not output any Let's redirect to the file. Can use
Autodi; The system "sed 's / \\ s \\ + // g' aaa & gt; Bbb ";
use
autodyne; system q (sed) / \ s \ + // g 'aaa
Autodie; # Automatic Error Handling Open My $ Out, "& gt;", "BBB"; Open your IN $, "& lt;", "AAA"; While (& lt; $ In & gt;) {s / \ s \ + // g; # Remove all locations with a plus print {$ out} $ _;}
No comments:
Post a Comment