Firstly, I have just installed 5.001m and have NO previous experience
of perl, but as the script I have a problem with is taken from
Programming Perl (so I'm told - I can't get hold of a copy
immediately), I imagine that this is a Perl 5 issue. I Have had a hunt
in the documentation, but there's rather a lot of it and I've been
told to get this working asap. Enough of my whingeing - the script is
the password checking one from the above book, and line 250:
open(PASSWD,"passwd") || die "Can't open passwd file.\n";
is rejected with
syntax error at perlpass line 250, near "open"
I have played around, but without success.
Whilst I'm here, I also had a problem with unmatched parentheses
reported for line 647:
if ($mo = ($pass =~ /^[ \d]*([a-zA-Z]{3,5})[ \d]*$/) &&
($mo =~ /^(jan|feb|mar(ch)?|apr(il)?|may|june?/i ||
$mo =~|july?|aug|sept?|oct|nov|dec)$/i) ) {
print "Please don't use dates.\n";
647 is the second of the above lines. I got round this by making the
test for months into one long line - after checking (by eyeball and
vi) that the parens were in fact matched.
Any suggestions on either of these problems would be appreciated.
TIA, Sam
of perl, but as the script I have a problem with is taken from
Programming Perl (so I'm told - I can't get hold of a copy
immediately), I imagine that this is a Perl 5 issue. I Have had a hunt
in the documentation, but there's rather a lot of it and I've been
told to get this working asap. Enough of my whingeing - the script is
the password checking one from the above book, and line 250:
open(PASSWD,"passwd") || die "Can't open passwd file.\n";
is rejected with
syntax error at perlpass line 250, near "open"
I have played around, but without success.
Whilst I'm here, I also had a problem with unmatched parentheses
reported for line 647:
if ($mo = ($pass =~ /^[ \d]*([a-zA-Z]{3,5})[ \d]*$/) &&
($mo =~ /^(jan|feb|mar(ch)?|apr(il)?|may|june?/i ||
$mo =~|july?|aug|sept?|oct|nov|dec)$/i) ) {
print "Please don't use dates.\n";
647 is the second of the above lines. I got round this by making the
test for months into one long line - after checking (by eyeball and
vi) that the parens were in fact matched.
Any suggestions on either of these problems would be appreciated.
TIA, Sam