neversaint has asked for the wisdom of the Perl Monks concerning the following question:
With the default input parameter, what's wrong with my script above such that it prints no underscore instead of with underscore.use strict; use Data::Dumper; use Carp; my $str = $ARGV[0] || '|78187980|ref|NM_0'; if ( $str =~ / /xms ) { print "no underscore\n"; } else { print "with underscore\n"; }
as with underscore.$str = "TIP UPSTREAM";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex for Differentiating Underscore and Whitespace
by jasonk (Parson) on Nov 03, 2007 at 02:52 UTC | |
|
Re: Regex for Differentiating Underscore and Whitespace
by grinder (Bishop) on Nov 03, 2007 at 11:42 UTC | |
|
Re: Regex for Differentiating Underscore and Whitespace
by moritz (Cardinal) on Nov 03, 2007 at 09:19 UTC | |
|
Re: Regex for Differentiating Underscore and Whitespace
by davido (Cardinal) on Nov 03, 2007 at 04:29 UTC | |
|
Re: Regex for Differentiating Underscore and Whitespace
by CountZero (Bishop) on Nov 03, 2007 at 09:53 UTC | |
|
Re: Regex for Differentiating Underscore and Whitespace
by mwah (Hermit) on Nov 03, 2007 at 18:03 UTC | |
by blazar (Canon) on Nov 04, 2007 at 11:15 UTC | |
by mwah (Hermit) on Nov 04, 2007 at 14:09 UTC |