Thread Datensätze einer CSV-Datei mit CGI ausgeben
(11 answers)
Opened by leaves at 2009-12-17 11:51
Hallo zusammen,
ich möchte gerne einen Datensatz aus einer CSV-Datei ausgeben. Warum bekommt man bei print $cgi->strong('Datensatz:'), $cgi->$sp1, $cgi->$sp2, $cgi->$sp3; einen Fehler bzw. warum geht die Ausgabe nicht? Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 @csvInhalt = <CSV>; close(CSV); chomp(@csvInhalt); use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); my $cgi = new CGI; my $search = $cgi->param(); print $cgi->header(), $cgi->start_html('SAP Test'), $cgi->h1('SAP-DS ',$cgi->i('comments.pl')); foreach (@csvInhalt) { ($sp1, $sp2, $sp3) = (split(/;/, $_)); if($sp2<$search != $search < $sp3 ){ print $cgi->strong('Datensatz:'), $cgi->$sp1, $cgi->$sp2, $cgi->$sp3; } } print $cgi->end_html(); Modedit GwenDragon: Titel erweitert Last edited: 2009-12-17 13:01:38 +0100 (CET) |