Re: Log4Perl query

2014-03-28 Thread Andy Bach
On Fri, Mar 28, 2014 at 8:01 AM, punit jain wrote: > Attempt to bless into a reference at > /root/scripts/bin/../lib/Log/Log4perl/Logger.pm line 143. > Not really but: Why "Log::Log4perl->get_logger" and not "Log::Log4perl->new"? We don't want to create a new object every time. Usually in

Log4Perl query

2014-03-28 Thread punit jain
Hi, I have a requirement where I need different appenders writing to same log file for different layout patterns. Below is my log4Perl config file :- log4perl.logger.timestamp = INFO, LOG1 log4perl.appender.LOG1 = Log::Log4perl::Appender::File log4perl.appender.LOG1.filename

Re: Query regarding Parallel::ForkManager

2012-03-30 Thread Dr.Ruud
On 2012-03-30 11:14, punit jain wrote: my $file = "/tmp/test"; die "\n Killed as filed doesnot exist \n" if(-e $file); It looks like you have to reverse your test. -e $file or die "[$$] exit early because '$file' doesn't exist\n"; But why even start a child, if its d

Query regarding Parallel::ForkManager

2012-03-30 Thread punit jain
Hi , I am using ForkManager module for multiprocessing in my code below : - use Parallel::ForkManager; $pm = new Parallel::ForkManager($MAX_PROCESSES); foreach $data (@all_data) { # Forks and returns the pid for the child: my $pid = $pm->start and next; ... do some work with $d

Re: XML QUERY

2012-02-16 Thread timothy adigun
Hi Anirban, On Wed, Feb 15, 2012 at 8:19 PM, Anirban Adhikary < anirban.adhik...@gmail.com> wrote: > > > > Hi List , > > I have two files one is a csv file another is a XML files which are > given here as attachments. > > Now I need to create a XML(Which is given here) file from this CSV > file(A

Fwd: XML QUERY

2012-02-15 Thread Anirban Adhikary
Hi List , I have two files one is a csv file another is a XML files which are given here as attachments. Now I need to create a XML(Which is given here) file from this CSV file(Also here as an attachment) and Create a CSV file from this XML file. My question is what perl module or modules I need

Re: Net::SMTP envelop from query

2011-09-13 Thread Jeff Pang
13 сентября 2011, 14:29 от Agnello George : > in the Net::SMTP module how does one differentiate the header-from and > envelope-from ID .. i had read somewhere that $smtp->mail($from) is > the envelope form id .. then how do i add the header from ID .. . That's in the message body. for example,

Net::SMTP envelop from query

2011-09-13 Thread Agnello George
in the Net::SMTP module how does one differentiate the header-from and envelope-from ID .. i had read somewhere that $smtp->mail($from) is the envelope form id .. then how do i add the header from ID .. . thanks a million : $smtp->mail($from); $smtp->to($to); $smtp->data(); $smtp->datasend("Subjec

RE: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Mimi Cafe
er 2010 07:37 => To: beginners@perl.org => Subject: PERL MYSQL query "IF EXISTS then UPDATE else INSERT" => => Hello, => => I want to update my database if the key value is already there then it => will => update the required field else it will insert the new row in the sa

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Peter Scott
On Wed, 20 Oct 2010 12:07:03 +0530, S Pratap Singh wrote: > I want to update my database if the key value is already there then it > will update the required field else it will insert the new row in the > same table. > > Insert query works fine but I am not able to figure out

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Chris Knipe
Just use SQL? INSERT INTO tbl, VALUES ('11','22','33') ON DUPLICATE KEY http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html On Wed, Oct 20, 2010 at 9:23 AM, Uri Guttman wrote: > >>>>> "SPS" == S Pratap Singh writes

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Uri Guttman
>>>>> "SPS" == S Pratap Singh writes: SPS> Insert query works fine but I am not able to figure out how to SPS> achieve this "IF EXISTS then UPDATE else INSERT" using a one SPS> liner MYSQL statement . If someone can give me an example to SP

PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-19 Thread S Pratap Singh
Hello, I want to update my database if the key value is already there then it will update the required field else it will insert the new row in the same table. Insert query works fine but I am not able to figure out how to achieve this "IF EXISTS then UPDATE else INSERT" using a

Re: one query

2010-09-21 Thread Jordi Durban
Woops! Sorry! I hit "Reply", not "Reply all". And I know that I have to learn more Perl. Is a perl-beginner list isn't? Regards. 2010/9/21 Shlomi Fish > In accordance with: > > > > > > > Please reply to list if it's a mailing list post - > http://shlom.in/yreply > > > . >

Re: one query

2010-09-21 Thread Shlomi Fish
In accordance with: > > > > Please reply to list if it's a mailing list post - http://shlom.in/reply > > . And the fact the message was not explicitly stated as replied-to-in-private and the fact it does not appear to be the author's intention, I'm CCing this to the list. Next time please hit

Re: One query

2010-09-20 Thread Dr.Ruud
On 2010-09-20 14:16, wrote: while(){ Use of a File Handle in this case would be better my ($key, $value) = split (/\t/,$_); and Use "\s+" instead of "\t" . And even better, use the special ' '. -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: One query

2010-09-20 Thread Whacky™
> while(){ Use of a File Handle in this case would be better >   my ($key, $value) = split (/\t/,$_); and Use "\s+" instead of "\t" . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: one query

2010-09-20 Thread Shlomi Fish
Hi Jordi, On Monday 20 September 2010 10:16:40 Jordi Durban wrote: > Hi all! > I have a file like this : > > colum acolum b > uid = 1 uid = 4 > uid = 2 uid = 3 > uid = 3 uid = 2 > uid = 4 uid = 1 > > I'm trying to find those columns with the same numbers

one query

2010-09-20 Thread Jordi Durban
Hi all! I have a file like this : colum acolum b uid = 1 uid = 4 uid = 2 uid = 3 uid = 3 uid = 2 uid = 4 uid = 1 I'm trying to find those columns with the same numbers regardless the colum they are. That's, in the example, the row 2 is identital to row 3.

Re: One query

2010-09-19 Thread Uri Guttman
> "PK" == Parag Kalra writes: PK> use strict; PK> use warnings; good. PK> my %mean_values; PK> while(){ PK> chomp; PK> my ($key, $value) = split (/\t/,$_); PK> if ( exists $mean_values{$key} ){ PK> push @{$mean_values{$key}}, $value; PK> } else { PK>

Re: One query

2010-09-19 Thread Parag Kalra
Hope this helps: #!/usr/bin/perl # Author: Parag Kalra # Date: 19-SEPT-2010 use strict; use warnings; my %mean_values; while(){ chomp; my ($key, $value) = split (/\t/,$_); if ( exists $mean_values{$key} ){ push @{$mean_values{$key}}, $value; } else { ${$mean_values{$key}}[

Re: One query

2010-09-17 Thread Uri Guttman
> "a:" == anamika : writes: a:> I have a file like this: a:> NM_003273 1929.19 a:> NM_053056 4662.262 a:> NM_053056 5728.343 a:> NM_024099 4009.705 a:> NM_001085372685.4568 a:> NR_003098 4700.29 a:> NM_199337 2727.46 a:> NM_018093

One query

2010-09-17 Thread anamika :
Hello, I have a file like this: NM_003273 1929.19 NM_053056 4662.262 NM_053056 5728.343 NM_024099 4009.705 NM_001085372685.4568 NR_003098 4700.29 NM_199337 2727.46 NM_018093 477.2938 NM_018093 813.0701 I want it to be something like: If the el

Re: Query on Qunatifiers

2010-07-15 Thread Jim Gibson
On 7/15/10 Thu Jul 15, 2010 12:24 PM, "Chandan Kumar" scribbled: > Hi guys, >   > I could able to understand the quantifiers. But still stuck with one > confusion.if dot operator is used with quantifiers. >   > ex: my string is $_="ths is my first regular expression"; >   > please explain t

Re: Query on Qunatifiers

2010-07-15 Thread Chandan Kumar
    Thanks in advance.     Best Regards, chandan. --- On Thu, 15/7/10, Chas. Owens wrote: From: Chas. Owens Subject: Re: Query on Qunatifiers To: "Thomas Bätzler" Cc: "Beginners Perl" , "Chandan Kumar" Date: Thursday, 15 July, 2010, 2:08 PM On Thu, Jul 15, 20

Re: Query on Qunatifiers

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 03:22, Thomas Bätzler wrote: snip > In RE, a "." by itself is the atom that matches any one character. > > The quantifiers mean: > > "?" 0 or 1 occurences of the previous expression. > "+" 1 or more occurrences of the previous expression (greedy match). > "*" 0 or more occu

Re: AW: Query on Qunatifiers

2010-07-15 Thread Chandan Kumar
Hi ,   Thanks guys for your quick response.   I will try it out combinations and get back to you if i have issues.       Regards, chandan. --- On Thu, 15/7/10, Thomas Bätzler wrote: From: Thomas Bätzler Subject: AW: Query on Qunatifiers To: "Beginners Perl" Cc: "Chand

AW: Query on Qunatifiers

2010-07-15 Thread Thomas Bätzler
Chandan Kumar asked: > I have query over quantifiers. > > Could you please explain the combination of operators Question mark > (?),dot(.),star(*),plus(+). > > Say this is my string: > > $_ = " this is my first pattern ,quite confused with quantifiers"

Re: Query on Qunatifiers

2010-07-15 Thread Shlomi Fish
On Thursday 15 Jul 2010 09:51:32 Chandan Kumar wrote: > Hi , > > I have query over quantifiers. > > Could you please explain the combination of operators Question mark > (?),dot(.),star(*),plus(+). > Say this is my string: > > $_ = " this is my fi

Query on Qunatifiers

2010-07-14 Thread Chandan Kumar
Hi ,   I have query over quantifiers.   Could you please explain the combination of operators Question mark (?),dot(.),star(*),plus(+).   Say this is my string:   $_ = " this is my first pattern ,quite confused with quantifiers"    ex: (thi.*?) or (thi.+?) etc   I know what eac

how to get XML::LibXML perfect xpath query ?

2010-06-12 Thread perl
i have tried to use the LibXML modules to xpath a document but its getting complicated .. i have seen this example over forum here . use XML::LibXML ; use strict; use warnings; { my $xml = <<'XML'; Hello world! XML my $parser = XML::LibXML->new; my $doc

Re: query

2009-12-22 Thread Parag Kalra
> > > my $input = shift; > what are we doing here? > First input paramter to the subroutine is getting shifted i.e getting stored in the variable '$input' > $sum += $_ for @digits; -> what exactly is the > . > All the elements of the array '@digits' are ge

query

2009-12-22 Thread Vishnu
I was going through the book intermediate perl and came across the following code. my @odd_digit_sum = grep digit_sum_is_odd($_), @input_numbers; sub digit_sum_is_odd { my $input = shift; > what are we doing here? my @digits = split //, $input; # Assume no nondigit cha

Re: Simple OOPs related query.

2009-12-21 Thread Shlomi Fish
On Tuesday 22 Dec 2009 04:20:30 Parag Kalra wrote: > Hi Shlomi, > > Thanks for your valuable comments. Will definitely keep it in mind in > future scripts. You're welcome. > > > > I've ran it and I still cannot figure out the bug. > > > > Here is the bug - > > pa...@station3:/tmp$ perl /t

Re: Simple OOPs related query.

2009-12-21 Thread Parag Kalra
Hi Shlomi, Thanks for your valuable comments. Will definitely keep it in mind in future scripts. I've ran it and I still cannot figure out the bug. Here is the bug - pa...@station3:/tmp$ perl /tmp/oops.pl Chetak goes Neigh Chetak eats Long grass Chetak has Brown color An unamed Horse goes Ne

Re: Simple OOPs related query.

2009-12-20 Thread Shlomi Fish
On Sunday 20 Dec 2009 21:15:53 Parag Kalra wrote: > Hello All, > > Just started learning OOPs in Perl from the book 'Intermediate Perl' > written by Randal. As well as brian d foy and Tom Phoenix I may add. > > I have written a small program given below. Its working at most places > except whi

Simple OOPs related query.

2009-12-20 Thread Parag Kalra
Hello All, Just started learning OOPs in Perl from the book 'Intermediate Perl' written by Randal. I have written a small program given below. Its working at most places except while printing color of unnamed creatures. Just execute the script and you will figure out the bug. Could someone explai

Re: Query Online File Size

2009-11-26 Thread Giany
use LWP::UserAgent; sub GetFileSize{ my $url=shift; $ua = new LWP::UserAgent; $ua->agent("Mozilla/5.0"); my $req = new HTTP::Request 'HEAD' => $url; $req->header('Accept' => 'text/html'); $res = $ua->request($req); if ($res->is_success) {

Query Online File Size

2009-11-26 Thread raphael()
Hi, I am writing a small script to download files of the web. How can I get the "file size" without downloading the file? use LWP::Simple; my $file = "http://www.abc.com/file.mp3"; my @array = head($file); print "$array[1]\n"; head() doesn't always returns all values? why?? Sometime there are a

Query on Threads, receiving Segment Fault.

2009-11-02 Thread Prasad Joshi
Hi All, I want to run multiple commands on a remote machine simultaneously. What I did is created a thread for each command, created an ssh object for each command and passed it to a function which simply runs command on remote machine using SSH. Here is the part of the code

Automating for the SNMPv3 query and trap

2009-09-23 Thread Rachit Gupta
HI All, I want to write perl script to automate SNMPv3 query and traps. Is there any module that can be use for the same? Also what are the different functions for the query / MIB file compilation and traps? Please suggest -- Rachit Gupta r.rac...@gmail.com 91-9873242190

Re: 'Join' query

2009-08-07 Thread jet speed
On Fri, Aug 7, 2009 at 4:46 PM, Shawn H. Corey wrote: > jet speed wrote: > >> Hi, >> >> I would like to join the $abc with ':' the final desired output 1:2:3:4:5 >> >> #!/usr/bin/perl >> >> use strict; >> use warnings; >> >> my $abc = "1 2 3 4 5"; >> my $out = join ':', $abc; >> print "$out"; >>

Re: 'Join' query

2009-08-07 Thread Shawn H. Corey
jet speed wrote: Hi, I would like to join the $abc with ':' the final desired output 1:2:3:4:5 #!/usr/bin/perl use strict; use warnings; my $abc = "1 2 3 4 5"; my $out = join ':', $abc; print "$out"; executing the above, i get the same output 1 2 3 4 5, not sure were am going wrong. Any he

Re: 'Join' query

2009-08-07 Thread John W. Krahn
jet speed wrote: Hi, Hello, I would like to join the $abc with ':' the final desired output 1:2:3:4:5 #!/usr/bin/perl use strict; use warnings; my $abc = "1 2 3 4 5"; my $out = join ':', $abc; print "$out"; executing the above, i get the same output 1 2 3 4 5, not sure were am going wron

Re: 'Join' query

2009-08-07 Thread Dermot
2009/8/7 jet speed : > Hi, > > I would like to join the $abc with ':'  the final desired output 1:2:3:4:5 > > #!/usr/bin/perl > > use strict; > use warnings; > > my $abc = "1 2 3 4 5"; > my $out = join ':', $abc; > print "$out"; > join works on arrays (LIST). You feeding it a scalar. @abc = qw/1

Re: 'Join' query

2009-08-07 Thread Telemachus
On Fri Aug 07 2009 @ 4:03, jet speed wrote: > Hi, > > I would like to join the $abc with ':' the final desired output 1:2:3:4:5 > > #!/usr/bin/perl > > use strict; > use warnings; > > my $abc = "1 2 3 4 5"; > my $out = join ':', $abc; > print "$out"; The function join works on lists not scala

Re: 'Join' query

2009-08-07 Thread Jim Gibson
On 8/7/09 Fri Aug 7, 2009 8:03 AM, "jet speed" scribbled: > Hi, > > I would like to join the $abc with ':' the final desired output 1:2:3:4:5 > > #!/usr/bin/perl > > use strict; > use warnings; > > my $abc = "1 2 3 4 5"; > my $out = join ':', $abc; > print "$out"; > > executing the above,

'Join' query

2009-08-07 Thread jet speed
Hi, I would like to join the $abc with ':' the final desired output 1:2:3:4:5 #!/usr/bin/perl use strict; use warnings; my $abc = "1 2 3 4 5"; my $out = join ':', $abc; print "$out"; executing the above, i get the same output 1 2 3 4 5, not sure were am going wrong. Any help on this would be

Re: perl query

2009-07-17 Thread John W. Krahn
7;, $t or die "Cannot open pipe from '$swlist' $!"; while ( <$PIPE> ) { next unless /$n/; print $LOG1 $_; print $LOG2 $_; } close $PIPE or warn $! ? "Error closing '$swlist' pipe: $!" : "Exit status $? from

RE: perl query

2009-07-14 Thread David Christensen
Rajini Naidu wrote: > `$swlist -l bundle -a revision -a architecture -s $t | $grep $n >> > $log_our_depot`; > `$swlist -l bundle -a revision -a architecture -s $t | $grep $n >> > $log_ourdepot_comp`; > Here I am outputting the same command line output to different > logfile. Why not use tee(1)?

Re: perl query

2009-07-14 Thread John W. Krahn
Rajini Naidu wrote: Hi, Hello, I have the below commands in the script. `$swlist -l bundle -a revision -a architecture -s $t | $grep $n >> $log_our_depot`; `$swlist -l bundle -a revision -a architecture -s $t | $grep $n >> $log_ourdepot_comp`; Here I am outputting the same command line ou

Re: perl query

2009-07-14 Thread Eric Veith
beginners@perl.org Date: 07/14/2009 11:41 AM

perl query

2009-07-14 Thread Rajini Naidu
Hi, I have the below commands in the script. `$swlist -l bundle -a revision -a architecture -s $t | $grep $n >> $log_our_depot`; `$swlist -l bundle -a revision -a architecture -s $t | $grep $n >> $log_ourdepot_comp`; Here I am outputting the same command line output to different logfile. Is th

RE: Query related to PAR::Packer

2009-06-23 Thread sanket vaidya
-Original Message- From: Anirban Adhikary [mailto:anirban.adhik...@gmail.com] Sent: Saturday, June 20, 2009 9:26 PM To: beginners@perl.org Subject: Query related to PAR::Packer >>Hi List >I need to run some applications written entirely in perl in some systems >where I

Query related to PAR::Packer

2009-06-20 Thread Anirban Adhikary
Hi List I need to run some applications written entirely in perl in some systems where I dont have an access. Other people run this applications. Now the problem is that when they find any error they always open the source and edited it which makes things more worse.So I compiled the source using

RE: CGI query

2009-06-17 Thread David Christensen
Rajini Naidu wrote: > I am new to CGI scripting. Get this book and work your way through it (I prefer Debian GNU/Linux): http://www.wiley.com/legacy/compbooks/stein/ HTH, David -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@p

CGI query

2009-06-17 Thread Rajini Naidu
Hi , I am new to CGI scripting. I have a below query. I have one form say "xyz" with checkbox, where I am supposed to select certain options using these checkboxes. I have another form say "abc" where I am required to display the selected options from form "xyz".

Re: Perl query

2009-06-05 Thread Chas. Owens
On Fri, Jun 5, 2009 at 14:24, Chas. Owens wrote: snip > what line is line 371? snip Nevermind, it is obvious: open my $pipe, "-|", "/usr/atria/bin/cleartool", "desc", $include_path/$srcfile or die "could not run cleartool: $!"; $include_path is being divided by $srcfile. The code should probab

Re: Perl query

2009-06-05 Thread Chas. Owens
On Fri, Jun 5, 2009 at 13:57, Rajini Naidu wrote: > Thanks owens for the response > >  This code is included in our testing infrastructure to extract some data. > > Please find the code included in the perl module : > >  print SCRIPT "${d}${driver} ${d}${driver}_OPTIONS ${d}DATA_MODE_FLAG > ${d}\{

Re: Perl query

2009-06-05 Thread Rajini Naidu
Thanks owens for the response This code is included in our testing infrastructure to extract some data. Please find the code included in the perl module : print SCRIPT "${d}${driver} ${d}${driver}_OPTIONS ${d}DATA_MODE_FLAG ${d}\{CTI_OPT_SIGN\}O${d}OPT_LEVEL -c \$INCLUDE $srcfile \$EXTRA_ARGS

Re: Perl query

2009-06-05 Thread Chas. Owens
On Fri, Jun 5, 2009 at 07:37, Rajini Naidu wrote: > Hi, > > This is my code in perl. > >   my $include = "foo.1"; >  my $ct = "/usr/atria/bin/cleartool"; > > open my $pipe, "-|", $ct, "desc", $include or die "could not run cleartool: > $!"; > > When i execute this , I am getting below error. > >  

Perl query

2009-06-05 Thread Rajini Naidu
Hi, This is my code in perl. my $include = "foo.1"; my $ct = "/usr/atria/bin/cleartool"; open my $pipe, "-|", $ct, "desc", $include or die "could not run cleartool: $!"; When i execute this , I am getting below error. meaningless input. Uncaught exception from user code: Il

OpenSource Query

2009-05-18 Thread Rajini Naidu
Hi, In ActiveState perl there are two modules namely menu and prompt. TO know more about these modules refer to : *http://docs.activestate.com/activeperl/5.10/lib/ActiveState/Prompt.html* *http://docs.activestate.com/activ

Re: Syntax query

2009-04-15 Thread asmith9983
I'd suggest placing your pipeline of commands into a bash shell script and running it manually from the command line and carefully observing it running. That way you are then dealing with a known quantity outwith any Perl issues. As someone else replied, consider using the "qx" command rather th

Re: Syntax query

2009-04-15 Thread Chas. Owens
On Wed, Apr 15, 2009 at 10:41, John W. Krahn wrote: > Chas. Owens wrote: >> >> On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote: >>> >>>  I am trying to execute the below line in the perl program and returns a >>> value 0. >>> >>> my $test2 = ""; >>> my $include =  "file"; >>> >>> $test2 = syste

Re: Syntax query

2009-04-15 Thread John W. Krahn
Chas. Owens wrote: On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote: I am trying to execute the below line in the perl program and returns a value 0. my $test2 = ""; my $include = "file"; $test2 = system("/usr/atria/bin/cleartool desc \$include | grep created | awk -F\" \" \'{print \$2}\'

Re: Syntax query

2009-04-15 Thread Chas. Owens
y people use Perl with ClearCase, so there should be some decent modules available that might make your life easier. 1. http://search.cpan.org 2. http://search.cpan.org/search?query=cleartool&mode=all -- Chas. Owens wonkden.net The most important skill a programmer can have is the abil

Re: Syntax query

2009-04-15 Thread Jayesh Thakrar
essage From: Owen To: Rajini Naidu Cc: beginners@perl.org Sent: Wednesday, April 15, 2009 8:39:42 AM Subject: Re: Syntax query > Hi, > > I am trying to execute the below line in the perl program and returns > a > value 0. > > my $test2 = ""; > my $inclu

Re: Syntax query

2009-04-15 Thread Chas. Owens
On Wed, Apr 15, 2009 at 09:39, Owen wrote: snip > You will probably need to specify the full path of grep and awk. > (usr/bin/grep etc) snip Whereas that is not a bad thing to do, it is not his/her current problem. The system function is returning 0 which means that it was successful. The probl

Re: Syntax query

2009-04-15 Thread Owen
> Hi, > > I am trying to execute the below line in the perl program and returns > a > value 0. > > my $test2 = ""; > my $include = "file"; > > $test2 = system("/usr/atria/bin/cleartool desc \$include | grep > created | > awk -F\" \" \'{print \$2}\' | cut -b 1-9 "); > > The value returned by $tes

Re: Syntax query

2009-04-15 Thread Chas. Owens
On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote: > Hi, > >  I am trying to execute the below line in the perl program and returns a > value 0. > > my $test2 = ""; > my $include =  "file"; > > $test2 = system("/usr/atria/bin/cleartool desc \$include | grep created | > awk -F\" \" \'{print \$2}\'

Syntax query

2009-04-15 Thread Rajini Naidu
Hi, I am trying to execute the below line in the perl program and returns a value 0. my $test2 = ""; my $include = "file"; $test2 = system("/usr/atria/bin/cleartool desc \$include | grep created | awk -F\" \" \'{print \$2}\' | cut -b 1-9 "); The value returned by $test2 is 0. I suspect grep a

Re: query in searching

2009-03-24 Thread Chas. Owens
On Tue, Mar 24, 2009 at 19:50, Rajini Naidu wrote: snip >> open my $IN,  '<', "$data_dir/$node.load" or die "Cannot open >> '$data_dir/$node.load' $!"; >> open my $OUT, '>', "/tmp/$day[0].$day[1].$day[2].$node.log" or die "Cannot >> open '/tmp/$day[0].$day[1].$day[2].$node.log' $!"; >> >> while (

Re: query in searching

2009-03-24 Thread Rajini Naidu
Thanks John for the reply. I included the code as you suggested, but does'nt seem to work. The output file is empty. -rajini On Wed, Mar 25, 2009 at 12:19 AM, John W. Krahn wrote: > Rajini Naidu wrote: > >> Hi, >> > > Hello, > > > I am trying to search for a pattern in a file in my pe

query in searching

2009-03-24 Thread Rajini Naidu
Hi, I am trying to search for a pattern in a file in my perl script. Syntax used is : system("grep \"$res\" ${data_dir}/${node}.load > /tmp/${day[0]}.${day[1]}.${day[2]}.${node}.log"); But the grep command is'nt successful in getting the desired string. Am I missing anything here ? Rajini

Re: query in searching

2009-03-24 Thread John W. Krahn
Rajini Naidu wrote: Hi, Hello, I am trying to search for a pattern in a file in my perl script. Syntax used is : system("grep \"$res\" ${data_dir}/${node}.load > /tmp/${day[0]}.${day[1]}.${day[2]}.${node}.log"); But the grep command is'nt successful in getting the desired string. Am I miss

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

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 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-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-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 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-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-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
> > #perl -c

RE: Query in Perl Programming

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

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)
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 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)
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-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-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 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)
;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
> > 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)
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-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-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-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 >>&

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

  1   2   3   4   5   >