Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I was musing to post a similar meditation to yours, based on a quote I saw by Einstein, and it seemed to remind me of the problem. I decided not to make the post, because I'm not an XPWhore ;-), but your node seemed like an invitation from the Tao. :-)

Theory is when you know all and nothing works. Practice is when all works and nobody knows why. (Albert Einstein)

As it relates to manipulexity and whipuptitude and religion, the modules work well in practice, but very few know why. Whearas, back in the pre-module days of Perl4, everyone could see why, but nothing worked. :-) The best example is the CGI module, try using the often seen manual Perl4 cgi readparse code

sub ReadParse { local($name, $value, $pair, $buffer, @pairs); if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # @pairs = split(/&/, $buffer); # } else { $Error_Message = "Bad request method ($ENV{'REQUEST_METHOD'}). Use PO +ST or GET"; return(0); } foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $name =~ s/\n//g; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\n//g; $value =~ s/<!--(.|\n)*-->//g; # disallow SSI $in{$name} = $value; } return; }
and compare it to
use CGI; my $query = CGI->new(); my @names = $query->param;
The second modular one almost always works, but the average programmer does not know why. The first, allows the programmer to see why, but it seldom works out in the real world anymore.

Other modules follow a similar course, try writing your own program to do mail with multiple attachments, then compare it's ease and functionality to code written using MIME::Lite. Or try writing your own html parser code.

There is no Bad Religion, in a world of religous freedom. There is just your religion and then there is the other guy's. The first step toward religous intolerance, is to start yelling the other guy has a bad religion.

It is true, some religions put you on the path to enlightenment faster, but maybe some people can't handle a quick awakening, so the slow paths to enlightenment are still needed.

Update: just to prove I'm susceptible too, see Gmail ssl pop mail stopped working. (SOLVED) , where my overlooking a simple thing like Content-type in the header, causes my manual code to fail, where the module worked!!


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Bad Religion! by zentara
in thread Bad Religion! by Logicus

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 scrutinizing the Monastery: (6)
As of 2024-04-19 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found