in reply to deprecated split ??
There is a typo in your code. You put a semi-colon after the /;\s*/ but should have a comma instead. You also wrote $_[1] which ... I would *guess* should probably be $_->[1]. The way you've written this function and it has been interpreted is a model of obfuscation. split() called like this is in list context (contrary to someone else's assertion that it is scalar) and shouldn't pull up that warning. That perl has somehow decided to treat it as void context means that split separates the first element of the @_ array, then writes into it. The next call then splits the previous call's output and so on.
Perhaps you mean @models = map { ( split /;\s*/ )[ 1 ] } @models which is significantly more probable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: deprecated split ??
by bart (Canon) on May 27, 2004 at 20:53 UTC | |
by diotalevi (Canon) on May 27, 2004 at 22:03 UTC | |
by bart (Canon) on May 28, 2004 at 09:24 UTC |