Sunday, September 25, 2011

Fix issue with "@" on a Perl Script

There are times that you encounter problems executing PERL scripts which failed for example this one:

Possible unintended interpolation of @23mxxxx in string at
/usr/local/scripts/ line 212 (#1)
(W ambiguous) You said something like `@foo' in a double-quoted string
but there was no array @foo in scope at the time. If you wanted a
literal @foo, then write it as \@foo; otherwise find out what happened
to the array you apparently lost track of.

Name "main::23mxxxx" used only once: possible typo at
/usr/local/scripts/ line 212 (#2)
(W once) Typographical errors often show up as unique variable names.
If you had a good reason for having a unique name, then just mention it
again somehow to suppress the message. The our declaration is
provided for this purpose.

NOTE: This warning detects symbols that have been used only once so $c, @c,
%c, *c, &c, sub c{}, c(), and c (the filehandle or format) are considered
the same; if a program uses $c only once but also uses any of the others it
will not trigger this warning.


Escape the character before "@" with "\" this should fix it.

No comments:

Post a Comment