in reply to I am now slice-aware
Whilst array (and hash) are, indeed, most cool, your current problem could have been solved by investigating the rarely used third parameter to split.
@entry = split(/:/, $_, 8); $newentry = join(":", @entry);
Update: And if you're wondering why I only split into 8 elements when the original code used 9 (0 .. 8), I counted the ':' characters in the original data and saw that there were only 8 elements :)
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I am now slice-aware
by tadman (Prior) on Apr 17, 2001 at 19:15 UTC | |
by davorg (Chancellor) on Apr 17, 2001 at 19:19 UTC | |
|
Re: Re: I am now slice-aware
by jeroenes (Priest) on Apr 17, 2001 at 19:22 UTC | |
|
Re: Re: I am now slice-aware
by birdbrane (Chaplain) on Apr 17, 2001 at 19:29 UTC | |
by davorg (Chancellor) on Apr 17, 2001 at 19:33 UTC | |
by birdbrane (Chaplain) on Apr 17, 2001 at 19:44 UTC |