NAME

Sub::Spec::FAQ - Frequently asked questions about Sub::Spec

VERSION

version 1.0.2

QUESTIONS

General

Do I need to 'use Sub::Spec'?

No. Sub::Spec is just a specification. And your sub spec is just data structure (with some coderefs, for some clauses). There are modules that do stuffs using information from the sub spec, and you 'use' those.

Where should I put the specs?

Sub::Spec::URI::pm expects them to be in %SPEC package variables. Most other subroutine uses Sub::Spec::URI::pm to locate local specs.

I have created a spec, now what happens? What can it do for my sub?

Nothing. Just creating the spec won't magically change your sub, the spec is just a piece of data. You need one or more modules that do stuffs to your sub using the spec. Sub::Spec::Wrapper and Sub::Spec::Exporter should be the first one to see; they implement many of the basic clauses like 'args' for argument validation, 'timeout', etc. For the rest, browse Sub::Spec::* on CPAN to see a growing list of modules. Here's a partial list:

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.