Permalink
Browse files

~~<> returns '' at EOF

  • Loading branch information...
1 parent 04a435a commit 79e5a7ffd4bf2dc114374083e4834ae2c98c76a1 @book committed Sep 7, 2012
Showing with 5 additions and 1 deletion.
  1. +3 −0 lib/perlsecret.pod
  2. +2 −1 t/secret.t
View
3 lib/perlsecret.pod
@@ -475,6 +475,9 @@ several lines at once:
Like the other operators based on bracketing constructs, the kite is a
container, and can carry a payload (a file handle, in this case).
+Note that when the filehandle is exhausted, the kite operator will
+return the empty string instead of C<undef>.
+
Mnemonic: It provides a feature that is tied to one line, a string,
as it were. (Tye McQueen in L<http://www.perlmonks.org/?node_id=959906>).
View
3 t/secret.t
@@ -165,6 +165,8 @@ is( "@got", '31337 eleet', '=<>=~' );
# kite
@got = ( ~~<DATA>, ~~<DATA> );
is( "@got", "camel\n llama\n", '~~<>' );
+@got = ( ~~<DATA> ); # return '' instead of undef at EOF
+is( "@got", '', '~~<>' );
# 0rnate double bladed sword
$got = 1;
@@ -283,4 +285,3 @@ __DATA__
31337 is eleet
camel
llama
-dromedary

0 comments on commit 79e5a7f

Please sign in to comment.