summaryrefslogtreecommitdiff
path: root/t/op/split.t
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.compulink.co.uk>1997-06-11 12:00:00 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-06-11 12:00:00 +1200
commite1fa4fd353846cf20c57c566e2cc3df9b041857d (patch)
treec3b8776438ab74be3ecdfd978aa018f26c97a64f /t/op/split.t
parentad4f75a617e142cf0d567ad25c1dbd4439093580 (diff)
downloadperl-e1fa4fd353846cf20c57c566e2cc3df9b041857d.tar.gz
Re: Using undef to ignore values returned from split
Diffstat (limited to 't/op/split.t')
-rwxr-xr-xt/op/split.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/split.t b/t/op/split.t
index 90bb436550..b449ba96fa 100755
--- a/t/op/split.t
+++ b/t/op/split.t
@@ -2,7 +2,7 @@
# $RCSfile: split.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:26 $
-print "1..14\n";
+print "1..16\n";
$FS = ':';
@@ -66,3 +66,13 @@ print $_ eq "1|-|10||20" ? "ok 13\n" : "not ok 13\n";
# do subpatterns generate additional fields (with a limit)?
$_ = join '|', split(/,|(-)/, "1-10,20,,,", 10);
print $_ eq "1|-|10||20||||||" ? "ok 14\n" : "not ok 14\n";
+
+# is the 'two undefs' bug fixed?
+(undef, $a, undef, $b) = qw(1 2 3 4);
+print "$a|$b" eq "2|4" ? "ok 15\n" : "not ok 15\n";
+
+# .. even for locals?
+{
+ local(undef, $a, undef, $b) = qw(1 2 3 4);
+ print "$a|$b" eq "2|4" ? "ok 16\n" : "not ok 16\n";
+}