On Sep 14, siren jones said:
>$date = `/bin/date + %y%m%d`;
There's really no need to be calling an external system command to get the
date. Perl has its own function, localtime(), and you can use the
POSIX::strftime() function to use date-like formatting instructions (the
%y and %m stuff).
>$
On Fri, 14 Sep 2001, siren jones wrote:
> What is happening here?
>
> $date = `/bin/date + %y%m%d`;
> print "$date";
>
> prints
> >20010914
> >
>
> But if I add:
>
> $a = chomp($date);
> print "$a";
>
>
> it prints
> >
Because you aren't using chomp the way it's supposed to be used. Try
this:
What is happening here?
$date = `/bin/date + %y%m%d`;
print "$date";
prints
>20010914
>
But if I add:
$a = chomp($date);
print "$a";
it prints
>
What happens to the number? Why doesn't chomp just get rid of the newline?
Thank you in advance.
_