diff options
author | Elvin Aslanov <rwp.primary@gmail.com> | 2022-08-30 12:09:02 +0400 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-08-30 09:27:19 -0600 |
commit | 80f9dd66d1498f4eb40bcec77888c00955ed7527 (patch) | |
tree | 7d78a5bcb7d1053d24a8a8ac3621a5249d3d237b /dist/IO | |
parent | 93f2abd3f113ccb9e074668c0dacb7c9fa47acd4 (diff) | |
download | perl-80f9dd66d1498f4eb40bcec77888c00955ed7527.tar.gz |
Update IO::File synopsis
Add `my` to examples for better practice.
Diffstat (limited to 'dist/IO')
-rw-r--r-- | dist/IO/lib/IO/File.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dist/IO/lib/IO/File.pm b/dist/IO/lib/IO/File.pm index 15ac635cb9..c22212c9f6 100644 --- a/dist/IO/lib/IO/File.pm +++ b/dist/IO/lib/IO/File.pm @@ -10,29 +10,29 @@ IO::File - supply object methods for filehandles use IO::File; - $fh = IO::File->new(); + my $fh = IO::File->new(); if ($fh->open("< file")) { print <$fh>; $fh->close; } - $fh = IO::File->new("> file"); + my $fh = IO::File->new("> file"); if (defined $fh) { print $fh "bar\n"; $fh->close; } - $fh = IO::File->new("file", "r"); + my $fh = IO::File->new("file", "r"); if (defined $fh) { print <$fh>; undef $fh; # automatically closes the file } - $fh = IO::File->new("file", O_WRONLY|O_APPEND); + my $fh = IO::File->new("file", O_WRONLY|O_APPEND); if (defined $fh) { print $fh "corge\n"; - $pos = $fh->getpos; + my $pos = $fh->getpos; $fh->setpos($pos); undef $fh; # automatically closes the file @@ -135,7 +135,7 @@ require Exporter; our @ISA = qw(IO::Handle IO::Seekable Exporter); -our $VERSION = "1.48"; +our $VERSION = "1.49"; our @EXPORT = @IO::Seekable::EXPORT; |