On Fri, Mar 28, 2008 at 10:58:25PM -0000, Robin Barker wrote: > From: Frédéric Buclin [mailto:lpsolit@gmail.com] > > For all installations which do not have the not-yet-released Perl 5.8.9, > > which workaround(s) do they have? On critical installations, it's hard > > to upgrade Perl as it's a pretty heavy change. > > I have rewritten Text::Tabs to avoid s//pos/ > The code is at work and I haven't had a chance to test it. > >From memory, the code for C<sub expand> is below. > > Robin > > sub expand { > my @l; > for ( @_ ) { > my $s = ''; > for (split(/^/m, $_, -1)) { > my @tabs = split(/\t/, $_, -1); > my $line = shift @tabs; > for (@tabs) { > my $pad = $tabstop - (length $line) % $tabstop; > $line .= " " x $pad; > $line .= $_; > } > $s .= $line; > } > push(@l, $s); > } > return @l if wantarray; > return $l[0]; > } Although that's not a huge win unless the work around code goes into a release on CPAN, which is not something that p5p controls. Nicholas ClarkThread Previous | Thread Next