They are call backreferences, used in regular expression as buffer where
you can store pieces of the result collected in the regular expression.

eg. if you have this

"123 456" =~ /(\d*) (\d*)/;

$1 will equal to 123 while $2 will equal to 456

If you have the 'proramming perl' book from oreilly, refer to page 31,
it has a very detail description of what backreferences is.

Tor.

lyf wrote:

> hi, I am a perl beginner, and I am confused by $1.
> what does $1 ($2,and so on) mean?
> and how to use them?
>
> thanks
>
>     yuefu li


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to