From: Rafael Garcia-Suarez Date: Mon, 19 Dec 2005 18:43:04 +0000 (+0000) Subject: Attempt at making IO::Handle backwards compatible again X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4769da7e4ba2947901539be526b741c6157838a;p=p5sagit%2Fp5-mst-13.2.git Attempt at making IO::Handle backwards compatible again p4raw-id: //depot/perl@26405 --- diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm index 551988b..e3b3f7f 100644 --- a/ext/IO/lib/IO/Handle.pm +++ b/ext/IO/lib/IO/Handle.pm @@ -409,11 +409,16 @@ sub printf { printf $this @_; } -sub say { - @_ or croak 'usage: $io->say(ARGS)'; - my $this = shift; - use feature 'say'; - say $this @_; +if ($] >= 5.009003) { + *say = eval q{ sub { + @_ or croak 'usage: $io->say(ARGS)'; + my $this = shift; + use feature 'say'; + say $this @_; + }}; +} +else { + *say = sub { croak "say() is not implemented for this version of perl\n" }; } sub getline {