From: Albert Dvornik Date: Wed, 22 Jul 1998 15:14:46 +0000 (-0400) Subject: don't use qualify() in class methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b61d194ccc4ffeadd2cf0ae98317321309a3dd04;p=p5sagit%2Fp5-mst-13.2.git don't use qualify() in class methods Message-Id: Subject: [PATCH 5.005-MAYBE] Bug in IO::Handle->input_record_separator p4raw-id: //depot/perl@1645 --- diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm index af3df71..7927641 100644 --- a/ext/IO/lib/IO/Handle.pm +++ b/ext/IO/lib/IO/Handle.pm @@ -423,21 +423,19 @@ sub stat { ## sub autoflush { - my $old = new SelectSaver qualify($_[0], caller); + my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $|; $| = @_ > 1 ? $_[1] : 1; $prev; } sub output_field_separator { - my $old = new SelectSaver qualify($_[0], caller); my $prev = $,; $, = $_[1] if @_ > 1; $prev; } sub output_record_separator { - my $old = new SelectSaver qualify($_[0], caller); my $prev = $\; $\ = $_[1] if @_ > 1; $prev; @@ -450,55 +448,54 @@ sub input_record_separator { } sub input_line_number { + # localizing $. doesn't work as advertised. grrrrrr. my $prev = $.; $. = $_[1] if @_ > 1; $prev; } sub format_page_number { - my $old = new SelectSaver qualify($_[0], caller); + my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $%; $% = $_[1] if @_ > 1; $prev; } sub format_lines_per_page { - my $old = new SelectSaver qualify($_[0], caller); + my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $=; $= = $_[1] if @_ > 1; $prev; } sub format_lines_left { - my $old = new SelectSaver qualify($_[0], caller); + my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $-; $- = $_[1] if @_ > 1; $prev; } sub format_name { - my $old = new SelectSaver qualify($_[0], caller); + my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $~; $~ = qualify($_[1], caller) if @_ > 1; $prev; } sub format_top_name { - my $old = new SelectSaver qualify($_[0], caller); + my $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $^; $^ = qualify($_[1], caller) if @_ > 1; $prev; } sub format_line_break_characters { - my $old = new SelectSaver qualify($_[0], caller); my $prev = $:; $: = $_[1] if @_ > 1; $prev; } sub format_formfeed { - my $old = new SelectSaver qualify($_[0], caller); my $prev = $^L; $^L = $_[1] if @_ > 1; $prev;