- or download this
my $thing_to_find = 'needle';
my @haystack = ('needle', 'hay', 'more hay', 'yet more hay');
my $needle_count = scalar(grep { /^$thing_to_find$/ } @haystack);
- or download this
sub getAnswer {
my $ans;
...
chomp($ans);
return $ans;
}
- or download this
sub pad {
my ($str, $padSize, $padChar, $dir) = @_;
...
}
return $str;
}