#!c:/perl/bin/perl use strict; use warnings; #opening the csv file my $caption=pop(@ARGV); open(FH,$caption) || die("Cannot open $caption file"); my($line,$id,$name,$age,@records,@out); @out="CSV Output"; #creating a new file for the html output and writing the header content open(FH1,">output.html"); print FH1 @out; #splitting the comma separated values and writing it to the html file while($line=){ next if($line=~/^ID/); chomp($line); ($id,$name,$age)=split(/,/,$line); print FH1 ""; } print FH1 "
IDNAMEAGE
$id$name$age
"; close FH1; close FH;