[ABE.pm] Reference fun
Faber J. Fedor
faber at linuxnj.com
Sat Nov 10 11:12:53 PST 2007
On 09/11/07 21:06 -0500, Ricardo SIGNES wrote:
> * "Faber J. Fedor" <faber at linuxnj.com> [2007-11-09T20:35:46]
> You have a HUGE difference here:
>
> > tie %fndVars, 'Config::IniFiles', ( -file => $inFile);
>
> Once you're using a tied variable, all bets are off.
Ohhh-kaaay. Why? Isn't a hash a hash, even if it's tied?
> I would be happy to take a commission to make it work, though. :-)
:-)
> > If I replace '$yaml->[0] = $ref;' with '$yaml->[0] = %fndVars;' I get
> > this:
> >
> > --- 0
>
> You can't put a hash directly into an array element, only a reference to it.
Yeah, well the reference didn't work, so I tried the has h itself.
> Otherwise, you're using the hash in scalar context. Normally, that gives you a
> fairly useles string describing hash bucket usage, like "3/8."
I did see a fraction in one iteration of what I was doing.
> With a tied
> hash, all bets are off. Usually you get false.
>
> For .ini files, I use Config::INI (and ::Reader and ::Writer).
After thinking through my project (how to edit an ini file via a
webform), I won't be needing the YAML stuff anyway. And I think I'll
stay away from tie-d vairables (except for Tie::File) from now on.
--
Regards,
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701
http://www.linuxnj.com
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the ABE-pm
mailing list