Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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        

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 lurking in the Monastery: (7)
As of 2016-10-26 05:28 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (335 votes). Check out past polls.