Leon -- ...and then lz said... % ... % Here is a line from my file: % Dear Test Test1(ID127158), ... % % I use the following line, when I am reading the file: % ($idNumber) = $line =~ /\((ID\d+)\)/; % % For, some reasons idNumber is still empty....
Do you actually read the line into $line? My famous one-liner method shows echo "Dear Test Test1(ID127158)," | \ perl -e 'while (<>) { $line = $_ ; \ ($id) = $line =~ /\((ID\d+)\)/; } \ print "$id\n";' ID127158 Note the while loop and the setting $line = $_ on the "perl -e" line; if you don't set $line, then the match won't have anything against which to work. % % Thanks again! HTH & HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg25580/pgp00000.pgp
Description: PGP signature