in reply to Cant coerce
you don't tell us the line number.
> New to perl ...
use diagnostics might help, and maybe a look into perldiag , there is only one possible error message that fits.
Cheers Rolf
(addicted to the Perl Programming Language)