Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Re: How do I dynamically declare a package name for

by gildir (Pilgrim)
on Apr 27, 2001 at 21:14 UTC ( [id://76176]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: How do I dynamically declare a package name for
in thread How do I dynamically declare a package name for

Yes, but there is big difference when calling:
eval { $object = $class->new; };
and eval " $object = $class->new; "; In the former case, code is compiled as soon as it is first encountered by perl compiler, that is at compile time and it is compiled only once. While in the later case the code is compiled at run-time and is compiled every time the eval() is run.
There is no way to do eval { use $class; }; so I must use eval " use $class; "; version, and I try to execute it as seldom as possible.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found