in reply to I am now slice-aware
Slices do rock and so does "Effective Perl Programming", what confuses me is why is the code:
Do you need the brackets around the @entry? What am I missing?(@entry[0..8]) = split(/:/,$_); $newentry = join(":", @entry[0..8]);
Why isn't it:
or on a dark day:$newentry = join(':',(split/:/)[0..8]);@entry = split /:/; # Automagically uses $_. $newentry = join (":", @entry[0..8]);
--Brother Frankus. updated to remove stupid assumption about arrays.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: I am now slice-aware
by davorg (Chancellor) on Apr 17, 2001 at 19:00 UTC | |
by frankus (Priest) on Apr 17, 2001 at 19:10 UTC | |
|
Re: Re: I am now slice-aware
by birdbrane (Chaplain) on Apr 17, 2001 at 19:19 UTC |