develooper Front page | perl.beginners | Postings from May 2007

Simplification of the code

Thread Next
From:
alok.nath
Date:
May 22, 2007 06:34
Subject:
Simplification of the code
Message ID:
C4A55E6959ED6F498EA07FFB09DAB2E007081A37@bgeexc04.asiapacific.cpqcorp.net
Hi,
	Can anybody help me to simplify the for loops here ?
	It parses the excel file.
	

	foreach my $col (1..10){
		push @row_1, $Sheet->Cells(1, $col)->{'Value'} ;	
	}
	my @node_names = th(\@row_1);

	foreach my $col (1..10){
		push @row_2, $Sheet->Cells(2, $col)->{'Value'} ;	
	}
	my @workstations = td(\@row_2);


	foreach my $col (1..10){
		push @row_3, $Sheet->Cells(3, $col)->{'Value'} ;	
	}
	my @cards = td(\@row_3);


	I am using the above for loops to create a table -finally.


	print table({-border=>undef,-width=>'100%'},
            caption(b('My table')),
            Tr(\@node_names),
            Tr(\@workstations),
            Tr(\@cards),
	}

Thanks
Alok.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About