Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Arrays merges and redundancies

by Riales (Hermit)
on Mar 30, 2012 at 18:35 UTC ( #962665=note: print w/replies, xml ) Need Help??


in reply to Arrays merges and redundancies

I'm a little confused by your explanation, but I think you're using arrays when you probably want hashes? Maybe something like...

my %hash = ( 1 => [qw/a a a a a a a a/], 2 => [qw/b b b b b b b b/], 3 => [qw/c d c c c d c d/], );

But I'm still not very clear on what you're trying to do...

Replies are listed 'Best First'.
Re^2: Arrays merges and redundancies
by Anonymous Monk on Mar 30, 2012 at 19:51 UTC

    From the following studpi example;

    @IDs = qw(Apple Apple Grape Banana Banana) @Price = qw(5 5 2 3 4 ) @Amount = qw(10 15 3 4 4 ) I want; @IDs = qw(Apple Grape Banana) @Price = qw(5 2 3/4) @Amount = qw(10/15 3 4)

    Ithought about using hashes but for that I need unique key and IDs are not unique. Sorry for vague explanations and thanks for help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://962665]
help
Chatterbox?
[Lady_Aleena]: marioroy, it has 3 subroutines which can be fed data to generate random things. See here.
[Lady_Aleena]: marioroy, it is used in 24 other modules I wrote.
[Lady_Aleena]: GUH! I wrote a script better than I thought! 8)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2017-05-29 09:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?