#!/usr/bin/perl -l use strict; use warnings; while(){ chomp; print; print /\b\@testing\b/ ? "Matched \\b" : "Did not match \\b"; print /\B\@testing\b/ ? "Matched \\B" : "Did not match \\B"; print ""; } __DATA__ @testing foo@testing foo @testing