IO::Handle->say should ignore $\ (bug #49266)
[p5sagit/p5-mst-13.2.git] / ext / IO / lib / IO / Handle.pm
index 0e61ce1..7788411 100644 (file)
@@ -69,6 +69,7 @@ corresponding built-in functions:
     $io->read ( BUF, LEN, [OFFSET] )
     $io->print ( ARGS )
     $io->printf ( FMT, [ARGS] )
+    $io->say ( ARGS )
     $io->stat
     $io->sysread ( BUF, LEN, [OFFSET] )
     $io->syswrite ( BUF, [LEN, [OFFSET]] )
@@ -264,7 +265,7 @@ use IO ();  # Load the XS module
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = "1.24";
+$VERSION = "1.27_01";
 $VERSION = eval $VERSION;
 
 @EXPORT_OK = qw(
@@ -284,6 +285,7 @@ $VERSION = eval $VERSION;
 
     print
     printf
+    say
     getline
     getlines
 
@@ -407,6 +409,13 @@ sub printf {
     printf $this @_;
 }
 
+sub say {
+    @_ or croak 'usage: $io->say(ARGS)';
+    my $this = shift;
+    local $\ = "";
+    print $this @_, "\n";
+}
+
 sub getline {
     @_ == 1 or croak 'usage: $io->getline()';
     my $this = shift;
@@ -571,7 +580,7 @@ sub format_write {
     @_ < 3 || croak 'usage: $io->write( [FORMAT_NAME] )';
     if (@_ == 2) {
        my ($io, $fmt) = @_;
-       my $oldfmt = $io->format_name($fmt);
+       my $oldfmt = $io->format_name(qualify($fmt,caller));
        CORE::write($io);
        $io->format_name($oldfmt);
     } else {