summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvin Aslanov <rwp.primary@gmail.com>2022-08-30 12:13:25 +0400
committerKarl Williamson <khw@cpan.org>2022-08-30 09:29:36 -0600
commit4622e102066ac6c21fa38a6622b883eed7e7ed9e (patch)
tree612fb0d567e41c081f31a1277c06e8d9980e6636
parent1b6cb4fd1fd2aa3611fc3707b763076950831863 (diff)
downloadperl-4622e102066ac6c21fa38a6622b883eed7e7ed9e.tar.gz
[doc] Update IO::Handle synopsis
Add `my` to examples for better practice.
-rw-r--r--dist/IO/lib/IO/Handle.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/dist/IO/lib/IO/Handle.pm b/dist/IO/lib/IO/Handle.pm
index ef1a8f3c73..7367f6ecce 100644
--- a/dist/IO/lib/IO/Handle.pm
+++ b/dist/IO/lib/IO/Handle.pm
@@ -8,20 +8,20 @@ IO::Handle - supply object methods for I/O handles
use IO::Handle;
- $io = IO::Handle->new();
+ my $io = IO::Handle->new();
if ($io->fdopen(fileno(STDIN),"r")) {
print $io->getline;
$io->close;
}
- $io = IO::Handle->new();
+ my $io = IO::Handle->new();
if ($io->fdopen(fileno(STDOUT),"w")) {
$io->print("Some text\n");
}
# setvbuf is not available by default on Perls 5.8.0 and later.
use IO::Handle '_IOLBF';
- $io->setvbuf($buffer_var, _IOLBF, 1024);
+ $io->setvbuf(my $buffer_var, _IOLBF, 1024);
undef $io; # automatically closes the file if it's open
@@ -270,7 +270,7 @@ use IO (); # Load the XS module
require Exporter;
our @ISA = qw(Exporter);
-our $VERSION = "1.49";
+our $VERSION = "1.50";
our @EXPORT_OK = qw(
autoflush