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

Re^3: unsure how to use variable

by oko1 (Deacon)
on Feb 18, 2012 at 04:54 UTC ( #954697=note: print w/replies, xml ) Need Help??

in reply to Re^2: unsure how to use variable
in thread unsure how to use variable

If we're going to nitpick: you're flat wrong in a number of places.

  • I never said that arrays start at 0. Indices, however, do - unless you change them.
  • Changing them via $[ won't make the arrays start at 1 either. Although the indices will start at whatever number is assigned to it.
  • Human language being the imperfect tool that it is, exceptions to "always" can always be found. Being able to do this is not a mark of ability, distinction, or anything else positive - especially when you end up qualifying your "correction" by saying "Either way, avoid [it]."
  • Your statement about hashes being slower is mostly misleading - badly so when trying to explain something to someone who is just learning the language. In fact, hashes are usually *much* faster than arrays - although, as always, there's the exception. Which you, of course, seized on.

I'm totally fine - grateful, usually - when someone points out where I've been wrong; it's all a learning experience. Your post, however, was a pointless series of nitpicks and exception highlighting, and of no earthly use to anyone.

I hate storms, but calms undermine my spirits.
 -- Bernard Moitessier, "The Long Way"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://954697]
[Corion]: gnosti: I would cheat and use my approach instead of dealing with durations as objects, or a module
[Corion]: You could even do the calculation directly - my $duration = $H * 3600+ $M*60 + $S; strftime '%H:%M:%S', timelocal($duratio n)
[Corion]: (and that strftime call is largely superfluous too, converting back to H:M:S isn't hard either)
[gnosti]: Corion: Thanks. Going to seconds, then back to H:M:S using strftime looks good.
[gnosti]: True, it's easy to go both ways ;-)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-08-18 09:04 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (297 votes). Check out past polls.