Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: print list element from function syntax

by Hofmator (Curate)
on Jun 25, 2004 at 13:05 UTC ( [id://369612]=note: print w/replies, xml ) Need Help??


in reply to print list element from function syntax

What happens is that perl interprets this as
print(localtime) # call print with one argument: whatever is returne +d by localtime [2]."\n"
and then perl doesn't know what to do with the [2] after the print statement.

To fix this, simply write print +(localtime)[2]."\n";

-- Hofmator

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found