I needed to know that. but something is still wrong. the data is being returned. here's where i am now:
#!/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";
}
|