Hi,
I'm doing one of the Project Euler exercises which asks the sum of 100
fifty-digit numbers[1]. My code is 2 parts:
I open the text file containing the digits and put into an array:
BEGIN_CODE=
open (F, Fifty_hundred.txt) || die Could not open
Hello everyone,
I have a question about how to translate the meaning of .+?. Please
see the examples below:
SASI_Hs01_00205058 HUMAN NM_005762 857 MISSION® siRNA 2
140.00
I want to get number857, I found the command below works:
perl -ne 'if
On Thu, Dec 29, 2011 at 5:08 PM, Igor Dovgiy ivd.pri...@gmail.com wrote:
Hi Jonathan,
Let's review your script a bit, shall we? )
It's definitely good for a starter, but still has some rough places.
#!/usr/bin/perl
# md5-test.plx
use warnings;
use strict;
use File::Find;
use
Hi Jonathan,
Let's review your script a bit, shall we? )
It's definitely good for a starter, but still has some rough places.
#!/usr/bin/perl
# md5-test.plx
use warnings;
use strict;
use File::Find;
use Digest::MD5;
use File::Spec;
So far, so good. )
my $dir = shift ||
On Thu, Dec 29, 2011 at 1:17 PM, Xi Chen cxde...@gmail.com wrote:
Hello everyone,
I have a question about how to translate the meaning of .+?. Please
see the examples below:
SASI_Hs01_00205058 HUMAN NM_005762 857 MISSION® siRNA 2
140.00
I want to
Hi All
Firstly, many thanks for your help previously (19/12/11) - it has led to
making a useable script
I don't think it's brilliantly written, it seems a little bodged together
to me... but works fine - not a bad result for a first script
If you are new to this problem and are interested in
Hi Jeswin,
On Thu, 29 Dec 2011 11:40:09 -0500
Jeswin phillyj...@gmail.com wrote:
Hi,
I'm doing one of the Project Euler exercises which asks the sum of 100
fifty-digit numbers[1]. My code is 2 parts:
I open the text file containing the digits and put into an array:
Jonathan Harris wrote:
Hi Igor
Many thanks for your response
I have started reviewing the things you said
There are some silly mistakes in there - eg not using closedir
It's a good lesson in script vigilance
I found the part about opening the file handle particularly interesting
I had no
On 11-12-29 02:45 PM, Chris Stinemetz wrote:
On Thu, Dec 29, 2011 at 1:17 PM, Xi Chencxde...@gmail.com wrote:
Hello everyone,
I have a question about how to translate the meaning of .+?. Please
see the examples below:
SASI_Hs01_00205058 HUMAN NM_005762 857 MISSION® siRNA 2
Thank you so much! This answer is very clear!!
On Thu, Dec 29, 2011 at 2:03 PM, Kronheim, David (Contr)
david.kronh...@ftr.com wrote:
Actually, the ending ? makes the match non-greedy, in detail:
Given:
SASI_Hs01_00205058 HUMAN NM_005762 857 MISSION® siRNA 2
Actually, the ending ? makes the match non-greedy, in detail:
Given:
SASI_Hs01_00205058 HUMAN NM_005762 857 MISSION® siRNA 2
140.00
if (/(SASI\w+)(.+?)\s(\d+)\s/) { print $3\n; }
Match starts looking for the literal SASI followed by one or more \w's, which
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn jwkr...@shaw.ca wrote:
Jonathan Harris wrote:
Hi Igor
Many thanks for your response
I have started reviewing the things you said
There are some silly mistakes in there - eg not using closedir
It's a good lesson in script vigilance
I found
On Fri, Dec 30, 2011 at 12:33 AM, Jonathan Harris
jtnhar...@googlemail.comwrote:
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn jwkr...@shaw.ca wrote:
Jonathan Harris wrote:
Hi Igor
Many thanks for your response
I have started reviewing the things you said
There are some silly
Jonathan Harris wrote:
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahnjwkr...@shaw.ca wrote:
Igor made a lot of good points. Here are my two cents worth. You are
using the File::Find module to traverse the file system and add new files
along the way. This _may_ cause problems on some file
Jonathan Harris wrote:
FInally, I was advised by a C programmer to declare all variables at the
start of a program to avoid memory issues
Is this not necessary in Perl?
It is not really necessary in C either.
John
--
Any intelligent fool can make things bigger and
more complex... It takes
Hello everyone,
I saw a code below to get two same letters p in @a.
@a = qw (D D p O H p A O);
foreach $b (@a){
$n =~ /$b/i;
if($n = 2){
$m = $b;
}
}
But I don't know what does = mean. Thank you!
Xi
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands,
On Thu, Dec 29, 2011 at 9:26 PM, Xi Chen cxde...@gmail.com wrote:
Hello everyone,
I saw a code below to get two same letters p in @a.
@a = qw (D D p O H p A O);
foreach $b (@a){
$n =~ /$b/i;
if($n = 2){
$m = $b;
}
}
But I don't know what does = mean. Thank you!
It is just
Xi Chen wrote:
Hello everyone,
I saw a code below to get two same letters p in @a.
@a = qw (D D p O H p A O);
foreach $b (@a){
$n =~ /$b/i;
if($n= 2){
$m = $b;
}
}
But I don't know what does = mean. Thank you!
It means greater than or equal to. The expression $n = 2 is true
if
18 matches
Mail list logo