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
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
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
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
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
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,
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,
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
35 matches
Mail list logo