Trying to find perl logic

2012-11-08 Thread Asad
Hi All , I have a requirement in Linux environement to check for an application pre-requisites if rpm's are installed or not . Like rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}\n" compat-libstdc++-* rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}\n" glibc-common-* Wher

Re: Date::Manip question

2012-11-08 Thread Gerhard
On Thu, Nov 08, 2012 at 10:56:00AM +, Marco van Kammen wrote: > my $current_month =(should be Nov) > my $current_mont_num = (should be 11) > my $previous_month = (should be Oct) > my $previous_month_num = (should be 10) There is Time::Piece and

Re: Date::Manip question

2012-11-08 Thread Ken Slater
On Thu, Nov 8, 2012 at 7:42 AM, Marco van Kammen wrote: > Yeah, so something like this: > > #!/usr/bin/perl > > use strict; > use warnings; > > my $previous_month; > my $previous_month_num; > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); > > my @months = ( 'JAN', 'F

RE: Date::Manip question

2012-11-08 Thread Marco van Kammen
Yeah, so something like this: #!/usr/bin/perl use strict; use warnings; my $previous_month; my $previous_month_num; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my @months = ( 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC' );

Re: Date::Manip question

2012-11-08 Thread David Precious
On Thu, 8 Nov 2012 12:53:31 +0100 Rob Coops wrote: > Something like the below would do perfectly fine... > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = > localtime(time); > > my @months = ( 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', > 'SEP', 'OCT', 'NOV', 'DEC' ); >

Re: Date::Manip question

2012-11-08 Thread Rob Coops
On Thu, Nov 8, 2012 at 12:53 PM, Rob Coops wrote: > > On Thu, Nov 8, 2012 at 11:56 AM, Marco van Kammen > wrote: > >> Hi List, >> >> ** ** >> >> For a logrotation and cleanup script I want to fill the following >> variables. >> >> ** ** >> >> my $current_month =(shou

Re: Date::Manip question

2012-11-08 Thread Rob Coops
On Thu, Nov 8, 2012 at 11:56 AM, Marco van Kammen wrote: > Hi List, > > ** ** > > For a logrotation and cleanup script I want to fill the following > variables. > > ** ** > > my $current_month =(should be Nov) > > my $current_mont_num = (should be 11)

Date::Manip question

2012-11-08 Thread Marco van Kammen
Hi List, For a logrotation and cleanup script I want to fill the following variables. my $current_month =(should be Nov) my $current_mont_num = (should be 11) my $previous_month = (should be Oct) my $previous_month_num = (should be 10) I've been