rovf has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monk Fellows:
Is it possible to do the following without reverting to a temporary variable?
# split a string and put the pieces into an array and # assign the reference to this array to $aref my @temporary=split(/\D+/,"1,2xx4:17"); $aref=\@temporary # [1,2,4,17]
I thought about putting split into array context with something like ()=split(...), but this would also empty my array...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split and assign to arrayref in one go?
by moritz (Cardinal) on Jun 16, 2008 at 14:33 UTC | |
by rovf (Priest) on Jun 16, 2008 at 16:05 UTC | |
|
Re: split and assign to arrayref in one go?
by radiantmatrix (Parson) on Jun 16, 2008 at 15:58 UTC | |
by rovf (Priest) on Jun 16, 2008 at 16:13 UTC |