Perl doesn't support expressions like
if (9 < $X < 100)
Instead, you'll need to phrase it like
if (9 < $X && $X < 100)
Or, to be clearer on your intent
if ( $X >=10 && $X <=99 )
though this may be a matter of style.
Added note on the style thing.. becareful with &&, it has a low high* enough precedence that it gets interpreted early.
From perlop...
As more readable alternatives to `&&' and `||' when used for control
flow, Perl provides `and' and `or' operators (see below). The short-
circuit behavior is identical. The precedence of "and" and "or" is
much lower, however, so that you can safely use them after a list oper-
ator without the need for parentheses: