Problem (between my ears, no doubt): a runtime error not caught with perl -c FN:

C:\>perl -c D:\_STM_work\htmFROMstm16(sms+).pl D:\_STM_work\htmFROMstm16(sms+).pl syntax OK C:\>D:\_STM_work\htmFROMstm16(sms+).pl Global symbol "$skedhash" requires explicit package name (did you forg +et to declare "my $skedhash"?) at D:\_STM_work\htmFROMSTM16.pl line 65. BEGIN not safe after errors--compilation aborted at D:\_STM_work\htmFROMSTM16.pl line 66.

code (irrelevant lines redacted for brevity):

#! /usr/bin/perl use warnings; use strict; use feature qw'say'; use DBI; my ($link_id, $events_item, $events_type, $events_longdesc, $starttime +, $endtime, $location, $who, $note, $extra, %skedhash, $skedhash); # %skedhash &amp; $skedhash declared! my $FH_out; # get data from db # LN12 ... (irrelevant) $select->execute or die $DBI::errstr; # Create html #LN27 # ... (irrelevant) sub sked { #LN44 no warnings "uninitialized"; %skedhash = @_; say "In sub 'sked'"; say "LN50: \$link_id, \$events_item, \$events_type, \$starttime, \$endtime, \$location, \$who, \$note, \$extra: $skedhash{'li +nk_id'}, $skedhash{'events_item'}, $skedhash{'starttime'}, $skedhash{ +'endtime'}, $skedhash{'where'}, $skedhash{'who'}, \n $skedhash{'note'}, +\n $skedhash{'extra'} $skedhash{'events_longdesc'} \n"; if ($skedhash{'who'} ne '') { $skedhash{'who'} = 'Hosted by ' . $skedhash{'who'}; } print $FH_out "<tr> <td><b>$skedhash{'$events_item'} </b> <i>$skedhash{'$events_type'} </i> $skedhash +{'who'}<br> $skedhash{'starttime'} - $skedhash{'endtime'} $skedhash{'location'} </td> <td><b>$skedhash{'events_longdesc'}</b></td> </tr>"; use warnings "all"; } ### END sub sked() ######## my $sql = qq/SELECT events.link_id, events.item, events.type, events.l +ongdesc, times.starttime, times.endtime, times.location, times.who +, times.note, times.extra FROM events, times WHERE events.link_id = times.link_id ORDER BY starttime/; # LN65 my $sth = $db->prepare($sql); # LN66 $sth->execute(); while ( my ($events_link_id, $events_item, $events_type, $events_longd +esc, $starttime, $endtime, $location, $who, $note, $extra) = $sth->fetchrow_array ) { my %skedrow = ( 'events_link_id' => $events_link_id, 'events_item' => $events_item, 'events_type' => $events_type, 'events_longdesc' => $events_longdesc, 'starttime' => $starttime, 'endtime' => $endtime, 'location' => $location, 'who' => $who, 'note' => $note, 'extra' => $extra ); ....

Maybe it's too much Christmas cheer, but the headache here is too early to be a hangover.

check Ln42!
But I did!!!


In reply to runtime error not caught by compilation check??? by ww

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.