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

Re^3: use deprecated;

by Aristotle (Chancellor)
on Nov 28, 2003 at 01:18 UTC ( [id://310626]=note: print w/replies, xml ) Need Help??


in reply to Re^2: use deprecated;
in thread use deprecated;

Actually, you don't even need to check whether the function exists. If you take a reference to a named but undefined function, it magically works once that function is defined. Perl is devious that way.
#!/usr/bin/perl $_ = \&x; *x = sub { print "Oh my\n" }; $_->();
This actually prints "Oh my".

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^4: use deprecated;
by adrianh (Chancellor) on Dec 03, 2003 at 01:21 UTC
    Actually, you don't even need to check whether the function exists. If you take a reference to a named but undefined function, it magically works once that function is defined. Perl is devious that way.

    You're quite correct - I'm an idiot.

    In fact, I'm an idiot on two counts. My AUTOLOAD comment is equally bogus. Since everything is happening at INIT time the AUTOLOAD subroutine will already be defined.

    I restate my "sneaky" comment. Very nice :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-06-15 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.