in reply to In place replace, ignoring between quotes
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) ? '&&' : $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: In place replace, ignoring between quotes
by trippledubs (Deacon) on Oct 25, 2013 at 19:09 UTC | |
by toolic (Bishop) on Oct 25, 2013 at 19:23 UTC | |
by SuicideJunkie (Vicar) on Oct 25, 2013 at 19:20 UTC | |
by trippledubs (Deacon) on Oct 25, 2013 at 19:47 UTC |