As a follow-up to my original post, below is how the code for that same program looks now. I'm posting it here in case someone else wants to convert to modules and want to see how that would look. Thanks again for all of the advice everyone gave me. I'm still incorporating your ideas.

#!/usr/bin/perl # program name: musings.cgi # set libraries, scripts, & paths use strict; use warnings; use library::core; use library::musings; use CGI qw(:standard); my $scripts = core::get_script_variables(); my $script = $scripts->{'musing'}->{'script'}; my $top_script = $scripts->{'musings'}->{'script'}; # capture user input my $musing_id = param('musing_id') || ''; my $ref_id = param('ref_id') || ''; # check if user data is complete if($musing_id =~ m|\d|g) { print redirect($script . '?musing_id=' . $musing_id); exit; } # get general text for web page my $general_text = core::get_general_text('musings',1); my ($page_heading,$page_text,$page_image) = @{$general_text->[0]}; my $n = "\015\012"; # get web log entry my $entries = musings::get_musings_entries($ref_id); my $comments_cnt = musings::get_comments_cnt(); my $musing_stats = musings::get_reader_stats(); my $musing_cats = musings::get_musings_cats(); # alter heading if musing category selected if($ref_id) { $general_text = core::get_general_text('musings_category',1); ($page_heading,$page_text,$page_image) = @{$general_text->[0]}; $page_heading = ucfirst($musing_cats->{$ref_id}->{'ref_name'}) . $p +age_heading; } # web page core::heading($page_heading,undef,$page_text); core::panel_start(1); core::fiction(); core::miscellany(); core::musings_sites(); core::panel_end(); core::panel_start(2); core::page_heading($page_heading,$page_text,undef); # display musing entries foreach (@$entries) { my ($id, $ref_id, $log_head, $entry, $entry_date) = @$_; my $cat = lc($musing_cats->{$ref_id}->{'ref_name'}); my $cnt = $comments_cnt->{$id}->{'comments_cnt'} || 'no'; my $reader_stat = $musing_stats->{$id}->{'stat'}; $entry_date = lc($entry_date); print div({class=>'content_item'}, $n, div({class=>'musing_abstract'}, $n, h3(a({href=>$script . '?musing_id=' . $id}, $log_head) ), $n, span($entry), $n ), $n, div({class=>'item_stats'}, $n, 'posted:', $entry_date, '; readers: ', $reader_stat, '; ', $n, a({id=>'cmt_note', href=>$script . '?musing_id=' . $id}, $cnt, 'comments'), $n, 'category: ', a({id=>'cmt_note', href=>$top_script . '?ref_id=' . $ref_id}, $cat) ), $n ), $n; } core::panel_end(); core::panel_start(3); core::display_page_image($page_image); musings::get_display_category_data(); core::stats_musings(); core::panel_end(); core::footer(); exit;

-Spenser

That's Spenser, with an "s" like the detective.


In reply to Re^2: How's My Style Now? by Spenser
in thread How's My Style Now? by Spenser

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.