Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!rbj From: rbj@uunet.UU.NET (Root Boy Jim) Newsgroups: comp.lang.perl Subject: Re: Chapter 6 passwd program problem Message-ID: <121482@uunet.UU.NET> Date: 6 Feb 91 01:55:03 GMT References: <1991Feb5.210926.7914@NPIRS.Purdue.EDU> Organization: UUNET Communications Services, Falls Church, VA Lines: 36 In article <1991Feb5.210926.7914@NPIRS.Purdue.EDU> ramsey@NPIRS.Purdue.EDU (Ed Ramsey) writes: >I liked the "Programming Perl" approach to setting user passwords and >downloaded the book sources last night. The source for the >chapter 6 password program complains at two points in the code. That's cuz it's broke. >syntax error in file ./passwd at line 250, next token "open" Missing ';' on the previous line. >/^(jan|feb|mar(ch)?|apr(il)?|may|june?/: unmatched () > in regexp at ./passwd line 647. Looks like the line was split. It should read: /^(jan|...|june?)$/ And the RE on the next line should read: /^(july?|...|dec)$/ I am still skeptical of the assignment to $mo. I believe it should be @mo, and the following tests should be performed on $mo[0]. Either that, or $mo = ($pat =~ /...(...).../)[0] will work. I would have done the match outside the if and used $1 instead of $mo. Job's .signature: &rebuke("\b","\b\bjust another perl hacker"); -- Root Boy Jim Cottrell I got a head full of ideas They're driving me insane