D
Diamond, Mark
This post is prompted by having my earlier mistake ("Preventing lines from
printing 23/8/09) pointed out to me. My problem is now one of elegance
rather than failure.
I have
while (<>) {
..
..
($angle, $stage)= /^(\d\d)(\d+)/;
print "$angle $stage\n";
..
..
}
which prints something whether there is a match or not. I assume that I can
avoid the printing when there is no match by comparing $angle and $stage
with null strings, but please, what is the/a sensible/elegant way of
printing on a complete match and not printing on no match or only a partial
match?
Cheers,
Mark
printing 23/8/09) pointed out to me. My problem is now one of elegance
rather than failure.
I have
while (<>) {
..
..
($angle, $stage)= /^(\d\d)(\d+)/;
print "$angle $stage\n";
..
..
}
which prints something whether there is a match or not. I assume that I can
avoid the printing when there is no match by comparing $angle and $stage
with null strings, but please, what is the/a sensible/elegant way of
printing on a complete match and not printing on no match or only a partial
match?
Cheers,
Mark