in reply to CGI PM

You have not instantiated a CGI object. Either use the :standard interface and do not use the $cgi object, or create a new CGI object and forego the :standard interface:
use CGI; my $cgi = new CGI; my $field = $cgi->param('field'); # versus use CGI ':standard'; my $field = param('field').

Replies are listed 'Best First'.
Re: Re: CGI PM
by malaga (Pilgrim) on Jan 28, 2001 at 23:33 UTC
    thanks. i couldnt' get it to work the first way - with CGI, but the second way worked. well, my script isn't working, but the error is gone. :)

      Now that you have your cgi object, why not use the value you got from it? :)

      You maybe want to do:

      my $rowid = $ARGV[0] || $value ;

      instead of:

      my $rowid = $ARGV[0] || 'value';

      <kbd>--
      PerlMonger::Paris(http => 'paris.pm.org');</kbd>
        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"; }