Created
December 26, 2011 16:41
-
-
Save jyotty/1521579 to your computer and use it in GitHub Desktop.
This is why ‘use warnings' is important and ‘use diagnostics’ is helpful
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ perl -E'open my $fh, "test"; print {$fh} "butts"' | |
| $ perl -Mwarnings -E'open my $fh, "test"; print {$fh} "butts"' | |
| Filehandle $fh opened only for input at -e line 1. | |
| $ perl -Mwarnings -Mdiagnostics -E'open my $fh, "test"; print {$fh} "butts"' | |
| Filehandle $fh opened only for input at -e line 1 (#1) | |
| (W io) You tried to write on a read-only filehandle. If you intended | |
| it to be a read-write filehandle, you needed to open it with "+<" or | |
| "+>" or "+>>" instead of with "<" or nothing. If you intended only to | |
| write the file, use ">" or ">>". See "open" in perlfunc. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment