Hi, I've created a CGI script, that produces output that looks fine, but creates tons of error messages like these in the Apache error log:

Fri Dec 16 17:23:46 2011 -e: Use of uninitialized value $ModPerl::ROOT::ModPerl::Registry::home_rianne_Documents_workspace_Wordclouds_perl_wordclouds_2ecgi::word in pattern match (m//) at /home/rianne/Documents/workspace/Wordclouds/perl/wordclouds.cgi line 2139, <GEN1> line 4463. Fri Dec 16 17:23:46 2011 -e: Use of uninitialized value $ModPerl::ROOT::ModPerl::Registry::home_rianne_Documents_workspace_Wordclouds_perl_wordclouds_2ecgi::word in pattern match (m//) at /home/rianne/Documents/workspace/Wordclouds/perl/wordclouds.cgi line 2141, <GEN1> line 4463. Fri Dec 16 17:23:46 2011 -e: Use of uninitialized value $ModPerl::ROOT::ModPerl::Registry::home_rianne_Documents_workspace_Wordclouds_perl_wordclouds_2ecgi::word in concatenation (.) or string at /home/rianne/Documents/workspace/Wordclouds/perl/wordclouds.cgi line 1627, <GEN1> line 4463.

Anyone has an idea how to fix this ?

This is my code: (partly)
#!/usr/bin/perl -w # #wordclouds.cgi #create wordclouds for different categories from an ultimate data set use strict; use bytes; use warnings qw(redefine); require Encode; use Unicode::Normalize; use CGI qw/:standard -private_tempfiles/; use CGI::Carp qw/fatalsToBrowser/; use Text::Unaccent; use Text::CSV_XS; use Fcntl qw( :DEFAULT :flock ); use constant UPLOAD_DIR => "/tmp"; use constant BUFFER_SIZE => 16_384; use constant MAX_FILE_SIZE => 250*1_048_576; # Limit each uploa +d to 50 MB use constant MAX_DIR_SIZE => 300 * 1_048_576; # Limit total uploads +to 100 MB use constant MAX_OPEN_TRIES => 100; $CGI::DISABLE_UPLOADS = 0; $CGI::POST_MAX = MAX_FILE_SIZE; local our $q = new CGI; $q->cgi_error and error( $q, "Error transferring file: " . $q->cgi_err +or ); local our $filename = $q->param( "file" ) || error( $q, "No f +ile received." ); local our $infile = $q->upload( "file") || error( $q, "No file + uploaded."); local our $textcolumn = $q->param( "textcolumn" ) || error( $q, "No t +extcolumn entered." ); local our $catcolumn = $q->param( "categorycolumn" ) || error( $q, "N +o categorycolumn entered." ); local our $size = $q->param( "size" ) || error( $q, "No size entered." + ); local our $brands = $q->param( "brands" ) ; local our $stop = $q->param( "stop" ) ; local our $language = $q->param( "lang" ) || error( $q, "No language +entered." ); local our $colour = $q->param( "colour" ) || error( $q, "No colour en +tered." ); local our $twitterselect = $q->param( "twitterselect" ) || error( $q, +"No Twitter selection entered." ) ; local our $stem = $q->param( "stem" ) || error( $q, "No stemming prefe +rence entered." ); local our $bigrams = $q->param( "bigrams" ) || error( $q, "No preferen +ce for bigrams entered." ); $textcolumn--; $catcolumn--; local our $onlyhashtags = 0; local our $onlyusernames = 0; if($twitterselect eq "hashtags"){ $onlyhashtags =1 ; } elsif($twitterselect eq "usernames"){ $onlyusernames = 1; } local our @fontsizes =("xx-small", "x-small", "small", "normal", "larg +e", "x-large", "xx-large"); local our %stat_tf; local our %stat_df; local our $max_tf; local our %prob; local our %stat_2tf; local our %count_2tf; local our %prob2; local our %p; local our %count_tf; local our %count_df; local our $term_count; local our $doc_count; local our $lambdap = 0.1; local our $mu = 0.4; local our $prune = 0.001; local our $minnrquotes = 10; local our $minbigrams = 5; local our $cloudsize = $size; local our %length; local our $total_length; local our %cloud; local our @brandsarray; local our %tablestring; local our %languages = ( "en" => 'English', "de" => 'German', "nl" => 'Dutch', "fr" => 'French', ); local our %colours = ( "black" => ':000000', "none" => '', "red" => ':FF0000', "green" => ':006600' ); $stop =~ s/ //g; my @addstop = split(/\,/, $stop); for(@addstop){ $stophash{"all"}{$_} = 1; } print $q->header( "text/html", -expires => "-1s" ), + $q->start_html( -title => "Wordcloud Generator Version 0.02", -b +gcolor => "#ffffff", -head=>$q->meta({-http_equiv => 'Pragma', -content => 'no-cache'}) +), $q->h2( "Wordcloud Generator" ), $q->hr, $q->p("Processed file:", $filename), #$q->p("Removing ", $languages{$language}, " stopwords"); #$q->p("Text column:", $textcolumn+1), #$q->p("Category column:", $catcolumn+1); process_file($infile); show_word_stat(); print $q->end_html; exit;

In reply to ModPerl::Registry error by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.