Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Scriptalicious 1.14

    Download button

    No screenshots available
    Downloads: 447  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.1/5)
    16 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sam Vilain | More programs
    Perl Artistic License / FREE
    May 9th, 2008, 10:30 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Scriptalicious description

    Scriptalicious Perl module can make scripts more delicious to SysAdmins.

    Scriptalicious Perl module can make scripts more delicious to SysAdmins.

    SYNOPSIS

    use Scriptalicious
    -progname => "pu";

    our $VERSION = "1.00";

    my $url = ".";
    getopt getconf("u|url" => $url);

    run("echo", "doing something with $url");
    my $output = capture("svn", "info", $url);

    __END__

    =head1 NAME

    pu - an uncarved block of wood

    =head1 SYNOPSIS

    pu [options] arguments

    =head1 DESCRIPTION

    This script's function is to be a blank example that many
    great and simple scripts may be built upon.

    Remember, you cannot carve rotten wood.

    =head1 COMMAND LINE OPTIONS

    =over

    =item B< -h, --help >

    Display a program usage screen and exit.

    =item B< -V, --version >

    Display program version and exit.

    =item B< -v, --verbose >

    Verbose command execution, displaying things like the
    commands run, their output, etc.

    =item B< -q, --quiet >

    Suppress all normal program output; only display errors and
    warnings.

    =item B< -d, --debug >

    Display output to help someone debug this script, not the
    process going on.

    =back

    This module helps you write scripts that conform to best common practices, quickly. Just include the above as a template, and your script will accept all of the options that are included in the manual page, as well as summarising them when you use the -h option.

    (Unfortunately, it is not possible to have a `use' dependency automatically add structure to your POD yet, so you have to include the above manually. If you want your help message and Perldoc to be meaningful, that is.)

    Shortcuts are provided to help you abort or die with various error conditions; all of which print the name of the program running (taken from $0 if not passed). The motive for this is that "small" scripts tend to just get written and forgotten; so, when you have a larger system that is built out of lots of these pieces it is sometimes guesswork figuring out which script a printed message comes from!

    For instance, if your program is called with invalid arguments, you may simply call abort with a one-line message saying what the particular problem was. When the script is run, it will invite the person running the script to try to use the --help option, which gives them a summary and in turn invites them to read the Perldoc. So, it reads well in the source;

    @ARGV and abort "unexpected arguments: @ARGV";
    $file or abort "no filename supplied";

    And in the output;

    somescript: no filename supplied!
    Try `somescript --help' for a summary of options

    On the other hand, if you call barf, then it is considered to be a hard run-time failure, and the invitation to read the --help page to get usage not given. Also, the messages are much tidier than you get with die et al.

    open FOO, "

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    write scripts | compile scripts | Perl module | Scriptalicious | build | compile

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM