Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
This is an example of how imports in Perl do *not* work.
#! /usr/bin/perl
use strict;
use warnings qw(all);
package Foo;
*Foo::pseudoimport = sub { printf "Cool beans!\n" };
sub fancysub {
sub normalsub {
printf "Boring beans.\n";
undef *Foo::pseudoimport;
package Main;
my $obj = bless {}, 'Foo';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment