in reply to Lexicals and timestamps
in thread stop me from embarrassing myself

$starttime = "$mon"."$day"."$hour"."$min"."$year";
here you are performing a null series of interpolations. You are better off saying
$starttime = "$mon$day$hour$min$year";

The real problem I see with the first one is writing "$var" when $var would do (this habit can actually hurt if you are dealing with things that aren't strings -- references, for example). FYI, both of these compile to the same code which is most like:

$starttime = $mon.$day.$hour.$min.$year;
Which isn't to say that the above line is a better way to write it than what you wrote. I find both equally valid, perhaps even preferring yours. I just wanted to emphasize the mistake of writing "$var", which is only useful when you want to convert something that might not be a string into a string.

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re: Lexicals and timestamps
by blueflashlight (Pilgrim) on Feb 28, 2001 at 00:06 UTC
    I'm afraid that I get quote-happy (comes from my old sh-scripting days); I'm sure that I'll continue to use unnecessary quotes until the day that I get bitten, just as you said above.

    thanks! -s-