> I am supposed to parse a text file such as this-
> 781457  Hartanto Victor Setiawan <[EMAIL PROTECTED]>
> 777557  Hatfield Benjamin <[EMAIL PROTECTED]>
> 779777  Henry James <[EMAIL PROTECTED]>
> 777947  Hergert Michael William <[EMAIL PROTECTED]>
> 778097  Iverson Jennifer Marsee <[EMAIL PROTECTED]>

Hi,

Please no homework questions to the [EMAIL PROTECTED] list,
hard graft teaches you more effectively.  At least make sure
you understand entirely whatever solution you submit...

while (<FILE>) {
    if (/^(\d+)\s+([^<]+) <([^>]+)>$/) {
        my ($id, $name, $email) = ($1, $2, $3);
        # Process line
    }
    else {
        die "Parse error at line $.\n";
    }
}

I think you've got some studying to do :)

Jonathan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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

Reply via email to