If you're passing around filehandles, you could usually just use the bare typeglob, like
*STDOUT, but typeglobs references would be better because they'll still work properly under
use strict 'refs'. For example:

To pass regexps around, you'll need to either use one of the highly experimental regular expression modules from
CPAN (Nick Ing-Simmons's Regexp or Ilya Zakharevich's Devel::Regexp), pass around strings and use an exception-trapping eval, or else be be very, very clever. Here's an example of how to pass in a string to be regexp compared:

or someone can sneak shell escapes into the regexp due to the double
interpolation of the eval and the double-quoted string. For example:

$pattern_of_evil = 'danger ${ system("rm -rf * &") } danger';

eval "\$string =~ /$pattern_of_evil/";

Those preferring to be very, very clever might see the O'Reilly book,
Mastering Regular Expressions, by Jeffrey Friedl. Page 273's
Build_MatchMany_Function() is particularly interesting.
A complete citation of this book is given in
the perlfaq2 manpage.