in reply to shellscript to Perl
Perhaps I'm misinterpreting your post, but is "Y" a variable or a character?
The compiler is complaining because it doesn't know how to handle 'Y' -- you need to either use it as a variable, i.e., $Y or surround it by quotes, i.e., 'Y'.
As a side note, it is generally slightly faster to use single quotes rather than interpolating a variable or special character, e.g,
'Hello world.' vs. "Hello world",
'The number is '.$num vs "The number is $num", or
'Hello world.'."\n" vs "Hello world\n".
|
|---|