SPUG: parsing a config file

Scott Blachowicz sab at rresearch.com
Tue Jan 11 15:25:26 CST 2000


On Tue, Jan 11, 2000 at 12:22:32PM -0800, El JoPe Magnifico wrote:
> >> $config = HASH(0x2ff098)
> >> 	'Domain' => HASH(0x282a0c)
> >> 		'servers' => 'beluga'
> >> 		'status' => 'Enabled'
> >> 		'toddw2' => '150.215141.11'
> [...]
> >> Would it better if I turn those parens into brackets?
> >> Or do you have some other trick up your sleeve?
> > 
> > Turning them into brackets would turn the contents into an anonymous
> > reference to a hash (curly braces) or an array (square brackets)...
> > and that's not what you want.
> 
> I'm assuming this is in reference to the 'servers' field above.
> An anonymous array reference (a la square brackets) _is_ what you want.
> That's how you nest an array/list inside another data structure in perl.
> Apologies if I'm misunderstanding your response, Scott.

No...you're right...I was just fixating on that "150.215141.11" number
and how that happened without noticing the general data structure
problem...so I misspoke...sorry for the confusion.

Scott.Blachowicz at seaslug.org

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list