On Jun 6, Jerry Preston said:

>  %T_MODLUES = (
>                                 A1 => [ qw/ A B C D E F/ ],
>                                 A2 => [ qw/ A B C D E F/ ],
>                                 A3 => [ qw/ A B C D E F/ ],
>                                   N => [ qw/ A1 A2 A3/],
>                            );
>
>I have a hash that looks like the above.  I want to have A1, A2 and A3 all
>point to  [ qw/ A B C D E F/ ] with out having to but in separately for A1,
>A2 and A3 .   The hash it's current configuration is a monster.  I am look
>for a simple way to manage it.

Do you want them to point to the SAME array reference, or just copies?

  # for copies
  $T_MODULES{$_} = [qw(A B C D E F)] for qw( A1 A2 A3 );

  # also copies
  @T_MODULES{qw( A1 A2 A3 )} = ([qw(A B C D E F)]) x 3;

  # same
  $T_MODULES{A1} = [qw(A B C D E F)];
  $T_MODULES{$_} = $T_MODULES{A1} for qw( A2 A3 );

  # also same
  $T_MODULES{A1} = [qw(A B C D E F)];
  @T_MODULES{qw( A2 A3 )} = ($T_MODULES{A1}) x 2;

-- 
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