[OT] slice vs. splice

2004-04-16 Thread Joel Rees
slice syntax isn't deprecated or anything is it? Don't see it mentioned in O'Reilly's Nutshell or in the Cookbook's section on arrays. (Sorry about the not-really-topical noise.)

Re: [OT] slice vs. splice

2004-04-16 Thread Randal L. Schwartz
Joel == Joel Rees [EMAIL PROTECTED] writes: Joel slice syntax isn't deprecated or anything is it? Don't see it Joel mentioned in O'Reilly's Nutshell or in the Cookbook's section on Joel arrays. Joel (Sorry about the not-really-topical noise.) Well, according to the blding edge Perl

Re: [OT] slice vs. splice

2004-04-16 Thread David Wheeler
On Apr 16, 2004, at 7:15 AM, Joel Rees wrote: slice syntax isn't deprecated or anything is it? Don't see it mentioned in O'Reilly's Nutshell or in the Cookbook's section on arrays. There is no slice function. You can use the splice function, but this syntax is easier: my @foo = qw(one two

Re: [OT] slice vs. splice

2004-04-16 Thread Sherm Pendley
On Apr 16, 2004, at 10:51 AM, David Wheeler wrote: Remember, array indexes are zero-based: my @foo = qw(one two three four); my @slice = @foo[1,3]; # (one, three) [EMAIL PROTECTED] = @foo[1,3]; # ('two', 'four') my $ref = [EMAIL PROTECTED]; @slice = @{$ref}[2,4]; # (two, four) @slice =

Re: [OT] slice vs. splice

2004-04-16 Thread David Wheeler
On Apr 16, 2004, at 10:27 AM, Sherm Pendley wrote: Remember, array indexes are zero-based: Gah! That's what I get for using comments! ;-) David

Re: [OT] slice vs. splice

2004-04-16 Thread Sherm Pendley
On Apr 16, 2004, at 1:35 PM, David Wheeler wrote: Gah! That's what I get for using comments! ;-) Darn right, stop that! Code is hard to write, it should be hard to read, too! ;-) sherm--