jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Which didn't work, it returned:splice( keys(%mh), 0, 100 ) ;
I can fix this likeType of arg 1 to splice must be array (not keys) at myprog.pl line 36, + near "100)" Compilation failed in require at ./test.pl line 8. BEGIN failed--compilation aborted at ./test.pl line 8.
but I guess the one-liner should work too ?!my @k = keys(%mh) ; splice( @k ...) ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Type of arg 1 to splice must be array (not keys)
by jwkrahn (Abbot) on Dec 14, 2009 at 12:57 UTC | |
by jeanluca (Deacon) on Dec 14, 2009 at 13:11 UTC | |
by JavaFan (Canon) on Dec 14, 2009 at 13:15 UTC | |
by ikegami (Patriarch) on Dec 14, 2009 at 15:36 UTC | |
|
Re: Type of arg 1 to splice must be array (not keys)
by AnomalousMonk (Archbishop) on Dec 14, 2009 at 13:14 UTC | |
by jeanluca (Deacon) on Dec 14, 2009 at 13:21 UTC | |
|
Re: Type of arg 1 to splice must be array (not keys)
by happy.barney (Friar) on Dec 14, 2009 at 15:31 UTC | |
by kikuchiyo (Hermit) on Dec 14, 2009 at 22:29 UTC | |
by ikegami (Patriarch) on Dec 14, 2009 at 23:12 UTC |