Hi,

I have been playing around with the rat book but have the following
problem:

The attached snippet of code produces errors of unitialised value
strings for the lines I have marked.  The script compiles OK.  What
obvious newbie thing am I missing?

Cheers & Thanks

Francesco

#!/usr/bin/perl -w
#
# add taint check later

use CGI qw(:standard);
use strict;
use CGI::Carp qw(fatalsToBrowser); # remove later
use Fcntl qw(:flock);

my $filename =  param('filename');
my $subject  =  param('subject');
my $action   =  param('action');

my @subjects = ( 'running', 'computers', 'med_pol', 'med_clin', 'misc', 'links' );
my $DATA_DIR = ( "../data/$subject" ); # USE OF UNINITIALISED VALUE IN
                                       # CONCATENATION (.)
my $COMMENT_DIR = ( "../data/$subject/.comments" );   # USE OF UNINITIALISED
                                                      # VALUE IN CONCATENATION

( my $today = localtime )  =~ s/ +\d+:\d+:\d+/,/;


#( $filename ) = ( $q->param('filename') =~ /^(\d+)$/ );
#( $subject  ) = ( $q->param('subject' ) =~ /^(\w+)$/ );
#( $action   ) = ( $q->param('action ' ) =~ /^(\w+)$/ ) || 'start' ;


if    ( $action eq 'start'   ) { start(); }    # USE OF UNINITIALISED VALUE
                                               # IN STRING
elsif ( $action eq 'list'    ) { list() ; }
elsif ( $action eq 'display' ) { display(); }
elsif ( $action eq 'comment' ) { comment(); }
else  { start(); }

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to