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 number"857", I found the command below works:
perl -ne 'if (/(SASI\w+
On Thu, Dec 29, 2011 at 5:08 PM, Igor Dovgiy 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 Digest::MD
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 || '/Users/j
On Thu, Dec 29, 2011 at 1:17 PM, Xi Chen 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 get number"
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 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:
> BEGIN_CODE
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 idea
On 11-12-29 02:45 PM, Chris Stinemetz wrote:
On Thu, Dec 29, 2011 at 1:17 PM, Xi Chen 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)
wrote:
> Actually, the ending ? makes the match non-greedy, in detail:
> Given:
> SASI_Hs01_00205058 HUMAN NM_005762 857 MISSION® siRNA 2
> 140.00
> if
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, whic
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn 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
On Fri, Dec 30, 2011 at 12:33 AM, Jonathan Harris
wrote:
>
>
> On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn 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
Jonathan Harris wrote:
On Thu, Dec 29, 2011 at 6:39 PM, John W. Krahn 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 systems. It would
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 command
On Thu, Dec 29, 2011 at 9:26 PM, 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 is just g
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
18 matches
Mail list logo