On Sep 2, Andrew Metcalfe said:

>I'm a MS and Java developer, trying to debug some perl code.

If you're not a Perl programmer, you'll probably have some difficulties.

>    my $self = {
>        LOCATION => {
>            USERNAME => $options{user_field} || 'username',
>            BILLING => $options{bill_field} || 'accounts',
>            INACTIVE => $options{inactive_field} || 'inactive',
>        },
>
>All fields are strings.  I imagine "=>" is simply "equal or greater to", but
>I'm confused as to what this returns with strings...?

No, => is a "fat comma".  It's pretty much equivalent to , but with an
added feature that if it is preceded by a bareword (like LOCATION), the
bareword is automatically quoted.

>  if ($self->{PRESENT}->{$self->{LOCATION}{INACTIVE}} &&
>         $user_data->{$self->{LOCATION}{INACTIVE}}
>  ){
>
>Again, what is the significance of "->" in this comparator?  Again, all
>fields are strings.

The arrow operator is used between a reference and a subscript.  So
$self->{PRESENT} means that $self is a hash reference, and you want to
access the value of the key 'PRESENT' in the hash referred to by $self.

Please read 'perldoc perlop'.  Even better, read a Perl tutorial.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


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

Reply via email to