Re: splice or split an array

From: John W. Krahn (someone_at_example.com)
Date: 09/08/04


Date: Tue, 07 Sep 2004 23:36:12 GMT

Scott Bryce wrote:
> Peter wrote:
>
>> @list =
>> ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"
>> ,"18");
>
> Double quotes are neither necessary, nore desireable here.
>
> my @list = qw(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18);
>
> or
>
> my @list = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18);
>
> or
>
> my @list = (1 .. 18);

Speaking of unnecessary, the parentheses are not required in the last example.
  :-)

my @list = 1 .. 18;

John

-- 
use Perl;
program
fulfillment


Relevant Pages

  • Re: Questions
    ... Note that she calls publications inferior ... That I am not presenting every proof Tom or Peter A calls for, ... As every serious scholar knows quotes taken out of context isn't ... together with scholars employed in respective town or area pre-view the ...
    (sci.archaeology)
  • Re: Too few parameters. Expected 1.
    ... The parentheses are not necessary, ... As to the single quotes, we will have to agree it is a matter of style. ... > As for the parentheses, s is defined as a string, but the string starts with ... > parentheses to be part of the Execute method, and the string to replace what ...
    (microsoft.public.access.formscoding)
  • Re: Shellexecute a CAB File
    ... Peter Foot ... >>> You need to be very careful about spaces in folder and file names. ... >>>> slashes and used quotes and nothing worked. ... The same exact path ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Bes-Toilette [war: Zwischenstand Katja]
    ... Schon die Zusammenstellung von Quotes zeigt ... || deutlich, das Peter nicht mal im Ansatz begriffen hat, worin der ...
    (de.rec.tiere.hunde)
  • Re: Seeking an equivalent expression
    ... them (let's call him Peter) starts to make malicious comments about ... occasions) and because he seems to appreciate it, one of the chat ... "There you are, speaking of others again." ... language, playing football, etc.) Others in the group may have better ...
    (alt.usage.english)