On Thursday 08 July 2004 13:51, perl.org wrote:
>
> On Thu, 8 Jul 2004 13:01:07 -0700, John W. Krahn wrote
> >
> > You like typing a lot?  :-)  You could use a hash slice.
>
> I'm not really a Perl programmer so I try to make the code clear to
> people coming from Java, C#, etc.

Ah, then why are you using $/ instead of "\n" in your example?

> (no remarks on my relative success are needed).

Sorry, I just had to.  :-)

> This kind of construct seems foreign to most other
> languages.  In fact I wish localtime would return an associative
> array instead of a positional array (I basically wrap localtime with
> a sub that converts the data to a hash).

localtime(), like many of Perl's builtin functions, is just a wrapper 
around the C library function of the same name.

man 3 localtime

> > I don't know why it is changing,
> > (I can't see your entire program) but perhaps you should just store
> > the current time in a scalar and see if that helps.
>
> It would have to be a global or environment variable, which I am
> hoping to avoid (especially since this one should already contain the
> value).

The value in $^T should remain the same for the duration of the 
program.  When it changes does it stay at the new value or does it 
switch back to the old value?


John
-- 
use Perl;
program
fulfillment


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to