I have this value,  from the date format solution emails,  in a subroutine 
and I want to pass it to a if clause, how would I go about this?
Can I assign a literal such as 

sub datemanip {

        my ( $month, $day, $year) = (localtime)[4,3,5];
        my $foodate = printf ("%02d/%02d/%02d\n", $month + 1, $day, ($year %100));
}

while  (<D>)
if ( $_ =~ $foodate) {

.....

}






Flemming Greve Skovengaard <[EMAIL PROTECTED]>
08/16/2004 02:58 PM

 
        To:     "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
        cc:     Bob Showalter <[EMAIL PROTECTED]>
        Subject:        Re: date format


Bob Showalter wrote:
> Flemming Greve Skovengaard wrote:
> 
>>printf ("%02d/%02d/%02d\n", $month + 1, $day, $year - 100);
>># Only works when $year > 1999.
> 
> 
> And when $year <= 2099 :~)
> 
> Stick to $year % 100;
> 

Yes, you are correct. Your solution is fool proof.

-- 
Flemming Greve Skovengaard           FAITH, n.
a.k.a Greven, TuxPower                   Belief without evidence in what 
is told
<[EMAIL PROTECTED]>              by one who speaks without 
knowledge,
4112.38 BogoMIPS                         of things without parallel.


-- 
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