Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 contemplating the Monastery: (16)
As of 2014-07-24 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (162 votes), past polls