Hello, Can somebody explain me the magic here....
=============================
sub vprint (@) {
return unless $Utils::verbose;
my ($file, $line) = (caller)[1,2];
my $subr = (caller 1)[3] || 'main';
$file =~ s!.*/!!;
print STDERR "$subr($file:$line): ", @_;
}
================What would be the better way to add facilty to write to a log file as well.
- by passing a file handle (or some other mechanism).
Write to file handle only if one is passed to the subroutine, otherwise just print to the STDERR.
Thanks and Regards, Manish
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
