Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Parenthetical help

by jwkrahn (Monsignor)
on Apr 03, 2011 at 17:55 UTC ( #897224=note: print w/replies, xml ) Need Help??


in reply to Parenthetical help

BTW, all three are wrong as time always returns a scalar so using a list slice on it makes no sense.

Replies are listed 'Best First'.
Re^2: Parenthetical help
by eye (Chaplain) on Apr 04, 2011 at 04:59 UTC
    Good point. The code I posted was oversimplified to isolate the issue. The original code was getting the modify time of a file and looked more like:

    localtime((stat $file)[9])

      The problem is that localtime has a prototype and that prototype says that localtime's first argument, if present, must be a scalar value, so arrays and lists are converted to a scalar value so localtime can use it.

      $ perl -le'print prototype "CORE::localtime"' ;$

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://897224]
help
Chatterbox?
[Corion]: Hi choroba! Yay, day off sounds great! I hope the performances of the kids go well!
[Corion]: I think I'm overdesigning things again. I want to export(later, synchronize) data from Google Keep, by scraping the HTML. And I'm thinking of automating this by having a canary note whose text my program knows and from which it can determine the ...
[Corion]: ... surrounding HTML to scrape all the other notes. Maybe I should better look at dumping all the requests that pass between Google and my "browser" instead.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-12-12 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (327 votes). Check out past polls.

    Notices?