#! /usr/bin/perl $a = " a 10 b a2 s2 c 30" ; ($c) = $a =~ /^b\s+(.*?)$/m ; print "c is $c\n" ;