summaryrefslogtreecommitdiff
path: root/examples/warndie.pl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/warndie.pl')
-rw-r--r--examples/warndie.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/warndie.pl b/examples/warndie.pl
new file mode 100644
index 0000000..23e2e9e
--- /dev/null
+++ b/examples/warndie.pl
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+
+require Error;
+if( $ARGV[0] ) {
+ import Error qw( :warndie );
+ print "Imported the :warndie tag.\n";
+ print "\n";
+}
+else {
+ print "Running example without the :warndie tag.\n";
+ print "Try also passing a true value as \$ARGV[0] to import this tag\n";
+ print "\n";
+}
+
+sub inner {
+ shift->foo();
+}
+
+sub outer {
+ inner( @_ );
+}
+
+outer( undef );