Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Linking and Combining Two Arrays

by merlyn (Sage)
on Feb 01, 2010 at 18:39 UTC ( [id://820813]=note: print w/replies, xml ) Need Help??


in reply to Linking and Combining Two Arrays

When you have a lot of similar names like this:
$D_agc =~ s/\s*$//; $D_market =~ s/\s*$//; $D_analysis_code =~ s/\s*$//; $D_item =~ s/\s*$//; $D_customer =~ s/\s*$//; $D_key_val2 =~ s/\s*$//; $D_key_val3 =~ s/\s*$//; $D_terms_code =~ s/\s*$//; $D_audit_seq =~ s/\s*$//; $D_aud_date =~ s/\s*$//; $D_aud_time =~ s/\s*$//; $D_opr_id =~ s/\s*$//; $D_action =~ s/\s*$//; $D_column_name =~ s/\s*$//; $D_new_value =~ s/\s*$//; $D_old_value =~ s/\s*$//; $D_tot_canc_qty =~ s/\s*$//; $D_tot_ord_qty =~ s/\s*$//; $D_tot_ship_qty =~ s/\s*$//; $D_ship_complete =~ s/\s*$//; $D_unit_price =~ s/\s*$//;
It's a clue that you have a data structure, not a bunch of unrelated scalars. Consider the use of a proper hash to hold these items.

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Replies are listed 'Best First'.
Re^2: Linking and Combining Two Arrays
by roguez33 (Initiate) on Feb 01, 2010 at 18:51 UTC

    You are correct they are data structures!

    The key values are "item" ( $c_1_ITEM and $D_item) in each array.

    Can the be more than one value per key in a hash array?

      Can the be more than one value per key in a hash array?
      Yes, in HASHES OF ARRAYS

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://820813]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-26 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found