Retract #8552.
[p5sagit/p5-mst-13.2.git] / t / lib / filter-util.pl
CommitLineData
2c4bb738 1sub readFile
2{
3 my ($filename) = @_ ;
4 my ($string) = '' ;
5
6 open (F, "<$filename")
7 or die "Cannot open $filename: $!\n" ;
8 while (<F>)
9 { $string .= $_ }
10 close F ;
11 $string ;
12}
13
14sub writeFile
15{
16 my($filename, @strings) = @_ ;
17 open (F, ">$filename")
18 or die "Cannot open $filename: $!\n" ;
19 binmode(F) if $filename =~ /bin$/i;
20 foreach (@strings)
21 { print F }
22 close F ;
23}
24
25sub ok
26{
27 my($number, $result, $note) = @_ ;
28
29 $note = "" if ! defined $note ;
30 if ($note) {
31 $note = "# $note" if $note !~ /^\s*#/ ;
32 $note =~ s/^\s*/ / ;
33 }
34
35 print "not " if !$result ;
36 print "ok ${number}${note}\n";
37}
38
39$Inc = '' ;
40foreach (@INC)
03ec374d 41 { $Inc .= "\"-I$_\" " }
2c4bb738 42
43$Perl = '' ;
44$Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
45
46$Perl = "$Perl -w" ;
47
481;