my $user = "one"; while (my $line=) { chomp($line); print "match on $line\n" if $line=~/^\Q$user\E:/; } __DATA__ foo:bar:quz one:two:three a:b:c