Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I can seem to figure out why this isn't matching. I can only figure it has something to do with the square brackets.
How can I get this to work?
How can I get this to work?
#!/usr/bin/perl -w use strict; use Data::Dumper; my $orig = 'my_stuff[1]=400'; my $want = 'my_stuff[1]='; print "They Match\n" if $orig =~ /$want/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How does this regex not match?
by CountZero (Bishop) on Feb 13, 2010 at 09:11 UTC | |
Re: How does this regex not match?
by Anonymous Monk on Feb 13, 2010 at 07:47 UTC | |
by Anonymous Monk on Feb 13, 2010 at 08:13 UTC | |
Re: How does this regex not match?
by 7stud (Deacon) on Feb 13, 2010 at 11:54 UTC | |
Re: How does this regex not match?
by targetsmart (Curate) on Feb 13, 2010 at 14:22 UTC | |
by AnomalousMonk (Archbishop) on Feb 15, 2010 at 20:39 UTC | |
Re: How does this regex not match?
by FunkyMonk (Chancellor) on Feb 13, 2010 at 14:26 UTC | |
Re: How does this regex not match?
by repellent (Priest) on Feb 13, 2010 at 18:29 UTC |
Back to
Seekers of Perl Wisdom