in reply to Re^3: How to check if a variable's value is equal to a member of a list of values
in thread How to check if a variable's value is equal to a member of a list of values

You have to provide a list of values on the right hand side. For example, you can try:
@hash1{@array} = ('value') x @array; @hash2{@array} = 0 .. $#array;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re^4: How to check if a variable's value is equal to a member of a list of values
  • Download Code

Replies are listed 'Best First'.
Re^5: How to check if a variable's value is equal to a member of a list of values
by cls33 (Novice) on Mar 25, 2013 at 16:30 UTC
    Hm... makes sense. But how do I handle it if I don't know the size/length of the array? Do I really have to check that and then programmatically build an array in a loop? Or is there a syntactical shortcut?
      I do not understand. In my examples, the size of the array is not hardcoded, it is dynamically computed from @array in the scalar context or $@array.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