Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: search, replace and backrefrences

by Helter (Chaplain)
on Sep 30, 2002 at 17:46 UTC ( [id://201782]=note: print w/replies, xml ) Need Help??


in reply to search, replace and backrefrences

After some more reading I found that my first assumption is only half true.
$1-$9 are ALWAYS backrefrences, where $10 and up are only backrefrences if more than 10 parens were used.
This mixes with the comments about a variable that starts with a digit, can only have digits.

So $10 is taken as the whole name of a variable (undefined)
$1_ gets treated like $1 because _ is not a digit.

Thanks for all the help, I'm slowly understanding the subtle nature of Perl :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://201782]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found