require Config; import Config;
}
+use File::Path;
+
$| = 1;
my $Is_VMS = $^O eq 'VMS';
foreach my $file (@w_files) {
next if $file =~ /(~|\.orig|,v)$/;
+ next if $file =~ /perlio$/ && !(find PerlIO::Layer 'perlio');
open F, "<$file" or die "Cannot open $file: $!\n" ;
my $line = 0;
}
my $switch = "";
my @temps = () ;
+ my @temp_path = () ;
if (s/^\s*-\w+//){
$switch = $&;
$switch =~ s/(-\S*[A-Z]\S*)/"$1"/ if $Is_VMS; # protect uc switches
my $filename = shift @files ;
my $code = shift @files ;
push @temps, $filename ;
+ if ($filename =~ m#(.*)/#) {
+ mkpath($1);
+ push(@temp_path, $1);
+ }
open F, ">$filename" or die "Cannot open $filename: $!\n" ;
print F $code ;
close F or die "Cannot close $filename: $!\n";
foreach my $option (split(' ', $1)) {
if ($option eq 'regex') { # allow regular expressions
$option_regex = 1;
- }
+ }
elsif ($option eq 'random') { # all lines match, but in any order
$option_random = 1;
}
print "ok ", ++$i, "\n";
foreach (@temps)
{ unlink $_ if $_ }
+ foreach (@temp_path)
+ { rmtree $_ if -d $_ }
}
sub randomMatch