Author image Jeroen Elassaiss-Schaap

NAME

SuperSplit::Obj - Provides object interface to SuperSplit

SYNOPSIS

 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 );
 

DESCRIPTION

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.

new()

Initialises the object and retuns it, aka just what you expect from a simple object constructor.

stdin()

Tells the object to use STDIN to obtain data. STDIN is read right away.

handle( $fh )

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.

open( ">$filename" )

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.

string( $string )

Tells the object to use the string for data input.

sep( @separator_array )

Uses the given array as separators. Synonyms: separator(); separators().

limit( @limit_array )

Uses the given array as LIMITs. Synonyms: lim(); limits().

split()

Perform the actual multi-dimensional splitting using earlier provided arguments. It returns a multi-dimensional array.

join( @args )

Behaves exactly like the superjoin method. So you don't even need to use the constructor before calling it.

splitjoin( @args )

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.

AUTHOR

Jeroen Elassaiss-Schaap.

LICENSE

Perl/ artisitic license

STATUS

Alpha