#!/usr/bin/perl @chumptastic = ; $chumpstain = join "\n", @chumptastic; $chumpstain =~ m/bakjob2_details .+? credit .+? # The ? makes these minimal matches; # thus catching the nearest match. customer2\ =\ (-?\d+\.?\d*),/sx; # Modified s to treat it as one string # (. matches newlines) print "$1\n"; __DATA__ # Your Data goes here