http://www.perlmonks.org?node_id=92478


in reply to How to make bi-modal variables like $! ?

Cheat - use @err and force context :)
my @err = build_error("Something went wrong",5); print "The error message is: @err\n"; print "The error number is: ".@err."\n"; exit(0); sub build_error { my @err; $err[0] = $_[0]; int($_[1]); $err[$_[1]-1] = '' if ($_[1]-1 > 0); return @err; }
cLive ;-)