Skip to content

Instantly share code, notes, and snippets.

@skreuzer
Created October 27, 2010 02:39
Show Gist options
  • Save skreuzer/648313 to your computer and use it in GitHub Desktop.
Save skreuzer/648313 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use lib 'lib';
use SourceCarp fatal => 1, warnings => 1;
# throw warning
open my $fh, '<', '/no/file';
print {$fh}
# report from subroutine
report_with_level( );
sub report_with_level
{
SourceCarp::report( "report caller, not self\\n", 2 );
}
# throw error
die "Oops!";
print "hello world\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment