Re: reference to an array

2005-08-08 Thread Binish A R
David Baird wrote: On 8/8/05, Binish A R <[EMAIL PROTECTED]> wrote: I am a bit confused whether this is possible or not? I would like to have an array reference, the command am using is something like : -- $sth = $dbh->prepare("SELECT * from tablename"); $sth->execute; $aref = $sth->fetch

Re: reference to an array

2005-08-08 Thread David Baird
On 8/8/05, Binish A R <[EMAIL PROTECTED]> wrote: > I am a bit confused whether this is possible or not? > I would like to have an array reference, the command am using is something > like : > > -- > $sth = $dbh->prepare("SELECT * from tablename"); > $sth->execute; > > $aref = $sth->fetchrow_arra

reference to an array

2005-08-08 Thread Binish A R
I am a bit confused whether this is possible or not? I would like to have an array reference, the command am using is something like : -- $sth = $dbh->prepare("SELECT * from tablename"); $sth->execute; $aref = $sth->fetchrow_array; -- The last line, viz $aref = $sth->fetchrow_array; I am expec

Re: Reference to an array from within a hash....how to de-ref.

2003-06-02 Thread Rob Anderson
> the life of me, I cannot get there. I have tried... > >foreach $key ( keys %$hostsref ) { >print ("Inserting $key into Database\n"); Try this, the prints are to make it easier to understand, hopefully :-) # print '$hostsref = ' . $hostsref . "\n";# your or

RE: Reference to an array from within a hash....how to de-ref.

2003-06-02 Thread Charles K. Clarkson
Hamish Whittal <[EMAIL PROTECTED]> wrote: : Now I want to get at the arrays inside the IP address : keysand for the life of me, I cannot get there. I : have tried... : : foreach $key ( keys %$hostsref ) { : print ("Inserting $key into Database\n"); : @arr = @{ $hostsref{$key} };

Reference to an array from within a hash....how to de-ref.

2003-06-02 Thread Hamish Whittal
Hi People, Anyone can help me out. I have a datastructure that looks like this: $hostsref = { '10.15.110.1' => [ '10_15_110_1', 'public', '.1.3.6.1.4.1.9.1.209', '2

RE: $_ vs @_ (was: Using a dereferenced reference to an array)

2003-03-03 Thread wiggins
On Mon, 3 Mar 2003 06:01:01 -0800 (PST), Rob Richardson <[EMAIL PROTECTED]> wrote: > I am now expanding one of my favorite sayings: > "C++ gives you thousands of ways to shoot yourself in the foot. Visual > Basic hides all the ways it shoots you

$_ vs @_ (was: Using a dereferenced reference to an array)

2003-03-03 Thread Rob Richardson
Greetings! A few days back, I posted a message in which I asked for help figuring out why Perl was reporting that an array had one element when printing the array showed all 17 elements that it was supposed to have. I took a closer look at my entire application last night. I thought I had been r

Re: Using a dereferenced reference to an array

2003-02-27 Thread Jenda Krynicky
From: Rob Richardson <[EMAIL PROTECTED]> > I have a class that contains a member that is an array. I have a > method of the class that gets me a reference to the array. I can > print out the contents of the array. But I can't find out how many > items are in it! What is going on here? There's

Using a dereferenced reference to an array

2003-02-26 Thread Rob Richardson
Greetings! I have a class that contains a member that is an array. I have a method of the class that gets me a reference to the array. I can print out the contents of the array. But I can't find out how many items are in it! What is going on here? There's something simple I'm missing. Here's

Re: reference to an array

2002-05-28 Thread Peter Scott
At 09:22 AM 5/28/02 -0400, William West wrote: > b) you might want to pass in a reference to the array - and fill it up > > push( @$array_ref, $_ ) > > >i almost understand this- not really though... I'm not sure what it was for either, missed the earlier part of the

Re: reference to an array

2002-05-28 Thread drieux
On Tuesday, May 28, 2002, at 06:22 , William West wrote: [..] > drieux wrote... > > b) you might want to pass in a reference to the array - and fill it up > > push( @$array_ref, $_ ) [..] > i almost understand this- not really though... I shall presume you got David's c

Re: reference to an array

2002-05-28 Thread David vd Geer Inhuur tbv IPlib
Hi Willy, What does push and what is $_ That will probably be your question. Here is one example : open(FH, "< $file"); while { ## is the File Handler we just openened with open ## We do something with ?? ## Yes, no var is set but instead we use $_ for the current line. ## Now we ca

reference to an array

2002-05-28 Thread William West
drieux <[EMAIL PROTECTED]> has kindly answered my question about $/ to change the way a loop parses text but his answer uses stuff which i am not familiar with yet: drieux wrote... b) you might want to pass in a reference to the array - and fill it up pus