#!/usr/bin/perl if (!(caller(0))[7]) { # Not inside of a use print "Running tests...\n"; } sub some_sub { print "Running some_sub\n"; } 1;