Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: list slice (fewer)

by tye (Sage)
on Jul 21, 2006 at 22:35 UTC ( #562968=note: print w/ replies, xml ) Need Help??

in reply to list slice

There is also a way to make it work without quite so many parens:

my $year= ( localtime (stat $file)[9] )[5] + 1900;
my $year= ( localtime +(stat $file)[9] )[5] + 1900;

There are several cases where the more traditional func( args... ) can be "improved" to ( func args... ). But it won't work if func() isn't known to Perl at the time that this code is compiled.

Update: Have I mentioned recently that I hate the "looks like a function call" rule. Not allowing func (...) was a good feature that should've stayed and will be restored with Perl6. (:

- tye        

Comment on Re: list slice (fewer)
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://562968]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2015-12-01 03:33 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (792 votes), past polls