godspeed06
Vendor
Greetings,
Consider the script below, where I am expecting "dino" to be retuned, but for some reason is not. --can anyone shed light on this?
Script:
#!perl -w
use strict;
my @names = qw/ fred barney betty dino wilma pebbles bamm-bamm /;
my $results = &which_element_is("dino", @names);
sub which_element_is
{
my($what, @list) = @_;
foreach (0..$#list)
{
if($what eq $list[$_])
{
return $_;
}
}
-1
}
Consider the script below, where I am expecting "dino" to be retuned, but for some reason is not. --can anyone shed light on this?
Script:
#!perl -w
use strict;
my @names = qw/ fred barney betty dino wilma pebbles bamm-bamm /;
my $results = &which_element_is("dino", @names);
sub which_element_is
{
my($what, @list) = @_;
foreach (0..$#list)
{
if($what eq $list[$_])
{
return $_;
}
}
-1
}