On Wednesday, May 22, 2002, at 12:25 , Felix Geerinckx wrote:
[..]
> or
>     my ($a, $b, $c);
>     if ($foo =~ /Foo (\d{4} at (\S+), (\w{2})/) {
----------------------------^
missing ) - no smileyPossible - cf OldPerlGuyBrainFade....

>         $a = $1; $b = $2; $c = $3;
>     } else {
>         # No match
>     }

{ and to show the other option available }

assuming that this $foo is possibly more than one "line"
then I would propose say

        if ( $foo =~ s/Foo (\d{4}) at (\S+), (\w{2})// )        {       
                ($a, $b, $c) = ( $1, $2, $3);
                print "The line has become:\n # $line #\n";
                print "$a $b $c\n";
        } else {
                print "The Line Remains the same:\n # $line #\n";
        }

since if we find our "abc's" we leave less stuff in $foo
for subsequent parsing....

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to