Next | The Perl Hardware Store | DC.pm Version | 54 |
sub croak { require Carp; *croak = \&Carp::croak; goto &croak; }
The first time you call this, it replaces itself with the real croak.
The second time you try to call it, you just get the real croak directly.
Now just say
croak("I am not a number. I am a free man.");
Alternative:
use autouse 'Carp' => 'croak';
Next | Copyright © 2003 M. J. Dominus |