On Wed, Mar 19, 2014 at 1:49 PM, Thomas H. George <[email protected]>wrote:
> Here is the code that is not working
>
The code you sent was missing an 's' in the RE. It also has no print stmt -
trying:
#!/usr/bin/perl
use diagnostics;
use strict;
#...
my $dud1 = "dud1";
my $dud2 = "dud2";
my $w_player = "?";
my $n_player = "?";
my $e_player = "?";
my $s_player = "?";
# $_ = $Board_1[3];
$_ = " H K53 deloresg Bills
Hank99 Pellinor";
if (/\s*(\w+)\s*(\w+)\*(\w+)\s*(\w+)\s*(\w+)\s*(\w+)/i) {
$dud1 = $1;
$dud2 = $2;
$w_player = $3;
$n_player = $4;
$e_player = $5;
$s_player = $6;
print "found:
$dud1 = $1;
$dud2 = $2;
$w_player = $3;
$n_player = $4;
$e_player = $5;
$s_player = $6;
";
}
else {
print "failed to match\n";
}
gets:
# perl -w /tmp/d.pl
found:
H = H;
K53 = K53;
deloresg = deloresg;
Bills = Bills;
Hank99 = Hank99;
Pellinor = Pellinor;
--
a
Andy Bach,
[email protected]
608 658-1890 cell
608 261-5738 wk