in reply to Re: Re: What?? delete chars.
in thread What?? delete chars.
This refers to the declaration and initialization of %action in the action subroutine (why do you have so many things with the same name?). You declared a %action at file scope around line 15. You then declare another one midway through the action subroutine after already having referenced the first on the previous line. You are aware that my creates a new variable, correct? You don't have to use my every time you reference a variable for the first time within a block. You do the same thing with a bunch of other variables, as well.
Useless use of private variable in void context at test.pl line 40.This refers to the line $data, $location = @_;. If you wish to assign to a list, you must specify list syntax. That line should read ($data, $location) = @_;. Notice the parenthesis.
Bareword "LOC" not allowed while "strict subs" in use at test.pl line +95. Bareword "LOC" not allowed while "strict subs" in use at test.pl line +97. Bareword "LOC" not allowed while "strict subs" in use at test.pl line +99.
You seem to be confused with file handles. LOC in your open statement should not have quotes around it. I also get the feeling you are trying to pass a file handle to index(). That won't work. index() works on strings, not filehandles. If you want to process the contents of a file, you have to read it into memory first. You do that by putting the file handle in angle brackets and assigning the result to a scalar as in my $loctext = <LOC>;. You would then use $loctext in your calls to index.
That ought to clean up those syntax errors. Logic problems are another story.
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
|
|---|