Marko Krstic wrote:
>
> What is the best (shortest) way to define a hash where different keys
> have same values:
>
> %my_hash = { 1 => 'something', 2 => 'something', 3 => 'something else'};
>
> Is there a way to write something like:
>
> %my_hash = { 1,2 => 'something', 3 => 'something else', etc...}
- If you have chosen to use Perl then use it. Wishing you were writing in a
different language will frustrate you enormously and Perl won't care a jot.
- If your keys are all numeric then you should be using an array
my @data = (('something') x 2, 'something else');
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/