in reply to $date in print is printing \$date ???

By changing the $date=`date` line to $date = localtime() the code now seems to work 100%. Whereas before it worked somewhere around 75%.
There is something really strange out this...
  • Comment on Re: $date in print is printing \$date ???

Replies are listed 'Best First'.
Re: Re: $date in print is printing \$date ???
by PodMaster (Abbot) on Mar 13, 2003 at 10:14 UTC
    Not really. Perl doesn't know anything about date.
    delete $ENV{path}; die `date`;
    date is an external program, and as such, depends on the ENVironment. It is a very bad idea to do things like `date`. This ain't shell programming, this is perl, and perl has gmtime() and localtime() which in scalar context return a neato time string, as in
    perl -le die~~gmtime perl -le die~~localtime
    Now that's called portability.


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.