Re: s/// and \n question

2011-07-21 Thread Dr.Ruud
On 2011-07-22 03:06, Shawn H Corey wrote: According to perlre, under "Regular Expressions", $ Match the end of the line (or before newline at the end) That means it can match the end of the string or a newline at the end of the string. Hello Shawn, You are not reading exact enough. The $ ca

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread John W. Krahn
Rob Dixon wrote: After these changes, the loop looks like this while (){ chomp; my @line=split(/\t/); if ($line[3] == -1) { print OUT "$_\n"; } } You can make it much simpler than that: while ( ) { print OUT if /\t-1$/; } John -- Any intelligent fool can make

Re: s/// and \n question

2011-07-21 Thread Shawn H Corey
On 11-07-21 08:54 PM, Rob Dixon wrote: On 21/07/2011 22:11, Mike McClain wrote: Given the following snippet of code could someone explain to me why the linefeed gets included in $num? mike@/deb40a:~/perl> perl -e' $str = "asdfggfh 987321qwertyyy\n"; ($num = $str) =~ s/^.*?(\d+).*$/$1/; print $n

Re: s/// and \n question

2011-07-21 Thread Rob Dixon
On 21/07/2011 22:11, Mike McClain wrote: Given the following snippet of code could someone explain to me why the linefeed gets included in $num? mike@/deb40a:~/perl> perl -e' $str = "asdfggfh 987321qwertyyy\n"; ($num = $str) =~ s/^.*?(\d+).*$/$1/; print $num; ' | hd 39 38 37 33 32 31

Re: What's new on http://perl-begin.org/

2011-07-21 Thread Jennifer Maldonado
2011/7/21 Shlomi Fish > http://perl-begin.org/ is a site for Perl Beginners, that aims to collect > the > Internet's best resources for learning Perl. Here are the major changes to > it > since the last update: > > 1. The book [Modern Perl](http://perl-begin.org//books/#modern-perl) is > now > re

Re: Checking a config file for malformed entries - Oracle TNSNAMES.ORA file - having problems, please help

2011-07-21 Thread Jim Gibson
On 7/21/11 Thu Jul 21, 2011 4:27 PM, "newbie01 perl" scribbled: > Hi all, > > In Oracle, there is a file named tnsnames.ora that contains connection > strings to Oracle Databases. > > At the moment the file is 1+ lines long. We are currently having a > problem where the file is malformed,

Re: Checking a config file for malformed entries - Oracle TNSNAMES.ORA file - having problems, please help

2011-07-21 Thread Jim Gibson
On 7/21/11 Thu Jul 21, 2011 4:27 PM, "newbie01 perl" scribbled: > Hi all, > > In Oracle, there is a file named tnsnames.ora that contains connection > strings to Oracle Databases. > > At the moment the file is 1+ lines long. We are currently having a > problem where the file is malformed,

Checking a config file for malformed entries - Oracle TNSNAMES.ORA file - having problems, please help

2011-07-21 Thread newbie01 perl
Hi all, In Oracle, there is a file named tnsnames.ora that contains connection strings to Oracle Databases. At the moment the file is 1+ lines long. We are currently having a problem where the file is malformed, i.e. missing matching brackets. Can any of the experts please advise how best to

Re: What's new on http://perl-begin.org/

