⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pp_sys

📁 source of perl for linux application,
💻
字号:
  pp_sys.c 	AOK  untie attempted while %d inner references still exist	[pp_untie]    sub TIESCALAR { bless [] } ; tie $a, 'main'; untie $a ;  fileno() on unopened filehandle abc		[pp_fileno]    $a = "abc"; fileno($a)  binmode() on unopened filehandle abc		[pp_binmode]    $a = "abc"; fileno($a)  printf() on unopened filehandle abc		[pp_prtf]    $a = "abc"; printf $a "fred"  Filehandle %s opened only for input		[pp_leavewrite]    format STDIN =    .    write STDIN;  write() on closed filehandle %s		[pp_leavewrite]    format STDIN =    .    close STDIN;    write STDIN ;  page overflow	 				[pp_leavewrite]  printf() on unopened filehandle abc		[pp_prtf]    $a = "abc"; printf $a "fred"  Filehandle %s opened only for input		[pp_prtf]    $a = "abc";     printf $a "fred"  printf() on closed filehandle %s		[pp_prtf]    close STDIN ;    printf STDIN "fred"  syswrite() on closed filehandle %s		[pp_send]    close STDIN;     syswrite STDIN, "fred", 1;  send() on closed socket %s			[pp_send]    close STDIN;     send STDIN, "fred", 1  bind() on closed socket %s			[pp_bind]    close STDIN;     bind STDIN, "fred" ;  connect() on closed socket %s			[pp_connect]    close STDIN;     connect STDIN, "fred" ;  listen() on closed socket %s			[pp_listen]    close STDIN;     listen STDIN, 2;  accept() on closed socket %s			[pp_accept]    close STDIN;     accept "fred", STDIN ;  shutdown() on closed socket %s		[pp_shutdown]    close STDIN;     shutdown STDIN, 0;  setsockopt() on closed socket %s		[pp_ssockopt]  getsockopt() on closed socket	%s		[pp_ssockopt]    close STDIN;     setsockopt STDIN, 1,2,3;    getsockopt STDIN, 1,2;  getsockname() on closed socket %s		[pp_getpeername]  getpeername() on closed socket %s		[pp_getpeername]    close STDIN;     getsockname STDIN;    getpeername STDIN;  flock() on closed socket %s			[pp_flock]  flock() on closed socket			[pp_flock]    close STDIN;    flock STDIN, 8;    flock $a, 8;  warn(warn_nl, "stat");			[pp_stat]  -T on closed filehandle %s  stat() on closed filehandle %s	close STDIN ; -T STDIN ; stat(STDIN) ;  warn(warn_nl, "open");			[pp_fttext]    -T "abc\ndef" ;  Filehandle %s opened only for output		[pp_sysread]	my $file = "./xcv" ;	open(F, ">$file") ; 	my $a = sysread(F, $a,10) ;  lstat on filehandle %s			[pp_lstat]  getc() on unopened filehandle			[pp_getc]  getc() on closed filehandle			[pp_getc]  Non-string passed as bitmask			[pp_sselect]__END__# pp_sys.c [pp_untie]use warnings 'untie' ;sub TIESCALAR { bless [] } ; $b = tie $a, 'main'; untie $a ;no warnings 'untie' ;$c = tie $d, 'main'; untie $d ;EXPECTuntie attempted while 1 inner references still exist at - line 5.######### pp_sys.c [pp_leavewrite]use warnings 'io' ;format STDIN =.write STDIN;no warnings 'io' ;write STDIN;EXPECTFilehandle STDIN opened only for input at - line 5.######### pp_sys.c [pp_leavewrite]use warnings 'closed' ;format STDIN =.close STDIN;write STDIN;opendir STDIN, ".";write STDIN;closedir STDIN;no warnings 'closed' ;write STDIN;opendir STDIN, ".";write STDIN;EXPECTwrite() on closed filehandle STDIN at - line 6.write() on closed filehandle STDIN at - line 8.	(Are you trying to call write() on dirhandle STDIN?)######### pp_sys.c [pp_leavewrite]use warnings 'io' ;format STDOUT_TOP =abc.format STDOUT =defghi.$= = 1 ;$- =1 ;open STDOUT, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ;write ;no warnings 'io' ;write ;EXPECTpage overflow at - line 13.######### pp_sys.c [pp_prtf]use warnings 'unopened' ;$a = "abc"; printf $a "fred";no warnings 'unopened' ;printf $a "fred";EXPECTprintf() on unopened filehandle abc at - line 4.######### pp_sys.c [pp_prtf]use warnings 'closed' ;close STDIN ;printf STDIN "fred";opendir STDIN, ".";printf STDIN "fred";closedir STDIN;no warnings 'closed' ;printf STDIN "fred";opendir STDIN, ".";printf STDIN "fred";EXPECTprintf() on closed filehandle STDIN at - line 4.printf() on closed filehandle STDIN at - line 6.	(Are you trying to call printf() on dirhandle STDIN?)######### pp_sys.c [pp_prtf]use warnings 'io' ;printf STDIN "fred";no warnings 'io' ;printf STDIN "fred";EXPECTFilehandle STDIN opened only for input at - line 3.######### pp_sys.c [pp_send]use warnings 'io' ;syswrite STDIN, "fred";no warnings 'io' ;syswrite STDIN, "fred";EXPECTFilehandle STDIN opened only for input at - line 3.######### pp_sys.c [pp_send]use warnings 'closed' ;close STDIN; syswrite STDIN, "fred", 1;opendir STDIN, ".";syswrite STDIN, "fred", 1;closedir STDIN;no warnings 'closed' ;syswrite STDIN, "fred", 1;opendir STDIN, ".";syswrite STDIN, "fred", 1;EXPECTsyswrite() on closed filehandle STDIN at - line 4.syswrite() on closed filehandle STDIN at - line 6.	(Are you trying to call syswrite() on dirhandle STDIN?)######### pp_sys.c [pp_flock]use Config; BEGIN {   if ( !$Config{d_flock} &&       !$Config{d_fcntl_can_lock} &&       !$Config{d_lockf} ) {    print <<EOM ;SKIPPED# flock not presentEOM    exit ;  } }use warnings qw(unopened closed);close STDIN;flock STDIN, 8;opendir STDIN, ".";flock STDIN, 8;flock FOO, 8;flock $a, 8;no warnings qw(unopened closed);flock STDIN, 8;opendir STDIN, ".";flock STDIN, 8;flock FOO, 8;flock $a, 8;EXPECTflock() on closed filehandle STDIN at - line 16.flock() on closed filehandle STDIN at - line 18.	(Are you trying to call flock() on dirhandle STDIN?)flock() on unopened filehandle FOO at - line 19.flock() on unopened filehandle at - line 20.######### pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername]use warnings 'io' ;use Config; BEGIN {   if ( $^O ne 'VMS' and ! $Config{d_socket}) {    print <<EOM ;SKIPPED# send not present# bind not present# connect not present# accept not present# shutdown not present# setsockopt not present# getsockopt not present# getsockname not present# getpeername not presentEOM    exit ;  } }close STDIN; send STDIN, "fred", 1;bind STDIN, "fred" ;connect STDIN, "fred" ;listen STDIN, 2;accept "fred", STDIN;shutdown STDIN, 0;setsockopt STDIN, 1,2,3;getsockopt STDIN, 1,2;getsockname STDIN;getpeername STDIN;opendir STDIN, ".";send STDIN, "fred", 1;bind STDIN, "fred" ;connect STDIN, "fred" ;listen STDIN, 2;accept "fred", STDIN;shutdown STDIN, 0;setsockopt STDIN, 1,2,3;getsockopt STDIN, 1,2;getsockname STDIN;getpeername STDIN;closedir STDIN;no warnings 'io' ;send STDIN, "fred", 1;bind STDIN, "fred" ;connect STDIN, "fred" ;listen STDIN, 2;accept STDIN, "fred" ;shutdown STDIN, 0;setsockopt STDIN, 1,2,3;getsockopt STDIN, 1,2;getsockname STDIN;getpeername STDIN;opendir STDIN, ".";send STDIN, "fred", 1;bind STDIN, "fred" ;connect STDIN, "fred" ;listen STDIN, 2;accept "fred", STDIN;shutdown STDIN, 0;setsockopt STDIN, 1,2,3;getsockopt STDIN, 1,2;getsockname STDIN;getpeername STDIN;EXPECTsend() on closed socket STDIN at - line 22.bind() on closed socket STDIN at - line 23.connect() on closed socket STDIN at - line 24.listen() on closed socket STDIN at - line 25.accept() on closed socket STDIN at - line 26.shutdown() on closed socket STDIN at - line 27.setsockopt() on closed socket STDIN at - line 28.getsockopt() on closed socket STDIN at - line 29.getsockname() on closed socket STDIN at - line 30.getpeername() on closed socket STDIN at - line 31.send() on closed socket STDIN at - line 33.	(Are you trying to call send() on dirhandle STDIN?)bind() on closed socket STDIN at - line 34.	(Are you trying to call bind() on dirhandle STDIN?)connect() on closed socket STDIN at - line 35.	(Are you trying to call connect() on dirhandle STDIN?)listen() on closed socket STDIN at - line 36.	(Are you trying to call listen() on dirhandle STDIN?)accept() on closed socket STDIN at - line 37.	(Are you trying to call accept() on dirhandle STDIN?)shutdown() on closed socket STDIN at - line 38.	(Are you trying to call shutdown() on dirhandle STDIN?)setsockopt() on closed socket STDIN at - line 39.	(Are you trying to call setsockopt() on dirhandle STDIN?)getsockopt() on closed socket STDIN at - line 40.	(Are you trying to call getsockopt() on dirhandle STDIN?)getsockname() on closed socket STDIN at - line 41.	(Are you trying to call getsockname() on dirhandle STDIN?)getpeername() on closed socket STDIN at - line 42.	(Are you trying to call getpeername() on dirhandle STDIN?)######### pp_sys.c [pp_stat]use warnings 'newline' ;stat "abc\ndef";no warnings 'newline' ;stat "abc\ndef";EXPECTUnsuccessful stat on filename containing newline at - line 3.######### pp_sys.c [pp_fttext]use warnings qw(unopened closed) ;close STDIN ; -T STDIN ;stat(STDIN) ;-T HOCUS;stat(POCUS);no warnings qw(unopened closed) ;-T STDIN ;stat(STDIN);-T HOCUS;stat(POCUS);EXPECT-T on closed filehandle STDIN at - line 4.stat() on closed filehandle STDIN at - line 5.-T on unopened filehandle HOCUS at - line 6.stat() on unopened filehandle POCUS at - line 7.######### pp_sys.c [pp_fttext]use warnings 'newline' ;-T "abc\ndef" ;no warnings 'newline' ;-T "abc\ndef" ;EXPECTUnsuccessful open on filename containing newline at - line 3.######### pp_sys.c [pp_sysread]use warnings 'io' ;if ($^O eq 'dos') {    print <<EOM ;SKIPPED# skipped on dosEOM    exit ;}my $file = "./xcv" ;open(F, ">$file") ; my $a = sysread(F, $a,10) ;no warnings 'io' ;my $a = sysread(F, $a,10) ;close F ;use warnings 'io' ;sysread(F, $a, 10);read(F, $a, 10);sysread(NONEXISTENT, $a, 10);read(NONEXISTENT, $a, 10);unlink $file ;EXPECTFilehandle F opened only for output at - line 12.sysread() on closed filehandle F at - line 17.read() on closed filehandle F at - line 18.sysread() on unopened filehandle NONEXISTENT at - line 19.read() on unopened filehandle NONEXISTENT at - line 20.######### pp_sys.c [pp_binmode]use warnings 'unopened' ;binmode(BLARG);$a = "BLERG";binmode($a);EXPECTbinmode() on unopened filehandle BLARG at - line 3.binmode() on unopened filehandle at - line 4.######### pp_sys.c [pp_lstat]use warnings 'io';open FH, "harness" or die "# $!";lstat FH;open my $fh, $0 or die "# $!";lstat $fh;no warnings 'io';lstat FH;lstat $fh;close FH;close $fh;EXPECTlstat() on filehandle FH at - line 4.lstat() on filehandle $fh at - line 6.######### pp_sys.c [pp_getc]use warnings qw(unopened closed) ;getc FOO;close STDIN;getc STDIN;# Create an empty file$file = 'getcwarn.tmp';open FH1, ">$file" or die "# $!"; close FH1;open FH2, $file    or die "# $!";getc FH2; # Should not warn at EOFclose FH2;getc FH2; # Warns, nowunlink $file;no warnings qw(unopened closed) ;getc FOO;getc STDIN;getc FH2;EXPECTgetc() on unopened filehandle FOO at - line 3.getc() on closed filehandle STDIN at - line 5.getc() on closed filehandle FH2 at - line 12.######### pp_sys.c [pp_sselect]use warnings 'misc';$x = 1;select $x, undef, undef, 1;no warnings 'misc';select $x, undef, undef, 1;EXPECTNon-string passed as bitmask at - line 4.########use Config;BEGIN {    if (!$Config{d_fchdir}) {	print <<EOM;SKIPPED# fchdir not presentEOM	exit;    }}opendir FOO, '.'; closedir FOO;open BAR, '.'; close BAR;opendir $dh, '.'; closedir $dh;open $fh, '.'; close $fh;chdir FOO;chdir BAR;chdir $dh;chdir $fh;use warnings qw(unopened closed) ;chdir FOO;chdir BAR;chdir $dh;chdir $fh;EXPECTchdir() on unopened filehandle FOO at - line 20.chdir() on closed filehandle BAR at - line 21.chdir() on unopened filehandle $dh at - line 22.chdir() on closed filehandle $fh at - line 23.######### pp_sys.c [pp_open]use warnings;opendir FOO, ".";opendir my $foo, ".";open FOO, "TEST";open $foo, "TEST";no warnings qw(io deprecated);open FOO, "TEST";open $foo, "TEST";EXPECTOpening dirhandle FOO also as a file at - line 5.Opening dirhandle $foo also as a file at - line 6.######### pp_sys.c [pp_open_dir]use warnings;open FOO, "TEST";open my $foo, "TEST";opendir FOO, ".";opendir $foo, ".";no warnings qw(io deprecated);opendir FOO, ".";opendir $foo, ".";EXPECTOpening filehandle FOO also as a directory at - line 5.Opening filehandle $foo also as a directory at - line 6.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -