In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] writes:
> Andrew Savige schreef op 22 februari 2002:
>> #!/usr/bin/perl -l
>> [pop=~/.(?{$a=$a*36+(ord(lc$&)-9)%39})/g];print$a
>>
>> why do you need the [] ?
>
> OK, I understand it now. The [] provides the list context
> to force iteration of the whole string. For example:
> $x = 'abc';
> @a=$x=~/.(?{print$&})/g;
> $x=~/.(?{print$&})/g;
> The @a case above prints 'abc' while the next line prints just 'a'.
>
Yup. and the other way to get (?{}) constructs to be loop is to cause
backtracing, e.g. something like:
perl -wle '"abcd" =~ /(??{print $`})/'