[Israel.pm] function prototypes

Levenglick Dov dov at freescale.com
Tue Jun 10 21:15:39 PDT 2008


Hi,
Without verifying this theory with code (too early in the morning ;)),
my guess would be that perl is not interpreting this as being a
subroutine. Perhaps adding pretences would help: i.e.
$_->ctx->{length}()

 
Best Regards,
Dov Levenglick
 
The information contained in this email is classified as:
[ ] Freescale General Business Information
[x] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Shmuel Fomberg
Sent: Tuesday, June 10, 2008 23:26
To: Perl in Israel
Subject: [Israel.pm] function prototypes

Hi All.

I'm trying to write a function:
sub MetaField ($&) { ... }

and call it like that:
MetaField("data", { $_->ctx->{length} })
or:
MetaField("data", $_->ctx->{length})

but only this works:
MetaField("data", sub { $_->ctx->{length} })

Why?
Shmuel.
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl



More information about the Perl mailing list