Hi,

I was getting this error message for one of my script.

The reason came out out to be, I had not place a semi-colon at the end of
try-catch block.

try {
   something
} catch some_exception {
  do something
}

After I placed the semi-colon, I am no longer getting this error (Can't use
string ("1") as a HASH ref while "strict refs")

try {
   something
} catch some_exception {
  do something
};

My questions is I have quite a few scripts that are using the SAME try-catch
block without a semi-colon but those are working seamlessly. They why was I
getting the error for only this try-catch block.

Is there some rule which we need to follow while using try-catch in Perl?

Thanks,
Parag

Reply via email to