in reply to Last Letters

Ooops, i forgot. Each of the names above, are strings, they arent all part of an array. Also, scratch when i said extract the 4 numbers from the name, cause thats easy using substr() :).
Thanks Again

Dipul

Replies are listed 'Best First'.
Re: Re: Last Letters
by arturo (Vicar) on Nov 30, 2000 at 00:32 UTC

    The key is the regular expression, which grabs the numbers out of the line (assuming your data is sane)

    while (<FILE>) { # $number will only get set if the current line contains one or mo +re digits in between parentheses my ($number) = /\((\d+))/; # do something with $number }

    I'd suggest reading perlre (but check your own system's docs) and poke around for phrases like "regular expression memory", which is the technique being employed here.

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor