|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Answer: How would I replace the string 'Red1' with $Red[1]? |
| ( #20367=categorized answer: print w/ replies, xml ) | Need Help?? |
|
Q&A > regular expressions > How would I replace the string 'Red1' with $Red[1]? contributed by QandAEditors
Use an array (or a hash). What you're trying to
do now smells like symbolic refrences, which
are just yicky (to use the technical term )
and make your code harder to write and maintain.
You will also need to use the /e modifier (which causes Perl to eval the right-side as an expression).
|
|
||||||||||||||||||