note
kcott
<p>G'day [kelscat18],</p>
<p>
You're using a substitution (i.e. <c>s/pattern/replacement/</c>) when you really want a pattern match (i.e. <c>/pattern/</c>). You're also using the '<c>g</c>' modifier, which is unnecessary here.
Take a look at "[http://perldoc.perl.org/perlretut.html|perlretut - Perl regular expressions tutorial]" to get an understanding of the basics. Here's how I might have coded that (which, I suspect, is close to what [Corion] had in mind):
</p>
<code>
#!/usr/bin/env perl
use strict;
use warnings;
my @tests = qw{jHj8nniO I87jjj8y jUjngnkk ikbHH 12345 !@$%^&*};
my @words = grep { /[A-Za-z]/ && /\d/ } @tests;
print "@words\n";
</code>
<p>Output:</p>
<code>
jHj8nniO I87jjj8y
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-861371">
<p>-- Ken</p>
</div></div>
1057061
1057061