in reply to required explicit package error.
In your case, just use lexicals. Add this, before you start executing any code:
I've got to sort of question your program flow, though; you're looking for lines that begin with $name, right? But $name isn't defined--it has no value. So what are you trying to look for, then? Or are you trying to look for the string literal '$name', not the value of the variable name? If so, you should backslash the '$':my($currentLine, $name, $infilename);
Also, the first line of your script is a bit odd:if ($currentLine =~ /^ \$name:/) {
Is this what you're really using? I don't think this will work. You should have:!/usr/local/bin/perl
and while you're at it, you should turn warnings on:#!/usr/local/bin/perl
#!/usr/local/bin/perl -w
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: required explicit package error.
by Paav (Novice) on Jun 14, 2000 at 23:58 UTC | |
by verbal (Initiate) on Jun 15, 2000 at 08:08 UTC | |
by Anonymous Monk on Jun 15, 2000 at 21:16 UTC | |
by Paav (Novice) on Jun 15, 2000 at 21:20 UTC | |
by nuance (Hermit) on Jun 15, 2000 at 23:43 UTC | |
by Paav (Novice) on Jun 15, 2000 at 21:29 UTC | |
by btrott (Parson) on Jun 15, 2000 at 00:56 UTC |