On Thu, 17 Oct 2002, Belden Lyman wrote:

> >>>the numbers would be most appreciated as I'm simply picking
> >>>everything in a 12 char range each time.
> >>>
> >>In the interest of more than one way, here's something else:
> >>
> >>pos($_) = 9;  # skip first 9 chars
> >>push @ext, $1 while /(.{12})/g;
> > 
> > Wouldn't it be better to use split with a zero width lookahead assertion?
> 
> Dunno - I'm having trouble writing such a split. zero width lookahead;
> not my forte. I assume the use of the lookahead is to skip the pos() ?

Look at the example in perldoc -f split:

      print join(':', split(/(?=\w)/, 'hi there!'));

Something like that might work.

S.

-- 
Shevek
I am the Borg.

sub AUTOLOAD{my$i=$AUTOLOAD;my$x=shift;$i=~s/^.*://;print"$x\n";eval
qq{*$AUTOLOAD=sub{my\$x=shift;return unless \$x%$i;&{$x}(\$x);};};}

foreach my $i (3..65535) { &{'2'}($i); }



Reply via email to