[Bioperl-l] Added check

Kris Boulez kris.boulez@algonomics.com
Wed, 12 Jun 2002 09:14:11 +0200


Quoting Elia Stupka (elia@fugu-sg.org):
> With regards to that problem I was mentioning before to Chris, I have
> added a check so we don't try to int a string, but directly conver it to
> zero, eliminates all the warnings.
> 
> Let me expose my ignorance... I've used this simple regexp, but there must
> be a better way to check if a variable is numeric in perl?
> 
> [I have asked everybody in the group and checked the web, and everybody
> comes up with hacky perl regexps... but perl interprets context as numeric
> so there must be a way of evaluating the context on the fly?]
> 
The Perl Cookbook talks about this in recipe 2.1 and says that it's not
easy. They come up with a solution like yours.

Kris,