Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Looking for syntactic shortcut

by Thilosophy (Curate)
on Jul 19, 2005 at 12:58 UTC ( #476067=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Looking for syntactic shortcut
in thread Looking for syntactic shortcut

I dont know about print, but assignment to a scalar works fine:

perl -e 'print $a=(localtime())[5]' 105

Update: Or, following BrowserUK:

perl -e 'print +(localtime())[5]' 105

Update: But not (in response to socketdave):

perl -e 'print (localtime())[5]' syntax error at -e line 1, near ")[" Execution of -e aborted due to compilation errors.
It seems we are hitting the finer points in the parser here...


Comment on Re^3: Looking for syntactic shortcut
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-12-27 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (177 votes), past polls