2011-07-21 Thread Shlomi Fish
Hi Natal, Replying in public (though you may opt to reply in private). On Fri, 22 Jul 2011 00:12:21 +0200 Natal Ngétal wrote: > 2011/7/21 Shlomi Fish : > > 11. We're now maintaining the sources of the Perl Beginners' Site in [a > > bitbucket.org repository](http://perl-begin.org/source/#vcs) an

Re: What's new on http://perl-begin.org/

2011-07-21 Thread Natal Ngétal
2011/7/21 Shlomi Fish : > http://perl-begin.org/ is a site for Perl Beginners, that aims to collect the > Internet's best resources for learning Perl. Here are the major changes to it > since the last update: It's very cool. > 1. The book [Modern Perl](http://perl-begin.org//books/#modern-perl) is

What's new on http://perl-begin.org/

2011-07-21 Thread Shlomi Fish
http://perl-begin.org/ is a site for Perl Beginners, that aims to collect the Internet's best resources for learning Perl. Here are the major changes to it since the last update: 1. The book [Modern Perl](http://perl-begin.org//books/#modern-perl) is now recommended, and [a local copy](http://perl

Re: s/// and \n question

2011-07-21 Thread Jim Gibson
On 7/21/11 Thu Jul 21, 2011 2:11 PM, "Mike McClain" scribbled: > Given the following snippet of code could someone explain to me > why the linefeed gets included in $num? > > mike@/deb40a:~/perl> perl -e' > $str = "asdfggfh 987321qwertyyy\n"; > ($num = $str) =~ s/^.*?(\d+).*$/$1/; > print $num

Re: s/// and \n question

2011-07-21 Thread Shawn H Corey
On 11-07-21 05:11 PM, Mike McClain wrote: Given the following snippet of code could someone explain to me why the linefeed gets included in $num? mike@/deb40a:~/perl> perl -e' $str = "asdfggfh 987321qwertyyy\n"; ($num = $str) =~ s/^.*?(\d+).*$/$1/; print $num; ' | hd 39 38 37 33 32 31

s/// and \n question

2011-07-21 Thread Mike McClain
Given the following snippet of code could someone explain to me why the linefeed gets included in $num? mike@/deb40a:~/perl> perl -e' $str = "asdfggfh 987321qwertyyy\n"; ($num = $str) =~ s/^.*?(\d+).*$/$1/; print $num; ' | hd 39 38 37 33 32 31 0a |987321.| 00

Re: Subdirectories and use lib

2011-07-21 Thread Shlomi Fish
Hi Marc, On Thu, 21 Jul 2011 08:40:44 -0700 Marc wrote: > On Jul 21, 2011, at 5:56 AM, Shlomi Fish wrote: > > > You can load modules from lib using "use Module::SubModule;" or "use > > Params::Validate" - no need to load all subdirectories. Just use "::" for > > loading stuff in sub-directorie

Re: first post

2011-07-21 Thread Shawn H Corey
On 11-07-21 11:41 AM, Rob Dixon wrote: I am pretty sure that the original code is a perversion of split /\t|\n/; which is a lazy way of losing a trailing newline without chomping first. It also seems excessive. This is the same thing: split /[\t\n]/; -- Just my 0.0002 million dolla

Re: Subdirectories and use lib

2011-07-21 Thread Marc
On Jul 21, 2011, at 5:56 AM, Shlomi Fish wrote: > You can load modules from lib using "use Module::SubModule;" or "use > Params::Validate" - no need to load all subdirectories. Just use "::" for > loading stuff in sub-directories. Thanks, Shlomi. That's all it took to get it to sink i

Re: first post

2011-07-21 Thread Rob Dixon
On 21/07/2011 14:03, Shlomi Fish wrote: However, there is one problem where will return a single line, and so there will only be one "\n" at most, so I don't understand what he wants to split exactly. Does he want to remove \t\n from the end of the line? I posted much earlier to comment on th

Re: first post

2011-07-21 Thread Shawn H Corey
On 11-07-21 09:03 AM, Shlomi Fish wrote: However, there is one problem where will return a single line, and so there will only be one "\n" at most, so I don't understand what he wants to split exactly. Does he want to remove \t\n from the end of the line? His file is probably a tab-delimited t

Re: first post

2011-07-21 Thread Shawn H Corey
On 11-07-21 09:05 AM, Shlomi Fish wrote: Do you really mean "\t \n"? If you do, it's better to write this as: "\t\x20\n" The extra effort of writing all those characters tells anyone who reads it that you really, truly do mean it. :) -- Just my 0.0002 million dollars worth, Shawn

Re: first post

2011-07-21 Thread Shlomi Fish
Hi, On Wed, 20 Jul 2011 22:30:42 -0700 "John W. Krahn" wrote: > H Kern wrote: > > Hi, > > Hello, > > > My first newbie post. I wish to have two arrays indexed by a hash > > table. The simple program below runs and behaves properly initializing > > the hash table with the information I wish it

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Shlomi Fish
Hi Nathalie, On Thu, 21 Jul 2011 12:00:57 +0100 Nathalie Conte wrote: > HI, > I want to create a simple script where I am parsing a file and writing > only the lines where I can find a certain value in a new output file > this is my Infile format: workable example attached > I want to keep only

Re: Command 'dir' not found in C:\MinGW\bin, C:\Python27,..... when use IPC::Run

2011-07-21 Thread Shlomi Fish
Hi hsin, On Thu, 21 Jul 2011 03:50:36 -0700 (PDT) hsin wrote: > I came across this error when I run follow code on windows. > and if changed the command `dir` to `ipconfig`, it's ok. > I guess it because dir is a cmd internal command but ipconfig isn't. I think that's the case. You shouldn't de

Re: first post

2011-07-21 Thread Shlomi Fish
Hi sencond, On Thu, 21 Jul 2011 03:03:13 -0700 (PDT) sencond gun wrote: > On Jul 21, 10:28 am, g...@pbwe.com ("H Kern") wrote: > > Hi, My first newbie post. I wish to have two arrays indexed by a hash   > > table. The simple program below runs and behaves properly initializing the   > > hash tab

Re: Subdirectories and use lib

2011-07-21 Thread Shlomi Fish
Hi Marc, On Wed, 20 Jul 2011 15:38:06 -0700 Marc wrote: > I'd like to organize a project's files into subdirectories for better > housekeeping. I thought that use lib "."; would also include any > subdirectories, but sadly it doesn't. Is there a way to include all subdirs > without havin

RE: url checker load average opensource s/w

2011-07-21 Thread Bob McConnell
From: Agnello George > i have a few web portals as my job profile to take care of and i > have a request from my testing team for a s/w where i can 1) check > all links within the website and the time taken for each link to load > , 2) and if 500 to 1000 concurrent connections are spawned the a

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Rob Dixon
On 21/07/2011 12:00, Nathalie Conte wrote: HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I want to keep only the lines where there is a 1 not the o

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Brian Fraser
On Thu, Jul 21, 2011 at 8:17 AM, Nathalie Conte wrote: > I forgot to say that the extra lines are empty... but I don't understand > why they are there :) > > That's rather simpler, since there's nothing in the program that could cause double output (unless you ran it twice :P). The issue is that

