Skip to content

Commit e4aa9a1

Browse files
authored
Merge pull request #18 from rwp0/rwp0/base64-my-synopsis
[doc] `Base64.pm` / `QuotedPrint.pm`: Add `my` to Synopsis
2 parents 8b9d377 + befca26 commit e4aa9a1

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

lib/MIME/Base64.pm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ MIME::Base64 - Encoding and decoding of base64 strings
4242
4343
use MIME::Base64;
4444
45-
$encoded = encode_base64('Aladdin:open sesame');
46-
$decoded = decode_base64($encoded);
45+
my $encoded = encode_base64('Aladdin:open sesame');
46+
my $decoded = decode_base64($encoded);
4747
4848
=head1 DESCRIPTION
4949
@@ -91,8 +91,8 @@ If you prefer not to import these routines into your namespace, you can
9191
call them as:
9292
9393
use MIME::Base64 ();
94-
$encoded = MIME::Base64::encode($decoded);
95-
$decoded = MIME::Base64::decode($encoded);
94+
my $encoded = MIME::Base64::encode($decoded_string);
95+
my $decoded = MIME::Base64::decode($encoded);
9696
9797
Additional functions not exported by default:
9898
@@ -132,8 +132,8 @@ bytes of data fills one complete base64 line (76 == 57*4/3):
132132
133133
use MIME::Base64 qw(encode_base64);
134134
135-
open(FILE, "/var/log/wtmp") or die "$!";
136-
while (read(FILE, $buf, 60*57)) {
135+
open(my $file, '<', '/var/log/wtmp') or die "$!";
136+
while (read($file, my $buf, 60*57)) {
137137
print encode_base64($buf);
138138
}
139139
@@ -161,7 +161,7 @@ example:
161161
use MIME::Base64 qw(encode_base64);
162162
use Encode qw(encode);
163163
164-
$encoded = encode_base64(encode("UTF-8", "\x{FFFF}\n"));
164+
my $encoded = encode_base64(encode("UTF-8", "\x{FFFF}\n"));
165165
print $encoded;
166166
167167
=head1 COPYRIGHT

lib/MIME/QuotedPrint.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ MIME::QuotedPrint - Encoding and decoding of quoted-printable strings
2626
2727
use MIME::QuotedPrint;
2828
29-
$encoded = encode_qp($decoded);
30-
$decoded = decode_qp($encoded);
29+
my $encoded = encode_qp($decoded_string);
30+
my $decoded = decode_qp($encoded);
3131
3232
=head1 DESCRIPTION
3333
@@ -85,8 +85,8 @@ If you prefer not to import these routines into your namespace, you can
8585
call them as:
8686
8787
use MIME::QuotedPrint ();
88-
$encoded = MIME::QuotedPrint::encode($decoded);
89-
$decoded = MIME::QuotedPrint::decode($encoded);
88+
my $encoded = MIME::QuotedPrint::encode($decoded_string);
89+
my $decoded = MIME::QuotedPrint::decode($encoded);
9090
9191
Perl v5.8 and better allow extended Unicode characters in strings.
9292
Such strings cannot be encoded directly, as the quoted-printable
@@ -97,7 +97,7 @@ example:
9797
use MIME::QuotedPrint qw(encode_qp);
9898
use Encode qw(encode);
9999
100-
$encoded = encode_qp(encode("UTF-8", "\x{FFFF}\n"));
100+
my $encoded = encode_qp(encode("UTF-8", "\x{FFFF}\n"));
101101
print $encoded;
102102
103103
=head1 COPYRIGHT

0 commit comments

Comments
 (0)