different type of getting an array reference
From: Octavian Rasnita (orasnita_at_fcc.ro)
Date: 12/27/04
- Next message: John W. Krahn: "Re: different type of getting an array reference"
- Previous message: Mike Blezien: "Re: Hash problem"
- Next in thread: John W. Krahn: "Re: different type of getting an array reference"
- Reply: John W. Krahn: "Re: different type of getting an array reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <beginners@perl.org> Date: Mon, 27 Dec 2004 09:26:22 +0200
Hi all,
Can you please tell me what's the difference between these two types of
getting the reference to @a array?
my $ref = [ @a ];
and
my $ref = \@a;
If I do:
use Data::Dumper;
print Dumper $ref;
Both ways of accesing the @a array with a reference seems to be the same,
because Data::Dumper prints the same thing for $ref.
I need to access an array reference in a module, like...
my $self = [ @a ];
or...
my $self = \@a;
and I don't know if there will be any differences...
Thank you much.
Teddy
- Next message: John W. Krahn: "Re: different type of getting an array reference"
- Previous message: Mike Blezien: "Re: Hash problem"
- Next in thread: John W. Krahn: "Re: different type of getting an array reference"
- Reply: John W. Krahn: "Re: different type of getting an array reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|