Tabs-to-space function
sub tabs2space($) { my $str = shift; 1 while $str =~ s/\t+/' ' x (length($&)*8 - length($`)%8)/e; return $str; }
DZone Snippets > Minimiscience > text
12374 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
sub tabs2space($) { my $str = shift; 1 while $str =~ s/\t+/' ' x (length($&)*8 - length($`)%8)/e; return $str; }
#!/usr/bin/perl -wn use strict; s/\s//g; print chr hex $1 while /([[:xdigit:]]{2})/g; print "\n";
#!/usr/bin/perl -wn use strict; s/\s//g; print chr oct "0b$1" while /([01]{8})/g; print "\n";
#!/usr/bin/perl -wni # para.pl use strict; /^\s+/ || /^$/ ? print : write; format ARGVOUT = ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $_ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ $_ .