Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-12-28 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls