use warnings; use strict; my $str = q(cd / ; /path/to/R/R_latest --vanilla --args "fName='rGSDPl +an';jobCode=682718;jobId=6827181;" < job682718.R > job_6827181.txt); my $new; my $out = 1; for (split //, $str) { $out = ! $out if /"/; $new .= (/;/ and $out) ? '&&' : $_; }
In reply to Re: In place replace, ignoring between quotes
by toolic
in thread In place replace, ignoring between quotes
by Klainn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |