This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
MANIFEST typo
[perl5.git] / t / op / lex.t
CommitLineData
bc795616 1#!perl
f3365a56 2use strict;
bc795616 3use warnings;
f3365a56
NC
4
5require './test.pl';
6
bc795616 7plan(tests => 4);
f3365a56
NC
8
9{
10 no warnings 'deprecated';
11 print <<; # Yow!
12ok 1
13
14 # previous line intentionally left blank.
15
16 my $yow = "ok 2";
17 print <<; # Yow!
18$yow
19
20 # previous line intentionally left blank.
21}
22
23curr_test(3);
bc795616
JV
24
25
26{
27 my %foo = (aap => "monkey");
28 my $foo = '';
29 is("@{[$foo{'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript');
30 is("@{[$foo {'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript - test for [perl #70091]');
31
32# Original bug report [perl #70091]
33# #!perl
34# use warnings;
35# my %foo;
36# my $foo = '';
37# (my $tmp = $foo) =~ s/^/$foo {$0}/e;
38# __END__
39#
40# This program causes a segfault with 5.10.0 and 5.10.1.
41#
42# The space between '$foo' and '{' is essential, which is why piping
43# it through perl -MO=Deparse "fixes" it.
44#
45
46}
47