Anil Kumar, Malyala wrote:
> I am new to perl and working for a small project...
> 
> I need some help from you..
> 
> How to get all the first days of a week in a month.

$ perl -le'
# get every Monday for August 2005
use Time::Local;
# start at noon August 1st
my $day = 1;
while ( eval { @date = gmtime( $date = timegm( 0, 0, 12, $day++, 7, 2005 ) ) } 
) {
    if ( $date[ 6 ] == 1 ) {
        print scalar gmtime $date;
        }
    }
'
Mon Aug  1 12:00:00 2005
Mon Aug  8 12:00:00 2005
Mon Aug 15 12:00:00 2005
Mon Aug 22 12:00:00 2005
Mon Aug 29 12:00:00 2005



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to