Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

My progress to date -

package Start; use strict; use warnings; use diagnostics; use vars qw($body_class $main_class $contents) use Cwd; use CGI qw(); use CGI::Carp qw(fatalsToBrowser); use File::Basename qw(fileparse basename dirname); use File::Spec; use Lingua::EN::Inflect qw(PL PL_N PL_V PL_ADJ NO NUM PL_eq PL_N_eq PL +_V_eq PL_ADJ_eq A AN PART_PRES ORD NUMWORDS inflect classical def_nou +n def_verb def_adj def_a def_an); print "content-type: text/html \n\n"; sub Class { my ($class) = @_; print " class=\"$class\""; } sub Heading { my ($level, $text) = @_; print "<h$level>$text</h$level>\n"; } #Written with the help of SAS_Spidey01 on #perl on freenode my $cwd = getcwd; my $rootdir = 0; sub get_rootdir { my @dirs = ('/home/lady_aleena/var/www', '/ftp/pub/www/fantasy', 'C: +/Documents and Settings/my name/My Documents/fantasy'); my @dir = grep { $_ if $cwd =~ /^$_/ } @dirs; return pop @dir; }; $rootdir = get_rootdir; #This sub written with the help of wfsp on PerlMonks and rindolf on fr +eenode #perl. sub Title { my $filename = basename($0); my $dirname = getcwd; if ($filename ne "") { $filename =~ tr/_/ /; $filename =~ s/.*\/+//; $filename =~ s/\.[^.]*\z//; $filename = ucfirst $filename; return $filename; } elsif ($dirname ne $rootdir) { $dirname =~ tr/_/ /; $dirname =~ s/.*\/+//; $dirname = ucfirst $dirname; return $dirname; } else { return "Lady Aleena's home"; } } print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w"> <html><head><title>'.Title.'</title><meta http-equiv="Content-Type" co +ntent="text/html; charset=windows-1252"><link rel="stylesheet" type=" +text/css" href="../main.css"></head><body'; if ($body_class) { print Class($body_class); } print '><div id="bar"></div><div id="main"'; #menu will go between <di +v id="bar"> and </div>. if ($main_class) { print Class($main_class); } print '>'; Heading(1,Title); #the juicy center print "</div></body></html>\n"; 1
For the juicy center, I am thinking of something simple, maybe...
print <<"CONTENTS"; $contents CONTENTS

The above did not work as expected. I am back to the drawing board for getting the juicy center code to run in that spot. I am currently looking at SelfLoader, but I am not sure that will work either.

Thoughts and suggestions gladly accepted.

Have a nice day!
Lady Aleena

In reply to Re: Seeing Perl in a new light by Lady_Aleena
in thread Seeing Perl in a new light by Lady_Aleena

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (3)
    As of 2020-07-10 19:30 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found