in reply to Re: Saving array duplicates, not using a hash?
in thread Saving array duplicates, not using a hash?

1. I don't understand what I would use for OTHERARRAY?
2. The if compares to a single element in OTHERARRAY right? How would I get at the single element unless I use another for loop to cycle through it?
  • Comment on Re^2: Saving array duplicates, not using a hash?

Replies are listed 'Best First'.
Re^3: Saving array duplicates, not using a hash?
by Anonymous Monk on Sep 28, 2008 at 08:11 UTC
    1. I don't understand what I would use for OTHERARRAY?
    Something like @OTHERARRAY or @SOMETHING, @POOPS, @MCGEE, @FOO, @BAR, @BAZ, @MOO, @SHOO, @GCTAYLOR1, @ELEMENTSSEENALREADY... :) understand? ARRAY is one name, OTHERARRAY is another.

    2. The if compares to a single element in OTHERARRAY right? How would I get at the single element unless I use another for loop to cycle through it?
    Almost, it compares to every single element in OTHERARRAY, and you use another loop for that. Loops are the basis for computers (everything is a loop, from RAM to CPU). Its one of those fundamental you must master, so stick to it and it will stick to you :)
    foreach String comparison

    After you've got that loop version working, next step is to do it without an explicit loop. You'll be using index and join :)