#!/usr/bin/perl

require 5.000 ;	# This is a perl 5.0 script

require CSV ;

my $record = 0 ;

	$csv = CSV_table->readFromInputFile("sample.csv") ;
	printf  "dimensions = %4d x %4d\n", $csv->dimensions() ;
	$csv = CSV_table->readFromInputFile("sample3.csv") ;
	printf  "dimensions = %4d x %4d\n", $csv->dimensions() ;
	$row = $csv->get_row('compound', 'PDBu' ) ;
	foreach $val (@$row)
	{
		print $val, "\n" ;
	}
			

	#If more than one row match
	$rows = $csv->get_mutiple_rows('compound', 'PDBu' ) ;
	foreach $row (@$rows){
		foreach $val (@$row)
		{
			print $val, "\n" ;
		}
		print "------------------\n";

	}	

	$prop = $csv->getProperties('compound', 'PDBu' ) ;

	while(($key,$val) = each %$prop)
	{
		printf "%s => %s\n", $key, $val;
	}
	
	print "------------------\n";


	$props = $csv->get_multi_Properties('compound', 'PDBu' ) ;
	foreach $prop (@$props)
	{
		while(($key,$val) = each %$prop)
		{
			printf "%s => %s\n", $key, $val;
		}
	
		print "------------------\n";
	}		
