On Monday, June 24, 2002, at 06:12 , Bob Showalter wrote: David's original file format info: >> an example of the file user.perm would be : >> >> user: vdgeerd, tester >> group: none, >> descr: all,
> I think you need to parse this file into some structures rather > than using the simple regex approach. Even if you check only the > user: line, your logic would allow user names like 'user', or 'v', > or ',' or even ''. > > I would do something like this: [..] the always excellent use of a hashIndexing trick! my complements! what concerns me here are two issues: a) configuration file format b) 'over parsing' the first problem - if we have only those three lines then things are modestly simple - and it will be very hard to 'over parse' the file. if on the other hand we have say user: vdgeerd, tester group: none, descr: all, user: drieux, tester group: FrootKakes, descr: some, left ..... We have a case where 'user' tester is a member of two groups - hence the question of how were we actually 'relating' the three types of data to each other.... Note that our 'hash' module would allow us the simple out of defining this type of data structure as { none => { user => "vdgeerd, tester", descr => "all"}, FrootKakes => { user => "drieux, tester", descr => "some, left"}, } At which point we could almost just 'require foo.dope' the data in - or Config::General, or.... The over parsing problem of course shows up in this class of problem where it is 'true' that user 'vdgeerd' has some access as a member of 'group none' - if the group that is in $group is set to FrootKakes - should we still allow him in? Or conversely simply because we find the user 'drieux' in the lot - should we allow him access to anything but the some and left???? ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]