mickep76 has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I want to use split to assign variables but keep the remainder and assign it to the last variable. And yes regular expression can do this I am aware, I was more interested if there is some way todo it using split.
The result currently would be:my $string = "a b c d e f"; my ($e1, $e2, $e3) = split /\s/, $string;
e1 = a e2 = b e3 = c
What I want to do is for the remaining part to get assigned to e3 like.
e3 = c d e f
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Howto get last items using split
by mje (Curate) on Oct 21, 2009 at 08:36 UTC | |
by mickep76 (Beadle) on Oct 21, 2009 at 08:43 UTC | |
by AnomalousMonk (Archbishop) on Oct 21, 2009 at 12:55 UTC | |
|
Re: Howto get last items using split
by CountZero (Bishop) on Oct 21, 2009 at 16:33 UTC |