Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
...but every so often $ptsp possesses a [ or ], which messes up my pattern matching. How do I treat [ and ] as literal characters and not special characters?if ($rpt[$ln] =~ /^\sStartpoint/ { @ptlalsp = split(/\s+/,$rpt[$ln]); $ptsp = $ptlalsp[2]; #get name do { $ln++; } until ($rpt[$ln] =~ /$ptsp/); #name will show up #again...increment #$ln until found #other stuff... }
Thanks,
-Fiddler42
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to deal with [ and ] chars
by Ven'Tatsu (Deacon) on May 04, 2004 at 19:16 UTC | |
|
Re: How to deal with [ and ] chars
by Zaxo (Archbishop) on May 04, 2004 at 20:28 UTC | |
|
Re: How to deal with [ and ] chars
by geekgrrl (Pilgrim) on May 04, 2004 at 19:34 UTC |