SuperSplit

Provides methods to split/join in two or more dimensions
Download

SuperSplit Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jeroen Elassaiss-Schaap
  • Publisher web site:
  • http://search.cpan.org/~jeroenes/

SuperSplit Tags


SuperSplit Description

Provides methods to split/join in two or more dimensions SuperSplit is a Perl module which provides methods to split/join in two or more dimensions.SYNOPSIS use SuperSplit ; #or qw/!:all supersplit/ |which function you want to use #first example: split on newlines and whitespace and print #the same data joined on tabs and whitespace. The split works on STDIN # print superjoin( supersplit() ); #behaves like while () {s/s+/ /g;print;} #second: split a table in a text file, and join it to HTML # my $array2D = supersplit( *INPUT ) #filehandle must be open my $htmltable = superjoin( '', " ", $array2D ); $htmltable = " " . $htmltable . " "; print $htmltable; #third: perl allows you to have varying number of columns in a row, # so don't stop with simple tables. To split a piece of text into # paragraphs, than words, try this: # undef $/; $_ = ; tr/.!();:?/ /; #remove punctiation my $array = supersplit( 's+', ' s* ', $_ ); # now you can do something nifty as counting the number of words in each # paragraph my $i = 0; for my $rowref (@$array) { print "Found ".@$rowref." words in paragraph ".++$i." "; } #other uses: $a = supersplit( 2 ); #behaves like supersplit(), but stops with the second column $b = supersplit_open( " Requirements: · Perl


SuperSplit Related Software