in reply to Tacking a function on to STDOUT?
but you can't so don't listen to me.#!perl -w use strict; sub my_print(@) { my @stuff = @_; print STDOUT time,": @stuff\n"; } *print = *my_print; print "Hello World!";
the warning message isn't useful in this case but if I change it to &print = &my_print; it prints...
so it reckons I can't do it but it has printed the time and the newline from the function just without the @_.Can't modify non-lvalue subroutine call at C:\Perl\scripts\newprint.pl + line 8. 991047768:
can this be made to work?
larryk
"Argument is futile - you will be ignorralated!"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Tacking a function on to STDOUT?
by RhetTbull (Curate) on May 28, 2001 at 18:39 UTC |