Vague talk is vague and not examples

You don't need to stuff everything into one file

Here are commands Stucki::Command::Ro Stucki::Command::Sham Stucki::Command::Bo, they correspond to lib/Stucki/Command/Ro.pm

package Stucki::Command::Ro ; sub run { print "Ro ro ro-sham-bo, gently down the stream\n" } 1;

They're loaded by by this module

package Stucki; use Module::Load qw/ load /; sub run { my( $shelf, $command, @rest ) = @_; my $plugin = "Stucki::Command::".$command; load $plugin; ## or dies $plugin->run( @rest ); } 1;

So from commandline you might use ./stucki ro ast some mo corn where stucki might be

#!/usr/bin/perl -- use Stucki::Frontend::CLI; Stucki::Frontend::CLI->run;

And a stucki.cgi might be

#!/usr/bin/perl -- use Stucki::Frontend::CGI; Stucki::Frontend::CGI->run;

And so on and so forth...

Some examples of organizing such an "app": Ask, P5U, CPANPLUS/ CPANPLUS::Shell::Default / CPANPLUS::Shell::Tk / CPANPLUS::Shell::Wx
App-Cme-1.002 Check or edit configuration data with Config::Model
Config-Model-2.068 Create tools to validate, migrate and edit configuration files
Config-Model-Approx-1.009 Approx configuration file editor
Config-Model-Backend-Augeas-0.118 Read and write configuration data through Augeas
Config-Model-CursesUI-1.104 Curses interface to edit config data through Config::Model
Config-Model-Itself-1.243 Model editor for Config::Model
Config-Model-LcdProc-2.042 Edit and validate LcdProc configuration file
Config-Model-OpenSsh-1.236 OpenSSH config editor
Config-Model-Tester-2.050 Test framework for Config::Model
Config-Model-TkUI-1.345 Tk GUI to edit config data through Config::Model
Config-Model-Xorg-1.106 Xorg configuration editor and validator

cpan2pkg generating native linux packages from cpan
App::CPAN2Pkg generating native linux packages from cpan
App::CPAN2Pkg::Controller controller for cpan2pkg interface
App::CPAN2Pkg::Lock Simple locking mechanism within cpan2pkg
App::CPAN2Pkg::Module poe session to drive a module packaging
App::CPAN2Pkg::Repository repository details for a given module
App::CPAN2Pkg::Types types used in the distribution
App::CPAN2Pkg::UI::Text text interface for cpan2pkg
App::CPAN2Pkg::UI::Tk main cpan2pkg window
App::CPAN2Pkg::Utils various utilities for cpan2pkg
App::CPAN2Pkg::Worker poe session to drive a module packaging
App::CPAN2Pkg::Worker::Mageia worker dedicated to Mageia distribution
App::CPAN2Pkg::Worker::RPM worker specialized in rpm distributions

math-image display some mathematical images App::MathImage math-image application module App::MathImage::Gtk2::AboutDialog App::MathImage::Wx::Main math-image wxWidgets main window App::MathImage::Tk::Main App::MathImage::Prima::Main

more examples at Re: Recommendations for adding plugin/addon capability to a program and other places


In reply to Re^2: Best way to call another perl file by Anonymous Monk
in thread Best way to call another perl file by derekstucki

Title:
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, details, 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, summary, 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.