Source,Destination,User,State 192.168.0.2,192.168.0.6,"cn=user1,ou=infrastructure,ou=accounts,o=ORG,c=US",Allowed 192.168.0.3,192.168.0.6,"cn=user2,ou=infrastructure,ou=accounts,o=ORG,c=US",Denied #### #!/usr/bin/perl use warnings; use strict; my $lineNum=1; print "\n"; if ( -f $ARGV[0] ){ #$ARGV[0] is a file open(CSV,'<',$ARGV[0]); while (){ csvLine2Html($_); } close(CSV); } else { #TODO... #$ARGV[0] is not a file } print "
\n"; sub csvLine2Html{ my $line = shift; chomp($line); if ($lineNum == 1){ #first line contains header information print "\t\n"; print map{ "\t\t$_\n" } split /,/, $line; print "\t\n"; } else { print "\t\n"; print map{ "\t\t$_\n" } split /,/, $line; print "\t\n"; } $lineNum++; }