Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: loop to allocate values to variables

by radiantmatrix (Parson)
on Aug 17, 2005 at 18:51 UTC ( [id://484527]=note: print w/replies, xml ) Need Help??


in reply to loop to allocate values to variables

I can't imagine why you'd need to take the values in a hash and populate them to variable names -- you already have a hash! Why do you want to do this?

Instead of creating and using $blastresult, why can you not use $self->{_blastresult} wherever you need that value?

If you must, you could:

while (my ($k,$v) = each %$self) { $k =~ s/^_//; eval '$'.$k.'= $v'; }
<-radiant.matrix->
Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law

Replies are listed 'Best First'.
Re^2: loop to allocate values to variables
by travisbickle34 (Beadle) on Aug 18, 2005 at 07:28 UTC
    Hmmm. Having read these replies I honestly don't know why I didn't just opt to use the hash values :-/

    That's the route I'm going to take now though.

    Thanks for highlighting the insane nature of my question!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://484527]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found