[omahaphpusers] Re: perl module howto

  • From: Jay Hannah <jay@xxxxxxxx>
  • To: omahaphpusers@xxxxxxxxxxxxx
  • Date: Sat, 21 Jun 2003 05:37:11 -0500

To keep things simple, all you really *need* is 

In a file "JaysKitchenSink.pm":
--------------------------
package JaysKitchenSink;
# Whatever sub's you want
return 1;
--------------------------

A lot of that other stuff is great if you want to learn it, but you
don't have to learn it all before you make your first module...

j



Mat Caughron wrote:
> 
> Omaha Perl list folks:
> 
> Here is a quasi-random collection of articles aimed at creating a perl 5
> module:
> 
> http://search.cpan.org/src/PVHP/ptkFAQ-0_03/PNMTYAK/p5-module-howto.html
> 
> Mat Caughron
> PHP Consulting
> 
> On Fri, 6 Jun 2003, Jay Hannah wrote:
> > r chakravarthula wrote:
> > > A Test To See If You Write Sloppy Software
> > >
> > > http://www.phpbuilder.com/columns/perdue20030310.php3?print_mode=1
> >
> > I'm a tab bigot. Tabs bad. Spaces good.
> >
> > In this example:
> >
> > ----------------
> > <?php
> >
> > function my_function () {
> >     global $feedback;
> >
> >     //code
> >     if ($error) {
> >         $feedback .= 'Could Not Perform Operation XXX';
> >         return false;
> >     } else {
> >         $feedback .= 'Operation XXX Successfully Performed';
> >         return true;
> >     }
> > }
> > ?>
> > ----------------
> >
> > What is the scope of $feedback? Is it just global anywhere in any PHP
> > code for this web hit, or is it persistant across a session?
> >
> > I assume PHP has a lot of fancy session management stuff? How do I store
> > variables into the scope of a session if I want to?
> >
> > What do explode()/implode() do? How do I look up functions in a PHP
> > environment on Linux? In Perl if I wanted to know what the function
> > implode() did, I'd type "perldoc -f implode". Is there a PHP equivalent
> > to that?
> >
> > How does job security fit into his 10 point rating system? -grin-
> >
> > Thanks from the newb,
> >
> > j
> >
> > Omaha Perl Mongers: http://omaha.pm.org
> > My favorite IE error: http://www.homestarrunner.com/systemisdown.html
> >
> >

Other related posts: