4 # test auto defined() test insertion
10 $SIG{__WARN__} = sub { $warns++; warn $_[0] };
14 $wanted_filename = $^O eq 'VMS' ? '0.' : '0';
15 $saved_filename = $^O eq 'MacOS' ? ':0' : './0';
17 print "not " if $warns;
20 open(FILE,">$saved_filename");
25 open(FILE,"<$saved_filename");
28 while (my $name = <FILE>)
30 $seen++ if $name eq '0';
32 print "not " unless $seen;
40 $seen++ if $line eq '0';
41 } while ($line = <FILE>);
43 print "not " unless $seen;
49 while (($seen ? $dummy : $name) = <FILE>)
51 $seen++ if $name eq '0';
53 print "not " unless $seen;
59 while ($where{$seen} = <FILE>)
61 $seen++ if $where{$seen} eq '0';
63 print "not " unless $seen;
67 opendir(DIR,($^O eq 'MacOS' ? ':' : '.'));
69 while (my $name = readdir(DIR))
71 $seen++ if $name eq $wanted_filename;
73 print "not " unless $seen;
79 while (($seen ? $dummy : $name) = readdir(DIR))
81 $seen++ if $name eq $wanted_filename;
83 print "not " unless $seen;
88 while ($where{$seen} = readdir(DIR))
90 $seen++ if $where{$seen} eq $wanted_filename;
92 print "not " unless $seen;
96 while (my $name = glob('*'))
98 $seen++ if $name eq $wanted_filename;
100 print "not " unless $seen;
105 while (($seen ? $dummy : $name) = glob('*'))
107 $seen++ if $name eq $wanted_filename;
109 print "not " unless $seen;
113 while ($where{$seen} = glob('*'))
115 $seen++ if $where{$seen} eq $wanted_filename;
117 print "not " unless $seen;
120 unlink($saved_filename);
122 my %hash = (0 => 1, 1 => 2);
125 while (my $name = each %hash)
127 $seen++ if $name eq '0';
129 print "not " unless $seen;
134 while (($seen ? $dummy : $name) = each %hash)
136 $seen++ if $name eq '0';
138 print "not " unless $seen;
142 while ($where{$seen} = each %hash)
144 $seen++ if $where{$seen} eq '0';
146 print "not " unless $seen;