GSP
Quick Navigator

Search Site

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

Support
Customer Portal
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
isa(3) User Contributed Perl Documentation isa(3)

isa - isn't the isa operator

  use isa 'HTTP::Tiny';
  
  my $obj = MyApp->get_user_agent;
  
  if ( isa_HTTP_Tiny $obj ) {
    my $response = $obj->get( 'https://www.example.com/' );
    MyApp->do_something( $response );
  }

The new "isa" operator in Perl 5.32 is pretty great, but if you need to support legacy versions of Perl, you can't use it yet. This module gives you isa-like functions you can use in Perl 5.6 and above.

If you've got Type::Tiny::XS installed, you will probably find that this module is faster than the native "isa" operator!

The functions exported respect inheritance and allow classes to override their "isa" method as you'd expect.

You need to list the classes you'll be using on the "use" line.

  use isa 'HTTP::Tiny', 'MyApp::Person';

This module will replace the "::" bits with underscores, and prefix "isa_" to each name to create functions like "isa_HTTP_Tiny" and "isa_MyApp_Person".

If you'd prefer to pick your own names for the imported functions, you can use a hashref in the import:

  use isa {
    isa_Browser => 'HTTP::Tiny',
    isa_Person  => 'MyApp::Person',
  };

Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=isa>.

perlop, Scalar::Util.

<https://github.com/tobyink/p5-isa/wiki>.

Toby Inkster <tobyink@cpan.org>.

This software is copyright (c) 2020 by Toby Inkster.

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

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

2020-09-06 perl v5.42.2

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.