lps.
--
Mike Arms
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 7:03 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Passing two arrays to a sub.
My understanding of Perl--and the Camel book--both s
-Original Message-
From: Ramprabhu K
Sent: Thursday, September 30, 2004 6:44 PM
To: Prashant Sudhir Pathare
Subject: RE: Passing two arrays to a sub.
hi
Two two different array is passed to subroutine it is better you pass it as
refference.
Same code with little modification
Pass them by reference.
use strict;
my @array1 = (1, 2, 3);
my @array2 = ('a', 'b', 'c');
Mysub([EMAIL PROTECTED],[EMAIL PROTECTED]);
sub Mysub {
my ($array1ref, $array2ref) =
@_;
foreach my $item
(@{$array1ref}) {
print $item
."\n";
}
print ${$arr
[EMAIL PROTECTED] wrote:
> Dear All,
> I am trying to pass two arrays to a subroutine. However I am not able
> to collect them properly in local variables. Would you please
> let me know what
> is wrong?
>
> Here I am expecting the output:-
> #s t q c#
> #1 2 3 4#
>
> But I am getting the output
"#@$b#\n";print "#@$c#";return;}
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]Sent: Thursday, September 30,
2004 8:03 AMTo: [EMAIL PROTECTED]Cc:
[EMAIL PROTECTED];
[EMAIL PROTECTED]Subject: Re: Passing two arrays
: [EMAIL PROTECTED]
09/30/2004 07:50
Please respond to deshpandes
To: <[EMAIL PROTECTED]>
cc:
Subject:Passing two arrays to a sub.
Dear All,
I am trying to pass two arrays to a subroutine. However I am not able to
collect them properly in local variables. Woul
EMAIL PROTECTED]";
print "[EMAIL PROTECTED]";
}
-Original Message-
From: Sandeep Deshpande [mailto:[EMAIL PROTECTED]
Sent: 30 September 2004 13:51
To: [EMAIL PROTECTED]
Subject: Passing two arrays to a sub.
Dear All,
I am trying to pass two arrays to a subroutine. Howe
;
cc:
Subject: Passing two arrays to a sub.
Dear All,
I am trying to pass two arrays to a subroutine. However I am not able to
collect them properly in local variables. Would you please let me know what
is wrong?
Here I am expecting the output:-
#s t q c#
#1 2 3 4#
But I am
Dear All,
I am trying to pass two arrays to a subroutine. However I am not able to
collect them properly in local variables. Would you please let me know what
is wrong?
Here I am expecting the output:-
#s t q c#
#1 2 3 4#
But I am getting the output as:-
#s t q c 1 2 3 4#
##
local @b is capturing