in reply to help with a regex
use warnings; use strict; my %words = (word => 1, word2 => 1, word3 =>1); my $temp = 'WORD2'; my $temp1 = 'word2'; $_ = 'here is word2'; s/$temp1/$words{$temp1} ? "$temp " : "[$temp] "/ex; print "$_\n"; __END__ here is WORD2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help with a regex
by Athanasius (Archbishop) on Feb 02, 2013 at 03:27 UTC | |
by AnomalousMonk (Archbishop) on Feb 02, 2013 at 12:29 UTC |