#1614 chomp($var = <STDIN>) crashes perl if there is no STDIN

closed-invalid
nobody
non-mingw (19)
2012-06-14
2012-01-04
No

chomp($var = <STDIN>) crashes perl if there is no STDIN.

Exampel crash:
Use of uninitialized value in chomp at test.pl line 1.
0 [main] perl.exe" 1916 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
1297 [main] perl.exe" 1916 open_stackdumpfile: Dumping stack trace to perl.exe.stackdump

Discussion

  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    IMO perl should crash in this case.

     
  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    • labels: 380073 --> non-mingw
    • status: open --> closed-invalid
     
  • Why should an interpreter ever crash? E.g. perl on *nix system does not crash in these situations - however, *nix perl correctly outputs the warning "Use of uninitialized value in chomp" (no crash).