in reply to Problem with inline replace
You are using the regex substitution operator the wrong way at a place where a simple assignment is sufficient. Change to this:
if ($array[0] eq $requestid) { if ($enddate) { $array[9]= $enddate;} if ($state) { $array[10]=$state;} } print join(",",@array); print "\n";
PS: The following does the same but is probably faster (and might be what you intented with your version):
if ($array[0] eq $requestid) { if ($enddate) { $array[9]= $enddate;} if ($state) { $array[10]=$state;} print join(",",@array); print "\n"; } else { print; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with inline replace
by Marshall (Canon) on Aug 15, 2010 at 06:45 UTC | |
|
Re^2: Problem with inline replace
by Anonymous Monk on Aug 13, 2010 at 13:39 UTC | |
by jethro (Monsignor) on Aug 13, 2010 at 15:48 UTC |