> >#!/usr/bin/perl > >use warnings; >use strict; > >my @date = (localtime (time - (24*60*60)))[3..5]; > >foreach my $i (@date) { > print $i . "\n"; >} > >exit; > >I get this: > >10 >1 >107 > > >I still have to add 1 to the month. Is that right? Also, the year still needs >to be fixed by adding 1900 but from what I've read that is due to the way >computers work and not necessarily because of Perl. >
I think it's better to write: my ($day,$month,$year) = (localtime (time - (24*60*60)))[3..5]; and you still need to add these two statements: $month++; $year+=1900; -- Jeff Pang EMAIL: [EMAIL PROTECTED] AIM: jeffpang -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/