my $k = ''; # A bunch of junk happens to this scalar before this point my $t = "\ttest \n \n"; $t =~ /^\s*(.*?)\s*$/g; ($k) .= $1; print $k ."\n";