Dave Tang wrote:
Hi everybody,
Hello,
I was reading perlfaq7.pod, 7.15: How can I pass/return a {Function,
FileHandle, Array, Hash, Method, Regex}?
In one of the examples it shows how regular expressions can be passed to
subroutines:
sub compare($$) {
my ($val1, $regex) = @_;
my $retval = $val1 =~ /$regex/;
return $retval;
}
$match = compare("old McDonald", qr/d.*D/i);
I know the special variable $$ contains the process number of the Perl
running this script, but just wanted to know its purpose in compare($$).
http://groups.google.com/group/comp.lang.perl.modules/msg/84484de5eb01085b
perldoc perlsub
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/