--- Barry Jones <[EMAIL PROTECTED]> wrote:
> If I have a hash full of values, and some of those values point to
> arrays of more values...in a loop, how could I distinguish which ones
> pointed to an array and which were just string values?

Barry,

Use the 'ref' function for this:

    perldoc -f ref

One caveat, though:  most uses of 'ref' seem wrong.  Generally speaking, whenever I am 
tempted to
use ref on vanilla code, I discover that I could simplify what I meant to do.  In your 
case, have
you considered making every value an array reference?  If you only have a scalar, you 
have a
one-element array ref.  Generally, when I rework the code to eliminate the need for 
'ref', I
discover that my code is shorter and easier to maintain.

I'm not saying that you've done anything wrong, of course.  I'm just suggesting that 
you might
want to give the code a second look.

Cheers,
Curtis "Ovid" Poe

=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to