> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> sub log_msg() { print LOG "@_\n"; }
Won't work. By defining the function as
sub log_msg() {
with an explicit set of empty parens, you've promised Perl that it will
never receive any arguments, so the compiler enforces that. Perl's
prototyping can be a real efficiency boost, but here it shot you in the
foot. :)
by defining it as
sub log_msg($) {
you promise exactly one scalar. On the other hand,
sub log_msg(@) {
means a list, which is the default, so for *this* code, just
sub log_msg {
would probably be better.
c.f. perldoc perlsub for more info than you'll likely ever use (lol),
but it's good to know. :)
__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]