in reply to printing the subscript separator

Let's put it in English:

$operator !~ /[^\s+]/

$operator does not match "a character that is not a space nor the plus sign"

I think what you want is:

$operator does not match "a space"

Which would be:

$operator !~ /\s/

Do remember that you're not testing if $operator has only that; you're testing for the existence of one single character in the string (maybe /^\s$/ or /^\s+$/ is what you really want?)

Replies are listed 'Best First'.
Re^2: printing the subscript separator
by jacques (Priest) on Feb 09, 2005 at 19:12 UTC
    Let's put it in English

    I want to say: $operator is something more than *just* a space or spaces. So saying as you suggest: "$operator does not match a space". Wouldn't do that.

    You are right about the plus sign and I have removed it. Thanks. So now I have:

    $operator !~ /[^\s]/
    But I am still seeing the same problem with $;
      $operator !~ /^\s*$/

      I used a plus, but I should have used an asterisk :-)

      How about now? Does it work? :-)