Re: parsing script duplication of lines issue, please advise

2011-07-21 Thread Nathalie Conte
I forgot to say that the extra lines are empty... but I don't understand why they are there :) HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I wa

parsing script duplication of lines issue, please advise

2011-07-21 Thread Nathalie Conte
HI, I want to create a simple script where I am parsing a file and writing only the lines where I can find a certain value in a new output file this is my Infile format: workable example attached I want to keep only the lines where there is a 1 not the ones with -1, there are 10 in this example

Re: url checker load average opensource s/w

2011-07-21 Thread hsin
On Jul 21, 3:04 pm, agnello.dso...@gmail.com (Agnello George) wrote: > hi > > i have a few web portals  as my job profile to take care of  and i > have a request from my testing team for a s/w where i can 1) check > all links within the website  and the time taken for each link to load > , 2) and i

Command 'dir' not found in C:\MinGW\bin, C:\Python27,..... when use IPC::Run

2011-07-21 Thread hsin
I came across this error when I run follow code on windows. and if changed the command `dir` to `ipconfig`, it's ok. I guess it because dir is a cmd internal command but ipconfig isn't. Can anybody explain it for me. Thanks code: use strict; use IPC::Run qw(run timeout); my @cmd = qw(dir); my

Re: first post

2011-07-21 Thread sencond gun
On Jul 21, 10:28 am, g...@pbwe.com ("H Kern") wrote: > Hi, My first newbie post. I wish to have two arrays indexed by a hash   > table. The simple program below runs and behaves properly initializing the   > hash table with the information I wish it to have. > > However, Perl generates the followin

Re: Arrow Notation vs. Colon Notation

2011-07-21 Thread C.DeRykus
On Jul 20, 6:09 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: > On 11-07-20 07:03 PM, Uri Guttman wrote: > > > the other is a class method call. it has two major differences. first it > > will pass its class (or object, the arg before ->) as the first arg in > > the call. the second thing is tha

url checker load average opensource s/w

2011-07-21 Thread Agnello George
hi i have a few web portals as my job profile to take care of and i have a request from my testing team for a s/w where i can 1) check all links within the website and the time taken for each link to load , 2) and if 500 to 1000 concurrent connections are spawned the average time for each link