in reply to Re: Dereferencing hashrefs
in thread Dereferencing hashrefs
Gives me:print "Errors are: $sth->err\n"; print "I got out: ref($rec_ref)\n";
both of which seem to indicate that I do, indeed, have a valid hashref to work with.Errors are: DBI::st=HASH(0xe2478)->err I got out: ref(HASH(0xf9d14))
I know from the database that there will *always* be a company value returned; thus, I was using that as a sanity-check that my hashref was good. From there, I set a flag on how to return from the subroutine I'm in; if it's good, I return the hash that should be filled by dereference from my hashref, otherwise undef.if ($rec_ref->{'company'} ne "") { %ref = %$rec_ref; $found = 1; } $dbh->disconnect(); if ($found) { return %rec; } else { return undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Dereferencing hashrefs
by blakem (Monsignor) on Feb 11, 2002 at 12:41 UTC | |
|
Re: Re: Re: Dereferencing hashrefs
by dash2 (Hermit) on Feb 11, 2002 at 14:39 UTC | |
|
Re: Re: Re: Dereferencing hashrefs
by CharlesClarkson (Curate) on Feb 12, 2002 at 05:47 UTC |