5 $ENV{PERL5LIB} = "../lib";
10 @prgs = split "\n########\n", <DATA>;
11 print "1..", scalar @prgs, "\n";
13 $tmpfile = "misctmp000";
14 1 while -f ++$tmpfile;
15 END { unlink $tmpfile if $tmpfile; }
22 my($prog,$expected) = split(/\nEXPECT\n/, $_);
23 open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1";
24 print TEST $prog, "\n";
27 $results = `cat $tmpfile`;
29 $expected =~ s/\n+$//;
30 if ( $results ne $expected){
31 print STDERR "PROG: $switch\n$prog\n";
32 print STDERR "EXPECTED:\n$expected\n";
33 print STDERR "GOT:\n$results\n";
36 print "ok ", ++$i, "\n";
42 Can't call method "go" without a package or object reference at - line 1.
51 $x=0x0eabcd; print $x->ref;
53 Can't call method "ref" without a package or object reference at - line 1.
55 chop ($str .= <STDIN>);
59 $x=2;$y=3;$x<$y ? $x : $y += 23;print $x;
63 eval {sub bar {print "In bar";}}
65 system "./perl -ne 'print if eof' /dev/null"
70 sub new {my ($obj,$n)=@_; bless \$n}
79 Can't coerce HASH to string in repeat at - line 1.
82 printf(STDOUT "%s\n", $_);
94 sub sub {local($_) = @_;
97 Modification of a read-only value attempted at - line 3.
99 package FOO;sub new {bless {FOO => BAR}};
113 print scalar ("foo","bar")
117 sub by_number { $a <=> $b; };# inline function for sort below
119 @ordered_array=sort by_number keys(%as_ary);
124 my($m2) = $#Shells++;
125 $Shells[$m2]{HOST} = $Host;
134 &ShowShell(&NewShell(beach,Work,"+0+0"));
135 &ShowShell(&NewShell(beach,Work,"+0+0"));
136 &ShowShell(&NewShell(beach,Work,"+0+0"));
142 { print "TIEARRAY @_\n";
143 die "bomb out\n" unless $count ++ ;
146 sub FETCH { print "fetch @_\n"; $_[0]->[$_[1]] }
147 sub STORE { print "store @_\n"; $_[0]->[$_[1]] = $_[2] }
148 sub DESTROY { print "DESTROY \n"; undef @{$_[0]}; }
151 eval 'tie @h, FAKEARRAY, fred' ;
152 tie @h, FAKEARRAY, fred ;
154 TIEARRAY FAKEARRAY fred
155 TIEARRAY FAKEARRAY fred
158 BEGIN { die "phooey\n" }
161 BEGIN failed--compilation aborted at - line 1.
165 Illegal division by zero at - line 1.
166 BEGIN failed--compilation aborted at - line 1.
170 Modification of a read-only value attempted at - line 1.
171 BEGIN failed--compilation aborted at - line 1.
177 print join(' ', reverse @_)."\n";
183 print "and destroyed as well\n";
189 print FOO "sentence.", "reversed", "a", "is", "This";
192 This is a reversed sentence.
193 and destroyed as well