Skip to content

Instantly share code, notes, and snippets.

@Abhinickz
Created April 11, 2017 08:36
Show Gist options
  • Save Abhinickz/78920f9511b7be67cf3442161bb692b8 to your computer and use it in GitHub Desktop.
Save Abhinickz/78920f9511b7be67cf3442161bb692b8 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict; use warnings;
my $data = [ 1, 2, 3, 4 ];
eval {
require Data::Dumper;
Data::Dumper->import();
print Dumper($data);
1;
} or do {
my $error = $@;
# Module load failed. You could recover, try loading
# an alternate module, die with $error...
# whatever's appropriate
print "Module Data::Dumper not found See the below error about module\n##########\n$error\n##########\nStill continuing with the program\n";
};
print "\nRunning other things without Data::Dumper!\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment