Connie Chan <[EMAIL PROTECTED]> wrote:
>
> 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;
> }
>
> 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...
AFAIK, you can't do it with lexical (my) variables, but
you can do this to typeglobs:
sub something {
local (*hash, *array) = @_;
print "$array[0] $hash{foo}\n";
# etc, with no dereference or copy
}
something( {qw/foo bar/}, [qw/foo bar/] );
--
Steve
perldoc -qa.j | perl -lpe '($_)=m("(.*)")'
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]