Processing variable name with [ ] in perl

Status
Not open for further replies.

neoflash

Advanced Member level 1
Joined
Jul 2, 2005
Messages
492
Helped
10
Reputation
20
Reaction score
2
Trophy points
1,298
Activity points
4,759
I have trouble with processing variable names with [] by itself since [ ] have special meaning in perl programming.

However, those variable names are read in from other sources and therefore can't be changed.

How can we effectively deal with them without too much trouble?

Added after 2 hours 57 minutes:

Let me specify it a bit more:

if ($p_line =~ / $line[1] /)

where $p_line has a variable as abc[1]. My problem is that it never match with $line[1] which is also abc[1].
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…