On May 16, Liger-dc said:

>are the variables $1 and $2 special variables? and if
>so what do they do?

Read perldoc perlvar:

     $<digits>
             Contains the subpattern from the corresponding set
             of parentheses in the last pattern matched, not
             counting patterns matched in nested blocks that have
             been exited already.  (Mnemonic: like \digits.)
             These variables are all read-only.

Example:

  if ($line =~ /^(\w+)\s*=\s*(.*)/) {
    print "setting '$1' to '$2'\n";
    $config{$1} = $2;
  }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
*** I need a publisher for my book "Learning Perl Regular Expressions" ***

Reply via email to