This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Croak for \local %{\%foo}
[perl5.git] / t / lib / croak / op
CommitLineData
7a44ba35 1__END__
b14845b4
FC
2# NAME my $<special>
3my $!;
4EXPECT
5Can't use global $! in "my" at - line 1, near "my $!"
6Execution of - aborted due to compilation errors.
7########
8# NAME my $<special_unicode>
9use utf8;
10BEGIN { binmode STDERR, ":utf8" }
11my $♠;
12EXPECT
13Can't use global $♠ in "my" at - line 3, near "my $♠"
14Execution of - aborted due to compilation errors.
15########
7a44ba35
TC
16# NAME OP_HELEM fields
17package Foo;
18use fields qw(a b);
19sub new {
20 my $class = shift;
21 return fields::new($class);
22}
23my Foo $f = Foo->new;
24$f->{c} = 1;
25EXPECT
26No such class field "c" in variable $f of type Foo at - line 8.
27########
28# NAME OP_HSLICE fields
29package Foo;
30use fields qw(a b);
31sub new {
32 my $class = shift;
33 return fields::new($class);
34}
35my Foo $f = Foo->new;
36@$f{"a", "c"} = ( 1, 2 );
37EXPECT
38No such class field "c" in variable $f of type Foo at - line 8.
39########
40# NAME my sub
41my sub foo { }
42EXPECT
43"my sub" not yet implemented at - line 1.
44########
45# NAME delete BAD
46delete $x;
47EXPECT
48delete argument is not a HASH or ARRAY element or slice at - line 1.
49########
50# NAME exists BAD
51exists $x;
52EXPECT
53exists argument is not a HASH or ARRAY element or a subroutine at - line 1.
54########
55# NAME exists non-sub
56exists &foo()
57EXPECT
58exists argument is not a subroutine name at - line 1.