in reply to Calling undefined method
There are many ways of calling code that is not immediately visible:
eval q{sub foo{print "Hello World"}} # or, somewhat cleaner, with Perl checking your # syntax at compile time: { no strict 'refs'; *{__PACKAGE__ . "::foo"} = sub { print "Hello World"; }; }; # ... and many more methods
I think this catches all common cases of creating methods, but I might have overlooked something.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling undefined method
by shyju (Initiate) on Dec 15, 2005 at 10:22 UTC |