in reply to Parsing issue

Do you know for sure about the form of each line? For instance, does each line ALWAYS have "allow", "deny", and "password"? If so, maybe doing something like this would help:

my($allow, $deny, $password) = split /allow:|deny:|password:/, $line;

Otherwise, I'm not sure how you'd go about this other than doing a more manual parser, where you look at each word and try and figure out which section it belongs to.

Update: Screw what I said! jj808's solution looks mighty tasty. ~CubicSpline
"No one tosses a Dwarf!"

Replies are listed 'Best First'.
Re: Re: Parsing issue
by hotshot (Prior) on Oct 08, 2002 at 12:55 UTC
    sorry, but there's no constant format the allow,demny,password are not the only paramters and no parameter is mandatory, so that's make it harder for parsing

    Hotshot