I am trying to write a Perl program that reads in lines from a text file, and, for each line, extract the first \"word\" from the line, and perform a different action based
($start) = $inputline =~ /\A([^:\s]+)/;
This will match anything except whitespace and : at the beginning of the line. Or using split:
:
split
($start) = split /[:\s]+/, $inputline, 2;