[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Stupid, non-Mac based PERL question



My spies tell me that one "Strider" wrote:

>I have a database laid out like this, in tab-delimited format:
>
>Number[tab]Username[tab]Unneeded data[tab]ditto[tab]... there are fifteen
>fields total, and then a newline at the end.
>
>All I want is the username, perferably in an array, one entry per username.
>How would I pattern match/replace to get this? Is that even the route I
>should take?

i haven't tested this, but i think that the following will work:

while(<>) {
    my $uname = /^[^\t]+\t([^\t]+)/;
    $array[$#array] = $uname;
}





***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch