| /openbsd/src/gnu/usr.bin/perl/t/io/ |
| D | scalar.t | 17 my $fh; 19 ok(open($fh,"+<",\$var)); 21 is(<$fh>, $var); 23 ok(eof($fh)); 25 ok(seek($fh,0,SEEK_SET)); 26 ok(!eof($fh)); 28 ok(print $fh "bbb\n"); 31 ok(seek($fh,0,SEEK_SET)); 32 ok(!eof($fh)); 33 is(<$fh>, "foo\n"); [all …]
|
| D | through.t | 45 my ($fh, $str, $read_c, $how_r, $write_c, $how_w, $why) = @_; 48 $buf .= $_ while <$fh>; 51 $buf .= $_ while <$fh>; 54 $buf .= $in while $c = read($fh, $in, $read_c); 57 $buf .= $in while $c = sysread($fh, $in, $read_c); 61 close $fh or die "close: $!"; 71 my $fh; 74 …open $fh, '-|', qq[$Perl -we "$set_out;print for grep length, split /(.{1,$write_c})/s, qq($quoted… 78 …open $fh, '-|', qq[$Perl -we "$set_out;eval qq(\\x24\\x7c = 1) or die;print for grep length, split… 81 …open $fh, '-|', qq[$Perl -we "$set_out;eval qq(\\x5b\\x4f = 1) or die;print for grep length, split… [all …]
|
| D | perlio_open.t | 19 ok((open my $fh, "+>", undef), "open my \$fh, '+>', undef"); 20 print $fh "the right write stuff"; 21 ok(seek($fh, 0, SEEK_SET), "seek to zero"); 22 my $data = <$fh>; 27 ok((open my $fh, "+<", undef), "open my \$fh, '+<', undef"); 28 print $fh "the right read stuff"; 29 ok(seek($fh, 0, SEEK_SET), "seek to zero"); 30 my $data = <$fh>; 36 ok((open my $fh, "+>>", undef), "open my \$fh, '+>>', undef") 38 print $fh "abc"; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/File-Temp/t/ |
| D | object.t | 44 my $fh = File::Temp->new( SUFFIX => '.txt' ); 46 ok( (-f "$fh"), "File $fh exists" ); 48 ok( close( $fh ), "Close file $fh" ); 49 ok( (-f "$fh"), "File $fh still exists after close" ); 51 push(@files, "$fh"); 92 $fh = File::Temp->new( 97 ok( $fh->unlink_on_destroy, "should unlink"); 98 print "# TEMPFILE: Created $fh\n"; 100 ok( (-f "$fh"), "File $fh exists in tempdir?"); 101 push(@files, "$fh"); [all …]
|
| D | cmp.t | 10 my $fh = File::Temp->new(); 11 isa_ok ($fh, 'File::Temp'); 13 ok( "$fh" ne "foo", "compare stringified object with string"); 14 ok( $fh ne "foo", "compare object with string"); 15 ok( $fh eq $fh, "compare eq with self"); 17 ok( $fh != 0, "compare != 0"); 18 ok( $fh == $fh, "compare == with self"); 19 ok( $fh != \*STDOUT, "compare != \*STDOUT"); 22 my $num = $fh+0; 26 my $str = "$fh"; [all …]
|
| D | posix.t | 25 (my $fh, $tmpnam) = tmpnam(); 27 print "# TMPNAM: in list context: $fh $tmpnam\n"; 33 my $status = unlink0($fh, $tmpnam); 44 $fh = tmpfile(); 46 if (defined $fh) { 47 ok( $fh ); 48 print "# TMPFILE: tmpfile got FH $fh\n"; 50 $fh->autoflush(1) if $] >= 5.006; 55 print $fh $original 59 ok( seek($fh,0,0) ); [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/autodie/t/ |
| D | utf8_open.t | 31 open my $fh, ">", $file; 33 my @layers = PerlIO::get_layers($fh); 36 print $fh $txt; 37 close $fh; 42 open my $fh, "<", $file; 44 my @layers = PerlIO::get_layers($fh); 47 is join("\n", <$fh>), $txt; 52 open my($fh), $file; 54 my @layers = PerlIO::get_layers($fh); 57 is join("\n", <$fh>), $txt; [all …]
|
| D | autodie.t | 12 eval { open(my $fh, '<', NO_SUCH_FILE); }; 17 eval { open(my $fh, '<', NO_SUCH_FILE); }; 21 eval { open(my $fh, '<', NO_SUCH_FILE); }; 25 eval { open(my $fh, '<', NO_SUCH_FILE); }; 32 eval { open(my $fh, '<', NO_SUCH_FILE); }; 37 eval { open(my $fh, '<', NO_SUCH_FILE); }; 42 open(my $fh, '<', NO_SUCH_FILE); 47 eval { open(my $fh, '<', NO_SUCH_FILE); }; 53 eval { open(my $fh, '<', NO_SUCH_FILE); }; 58 eval { open(my $fh, '<', NO_SUCH_FILE); }; [all …]
|
| /openbsd/src/libexec/security/ |
| D | security | 57 my ($fh, $cmd) = @_; 58 my $res = close $fh; 77 nag !(open my $fh, '<', $filename), "open: $filename: $!" and return; 79 while (my $line = <$fh>) { 129 close $fh; 154 nag !(open my $fh, '<', $filename), "open: $filename: $!" and return; 156 while (my $line = <$fh>) { 185 close $fh; 190 nag !(open my $fh, '<', $filename), "open: $filename: $!" and return; 192 while (<$fh>) { [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/ |
| D | openhan.t | 12 my $fh = \*STDERR; 13 is(openhandle($fh), $fh, 'STDERR'); 26 open my $fh, "<", $0; 27 skip "could not open $0 for reading: $!", 2 unless $fh; 28 is(openhandle($fh), $fh, "works with indirect filehandles"); 29 close($fh); 30 is(openhandle($fh), undef, "works with indirect filehandles"); 36 open my $fh, "<", \"in-memory file"; 37 skip "could not open in-memory file: $!", 2 unless $fh; 38 is(openhandle($fh), $fh, "works with in-memory files"); [all …]
|
| /openbsd/src/gnu/usr.bin/perl/ext/PerlIO-encoding/t/ |
| D | fallback.t | 30 ok(open(my $fh,">encoding(iso-8859-1)",$file),"opened iso-8859-1 file"); 32 print $fh $str,"0.02\n"; 33 close($fh); 37 open($fh,'<',$file) || die "File cannot be re-opened"; 38 my $line = <$fh>; 40 close($fh); 44 ok(open(my $fh,">encoding(iso-8859-1)",$file),"opened iso-8859-1 file"); 46 print $fh $str,"0.02\n"; 47 close($fh); 49 open($fh,'<',$file) || die "File cannot be re-opened"; [all …]
|
| /openbsd/src/regress/usr.sbin/syslogd/ |
| D | RSyslogd.pm | 62 open(my $fh, '>', $self->{conffile}) 65 print $fh "\$ModLoad imudp\n"; 66 print $fh "\$UDPServerRun $listenport\n"; 69 print $fh "\$ModLoad imtcp\n"; 70 print $fh "\$InputTCPServerRun $listenport\n"; 73 print $fh "\$DefaultNetstreamDriver gtls\n"; 81 print $fh "\$DefaultNetstreamDriver${k}File $v\n"; 83 print $fh "\$ModLoad imtcp\n"; 84 print $fh "\$InputTCPServerStreamDriverMode 1\n"; 85 print $fh "\$InputTCPServerStreamDriverAuthMode anon\n"; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/dist/IO/lib/IO/ |
| D | Pipe.pm | 52 my $fh; 63 $fh = $rw ? ${*$me}[0] : ${*$me}[1]; 66 $fh = $rw ? $me->reader() : $me->writer(); # close the other end 69 $io->fdopen($fh, $mode); 70 $fh->close; 99 my $fh = ${*$me}[0]; 101 $pid = $me->_doit(0, $fh, @_) 105 bless $me, ref($fh); 106 *$me = *$fh; # Alias self to handle 107 $me->fdopen($fh->fileno,"r") [all …]
|
| /openbsd/src/gnu/usr.bin/perl/t/op/ |
| D | incfilter.t | 27 my $fh; 29 open $fh, "<", \'pass("Can return file handles from \@INC");'; 30 do $fh or die; 63 open $fh, "<", \'fail("File handles and filters work from \@INC");'; 65 do [$fh, sub {s/fail/pass/; return;}] or die; 67 open $fh, "<", \'fail("File handles and filters with state work from \@INC");'; 69 do [$fh, sub {s/$_[1]/pass/; return;}, 'fail'] or die; 91 open $fh, "$echo_command $pass_arg|" or die $!; 93 do $fh or die; 95 open $fh, "$echo_command $fail_arg|" or die $!; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/HTTP-Tiny/t/ |
| D | 030_response.t | 23 my $fh = tmpfile($response); 24 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 31 my $fh = tmpfile($response); 32 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 40 my $fh = tmpfile($response); 41 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 49 my $fh = tmpfile($response); 50 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 59 my $fh = tmpfile($response); 60 my $handle = HTTP::Tiny::Handle->new(fh => $fh); [all …]
|
| D | 020_headers.t | 19 my $fh = tmpfile($header); 21 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 28 my $fh = tmpfile($header); 30 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 37 my $fh = tmpfile($header); 39 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 45 my $fh = tmpfile(); 46 my $handle = HTTP::Tiny::Handle->new(fh => $fh); 49 rewind($fh); 54 my $fh = tmpfile(); [all …]
|
| /openbsd/src/gnu/usr.bin/perl/ext/PerlIO-via/t/ |
| D | via.t | 18 my $fh; 24 ok( !open($fh,"<via(PerlIO::via::QuotedPrint)", $tmp), 'open QuotedPrint for input fails'); 25 ok( open($fh,">via(PerlIO::via::QuotedPrint)", $tmp), 'open QuotedPrint for output'); 26 ok( (print $fh $a), "print to output file"); 27 ok( close($fh), 'close output file'); 29 ok( open($fh,"<via(PerlIO::via::QuotedPrint)", $tmp), 'open QuotedPrint for input'); 30 { local $/; $b = <$fh> } 31 ok( close($fh), "close input file"); 43 my $fd = open($fh,'>',$tmp) && fileno($fh); 44 print $fh "Hello\n"; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/Win32API-File/t/ |
| D | tie.t | 29 my $fh = Win32API::File->new("+> $filename") 32 my $tell = tell $fh; 37 ok(print($fh $text), "printed 'some text\\n'"); 39 $tell = tell $fh; 43 my $seek = seek($fh, 0, 0); 46 my $eof = eof $fh; 49 my $readline = <$fh>; 55 $eof = eof $fh; 58 ok(close($fh), 'closed filehandle'); 62 $fh = Win32API::File->new("+> $filename") [all …]
|
| /openbsd/src/gnu/usr.bin/perl/lib/ |
| D | FileHandle.t | 27 my $fh = (new FileHandle "./TEST", O_RDONLY 29 ok(defined($fh), "create new handle O_RDONLY"); 31 my $buffer = <$fh>; 34 ungetc $fh ord 'A'; 36 CORE::read($fh, $buf,1); 38 close $fh; 40 $fh = new FileHandle; 41 ok(($fh->open("< TEST") && <$fh> eq $buffer), 44 $fh->seek(0,0); 45 ok((<$fh> eq $buffer), "Averted possible mixed CRLF/LF in t/TEST"); [all …]
|
| /openbsd/src/gnu/usr.bin/perl/t/uni/ |
| D | overload.t | 162 open my $fh, "+>:raw$layer", $tmpfile or die $!; 170 print $fh $u; 171 print $fh $u; 172 print $fh $u; 173 print $fh $l; 174 print $fh $l; 175 print $fh $l; 177 syswrite $fh, $u; 178 syswrite $fh, $u; 179 syswrite $fh, $u; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/Encode/t/ |
| D | perlio.t | 53 open my $fh, "<:utf8", $ufile or die "$ufile : $!"; 54 my @uline = <$fh>; 56 close $fh; 70 open $fh, ">:encoding($e)", $pfile or die "$sfile : $!"; 71 $fh->autoflush(0); 72 print $fh $utext; 73 close $fh; 83 open $fh, ">:encoding($e)", $pfile or die "$sfile : $!"; 84 $fh->autoflush(1); 86 print $fh $l; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/t/lib/warnings/ |
| D | utf8 | 363 open(my $fh, "+>:utf8", $file); 364 print $fh "\x{D7FF}", "\n"; 365 print $fh "\x{D800}", "\n"; 366 print $fh "\x{D900}", "\n"; 367 print $fh "\x{DA00}", "\n"; 368 print $fh "\x{DB00}", "\n"; 369 print $fh "\x{DC00}", "\n"; 370 print $fh "\x{DD00}", "\n"; 371 print $fh "\x{DE00}", "\n"; 372 print $fh "\x{DF00}", "\n"; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/cpan/File-Temp/lib/File/ |
| D | Temp.pm | 494 my $fh; 498 $fh = &Symbol::gensym; 510 $fh = VMS::Stdio::vmssysopen($path, $OPENFLAGS, $perms, 'fop=dlt'); 511 $open_success = $fh; 517 $open_success = sysopen($fh, $path, $flags, $perms); 525 return ($fh, $path); 955 my ($fh, $fname, $isdir) = @_; 989 push(@{ $files_to_unlink{$$} }, [$fh, $fname]); 1089 my ($fh, $path) = tempfile( @$maybe_template, %$args ); 1091 print "Tmp: $fh - $path\n" if $DEBUG; [all …]
|
| /openbsd/src/regress/usr.sbin/relayd/ |
| D | Relayd.pm | 54 open(my $fh, '>', $self->{conffile}) 56 print $fh "log state changes\n"; 57 print $fh "log host checks\n"; 58 print $fh "log connection\n"; 59 print $fh "prefork 1\n"; # only crashes of first child are observed 60 print $fh "table <table-$test> { $self->{connectaddr} }\n" 82 print $fh "${proto}protocol proto-$test {"; 85 print $fh "\n\ttls ca cert ca.crt"; 86 print $fh "\n\ttls ca key ca.key password ''"; 89 print $fh "\n\ttls client ca client-ca.crt"; [all …]
|
| /openbsd/src/gnu/usr.bin/perl/dist/Devel-PPPort/devel/ |
| D | scanprov | 102 open my $fh, "+<", $file or die "$file: $!\n"; 103 my @lines = <$fh>; 107 truncate $fh, 0; 108 seek $fh, 0, 0; 109 print $fh @lines; 110 close $fh or die "$file: $!\n"; 124 open my $fh, "+<", $file or die "$file: $!\n"; 125 my @lines = <$fh>; 138 truncate $fh, 0; 139 seek $fh, 0, 0; [all …]
|