[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [Fun With Perl] Re: system("date | perl -p -e 'chop' >> $timef")



>>>>> "John" == John Kristian <kristian@netscape.com> writes:

John> Please.  Why not

John>     { local *F; open F, ">> $timef"; print F (scalar localtime); close F }

John> or

John>     use FileHandle; (new FileHandle ">> $timef")->print(scalar localtime);

John> which are less compact, but faster, safer and more portable?

Of course, localtime doesn't return the timezone.  Perl doesn't know
it portably, so it just trusts the result from localtime(3). :)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me