News for hackers. Stuff that matters.
Re:Perl: When DWIM Doesn't by draegtun on Friday February 03, 2012 @03:41AM (#3546365)
!!! Supplementary for future readers of this comment thread !!!

The pragma autodie also spots this problem!

So....

    use strict;
    use warnings;
    use autodie;

    our $config;
    $config->{file_paht} = "somefile";

    open my $fh, '<', $config->{file_path};
Will throw an exception at open(). NB. Bizarrely the error is Use of uninitialized value $file in sprintf... but hey the problem is still caught :)

There are no comments on this comment yet.