rightfield has asked for the wisdom of the Perl Monks concerning the following question:
Could you please take a moment and straighten me out with regards to my references. Thanks. rightfield P.S. - My vpn's been down over an hour now, so I don't think its coming back up soon that's why I asking for help instead of just banging at it until I get it right. Without a database at home I'm on hold. Maybe I'll spend my time installing MySQL and get a database at home.my $query = "SELECT blah blah stuff to get"; my $sth = $dbh->prepare($query) or die "Can't prepare: $query. Reason: + $!"; $sth->execute($user_id)or die "Can't execute: $query. Reason: $!"; open( DATAOUT, ">$filename" ); while ( my $ref = $sth->fetchrow_hashref() ){ foreach ( keys (%{$ref}) ) { print DATAOUT "$_"+":"+"$ref->{$_}\t"; } print DATAOUT "\n"; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hashref and references
by kwaping (Priest) on May 22, 2006 at 15:22 UTC | |
|
Re: hashref and references
by davorg (Chancellor) on May 22, 2006 at 15:23 UTC | |
|
Re: hashref and references
by rightfield (Sexton) on May 22, 2006 at 15:47 UTC |