Hi All,

I am confused.

With this sub:

    sub odd( $Num ) { return $Num % 2; }


Why does this work:

     if odd $LineNum
              { $PartsStr ~= '<font color="#006600">'; }  # Green
        else  { $PartsStr ~= '<font color="#663366">'; }  # Purple

And this one throw an error:

     if $LineNum.odd
              { $PartsStr ~= '<font color="#006600">'; }  # Green
        else  { $PartsStr ~= '<font color="#663366">'; }  # PurpleNo

       No such method 'odd' for invocant of type 'Int'. Did
       you mean 'ord'?

What is my misunderstanding?


Many thanks,
-T

Reply via email to