in reply to using constants in regex/search
It does use a variable, but it saves a sub. The advantage of being able to interpolate variables to me outweight the advantages 'constants' give me.my $NAME = "abc"; ... if ($input =~ /$NAME/) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using constants in regex/search
by spmlingam (Scribe) on Dec 02, 2008 at 11:34 UTC | |
by JavaFan (Canon) on Dec 02, 2008 at 11:43 UTC | |
by spmlingam (Scribe) on Dec 03, 2008 at 07:59 UTC | |
by JavaFan (Canon) on Dec 03, 2008 at 10:11 UTC | |
by spmlingam (Scribe) on Dec 03, 2008 at 12:53 UTC | |
by ikegami (Patriarch) on Dec 03, 2008 at 08:27 UTC |