"... the error "Can't use global $1 in "my"" ..."
Somewhere in your code, you have "... my $1 ...". Here's a couple of examples:
$ perl -e 'my $1;' Can't use global $1 in "my" at -e line 1, near "my $1" Execution of -e aborted due to compilation errors. $ perl -e 'my $1 = 42;' Can't use global $1 in "my" at -e line 1, near "my $1 " Execution of -e aborted due to compilation errors.
You can find the full description of the problem from "perldiag - Perl diagnostic messages". Until you're familiar with that document, it can be a bit difficult finding the information. In this instance, you'd need to search for "Can't use global" (not "Can't use global $1"). Doing so, locates this:
Can't use global %s in "%s"
(F) You tried to declare a magical variable as a lexical variable. This is not allowed, because the magic can be tied to only one location (namely the global variable) and it would be incredibly confusing to have variables in your program that looked like magical variables but weren't.
While you're learning, you may find it useful to use the diagnostics pragma. Put this line near the start of your code:
use diagnostics;
That will give you a full description, rather than the somewhat terse shortened form.
Important: That pragma is intended as a developer tool. Do not leave it production code.
— Ken
In reply to Re^3: HTML::Parser / Regex
by kcott
in thread HTML::Parser / Regex
by MissPerl
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |