Chris Devers wrote:
On Thu, 9 Mar 2006, Practical Perl wrote:
Here is my script:
#!/usr/bin/perl
use strict;
use warnings;
my $date=`date +%y%m%d`;
chomp $date;
^^^
Not that this is your problem, but why on earth are you shelling out for
the date? Perl can do this just fine, you know, and you don't even have
to chomp() the result :-)
Try:
#!/usr/bin/perl
use strict;
use warnings;
use POSIX;
my @now = localtime;
print strftime( '%y%m%d', @now ), "\n";
__END__
The function strftime(3) uses the same format conversion specifications
as date(1). See `man strftime` for details.
--
Just my 0.00000002 million dollars worth,
--- Shawn
"Probability is now one. Any problems that are left are your own."
SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_
"This statement is true but unprovable."
Kurt Godel
* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>