Is there a way to determine if the current file is the one being executed in Perl source? In Python we do this with the following construct:
if __name__ == '__main__':
# This file is being executed.
raise NotImplementedError
I can hack something together using FindBin
and __FILE__
, but I'm hoping there's a canonical way of doing this. Thanks!