Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: list slice (fewer)

by tye (Cardinal)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2015-07-04 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls