Re: Passing array as First argument

2004-03-08 Thread Robin Sheat
On Sun, Mar 07, 2004 at 12:41:18AM +, Angie Ahl wrote: > However I get them now. And for any other newbies out there... go look > up references right now... really. In my case it was references and lists-vs-arrays (and how hashes fit into all this) that caught me. The moment they both had beco

Re: Passing array as First argument

2004-03-08 Thread Angie Ahl
I must chime in. I've been learning perl for pretty much exactly a year now. I Still feel like a newbie. I haven't yet got to the chapters on Prototypes and Inheritance, I've read about the concepts but not yet applied them. I've been using subroutines and modules quite a bit and references r

Re: Passing array as First argument

2004-03-07 Thread R. Joseph Newton
zsdc wrote: > Mallik wrote: > > > Dear Friends, > > > > I need to pass 3 parameters to a subroutine, in which the > > first parameter is an array and the last two parameters > > are strings. > > > > @abc = qw(1 2 3); > > $x = 4; > > $y = 5; > > > > testsub(@abc, $x, $y); > > Hello Mallik, > > I've

Re: Passing array as First argument

2004-03-07 Thread WilliamGunther
In a message dated 3/7/2004 6:58:57 AM Eastern Standard Time, [EMAIL PROTECTED] writes: >This is quite a common and simple problem for which reading the whole >perldoc perlsub might be somewhat too confusing, but asking about it on >mailing lists usually starts discussions which often become arg

Re: Passing array as First argument

2004-03-07 Thread zsdc
Mallik wrote: Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters are strings. @abc = qw(1 2 3); $x = 4; $y = 5; testsub(@abc, $x, $y); Hello Mallik, I've just read this thread and I'd like to add one more way to solve

Re: Passing array as First argument

2004-03-06 Thread R. Joseph Newton
William Gunther wrote: > > If a beginner can understand the concept > of prototyping and referencing, I think they can gather an array > reference is being passed. Actually no. I have not seen this in the last year of reading this list. The vast majority of newbie traffic that i have seen amo

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

Re: Passing array as First argument

2004-03-05 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > In a message dated 3/3/2004 5:15:57 AM Eastern Standard Time, > [EMAIL PROTECTED] writes: > >testsub(@abc, $x, $y); > > > >sub testsub(@$$) > >{ > >(@abc, $x, $y) = @_; > >print "Array @abc\n"; > >print "x $x\n"; > >print "y $y\n"; > >} > > sub testsub ([

Re: Passing array as First argument

2004-03-05 Thread R. Joseph Newton
"Halkyard, Jim" wrote: Hi Jim, It is better if you don't top-post. > 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 PROTECTE

Re: Passing array as First argument

2004-03-03 Thread WilliamGunther
In a message dated 3/3/2004 5:15:57 AM Eastern Standard Time, [EMAIL PROTECTED] writes: >testsub(@abc, $x, $y); > >sub testsub(@$$) >{ >(@abc, $x, $y) = @_; >print "Array @abc\n"; >print "x $x\n"; >print "y $y\n"; >} sub testsub ([EMAIL PROTECTED]); @abc = (1, 2, 3); $x = 3; $y =

RE: Passing array as First argument

2004-03-03 Thread David le Blanc
> From: Mallik [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 3 March 2004 1:00 AM > To: Perl Beginners > Subject: Passing array as First argument > Importance: High > > Dear Friends, > > I need to pass 3 parameters to a subroutine, in which the > first paramete

RE: Passing array as First argument

2004-03-03 Thread Halkyard, Jim
abc\n"; print "x $x\n"; print "y $y\n"; } See perldoc perlref for a much better explanation than I could give. Jim -Original Message- From: Mallik [mailto:[EMAIL PROTECTED] Sent: 02 March 2004 14:00 To: Perl Beginners Subject: Passing array as First ar

Passing array as First argument

2004-03-03 Thread Mallik
Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters are strings. @abc = qw(1 2 3); $x = 4; $y = 5; testsub(@abc, $x, $y); sub testsub(@$$) { (@abc, $x, $y) = @_; print "Array @abc\n"; print "x $x\n"; pri

Passing array as First argument

2004-03-03 Thread Mallik
Dear Friends, I need to pass 3 parameters to a subroutine, in which the first parameter is an array and the last two parameters are strings. @abc = qw(1 2 3); $x = 4; $y = 5; testsub(@abc, $x, $y); sub testsub(@$$) { (@abc, $x, $y) = @_; print "Array @abc\n"; print "x $x\n"; pr