Re: Is there a shorter, more elegant way to write this deep hash lookup statement

Discussion in 'Perl Misc' started by George Mpouras, Feb 17, 2013.

  1. use strict;
    use warnings;

    my $ebay_record = {};
    my $is_freight = 1;

    $ebay_record->{ShippingDetails}->{ShippingServiceOptions}->{ShippingService22}
    = 1;


    if (( exists
    $ebay_record->{ShippingDetails}->{ShippingServiceOptions}->{ShippingService}
    ) && (
    $ebay_record->{ShippingDetails}->{ShippingServiceOptions}->{ShippingService}
    == $is_freight ))
    {
    print "ok\n";
    }
    George Mpouras, Feb 17, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kamilche
    Replies:
    7
    Views:
    279
    Peter Hansen
    Jun 29, 2004
  2. dblock
    Replies:
    2
    Views:
    642
    Simon Krahnke
    Oct 9, 2011
  3. Dr.Ruud
    Replies:
    1
    Views:
    158
    Ted Zlatanov
    Feb 21, 2013
  4. C.DeRykus
    Replies:
    0
    Views:
    130
    C.DeRykus
    Feb 19, 2013
  5. Ted Zlatanov
    Replies:
    0
    Views:
    135
    Ted Zlatanov
    Feb 21, 2013
Loading...

Share This Page