SPUG: Perl oddity?

Mikel Tidwell dragon at dreamhaven.org
Thu Jan 29 10:08:21 CST 2004


I don't understand why you would think that @t should act different than
any other time you use an array explicitly like that.  localtime() is
expecting a scalar, and you're handing it an array.  Perl always returns
the number of elements in that case... right?

 _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _
  -- Mikel Tidwell  President, RPGamer -- http://www.rpgamer.com/
     ICQ: 9187899      FireMyst's Lair -- http://dragon.rpgamer.com/
 - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -

On Wed, 28 Jan 2004, Marc M. Adkins wrote:

-> # I was a little surprised at this...
->
-> print join('/', reverse localtime), "\n";
-> print join('/', reverse localtime(time)), "\n";
->
-> @t = ( time );
->
-> print join('/', reverse localtime($t[0])), "\n";
-> print join('/', reverse localtime(@t)), "\n";	# ????????
-> print join('/', reverse localtime(shift(@t))), "\n";
->
-> # I would have thought that the line with the question
-> # marks would have worked the same as the rest.
->
-> # mma
->
-> _____________________________________________________________
-> Seattle Perl Users Group Mailing List
-> POST TO: spug-list at mail.pm.org  http://spugwiki.perlocity.org
-> ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list
-> MEETINGS: 3rd Tuesdays, U-District, Seattle WA
-> WEB PAGE: http://www.seattleperl.org
->
->



More information about the spug-list mailing list