Text::Tabs will do the same as my example, it will replace the tabs with a fixed amount of spaces but it will not consider the spaces in between the two strings.
i disagree. from the description in the Text::Tabs pod:
Text::Tabs does about what the unix utilities expand(1) and unexpand(1) do. Given a line with tabs in it, expand will replace the tabs with the appropriate number of spaces. Given a line with or without tabs in it, unexpand will add tabs when it can save bytes by doing so. Invisible compression with plain ascii!
here's an example:
#!/usr/bin/perl require 5.006_001; use strict; use warnings; $|++; use Text::Tabs; my $tabstop = 8; my $text = "12345678901234567890\n\thi\tbye"; print $text,$/,length $text,$/; my $newtext = expand($text) print $newtext, $/,length $newtext,$/; __END__ ## prints 12345678901234567890 hi bye 28 12345678901234567890 hi bye 40
...unless i'm missing something
~Particle *accelerates*
In reply to Re^3: How to replace Tab with spaces not altering postion
by particle
in thread How to replace Tab with spaces not altering postion
by juo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |