From: Jarkko Hietaniemi Date: Tue, 12 Aug 2003 13:55:56 +0000 (+0000) Subject: Multiline one-liners are a bit too much to ask. X-Git-Tag: accepted/trunk/20130322.191538~23393 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed1af28e435c4f4992490e18b640d9daa5b5326a;p=platform%2Fupstream%2Fperl.git Multiline one-liners are a bit too much to ask. p4raw-id: //depot/perl@20657 --- diff --git a/t/op/closure.t b/t/op/closure.t index 763e2a7..2425a59 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -641,27 +641,31 @@ f16302(); test { $a{7}->()->() + $a{11}->()->() == 18 }; } -# bugid #23265 - this used to coredump during destruction of PL_maincv -# and its children - -require './test.pl'; - -my $got = runperl( - prog => q[ - print - sub {$_[0]->(@_)} -> ( - sub { - $_[1] - ? $_[0]->($_[0], $_[1] - 1) . sub {"x"}->() - : "y" - }, - 2 - ) - , "\n" - ; - - ], - stderr => 1 -); -test { $got eq "yxx\n" }; +require './test.pl'; # for runperl() + +{ + # bugid #23265 - this used to coredump during destruction of PL_maincv + # and its children + + my $progfile = "b23265.pl"; + open(T, ">$progfile") or die "$0: $!\n"; + print T << '__EOF__'; + print + sub {$_[0]->(@_)} -> ( + sub { + $_[1] + ? $_[0]->($_[0], $_[1] - 1) . sub {"x"}->() + : "y" + }, + 2 + ) + , "\n" + ; +__EOF__ + close T; + my $got = runperl(progfile => $progfile); + test { chomp $got; $got eq "yxx" }; + END { 1 while unlink $progfile } +} +