Re: parsing script misbehaving...

2011-10-21 Thread Rob Dixon
On 21/10/2011 19:16, Brandon McCaig wrote: Thanks for the explanation, Rob. :) use strict; use warnings; use v5.010; my $data = 'aaa bbb ccc'; say $data; for my $pattern (qw(bbb aaa ccc)) { say join ' ', pos($data) // 'undef', $pattern, scalar $data =~ /$pattern/g; } __EN

Re: parsing script misbehaving...

2011-10-21 Thread Brandon McCaig
On Fri, Oct 21, 2011 at 1:52 PM, Rob Dixon wrote: > It is nothing to do with matched patterns overlapping. As I tried to > describe, it is the designed behaviour of m//g in scalar context to find > just one match, searching from the end of the previous match if it was > successful, or restarting f

Re: parsing script misbehaving...

2011-10-21 Thread Rob Dixon
On 21/10/2011 16:32, Jim Gibson wrote: > > I ran the provided program and was going to say that the /g modifier is > unnecessary. I took it out and noticed that the results differed. I > believe the difference is that some of the matched patterns overlap, and > whether or not you want to count

Re: parsing script misbehaving...

2011-10-21 Thread Jim Gibson
At 11:55 AM +0100 10/21/11, Rob Dixon wrote: On 21/10/2011 11:31, Nathalie Conte wrote: HI Rob, Hello Nat Please keep your replies to the Perl beginners list, so that other people can both help and learn from the discussion. (It would also help if you could bottom-post your replies (put the

Re: parsing script misbehaving...

2011-10-21 Thread John W. Krahn
Rob Dixon wrote: On 21/10/2011 00:32, nac wrote: I have corrected myself a bit, I think the script is now giving me what I want, having said that, I guess it is not the best way ( even if there is more than one way), again any pointer are welcome. many thanks Nat #!/usr/bin/perl use strict;

Re: parsing script misbehaving...

2011-10-21 Thread Nathalie Conte
Rob Dixon wrote: On 21/10/2011 11:31, Nathalie Conte wrote: HI Rob, Hello Nat Please keep your replies to the Perl beginners list, so that other people can both help and learn from the discussion. (It would also help if you could bottom-post your replies (put the response after the text you

Re: parsing script misbehaving...

2011-10-21 Thread Rob Dixon
On 21/10/2011 11:31, Nathalie Conte wrote: HI Rob, Hello Nat Please keep your replies to the Perl beginners list, so that other people can both help and learn from the discussion. (It would also help if you could bottom-post your replies (put the response after the text you are quoting). It i

Re: parsing script misbehaving...

2011-10-21 Thread Rob Dixon
On 21/10/2011 00:32, nac wrote: > HI again, > I have corrected myself a bit, I think the script is now giving me what I > want, having said that, I guess it is not the best way ( even if there is > more than one way), again any pointer are welcome. > many thanks > Nat Hi Nat > #!/usr/bin/perl > u

Re: parsing script misbehaving...

2011-10-21 Thread Rob Dixon
On 21/10/2011 02:50, John W. Krahn wrote: nac wrote: HI again, Hello, I have corrected myself a bit, I think the script is now giving me what I want, having said that, I guess it is not the best way ( even if there is more than one way), again any pointer are welcome. many thanks Nat #!/usr/

Re: parsing script misbehaving...

2011-10-20 Thread John W. Krahn
nac wrote: HI again, Hello, I have corrected myself a bit, I think the script is now giving me what I want, having said that, I guess it is not the best way ( even if there is more than one way), again any pointer are welcome. many thanks Nat #!/usr/bin/perl use strict; use warnings; my @seq;

Re: parsing script misbehaving...

2011-10-20 Thread Rob Dixon
On 21/10/2011 00:32, nac wrote: > HI again, > I have corrected myself a bit, I think the script is now giving me what I > want, having said that, I guess it is not the best way ( even if there is > more than one way), again any pointer are welcome. > many thanks > Nat > #!/usr/bin/perl > use strict

Re: parsing script misbehaving...

2011-10-20 Thread John W. Krahn
nac wrote: HI, Hello, I need your wisdom on this parsing script. I have a fastq file,this contains info for reads ( from nextGen), 1 line starts with a @, second contain the sequence info from which I want to count pattern, third line with a sign, fourth with info about the sequence quality (

Re: parsing script misbehaving...

2011-10-20 Thread nac
HI again, I have corrected myself a bit, I think the script is now giving me what I want, having said that, I guess it is not the best way ( even if there is more than one way), again any pointer are welcome. many thanks Nat #!/usr/bin/perl use strict; use warnings; my @seq; @seq=qw{^TGGCAGTGGAGG

parsing script misbehaving...

2011-10-20 Thread nac
HI, I need your wisdom on this parsing script. I have a fastq file,this contains info for reads ( from nextGen), 1 line starts with a @, second contain the sequence info from which I want to count pattern, third line with a sign, fourth with info about the sequence quality ( see attached working e