The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Myco::Install - support library for installation system scripts

VERSION

Release

0.01

Repository

$Revision: 1.2 $ $Date: 2006/02/17 18:22:38 $

SYNOPSIS

  #!/usr/bin/perl -w

  use strict;
  use FindBin;
  use lib "$FindBin::Bin/../lib";
  use Myco::Install qw(:all);

DESCRIPTION

This module exports function used by the installation system scripts.

EXPORTED FUNCTIONS

soft_fail($msg)

Prints out an error message and returns 0. Usually used to soft-fail a test like:

  return soft_fail("Couldn't find Postgres...") unless ...;

This saves a few lines since the alternative would be:

  unless(...) {
    print "Couldn't find Postgres...\n";
    return 0;
  }
hard_fail($msg)

Prints out an error message surrounded by lines of hash marks and exits with code 1.

ask_yesno($question, $default)

Asks the user a yes/no question. Default to $default if they just press [return]. Returns 1 for a yes answer and 0 for no.

ask_confirm($description, $ref_to_setting)

Asks the user to confirm a setting. If they enter a new value asks "are you sure." Directly updates the setting and returns when done.

A default setting of "NONE" will force the user to enter a value.

ask_choice($question, [ "opt1", "opt2" ], "default")

Asks the user to choose from a list of options. Returns the option selected.

NOTES

NONE.

AUTHOR

Sam Tregar, originally Bric::Inst

SEE ALSO

Myco::Admin