#!/usr/local/bin/perl use Data::Dumper; use strict; use CGI qw/:standard/; my $value = param('name'); my $rowid = $ARGV[0] || $value; my %data = (); my @fields = split(/\t/, <FILE>); chomp @fields; open FILE , "facultydummy.txt" or die "Cannot open: $!"; while(<FILE>) { chomp; my @row = split(/\t/); if ($row[0] eq $rowid) { @data{@fields} = @row; last; } } print "Content-type: text/html\n\n"; if ( keys %data ) { # found, display data print Dumper \%data; } else { # not found, show error print STDERR "Can't find row '$rowid'\n"; }
In reply to Re: Re: Re: Re: CGI PM
by malaga
in thread CGI PM
by malaga
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |