----- Original Message -----
From: "Connie Chan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; "Michael Lamertz" <[EMAIL PROTECTED]>; "Robin Norwood"
<[EMAIL PROTECTED]>
Sent: Friday, July 26, 2002 11:16 AM
Subject: Re: How to throw 1 more hash or array to a sub ?
> >
> > @carryBack = $@something;
> > $elems = $#carryBack;
> >
>
> Sorry everybody... I know scalar(@array) and $#array's
> different... I do this just normally, I like to count
> from 0 as well.. so I treat the elems like this...
>
> What I am trying to ask is when this happen...
>
> sub something
> { my ($hash, $array) = @_;
> my @carrayBack = $@array;
> }
Again, you need to say @$array...
But I think this is exactly what you are looking for anyway...
sub sub {
my ($hash,$array)=@_;
for(@$array) { ... }
# same thing for hashes
foreach (keys %$hash) { ... }
}
Shawn
>
> Is there any method I can change the $array
> back to @array more direct, without to construct
> a new array... Sorry my question making confusing...
>
> Rgds,
> Connie
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]