Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

My progress to date - Start.pm

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 "index.pl") { $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 +3.org/TR/html4/strict.dtd"> <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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found