Re: splice or split an array
From: John W. Krahn (someone_at_example.com)
Date: 09/08/04
- Next message: Gregory Toomey: "Re: Shared memory for data structures"
- Previous message: kevincar: "Re: Execute Windows program from Perl script (??)"
- In reply to: Scott Bryce: "Re: splice or split an array"
- Next in thread: Anno Siegel: "Re: splice or split an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Gregory Toomey: "Re: Shared memory for data structures"
- Previous message: kevincar: "Re: Execute Windows program from Perl script (??)"
- In reply to: Scott Bryce: "Re: splice or split an array"
- Next in thread: Anno Siegel: "Re: splice or split an array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|