SuperSplit::Obj - Provides object interface to SuperSplit
use SuperSplit::Obj; #example: split on newlines and whitespace and print #the same data joined on tabs and whitespace. The split works on STDIN # $s = SuperSplit::Obj->new(); $s->stdin(); $array = $s->split(); # #use filehandle, filename to open or string: $s->handle( $fh ); $s->open( "<$filename" ); $s->text( $string ); # #use separators $s->sep( @separator_array ); #use limits $s->limits( @limit_array ); #split everything, and join it using @sep $s->splitjoin( @sep );
This module just provides an object-interface to the SuperSplit module. You initialize it using the input specifiers, and optionally the separator and/or LIMIT separators. The behavior is just like the supersplit_hashref method of the SuperSplit module.
Initialises the object and retuns it, aka just what you expect from a simple object constructor.
Tells the object to use STDIN to obtain data. STDIN is read right away.
Tells the object to use the filehandle $fh for input. $fh is read right away, and left open in case you want to "seek" in perlfunc.
Tells the object to get data from the argument using an open statement. It returns the opened and read filehandle, or undef if something went wrong.
Tells the object to use the string for data input.
Uses the given array as separators. Synonyms: separator(); separators().
Uses the given array as LIMITs. Synonyms: lim(); limits().
Perform the actual multi-dimensional splitting using earlier provided arguments. It returns a multi-dimensional array.
Behaves exactly like the superjoin method. So you don't even need to use the constructor before calling it.
This method combines the previous two. It first splits like the split method, and than joins the resulting array with the provided arguments, passing them to superjoin.
Jeroen Elassaiss-Schaap.
Perl/ artisitic license
Alpha
To install SuperSplit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SuperSplit
CPAN shell
perl -MCPAN -e shell install SuperSplit
For more information on module installation, please visit the detailed CPAN module installation guide.