1 pp_sys.c AOK 2 3 untie attempted while %d inner references still exist [pp_untie] 4 sub TIESCALAR { bless [] } ; tie $a, 'main'; untie $a ; 5 6 fileno() on unopened filehandle abc [pp_fileno] 7 $a = "abc"; fileno($a) 8 9 binmode() on unopened filehandle abc [pp_binmode] 10 $a = "abc"; fileno($a) 11 12 printf() on unopened filehandle abc [pp_prtf] 13 $a = "abc"; printf $a "fred" 14 15 Filehandle %s opened only for input [pp_leavewrite] 16 format STDIN = 17 . 18 write STDIN; 19 20 write() on closed filehandle %s [pp_leavewrite] 21 format STDIN = 22 . 23 close STDIN; 24 write STDIN ; 25 26 page overflow [pp_leavewrite] 27 28 printf() on unopened filehandle abc [pp_prtf] 29 $a = "abc"; printf $a "fred" 30 31 Filehandle %s opened only for input [pp_prtf] 32 $a = "abc"; 33 printf $a "fred" 34 35 printf() on closed filehandle %s [pp_prtf] 36 close STDIN ; 37 printf STDIN "fred" 38 39 syswrite() on closed filehandle %s [pp_send] 40 close STDIN; 41 syswrite STDIN, "fred", 1; 42 43 send() on closed socket %s [pp_send] 44 close STDIN; 45 send STDIN, "fred", 1 46 47 bind() on closed socket %s [pp_bind] 48 close STDIN; 49 bind STDIN, "fred" ; 50 51 52 connect() on closed socket %s [pp_connect] 53 close STDIN; 54 connect STDIN, "fred" ; 55 56 listen() on closed socket %s [pp_listen] 57 close STDIN; 58 listen STDIN, 2; 59 60 accept() on closed socket %s [pp_accept] 61 close STDIN; 62 accept "fred", STDIN ; 63 64 shutdown() on closed socket %s [pp_shutdown] 65 close STDIN; 66 shutdown STDIN, 0; 67 68 setsockopt() on closed socket %s [pp_ssockopt] 69 getsockopt() on closed socket %s [pp_ssockopt] 70 close STDIN; 71 setsockopt STDIN, 1,2,3; 72 getsockopt STDIN, 1,2; 73 74 getsockname() on closed socket %s [pp_getpeername] 75 getpeername() on closed socket %s [pp_getpeername] 76 close STDIN; 77 getsockname STDIN; 78 getpeername STDIN; 79 80 flock() on closed socket %s [pp_flock] 81 flock() on closed socket [pp_flock] 82 close STDIN; 83 flock STDIN, 8; 84 flock $a, 8; 85 86 warn(warn_nl, "stat"); [pp_stat] 87 88 -T on closed filehandle %s 89 stat() on closed filehandle %s 90 close STDIN ; -T STDIN ; stat(STDIN) ; 91 92 warn(warn_nl, "open"); [pp_fttext] 93 -T "abc\ndef" ; 94 95 Filehandle %s opened only for output [pp_sysread] 96 my $file = "./xcv" ; 97 open(F, ">$file") ; 98 my $a = sysread(F, $a,10) ; 99 100 lstat on filehandle %s [pp_lstat] 101 102 getc() on unopened filehandle [pp_getc] 103 104 getc() on closed filehandle [pp_getc] 105 106 Non-string passed as bitmask [pp_sselect] 107 108 %s too large [pp_gmtime] 109 110 %s failed [pp_gmtime] 111 112__END__ 113# pp_sys.c [pp_untie] 114use warnings 'untie' ; 115sub TIESCALAR { bless [] } ; 116$b = tie $a, 'main'; 117untie $a ; 118no warnings 'untie' ; 119$c = tie $d, 'main'; 120untie $d ; 121EXPECT 122untie attempted while 1 inner references still exist at - line 5. 123######## 124# pp_sys.c [pp_leavewrite] 125use warnings 'io' ; 126format STDIN = 127. 128write STDIN; 129no warnings 'io' ; 130write STDIN; 131EXPECT 132Filehandle STDIN opened only for input at - line 5. 133######## 134# pp_sys.c [pp_leavewrite] 135use warnings 'closed' ; 136format STDIN = 137. 138format FOO = 139. 140close STDIN; 141write STDIN; 142write FOO; 143opendir STDIN, "."; 144write STDIN; 145closedir STDIN; 146opendir FOO, "."; 147write FOO; 148closedir FOO; 149no warnings 'closed' ; 150write STDIN; 151write FOO; 152opendir STDIN, "."; 153opendir FOO, "."; 154write STDIN; 155write FOO; 156EXPECT 157write() on closed filehandle STDIN at - line 8. 158write() on closed filehandle STDIN at - line 11. 159 (Are you trying to call write() on dirhandle STDIN?) 160######## 161# pp_sys.c [pp_leavewrite] 162use warnings 'unopened'; 163format STDIN = 164. 165format FOO = 166. 167close STDIN; 168write STDIN; 169write FOO; 170opendir STDIN, "."; 171write STDIN; 172closedir STDIN; 173opendir FOO, "."; 174write FOO; 175closedir FOO; 176no warnings 'unopened'; 177write STDIN; 178write FOO; 179opendir STDIN, "."; 180opendir FOO, "."; 181write STDIN; 182write FOO; 183EXPECT 184write() on unopened filehandle FOO at - line 9. 185write() on unopened filehandle FOO at - line 14. 186 (Are you trying to call write() on dirhandle FOO?) 187######## 188# pp_sys.c [pp_leavewrite] 189use warnings 'io' ; 190format STDOUT_TOP = 191abc 192. 193format STDOUT = 194def 195ghi 196. 197$= = 1 ; 198$- =1 ; 199open STDOUT, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ; 200write ; 201no warnings 'io' ; 202write ; 203EXPECT 204page overflow at - line 13. 205######## 206# pp_sys.c [pp_prtf] 207use warnings 'unopened' ; 208$a = "abc"; 209printf $a "fred"; 210no warnings 'unopened' ; 211printf $a "fred"; 212EXPECT 213printf() on unopened filehandle abc at - line 4. 214######## 215# pp_sys.c [pp_prtf] 216use warnings 'closed' ; 217close STDIN ; 218printf STDIN "fred"; 219opendir STDIN, "."; 220printf STDIN "fred"; 221closedir STDIN; 222no warnings 'closed' ; 223printf STDIN "fred"; 224opendir STDIN, "."; 225printf STDIN "fred"; 226EXPECT 227printf() on closed filehandle STDIN at - line 4. 228printf() on closed filehandle STDIN at - line 6. 229 (Are you trying to call printf() on dirhandle STDIN?) 230######## 231# pp_sys.c [pp_prtf] 232use warnings 'io' ; 233printf STDIN "fred"; 234no warnings 'io' ; 235printf STDIN "fred"; 236EXPECT 237Filehandle STDIN opened only for input at - line 3. 238######## 239# pp_sys.c [pp_send] 240use warnings 'io' ; 241syswrite STDIN, "fred"; 242no warnings 'io' ; 243syswrite STDIN, "fred"; 244EXPECT 245Filehandle STDIN opened only for input at - line 3. 246######## 247# pp_sys.c [pp_send] 248use warnings 'closed' ; 249close STDIN; 250syswrite STDIN, "fred", 1; 251opendir STDIN, "."; 252syswrite STDIN, "fred", 1; 253closedir STDIN; 254no warnings 'closed' ; 255syswrite STDIN, "fred", 1; 256opendir STDIN, "."; 257syswrite STDIN, "fred", 1; 258EXPECT 259syswrite() on closed filehandle STDIN at - line 4. 260syswrite() on closed filehandle STDIN at - line 6. 261 (Are you trying to call syswrite() on dirhandle STDIN?) 262######## 263# pp_sys.c [pp_flock] 264use Config; 265BEGIN { 266 if ( !$Config{d_flock} && 267 !$Config{d_fcntl_can_lock} && 268 !$Config{d_lockf} ) { 269 print <<EOM ; 270SKIPPED 271# flock not present 272EOM 273 exit ; 274 } 275} 276use warnings qw(unopened closed); 277close STDIN; 278flock STDIN, 8; 279opendir STDIN, "."; 280flock STDIN, 8; 281flock FOO, 8; 282flock $a, 8; 283no warnings qw(unopened closed); 284flock STDIN, 8; 285opendir STDIN, "."; 286flock STDIN, 8; 287flock FOO, 8; 288flock $a, 8; 289EXPECT 290flock() on closed filehandle STDIN at - line 16. 291flock() on closed filehandle STDIN at - line 18. 292 (Are you trying to call flock() on dirhandle STDIN?) 293flock() on unopened filehandle FOO at - line 19. 294flock() on unopened filehandle at - line 20. 295######## 296# pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] 297use warnings 'closed'; 298use Config; 299BEGIN { 300 if ( $^O ne 'VMS' and ! $Config{d_socket}) { 301 print <<EOM ; 302SKIPPED 303# send not present 304# bind not present 305# connect not present 306# accept not present 307# shutdown not present 308# setsockopt not present 309# getsockopt not present 310# getsockname not present 311# getpeername not present 312EOM 313 exit ; 314 } 315} 316close STDIN; 317send STDIN, "fred", 1; 318bind STDIN, "fred" ; 319connect STDIN, "fred" ; 320listen STDIN, 2; 321accept "fred", STDIN; 322shutdown STDIN, 0; 323setsockopt STDIN, 1,2,3; 324getsockopt STDIN, 1,2; 325getsockname STDIN; 326getpeername STDIN; 327opendir STDIN, "."; 328send STDIN, "fred", 1; 329bind STDIN, "fred" ; 330connect STDIN, "fred" ; 331listen STDIN, 2; 332accept "fred", STDIN; 333shutdown STDIN, 0; 334setsockopt STDIN, 1,2,3; 335getsockopt STDIN, 1,2; 336getsockname STDIN; 337getpeername STDIN; 338closedir STDIN; 339send FOO, "fred", 1; 340bind FOO, "fred" ; 341connect FOO, "fred" ; 342listen FOO, 2; 343accept "fred", FOO; 344shutdown FOO, 0; 345setsockopt FOO, 1,2,3; 346getsockopt FOO, 1,2; 347getsockname FOO; 348getpeername FOO; 349opendir FOO, "."; 350send FOO, "fred", 1; 351bind FOO, "fred" ; 352connect FOO, "fred" ; 353listen FOO, 2; 354accept "fred", FOO; 355shutdown FOO, 0; 356setsockopt FOO, 1,2,3; 357getsockopt FOO, 1,2; 358getsockname FOO; 359getpeername FOO; 360closedir FOO; 361no warnings 'closed'; 362send STDIN, "fred", 1; 363bind STDIN, "fred" ; 364connect STDIN, "fred" ; 365listen STDIN, 2; 366accept STDIN, "fred" ; 367shutdown STDIN, 0; 368setsockopt STDIN, 1,2,3; 369getsockopt STDIN, 1,2; 370getsockname STDIN; 371getpeername STDIN; 372opendir STDIN, "."; 373send STDIN, "fred", 1; 374bind STDIN, "fred" ; 375connect STDIN, "fred" ; 376listen STDIN, 2; 377accept "fred", STDIN; 378shutdown STDIN, 0; 379setsockopt STDIN, 1,2,3; 380getsockopt STDIN, 1,2; 381getsockname STDIN; 382getpeername STDIN; 383send FOO, "fred", 1; 384bind FOO, "fred" ; 385connect FOO, "fred" ; 386listen FOO, 2; 387accept FOO, "fred" ; 388shutdown FOO, 0; 389setsockopt FOO, 1,2,3; 390getsockopt FOO, 1,2; 391getsockname FOO; 392getpeername FOO; 393opendir FOO, "."; 394send FOO, "fred", 1; 395bind FOO, "fred" ; 396connect FOO, "fred" ; 397listen FOO, 2; 398accept "fred", FOO; 399shutdown FOO, 0; 400setsockopt FOO, 1,2,3; 401getsockopt FOO, 1,2; 402getsockname FOO; 403getpeername FOO; 404EXPECT 405send() on closed socket STDIN at - line 22. 406bind() on closed socket STDIN at - line 23. 407connect() on closed socket STDIN at - line 24. 408listen() on closed socket STDIN at - line 25. 409accept() on closed socket STDIN at - line 26. 410shutdown() on closed socket STDIN at - line 27. 411setsockopt() on closed socket STDIN at - line 28. 412getsockopt() on closed socket STDIN at - line 29. 413getsockname() on closed socket STDIN at - line 30. 414getpeername() on closed socket STDIN at - line 31. 415send() on closed socket STDIN at - line 33. 416 (Are you trying to call send() on dirhandle STDIN?) 417bind() on closed socket STDIN at - line 34. 418 (Are you trying to call bind() on dirhandle STDIN?) 419connect() on closed socket STDIN at - line 35. 420 (Are you trying to call connect() on dirhandle STDIN?) 421listen() on closed socket STDIN at - line 36. 422 (Are you trying to call listen() on dirhandle STDIN?) 423accept() on closed socket STDIN at - line 37. 424 (Are you trying to call accept() on dirhandle STDIN?) 425shutdown() on closed socket STDIN at - line 38. 426 (Are you trying to call shutdown() on dirhandle STDIN?) 427setsockopt() on closed socket STDIN at - line 39. 428 (Are you trying to call setsockopt() on dirhandle STDIN?) 429getsockopt() on closed socket STDIN at - line 40. 430 (Are you trying to call getsockopt() on dirhandle STDIN?) 431getsockname() on closed socket STDIN at - line 41. 432 (Are you trying to call getsockname() on dirhandle STDIN?) 433getpeername() on closed socket STDIN at - line 42. 434 (Are you trying to call getpeername() on dirhandle STDIN?) 435######## 436# pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] 437use warnings 'unopened'; 438use Config; 439BEGIN { 440 if ( $^O ne 'VMS' and ! $Config{d_socket}) { 441 print <<EOM ; 442SKIPPED 443# send not present 444# bind not present 445# connect not present 446# accept not present 447# shutdown not present 448# setsockopt not present 449# getsockopt not present 450# getsockname not present 451# getpeername not present 452EOM 453 exit ; 454 } 455} 456close STDIN; 457send STDIN, "fred", 1; 458bind STDIN, "fred" ; 459connect STDIN, "fred" ; 460listen STDIN, 2; 461accept "fred", STDIN; 462shutdown STDIN, 0; 463setsockopt STDIN, 1,2,3; 464getsockopt STDIN, 1,2; 465getsockname STDIN; 466getpeername STDIN; 467opendir STDIN, "."; 468send STDIN, "fred", 1; 469bind STDIN, "fred" ; 470connect STDIN, "fred" ; 471listen STDIN, 2; 472accept "fred", STDIN; 473shutdown STDIN, 0; 474setsockopt STDIN, 1,2,3; 475getsockopt STDIN, 1,2; 476getsockname STDIN; 477getpeername STDIN; 478closedir STDIN; 479send FOO, "fred", 1; 480bind FOO, "fred" ; 481connect FOO, "fred" ; 482listen FOO, 2; 483accept "fred", FOO; 484shutdown FOO, 0; 485setsockopt FOO, 1,2,3; 486getsockopt FOO, 1,2; 487getsockname FOO; 488getpeername FOO; 489opendir FOO, "."; 490send FOO, "fred", 1; 491bind FOO, "fred" ; 492connect FOO, "fred" ; 493listen FOO, 2; 494accept "fred", FOO; 495shutdown FOO, 0; 496setsockopt FOO, 1,2,3; 497getsockopt FOO, 1,2; 498getsockname FOO; 499getpeername FOO; 500closedir FOO; 501no warnings 'unopened'; 502send STDIN, "fred", 1; 503bind STDIN, "fred" ; 504connect STDIN, "fred" ; 505listen STDIN, 2; 506accept STDIN, "fred" ; 507shutdown STDIN, 0; 508setsockopt STDIN, 1,2,3; 509getsockopt STDIN, 1,2; 510getsockname STDIN; 511getpeername STDIN; 512opendir STDIN, "."; 513send STDIN, "fred", 1; 514bind STDIN, "fred" ; 515connect STDIN, "fred" ; 516listen STDIN, 2; 517accept "fred", STDIN; 518shutdown STDIN, 0; 519setsockopt STDIN, 1,2,3; 520getsockopt STDIN, 1,2; 521getsockname STDIN; 522getpeername STDIN; 523send FOO, "fred", 1; 524bind FOO, "fred" ; 525connect FOO, "fred" ; 526listen FOO, 2; 527accept FOO, "fred" ; 528shutdown FOO, 0; 529setsockopt FOO, 1,2,3; 530getsockopt FOO, 1,2; 531getsockname FOO; 532getpeername FOO; 533opendir FOO, "."; 534send FOO, "fred", 1; 535bind FOO, "fred" ; 536connect FOO, "fred" ; 537listen FOO, 2; 538accept "fred", FOO; 539shutdown FOO, 0; 540setsockopt FOO, 1,2,3; 541getsockopt FOO, 1,2; 542getsockname FOO; 543getpeername FOO; 544EXPECT 545send() on unopened socket FOO at - line 44. 546bind() on unopened socket FOO at - line 45. 547connect() on unopened socket FOO at - line 46. 548listen() on unopened socket FOO at - line 47. 549accept() on unopened socket FOO at - line 48. 550shutdown() on unopened socket FOO at - line 49. 551setsockopt() on unopened socket FOO at - line 50. 552getsockopt() on unopened socket FOO at - line 51. 553getsockname() on unopened socket FOO at - line 52. 554getpeername() on unopened socket FOO at - line 53. 555send() on unopened socket FOO at - line 55. 556 (Are you trying to call send() on dirhandle FOO?) 557bind() on unopened socket FOO at - line 56. 558 (Are you trying to call bind() on dirhandle FOO?) 559connect() on unopened socket FOO at - line 57. 560 (Are you trying to call connect() on dirhandle FOO?) 561listen() on unopened socket FOO at - line 58. 562 (Are you trying to call listen() on dirhandle FOO?) 563accept() on unopened socket FOO at - line 59. 564 (Are you trying to call accept() on dirhandle FOO?) 565shutdown() on unopened socket FOO at - line 60. 566 (Are you trying to call shutdown() on dirhandle FOO?) 567setsockopt() on unopened socket FOO at - line 61. 568 (Are you trying to call setsockopt() on dirhandle FOO?) 569getsockopt() on unopened socket FOO at - line 62. 570 (Are you trying to call getsockopt() on dirhandle FOO?) 571getsockname() on unopened socket FOO at - line 63. 572 (Are you trying to call getsockname() on dirhandle FOO?) 573getpeername() on unopened socket FOO at - line 64. 574 (Are you trying to call getpeername() on dirhandle FOO?) 575######## 576# pp_sys.c [pp_stat] 577use warnings 'newline' ; 578stat "abc\ndef"; 579stat "abcdef\n"; 580stat "abcdef\n\0"; 581no warnings 'newline' ; 582stat "abc\ndef"; 583stat "abcdef\n"; 584stat "abcdef\n\0"; 585EXPECT 586Unsuccessful stat on filename containing newline at - line 4. 587Unsuccessful stat on filename containing newline at - line 5. 588######## 589# pp_sys.c [pp_fttext] 590use warnings qw(unopened closed) ; 591close STDIN ; 592-T STDIN ; 593stat(STDIN) ; 594-T HOCUS; 595stat(POCUS); 596stat "../test.pl"; 597stat *foo; 598no warnings qw(unopened closed) ; 599-T STDIN ; 600stat(STDIN); 601-T HOCUS; 602stat(POCUS); 603stat "../test.pl"; 604stat *foo; 605EXPECT 606-T on closed filehandle STDIN at - line 4. 607stat() on closed filehandle STDIN at - line 5. 608-T on unopened filehandle HOCUS at - line 6. 609stat() on unopened filehandle POCUS at - line 7. 610stat() on unopened filehandle foo at - line 9. 611######## 612# pp_sys.c [pp_fttext] 613use warnings 'newline' ; 614-T "abc\ndef" ; 615-T "abcdef\n" ; 616-T "abcdef\n\0" ; 617no warnings 'newline' ; 618-T "abc\ndef" ; 619-T "abcdef\n" ; 620-T "abcdef\n\0" ; 621EXPECT 622Unsuccessful open on filename containing newline at - line 4. 623Unsuccessful open on filename containing newline at - line 5. 624######## 625# pp_sys.c [pp_sysread] 626use warnings 'io' ; 627if ($^O eq 'dos') { 628 print <<EOM ; 629SKIPPED 630# skipped on dos 631EOM 632 exit ; 633} 634my $file = "./xcv" ; 635open(F, ">$file") ; 636binmode F; 637my $a = sysread(F, $a,10) ; 638no warnings 'io' ; 639my $a = sysread(F, $a,10) ; 640close F ; 641use warnings 'io' ; 642sysread(F, $a, 10); 643read(F, $a, 10); 644sysread(NONEXISTENT, $a, 10); 645read(NONEXISTENT, $a, 10); 646unlink $file ; 647EXPECT 648Filehandle F opened only for output at - line 13. 649sysread() on closed filehandle F at - line 18. 650read() on closed filehandle F at - line 19. 651sysread() on unopened filehandle NONEXISTENT at - line 20. 652read() on unopened filehandle NONEXISTENT at - line 21. 653######## 654# pp_sys.c [pp_binmode] 655use warnings 'unopened' ; 656binmode(BLARG); 657$a = "BLERG";binmode($a); 658EXPECT 659binmode() on unopened filehandle BLARG at - line 3. 660binmode() on unopened filehandle at - line 4. 661######## 662# pp_sys.c [pp_lstat] 663use warnings 'io'; 664open FH, "../harness" or die "# $!"; 665lstat FH; 666lstat *FH; 667lstat \*FH; 668open my $fh, $0 or die "# $!"; 669lstat $fh; 670lstat *FH{IO}; 671no warnings 'io'; 672lstat FH; 673lstat $fh; 674close FH; 675close $fh; 676EXPECT 677lstat() on filehandle FH at - line 4. 678lstat() on filehandle FH at - line 5. 679lstat() on filehandle FH at - line 6. 680lstat() on filehandle $fh at - line 8. 681lstat() on filehandle at - line 9. 682######## 683 684# pp_sys.c [pp_lstat] 685use warnings 'io'; 686use utf8; 687use open qw( :utf8 :std ); 688open ᶠḨ, "../harness" or die "# $!"; 689lstat ᶠḨ; 690open my $fᚺ, $0 or die "# $!"; 691lstat $fᚺ; 692no warnings 'io'; 693lstat ᶠḨ; 694lstat $fᚺ; 695close ᶠḨ; 696close $fᚺ; 697EXPECT 698lstat() on filehandle ᶠḨ at - line 7. 699lstat() on filehandle $fᚺ at - line 9. 700######## 701# pp_sys.c [pp_getc] 702use warnings qw(unopened closed) ; 703getc FOO; 704close STDIN; 705getc STDIN; 706# Create an empty file 707$file = 'getcwarn.tmp'; 708open FH1, ">$file" or die "# $!"; close FH1; 709open FH2, $file or die "# $!"; 710getc FH2; # Should not warn at EOF 711close FH2; 712getc FH2; # Warns, now 713unlink $file; 714no warnings qw(unopened closed) ; 715getc FOO; 716getc STDIN; 717getc FH2; 718EXPECT 719getc() on unopened filehandle FOO at - line 3. 720getc() on closed filehandle STDIN at - line 5. 721getc() on closed filehandle FH2 at - line 12. 722######## 723# pp_sys.c [pp_sselect] 724use warnings 'misc'; 725$x = 1; 726select $x, undef, undef, 1; 727sub TIESCALAR{bless[]} sub FETCH {"hello"} sub STORE{} 728tie $y, ""; 729select $y, undef, undef, 1; 730no warnings 'misc'; 731select $x, undef, undef, 1; 732EXPECT 733Non-string passed as bitmask at - line 4. 734######## 735use Config; 736BEGIN { 737 if (!$Config{d_fchdir}) { 738 print <<EOM; 739SKIPPED 740# fchdir not present 741EOM 742 exit; 743 } 744} 745opendir FOO, '.'; closedir FOO; 746open BAR, '.'; close BAR; 747opendir $dh, '.'; closedir $dh; 748open $fh, '.'; close $fh; 749chdir FOO; 750chdir BAR; 751chdir $dh; 752chdir $fh; 753use warnings qw(unopened closed) ; 754chdir FOO; 755chdir BAR; 756chdir $dh; 757chdir $fh; 758EXPECT 759chdir() on unopened filehandle FOO at - line 20. 760chdir() on closed filehandle BAR at - line 21. 761chdir() on unopened filehandle $dh at - line 22. 762chdir() on closed filehandle $fh at - line 23. 763######## 764# pp_sys.c [pp_open] 765use warnings; 766opendir FOO, "."; 767opendir my $foo, "."; 768open FOO, "../harness"; 769open $foo, "../harness"; 770no warnings qw(io deprecated); 771open FOO, "../harness"; 772open $foo, "../harness"; 773EXPECT 774Opening dirhandle FOO also as a file at - line 5. 775Opening dirhandle $foo also as a file at - line 6. 776######## 777 778# pp_sys.c [pp_open] 779use utf8; 780use open qw( :utf8 :std ); 781use warnings; 782opendir FOO, "."; 783opendir $foo, "."; 784open FOO, "../harness"; 785open $foo, "../harness"; 786no warnings qw(io deprecated); 787open FOO, "../harness"; 788open $foo, "../harness"; 789EXPECT 790Opening dirhandle FOO also as a file at - line 8. 791Opening dirhandle $foo also as a file at - line 9. 792######## 793# pp_sys.c [pp_open_dir] 794use warnings; 795open FOO, "../harness"; 796open my $foo, "../harness"; 797opendir FOO, "."; 798opendir $foo, "."; 799no warnings qw(io deprecated); 800opendir FOO, "."; 801opendir $foo, "."; 802EXPECT 803Opening filehandle FOO also as a directory at - line 5. 804Opening filehandle $foo also as a directory at - line 6. 805######## 806 807# pp_sys.c [pp_open_dir] 808use utf8; 809use open qw( :utf8 :std ); 810use warnings; 811use warnings; 812open FOO, "../harness"; 813open $foo, "../harness"; 814opendir FOO, "."; 815opendir $foo, "."; 816no warnings qw(io deprecated); 817opendir FOO, "."; 818opendir $foo, "."; 819EXPECT 820Opening filehandle FOO also as a directory at - line 9. 821Opening filehandle $foo also as a directory at - line 10. 822######## 823# pp_sys.c [pp_*dir] 824use Config ; 825BEGIN { 826 if ( ! $Config{d_telldir}) { 827 print <<EOM ; 828SKIPPED 829# telldir not present 830EOM 831 exit 832 } 833} 834#line 2 835use warnings 'io'; 836opendir FOO, "."; 837opendir $foo, "."; 838closedir FOO; 839closedir $foo; 840 841readdir(FOO); 842telldir(FOO); 843seekdir(FOO, 0); 844rewinddir(FOO); 845closedir(FOO); 846 847readdir($foo); 848telldir($foo); 849seekdir($foo, 0); 850rewinddir($foo); 851closedir($foo); 852 853EXPECT 854readdir() attempted on invalid dirhandle FOO at - line 8. 855telldir() attempted on invalid dirhandle FOO at - line 9. 856seekdir() attempted on invalid dirhandle FOO at - line 10. 857rewinddir() attempted on invalid dirhandle FOO at - line 11. 858closedir() attempted on invalid dirhandle FOO at - line 12. 859readdir() attempted on invalid dirhandle $foo at - line 14. 860telldir() attempted on invalid dirhandle $foo at - line 15. 861seekdir() attempted on invalid dirhandle $foo at - line 16. 862rewinddir() attempted on invalid dirhandle $foo at - line 17. 863closedir() attempted on invalid dirhandle $foo at - line 18. 864######## 865 866# pp_sys.c [pp_*dir] 867use Config ; 868BEGIN { 869 if ( ! $Config{d_telldir}) { 870 print <<EOM ; 871SKIPPED 872# telldir not present 873EOM 874 exit 875 } 876} 877#line 3 878use utf8; 879use open qw( :utf8 :std ); 880use warnings 'io'; 881opendir FOO, "."; 882opendir $foo, "."; 883opendir FOO, "."; 884opendir $foo, "."; 885closedir FOO; 886closedir $foo; 887 888readdir(FOO); 889telldir(FOO); 890seekdir(FOO, 0); 891rewinddir(FOO); 892closedir(FOO); 893 894readdir($foo); 895telldir($foo); 896seekdir($foo, 0); 897rewinddir($foo); 898closedir($foo); 899 900EXPECT 901readdir() attempted on invalid dirhandle FOO at - line 13. 902telldir() attempted on invalid dirhandle FOO at - line 14. 903seekdir() attempted on invalid dirhandle FOO at - line 15. 904rewinddir() attempted on invalid dirhandle FOO at - line 16. 905closedir() attempted on invalid dirhandle FOO at - line 17. 906readdir() attempted on invalid dirhandle $foo at - line 19. 907telldir() attempted on invalid dirhandle $foo at - line 20. 908seekdir() attempted on invalid dirhandle $foo at - line 21. 909rewinddir() attempted on invalid dirhandle $foo at - line 22. 910closedir() attempted on invalid dirhandle $foo at - line 23. 911######## 912 913# pp_sys.c [pp_gmtime] 914gmtime("NaN"); 915localtime("NaN"); 916use warnings "overflow"; 917gmtime("NaN"); 918localtime("NaN"); 919 920EXPECT 921gmtime(NaN) too large at - line 6. 922gmtime(NaN) failed at - line 6. 923localtime(NaN) too large at - line 7. 924localtime(NaN) failed at - line 7. 925 926######## 927# pp_sys.c [pp_alarm] 928alarm(-1); 929no warnings "misc"; 930alarm(-1); 931 932EXPECT 933alarm() with negative argument at - line 2. 934 935######## 936# pp_sys.c [pp_sleep] 937sleep(-1); 938no warnings "misc"; 939sleep(-1); 940 941EXPECT 942sleep() with negative argument at - line 2. 943######## 944# NAME sysread() deprecated on :utf8 945use warnings 'deprecated'; 946open my $fh, "<:raw", "../harness" or die "# $!"; 947my $buf; 948sysread $fh, $buf, 10; 949binmode $fh, ':utf8'; 950sysread $fh, $buf, 10; 951EXPECT 952sysread() is deprecated on :utf8 handles at - line 6. 953######## 954# NAME syswrite() deprecated on :utf8 955my $file = "syswwarn.tmp"; 956use warnings 'deprecated'; 957open my $fh, ">:raw", $file or die "# $!"; 958syswrite $fh, 'ABC'; 959binmode $fh, ':utf8'; 960syswrite $fh, 'ABC'; 961close $fh; 962unlink $file; 963EXPECT 964syswrite() is deprecated on :utf8 handles at - line 6. 965