GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOOSEX::APP::PLUGIN::DEPENDS (3)

.ds Aq ’

NAME

MooseX::App::Plugin::Depends - Adds dependent options

CONTENTS

SYNOPSIS

In your base class:



 package MyApp;
 use MooseX::App qw(Depends);

 use Moose::Util::TypeConstraints;

 option FileFormat => (
   is  => ro,
   isa => enum( [qw(tsv csv xml)] ),
 );

 option WriteToFile => (
   is       => ro,
   isa      => Bool,
   depends => [qw(FileFormat)],
 );



In your script:



 #!/usr/bin/env perl

 use strict;
 use warnings;

 use MyApp;

 MyApp->new_with_options( WriteToFile => 1 );
 # generates Error
 # Option WriteToFile requires FileFormat to be defined

 MyApp->new_with_options( WriteToFile => 1, FileFormat => tsv );
 # generates no errors

 MyApp->new_with_options();
 # generates no errors



DESCRIPTION

In many real-world scenarios, sets of options are, by design, needed to be specified together. This plugin adds the ability to create dependent options to your application, options that require one or more other options for your application to perform properly.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOOSEX::APP::PLUGIN::DEPENDS (3) 2015-04-30

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.