Just another Perl shrine | |
PerlMonks |
Re: loop to remove negativesby Athanasius (Archbishop) |
on May 15, 2012 at 04:31 UTC ( [id://970557]=note: print w/replies, xml ) | Need Help?? |
Hi BluGeni, You should prefer the more idiomatic syntax in Eliya’s solution. Just thought I’d mention that the code snippet you give, which you say “doesn’t seem to do the job,” should actually work fine, except that there’s a semicolon missing after $i=0; in the for loop:
Gives me:
as required. HTH, Athanasius <°(((>< contra mundum
In Section
Seekers of Perl Wisdom
|
|