[Dub-pm] hello

Fergal Daly fergal at esatclear.ie
Sat Jul 24 11:36:40 CDT 2004


On Sat, Jul 24, 2004 at 02:30:47PM +0100, Aidan Kehoe wrote:
> 
>  Ar an tr???? l?? is fiche de m?? I??il, scr??obh Fergal Daly: 
> 
>  > It compiled because Perl is a dynamic language and Perl does not know in
>  > advance that selectall_arrayref will not be returning a subroutine
>  > reference. It's perfectly valid code for suitable values of $sbh.
> 
> Fine, dynamic typing makes my life better, I hadn't realised that the arrow
> operator takes an array as its right-hand operand when you use it to
> dereference a subroutine reference. 

$a->($b, $c) is just a nicer way of writing

&{$a}($b, $c)

but given how uncommon it is, I think I'd prefer it was a syntax error. I've
been bitten more than once by exactly the same type of problem as you.

I think with Perl 6 and the effort to ensure the maximum value from the
minimum amount of code, there'll be very few strings aren't a valid Perl
program!

F



More information about the Dublin-pm mailing list