Re: Query in Perl Programming

2009-01-26 Thread Erez Schatz
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

Re: Query in Perl Programming

2009-01-27 Thread rhosto
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

Re: Query in Perl Programming

2009-01-27 Thread Gunnar Hjalmarsson
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

RE: Query in Perl Programming

2009-01-28 Thread S, Rajini (STSD)
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

Re: Query in Perl Programming

2009-01-28 Thread Rob Dixon
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 ->

Re: Query in Perl Programming

2009-01-28 Thread Gunnar Hjalmarsson
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

RE: Query in Perl Programming

2009-01-29 Thread S, Rajini (STSD)
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

RE: Query in Perl Programming

2009-01-30 Thread S, Rajini (STSD)
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

RE: Query in Perl Programming

2009-01-30 Thread Owen
> > 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

RE: Query in Perl Programming

2009-01-30 Thread S, Rajini (STSD)
;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

RE: Query in Perl Programming

2009-01-30 Thread Owen
-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

RE: Query in Perl Programming

2009-01-30 Thread S, Rajini (STSD)
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'); >

Re: Query in Perl Programming

2009-01-30 Thread Rob Dixon
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>./

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
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

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > 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.

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
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 >&

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > 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 =

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
#perl -c

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > #perl -c

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
y 23, 2009 12:03 PM >To: S, Rajini (STSD) >Cc: Perl Beginners >Subject: RE: Query in Perl Programming > >> >> #perl -c

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > 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

RE: Query in Perl Programming

2009-02-23 Thread S, Rajini (STSD)
>> >> 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

Re: Query in Perl Programming

2009-02-23 Thread Chas. Owens
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

Re: Query in Perl Programming

2009-02-23 Thread Rob Dixon
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

RE: Query in Perl Programming

2009-02-24 Thread S, Rajini (STSD)
- >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

Re: Query in Perl Programming

2009-02-24 Thread Chas. Owens
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

Re: Query in Perl Programming

2009-02-24 Thread Owen
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