On Tue, 24 Feb 2009 09:58:00 +
"S, Rajini (STSD)" wrote:
>
> My code in the program is :
That all seems to work. If you ever have problems getting a program to
work, it is often advisable to add some debugging aids, and I have
added a few to your code below so you might get the idea.
uni
shift;
> $dmy[1] = $month_num{lc $dmy[1]} || 0;
>
> return timelocal(0, 0, 0, @dmy) / (24 * 60 * 60);
> }
> }
>
>
> -Rajini
>
>
>
>
>
>>-Original Message-----
>>From: Rob Dixon [mailto:rob.di...@gmx.com]
>>Sent: Tuesday, Feb
-
>From: Rob Dixon [mailto:rob.di...@gmx.com]
>Sent: Tuesday, February 24, 2009 4:40 AM
>To: Perl Beginners
>Cc: S, Rajini (STSD)
>Subject: Re: Query in Perl Programming
>
>S, Rajini (STSD) wrote:
>> From: Owen [mailto:rc...@pcug.org.au]
>>> S, Rajini (STSD) wrote:
>&g
S, Rajini (STSD) wrote:
> From: Owen [mailto:rc...@pcug.org.au]
>> S, Rajini (STSD) wrote:
>>>
>>> When I included the below code in my script, I am getting below
>>> errors.
>>>
>>> Use of uninitialized value in integer ge (>=) at
>>> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73.
>>> Use
On Mon, Feb 23, 2009 at 06:01, S, Rajini (STSD) wrote:
snip
> Still I get the message : syntax OK
snip
Odd, I am getting:
Global symbol "$days1" requires explicit package name at z.pl line 5.
Global symbol "$days2" requires explicit package name at z.pl line 6.
Global symbol "$day" requires expl
>>
>> Yeah, the script posted below is part of the code In my script.
>>
>> After including the below code, when I ran the script, I am getting
>> the "uninitialized value" errors.
>
>
>
>Nope
>
>
>Do the following
>
>
>Copy the code you posted to a new file
>
>add #!/usr/bin/perl to the first l
>
> Yeah, the script posted below is part of the code
> In my script.
>
> After including the below code, when I ran the script,
> I am getting the "uninitialized value" errors.
Nope
Do the following
Copy the code you posted to a new file
add #!/usr/bin/perl to the first line
then run perl
y 23, 2009 12:03 PM
>To: S, Rajini (STSD)
>Cc: Perl Beginners
>Subject: RE: Query in Perl Programming
>
>>
>> #perl -c
>
> #perl -c
#perl -c
>
> Hi Owen,
>
> My code is as follows :
>
> use strict;
> use warnings;
> use Time::Local;
>
> $days1 = epoch_days('30-Jan-09');
> $days2 = epoch_days('16-Feb-09');
>
> $day = $days1 - $days2;
>
> print "Difference: @{[$days1 - $days2]} days\n";
>
> BEGIN {
>
> my %month_num = do {
> my $n =
en [mailto:rc...@pcug.org.au]
>Sent: Monday, February 23, 2009 10:08 AM
>To: S, Rajini (STSD)
>Cc: Rob Dixon; Perl Beginners
>Subject: RE: Query in Perl Programming
>
>>
>> Hi Rob,
>>
>> When I included the below code in my script, I am getting below
>&
>
> Hi Rob,
>
> When I included the below code in my script, I
> am getting below errors.
>
> Use of uninitialized value in integer ge (>=) at
> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73.
> Use of uninitialized value in integer lt (<) at
> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73.
gt;From: Rob Dixon [mailto:rob.di...@gmx.com]
>Sent: Friday, January 30, 2009 5:32 PM
>To: Perl Beginners
>Cc: S, Rajini (STSD)
>Subject: Re: Query in Perl Programming
>
>S, Rajini (STSD) wrote:
>>
>> Hi Rob,
>>
>> When I set the date to 30-Jan-2009 and run the
S, Rajini (STSD) wrote:
>
> Hi Rob,
>
> When I set the date to 30-Jan-2009 and run the code given below,
>
> Eg :
>
> When dates are set as :
>
> my $days1 = epoch_days('30-Jan-09');
> my $days2 = epoch_days('29-Feb-2009');
>
> I get the below error.
>
> hpcll402:/home/raji/perl>./
2009 4:43 PM
>To: S, Rajini (STSD)
>Cc: Perl Beginners
>Subject: RE: Query in Perl Programming
>
>>
>> Get the same error, when the date is set to
>>
>> my $days1 = epoch_days('30-Jan-09');
>> my $days2 = epoch_days('14-Feb-2009');
>
-Original Message-
>>From: Owen [mailto:rc...@pcug.org.au]
>>Sent: Friday, January 30, 2009 4:09 PM
>>To: S, Rajini (STSD)
>>Cc: Perl Beginners
>>Subject: RE: Query in Perl Programming
>>
>>>
>>> Hi Rob,
>>>
>>> When I set the
;Sent: Friday, January 30, 2009 4:09 PM
>To: S, Rajini (STSD)
>Cc: Perl Beginners
>Subject: RE: Query in Perl Programming
>
>>
>> Hi Rob,
>>
>> When I set the date to 30-Jan-2009 and run the code given below,
>>
>> Eg :
>>
>> When d
>
> Hi Rob,
>
> When I set the date to 30-Jan-2009 and run the code given below,
>
> Eg :
>
> When dates are set as :
>
> my $days1 = epoch_days('30-Jan-09');
> my $days2 = epoch_days('29-Feb-2009');
>
> I get the below error.
>
> hpcll402:/home/raji/perl>./date2.pl
> Day '30' out of range 1..2
out of range 1..28 at ./date2.pl line 35
-Rajini
>-Original Message-
>From: S, Rajini (STSD)
>Sent: Friday, January 30, 2009 9:50 AM
>To: Rob Dixon; Perl Beginners
>Subject: RE: Query in Perl Programming
>
>
>Thanks Rob, the solution which you suggeste
Thanks Rob, the solution which you suggested works fine.
-Rajini
>-Original Message-
>From: Rob Dixon [mailto:rob.di...@gmx.com]
>Sent: Wednesday, January 28, 2009 5:45 PM
>To: Perl Beginners
>Cc: S, Rajini (STSD)
>Subject: Re: Query in Perl Programming
>
&g
Rob Dixon wrote:
S, Rajini (STSD) wrote:
From: Gunnar Hjalmarsson [mailto:nore...@gunnar.cc]
Your particular problem can
be easily solved using only a module that is included in the
standard Perl distribution.
use Date::Parse;
my $time1 = str2time '26-Jan-2009';
my $time2 = str2
S, Rajini (STSD) wrote:
> From: Gunnar Hjalmarsson [mailto:nore...@gunnar.cc]
>> S, Rajini (STSD) wrote:
>>>
>>> I am new to Perl Programming and have a query in perl.
>>>
>>> In perl is there any system defined functions to find out the
>>> Differences in dates.
>>>
>>> Eg :
>>>
>>> Date 1 ->
42 PM
>To: beginners@perl.org
>Subject: Re: Query in Perl Programming
>
>S, Rajini (STSD) wrote:
>> Hi,
>>
>> I am new to Perl Programming and have a query in perl.
>>
>> In perl is there any system defined functions to find out the
>> Differences in
S, Rajini (STSD) wrote:
Hi,
I am new to Perl Programming and have a query in perl.
In perl is there any system defined functions to find out the
Differences in dates.
Eg :
Date 1 -> 26-Jan-2009
Date 2 -> 14-Jan-2009
So the difference between two dates is 12 days.
Is there a way to ac
On Jan 26, 9:37 pm, rajin...@hp.com (Rajini S) wrote:
> Hi,
>
> I am new to Perl Programming and have a query in perl.
>
> In perl is there any system defined functions to find out the
> Differences in dates.
>
> Eg :
>
> Date 1 -> 26-Jan-2009
> Date 2 -> 14-Jan-2009
>
> So the difference between t
2009/1/27 S, Rajini (STSD) :
>
> In perl is there any system defined functions to find out the
> Differences in dates.
>
Not as such. There are ways to do it by using Date:: modules, like
Date::Manip, Date::Calc, or DateTime.
Try the following links for more detailed information about the how.
h
Hi,
I am new to Perl Programming and have a query in perl.
In perl is there any system defined functions to find out the
Differences in dates.
Eg :
Date 1 -> 26-Jan-2009
Date 2 -> 14-Jan-2009
So the difference between two dates is 12 days.
Is there a way to achieve this with any syst
28 matches
Mail list logo