monkfan has asked for the wisdom of the Perl Monks concerning the following question:
Dear fellow monks,
For example I have an array as a repository and string as input.
Regards,
Edward
For example I have an array as a repository and string as input.
What's the compact way to find the index of 'bar' in @repo, such that finally it returns '2' (index in @repo).my $input = $ARGV[0] || 'bar'; my @repo = qw (foo bar qux);
Regards,
Edward
Back to
Seekers of Perl Wisdom