For an Acme module I'm trying to make an alternative to print, but can;t
get goto to work with print:
I'd like this:
perl -mstrict -wle 'sub x {goto &print} x("hi");'
to work like this:
perl -mstrict -MCarp -wle 'sub x {goto &Carp::croak } x("hi");'
I'm sure I'm missing a simple namespace issue but main:: and UNIVERSAL::
aren't it and I can't seem to find it documented.
Any ideas what I'm missing?
Read the section "Overriding Built-in Functions" in perlsub.
perldoc perlsub
Good info John, I don;t want to change print() calls though I want to
make foo() act just like print, the trick is getting print()s to Filehandles
fake_print "wee";
is easy *but*
fake_print STDERR "wee";
:) Its been an interesting mental exercise.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>