http://www.perlmonks.org?node_id=262464


in reply to Fetching a number

If your lines are always going to be 5 fields long...seperated by commas:
my ($s1, $s2, $s3, $pname, $index) = split(/,/, $line);
Update:
Or if the line looks exactly like
('AA', 'B','2','ProjectId','148')"> Unique Information Here (Index)
my ($before, $after) = split(/>/, $line); my ($s1,$s2,$s3,$pname,$index) = split (/,/, $before); and then just trim off the ',), and " characters from $index.