in reply to regex question

My mistake, here is the updated code:
You can try this:
It opens a file containing the above lines, then matches for the first and second instance.
#!/usr/bin/perl open(TMP,"$ARGV[0]"); while(<TMP>) { if($_ =~ m/([0-9-.]+)\|/) { $gref=$1; } if($_ =~ m/([0-9]+),/) { $type=$1; } }

Hope this helps...