Bodger has asked for the wisdom of the Perl Monks concerning the following question:
I want to unshift one scalar to the top of an array.
This is the only thing I can get past perl.
my @array = ( "Top" ); unshift (@array, @output);
Which seems wasteful, I have tried unsucessfully
unshift (("Top"), @output);
Is there a better way to do it without adding "my @array" to the mix?
Thanx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unshift single scalar
by Not_a_Number (Prior) on Aug 09, 2014 at 18:37 UTC | |
by Bodger (Acolyte) on Aug 09, 2014 at 18:47 UTC | |
by Not_a_Number (Prior) on Aug 09, 2014 at 19:14 UTC | |
|
Re: unshift single scalar
by dsheroh (Monsignor) on Aug 10, 2014 at 07:35 UTC | |
|
Re: unshift single scalar
by LanX (Saint) on Aug 09, 2014 at 18:15 UTC | |
|
Re: unshift single scalar
by Bodger (Acolyte) on Aug 09, 2014 at 18:42 UTC | |
by Laurent_R (Canon) on Aug 09, 2014 at 20:33 UTC | |
by LanX (Saint) on Aug 10, 2014 at 02:18 UTC | |
by AppleFritter (Vicar) on Aug 10, 2014 at 09:18 UTC | |
by LanX (Saint) on Aug 10, 2014 at 11:44 UTC | |
by AnomalousMonk (Archbishop) on Aug 10, 2014 at 00:43 UTC |