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
MooseX::Types::Stringlike(3) User Contributed Perl Documentation MooseX::Types::Stringlike(3)

MooseX::Types::Stringlike - Moose type constraints for strings or string-like objects

version 0.003

  package Foo;
  use Moose;
  use MooseX::Types::Stringlike qw/Stringlike Stringable ArrayRefOfStringlike ArrayRefOfStringable/;

  has path => (
    is => 'ro',
    isa => Stringlike,
    coerce => 1
  );

  has stringable_object => (
    is => 'ro',
    isa => Stringable,
  );

  has paths => (
    is => 'ro',
    isa => ArrayRefOfStringlike,
    coerce => 1
  );

  has stringable_objects => (
    is => 'ro',
    isa => ArrayRefOfStringable,
  );

This module provides a more general version of the "Str" type. If coercions are enabled, it will accepts objects that overload stringification and coerces them into strings.

This module uses MooseX::Types to define the following subtypes.

"Stringlike" is a subtype of "Str". It can coerce "Stringable" objects into a string.

"Stringable" is a subtype of "Object" where the object has overloaded stringification.

"ArrayRefStringlike" is a subtype of "ArrayRef[Str]". It can coerce "ArrayRefOfStringable" objects into an arrayref of strings.

"ArrayRefOfStringable" is a subtype of "ArrayRef[Object]" where the objects have overloaded stringification.

  • Moose::Manual::Types
  • MooseX::Types
  • MooseX::Types::Moose

Thank you to Dagfinn Ilmari Mannsåker for the idea on IRC that led to this module.

Please report any bugs or feature requests through the issue tracker at <https://github.com/dagolden/MooseX-Types-Stringlike/issues>. You will be notified automatically of any progress on your issue.

This is open source software. The code repository is available for public review and contribution under the terms of the license.

<https://github.com/dagolden/MooseX-Types-Stringlike>

  git clone https://github.com/dagolden/MooseX-Types-Stringlike.git

David Golden <dagolden@cpan.org>

Karen Etheridge <ether@cpan.org>

This software is Copyright (c) 2012 by David Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
2014-04-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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