s/^(\S\s+\S)/$1 $col[$i++]/e; - you have code you need executed in the replacement half of the substitution. Perl doesn't do that unless you tell it to.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] [d/l] |
Wrong. He wants it as a string, so it shouldn't have an /e. Quite the contrary, adding an /e would make his syntax invalid. You didn't even test your code, did you?
The only code I see is in the array index, and code in array or hash indexes is always executed, if the variable will be interpolated — thus: in double-quotish context. That's how the module Interpolation works.
| [reply] |
I think people get confused because of the /e being optional if there's just one thing there (e.g. s/(\S+)/$translate{$1}/e; is equivalent to s/(\S+)/$translate{$1}/;).
| [reply] |
meant following not subs e! $_ =~ s/^(\S\s+\S)/$1 $coli++/\e; | [reply] |
with
$_ =~ s/^(\S\s+\S)/$1, $col[$i++]/e;
stops in the same place? does this point to a key problem?
| [reply] [d/l] |
Without seeing the rest of your code, I can provide no further help.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] |