First module!!! YAAAAY!!! :)

From: Ben Crane (crane_ba_at_yahoo.com)
Date: 12/10/03

  • Next message: Ohad Ohad: "opening files on remote computers"
    Date: Wed, 10 Dec 2003 04:39:24 -0800 (PST)
    To: beginners@perl.org
    
    

    Hi all,

    Just sat done and put together my FIRST MODULE!!!!
    I went through an edited/modifyed text::parsewords and
    after lots of testing, editing and playing around
    with...I got it to work! I didn't realize it could be
    THIS easy! I have been playing around with h2xs and
    getting really confused. If I understand this, the
    *.pm file is standalone and will work on pretty much
    any platform?? So if I write another one completely
    from scratch using this rough template it is
    effectively a perl module that I can distribute??
    Surely it can't be THAT easy??

    I'm missing something I'm sure of it! :) Any
    thoughts...

    Ben

    package Test::Test;

    use vars qw($VERSION @ISA @EXPORT);
    $VERSION = "1.00";

    require 5.000;

    use Exporter;
    @ISA = qw(Exporter);
    @EXPORT = qw(Test);
    @EXPORT_OK = qw();

    sub Test
    {
        
       my (@parsewords) = @_;
        foreach $line (@parsewords)
                {
                (@linebreakdown)=split(/,/,$line);
                }
      
      return(@linebreakdown);
        
    }
    1;

    __END__

    =head1 NAME

    Test::Test - parse text into an array

    =head1 SYNOPSIS

      use Test::Test;
      
      @teststring = Test("...sometext here delimited by a
    comma...");
      
    =head1 DESCRIPTION

    =head1 EXAMPLES

    The sample program:

     use Test::Test;
     
     @ex=Test("Q,Path,Path2,File");
     print $ex[1];

    produces:

      c:\>path

    __________________________________
    Do you Yahoo!?
    New Yahoo! Photos - easier uploading and sharing.
    http://photos.yahoo.com/


  • Next message: Ohad Ohad: "opening files on remote computers"