#!/usr/bin/perl -l my $foo; BEGIN {$foo = rand 2 > 1} BEGIN {require strict; strict->import('vars') if $foo} $not_scoped = 1; # Error if $foo is true BEGIN {strict->unimport('vars')} $not_scoped = 1; # Not an error print "Finished." __END__