in reply to Re: Check input sub - comments please...
in thread Check input sub - comments please...

Could you explain your pet peeve further?   I'm not sure what you are thinking about.
  $s = "8b\n";
  printf "  %smatch\n", ($s=~/^\d*$/) ? '' : 'no ';
    no match
  printf "  %smatch\n", ($s=~/^\d*/)  ? '' : 'no ';
    match
Without the '$' the checking is, um, untrustworthy.
  • Comment on Re: Re: Check input sub - comments please...

Replies are listed 'Best First'.
Re: Re: Re: Check input sub - comments please...
by ysth (Canon) on Dec 14, 2003 at 18:17 UTC
    Use \z to match the end of the string.