http://www.perlmonks.org?node_id=942079


in reply to scoping problem?

Not that it matters much for this example, but any reason for the matching versus just a comparison?

if ("agag" =~ m/($username)/){
vs
if ("agag" eq $username){
bliz

Replies are listed 'Best First'.
Re^2: scoping problem?
by rocroc (Initiate) on Dec 06, 2011 at 20:28 UTC
    because in the "real" script, I'm looking for filenames in a directory that contain the username, but have other stuff in them as well.