TieCSV - TieCSV documentation


App-CCSV documentation Contained in the App-CCSV distribution.

Index


Code Index:

NAME

Top

App::CCSV::TieCSV.

VERSION

Top

Version 0.01

DESCRIPTION

Top

Helper class for App::CCSV.

SEE ALSO

Top

App::CCSV

BUGS

Top

There surely are ...

Please send bug reports or feature requests to Karlheinz Zoechling <kh at ibeatgarry dot com>.

COPYRIGHT & LICENSE

Top


App-CCSV documentation Contained in the App-CCSV distribution.

package TieCSV;

use strict;

require Tie::Handle;

our @ISA = qw(Tie::Handle);

our $VERSION = 0.01;

my $csv;
sub TIEHANDLE 
{
	my $class = shift;
	$csv = shift;
	my $fh = local *ARGV;
	bless \$fh, $class;
}

sub READLINE
{
	my $self = shift;
	my $line = <$self>;
	if ($line)
	{
		my $status = $csv->parse($line);
		@::f = $csv->fields();
		return $line;
	}
	return;
}

1;

__END__