# # Escape regular expression # # $Id: regexpr.pl,v 1.3 2002/04/10 15:09:25 T.Shigetome Exp $ # package Regexpr; $Regexpr::VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/); sub Escape { local($_); if( ref($_[0]) eq 'ARRAY' ) { foreach( @{$_[0]} ) { $_ = quotemeta; } return wantarray ? @_ : $_[0]; } else { foreach( @_ ) { $_ = quotemeta; } } return @_; } 1;