Re: a condition

2012-08-26 Thread John W. Krahn
Wang, Li wrote: Dear All Hello, Thanks very much for your help! I tried the script with my real data and found out that the situation gets more complicate. The following is part of my data: scaffold_1_13528T/T C/T T/T C/T T/T C/T T/T T/T N/N T/T

Re: a condition

2012-08-26 Thread Brandon McCaig
On Sun, Aug 26, 2012 at 05:03:31PM +, Wang, Li wrote: > If in each line, without count of "N/N", all the other SNPs are > the same, delete this line. The "scaffold" indicates the > position of the SNP. > > My code is as follows: > #! /usr/bin/perl > use strict; > use warnings; > > my $usage=

RE: a condition

2012-08-26 Thread Wang, Li
Hi, Jim Thanks very much! It works now! All the best Li From: Jim Gibson [jimsgib...@gmail.com] Sent: Sunday, August 26, 2012 12:13 PM To: Perl Beginners Subject: Re: a condition On Aug 26, 2012, at 10:03 AM, Wang, Li wrote: > Dear All > > Th

Re: a condition

2012-08-26 Thread Jim Gibson
On Aug 26, 2012, at 10:03 AM, Wang, Li wrote: > Dear All > > Thanks very much for your help! > I tried the script with my real data and found out that the situation gets > more complicate. > The following is part of my data: > scaffold_1_13528 T/T C/T T/T C/T T/T C/T

RE: a condition

2012-08-26 Thread Wang, Li
". I struggled but failed at figuring out what is the problem. Could you please point out the problem? All the best Li ____ From: John W. Krahn [jwkr...@shaw.ca] Sent: Saturday, August 25, 2012 2:28 PM To: Perl Beginners Subject: Re: a condition Wang, Li

Re: a condition

2012-08-25 Thread John W. Krahn
Wang, Li wrote: Dear All Hello, I have an array of a series of strinngs. I want to set up a condition in which all the scalers in the array are not the same. For example AB AB AB AB AB (delete the array) AB AC AB AB AB (Keep the array) AB AC AD AB AB (keep) $ perl -le' for ( [ &quo

Re: a condition

2012-08-25 Thread Alan Haggai Alavi
Hello Li, The `notall` function of `List::MoreUtils` (https://metacpan.org/module/List::MoreUtils) can be made use of along with Perl's `grep` function: #!/usr/bin/env perl use strict; use warnings; use List::MoreUtils qw( notall ); my @array = ( 'AB AB AB AB AB', 'AB AC AB AB AB',

Re: a condition

2012-08-25 Thread Praveen Kumar
On Sat, Aug 25, 2012 at 8:29 PM, Wang, Li wrote: > Dear All > > I have an array of a series of strinngs. I want to set up a condition in > which all the scalers in the array are not the same. > > For example > > AB AB AB AB AB (delete the array) > AB AC AB AB AB (Keep

a condition

2012-08-25 Thread Wang, Li
Dear All I have an array of a series of strinngs. I want to set up a condition in which all the scalers in the array are not the same. For example AB AB AB AB AB (delete the array) AB AC AB AB AB (Keep the array) AB AC AD AB AB (keep) Sorry for the naive questions! Best wishes Li

Testing for a condition immediately after require

2008-06-06 Thread Travis Thornhill
I want to be able to tag a module with one or more tags that can be tested for after requiring it.   require 'module';   Any ideas on the best way to accomplish this?   Thanks in advance  

Re: breaking out of a loop? (when a condition changes)

2002-10-22 Thread K Pfeiffer
Michael Fowler writes: > On Tue, Oct 22, 2002 at 10:13:49PM +0200, K Pfeiffer wrote: > > My "if" loop > > "if" isn't a loop, it's a conditional. oops [...] > Why are you using redo here? "while" is a loop, it naturally, uh, loops. > You don't need to tell it to loop again. Just let it fall throu

Re: breaking out of a loop? (when a condition changes)

2002-10-22 Thread Michael Fowler
On Tue, Oct 22, 2002 at 10:13:49PM +0200, K Pfeiffer wrote: > My "if" loop "if" isn't a loop, it's a conditional. > didn't work with "last" so I changed "if" to "while", but it > seems that the "redo" doesn't cause the "while" to re-evaluate with the new > value of $destfile. This is the docu

breaking out of a loop? (when a condition changes)

2002-10-22 Thread K Pfeiffer
Hi Perl-Meisters, My "if" loop didn't work with "last" so I changed "if" to "while", but it seems that the "redo" doesn't cause the "while" to re-evaluate with the new value of $destfile. When I run this and type something other than "yes" I get the message "File foobar already exists..." (even