Re: array references

2004-11-03 Thread Eric Lease Morgan
On Nov 1, 2004, at 10:40 PM, Eric Lease Morgan wrote: How do I manipulate array references? In a package I'm writing I initialize an array reference (I think) through DBI like this: $self->{author_ids} = $dbh->selectall_arrayref($query); Thank you for the replies. They were helpful,

Re: array references

2004-11-02 Thread Ed Summers
elf->{author_ids} = undef; But if I were you I'd have your constructor initialize the slots that can contain array references to an empty array reference: sub new { my $class = shift; my $self = bless {}, $class; $self->{author_ids} = []; } The advan

Re: array references

2004-11-02 Thread Mike Rylander
On Mon, 01 Nov 2004 22:30:29 -0700, Michael McDonnell <[EMAIL PROTECTED]> wrote: > Eric Lease Morgan wrote: > > > > > How do I manipulate array references? > > > > In a package I'm writing I initialize an array reference (I think) > > through DBI

Re: array references

2004-11-01 Thread Michael McDonnell
Eric Lease Morgan wrote: How do I manipulate array references? In a package I'm writing I initialize an array reference (I think) through DBI like this: $self->{author_ids} = $dbh->selectall_arrayref($query); This gets tricky because selectall_arrayref returns an reference to an a

array references

2004-11-01 Thread Eric Lease Morgan
How do I manipulate array references? In a package I'm writing I initialize an array reference (I think) through DBI like this: $self->{author_ids} = $dbh->selectall_arrayref($query); First of all, what sort of foreach loop can I write to iterate through the contents of $self-&