in reply to Re^4: Problem using value of variable in a regular expression
in thread Problem using value of variable in a regular expression
The problem with searching a solution for such a query is that one has to know the name of the concept behind the issue(here it is "interpolation") to get quickly to the answer. But then if one knew the concept, he/she wouldn't be facing the problem in the first place.
Yes, that's indeed a problem. That's why places like perlmonks, usenet and various IRC channels exist.
One appraoch that I'm eager to try out for Perl 6 is to write a tool that, given some piece of code, points you to the applicable documentation, and also tells you which possible usage of a character it is (for example the slash can be numeric division, or it can be the start of a regex).
In an ideal world, given the string
my $x = "\*E"
It would tell you that 'my' is a declarator (and point you to the docs), = is assignment (+ pointer to docs), "..." is a quote (+ pointer to docs", and \ introduces an escape sequence (+ pointer to docs).
For Perl 6 I know how to obtain the parse tree, but the docs are too sparse to make it useful right now. For Perl 5 it's hard to get the parse tree.
But it's on my list of long-term projects to hack on (and some of these projects done from time to time).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Problem using value of variable in a regular expression
by kejohm (Hermit) on Jul 30, 2010 at 13:23 UTC |