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

Re: system("date | perl -p -e 'chop' >> $timef")



Thank you for creating this list!

Vicki Brown <vlb@cfcl.com> wrote:

>     system("date | perl -p -e 'chop' >> $timef");
>
> no comment required here, I think... (if you want one, let me know).

Please.  Why not

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

or

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

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

I started using Perl a few months ago.  I enjoy it thoroughly, and hope to
master it, in time.