Re: How to slice a split directly?

2004-09-23 Thread William Gunther
On Thu, 23 Sep 2004 13:43:08 -0600, Siegfried Heintze <[EMAIL PROTECTED]> wrote: > This works and does what I want it to: > > perl -e '@x = split("\\.", "a.b.c"); print $x[0];' > > Why does not this work? > perl -e 'print @{split("\\.", "a.b.c")}[0];' Because split doesn't return an array refer

Re: Passing array as First argument

2004-03-06 Thread William Gunther
R. Joseph Newton wrote: > > Hi Malik, > > > > If you pass a reference to the array as the first argument as below > you can > > keep the array separate from the other arguments you are passing. > > > > @abc = qw(1 2 3); > > $x = 4; > > $y = 5; > > > > testsub([EMAIL PROTECTED], $x, $y