> $ perl -wle'
> $string = "abc";
> while ($string =~ /(.*?)/g) {
>   print pos($string), ": ", $1;}
>
> '
> 0:
> 1: a
> 1:
> 2: b
> 2:
> 3: c
> 3:
>
Can someone explain the working of the g modifier since my knowledge
of using g was to use it for substituting globally...
Here i get what paul is trying to explain but if i take out g from the
statement why does it say use of uninitialized value and prints
nothing.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to