in reply to shellscript to Perl

Enclose the Y into quotes 'Y', to transform a bareword into a string-literal.

Cheers Rolf

PS: please enclose your code in <code>...</code> tags.