On Thu, 2006-06-04 at 13:10 -0700, Ryan Gies wrote: 
> With the intention of optimization, I am looking for a way around using 
> *eval* in the below snippet at line 19:
> 
>      my $value = eval $key;

Please say this is a late April Fool's joke. Your suggested use of eval
is not optimal. This is the fastest, and easiest to understand, method
of extracting data from a data structure:

  my $value = $hash{food}{fruit}[0];

The way use you eval is a string eval, which is very costly in terms of
processing time. The Perl interrupter must be restarted every time this
statement is encountered. Just stick with POP (Plain Old Perl).


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to