Thanks, Ronald.

I was hoping there was a way around that still satisfied 'strict refs'.

-Nilanjan


-----Original Message-----
From: Ronald J Kimball [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2008 10:40 AM
To: Palit, Nilanjan
Cc: Boston Perl Mongers
Subject: Re: [Boston.pm] Interpolated scalar as an lvalue?

On Thu, Oct 16, 2008 at 08:32:41AM -0600, Palit, Nilanjan wrote:

> Perl complains about the second line in the foreach loop during run time:
> Can't use string ("abc_type") as a SCALAR ref while "strict refs" in use at 
> test1.pl line 19.
>

The error message explains exactly what the problem is.  You can't use
strings as refs while "strict refs" is in use.  If you want to use strings
as refs, turn off "strict refs".

no strict 'refs';

(Of course, using a hash would be preferable.)

Ronald

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to