From e4769da7e4ba2947901539be526b741c6157838a Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 19 Dec 2005 18:43:04 +0000 Subject: Attempt at making IO::Handle backwards compatible again p4raw-id: //depot/perl@26405 --- ext/IO/lib/IO/Handle.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'ext/IO/lib') diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm index 551988bae5..e3b3f7f1c2 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 { -- cgit v1.2.1