in reply to A Question on assigning variables from a big variable

Hi barrycarlyon,

You're not really doing a split here.  You're assigning variables to the results from a regular expression match.

Note a couple of things:

  1. You should change =- to =~ (the regular expression binding operator (thanks jwkrahn, below!))
  2. You shouldn't be capturing the values (10) and (8).  My guess is that you either meant "10" and "8" (without the parentheses), or (more likely) "{10}" and "{8}", to mean 10 digits and 8 digits respectively.

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
  • Comment on Re: A Question on assigning variables from a big variable

Replies are listed 'Best First'.
Re^2: A Question on assigning variables from a big variable
by jwkrahn (Abbot) on Jun 20, 2006 at 19:55 UTC
    =~ is not the "regular expression operator", for example:
    $string =~ tr/a-z/A-Z/;
    Notice that there is no regular expression involved in that example. Is the binding operator.