| 1 | package Venus::True; | ||
| 2 | |||
| 3 | 96 | ▶ | use 5.018; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 96 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 96 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 96 | ▶ | use Scalar::Util (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 96 | state $true = Scalar::Util::dualvar(1, "1"); | |
| 11 | |||
| 12 | use overload ( | ||
| 13 | 0 | ▶ | '!' => sub{!$true}, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 14 | 3 | ▶ | 'bool' => sub{$true}, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 15 | 96 | fallback => 1, | |
| 16 | 96 | ▶ | ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | # METHODS | ||
| 19 | |||
| 20 | sub new { | ||
| 21 | 2 | ▶ | return bless({}); |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 22 | } | ||
| 23 | |||
| 24 | sub value { | ||
| 25 | 24020 | ▶ | return $true; |
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
documented
| |||
| 26 | } | ||
| 27 | |||
| 28 | 96 | 1; | |
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | =head1 NAME | ||
| 33 | |||
| 34 | Venus::True - True Class | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | =head1 ABSTRACT | ||
| 39 | |||
| 40 | True Class for Perl 5 | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | =head1 SYNOPSIS | ||
| 45 | |||
| 46 | package main; | ||
| 47 | |||
| 48 | use Venus::True; | ||
| 49 | |||
| 50 | my $true = Venus::True->new; | ||
| 51 | |||
| 52 | # $true->value; | ||
| 53 | |||
| 54 | =cut | ||
| 55 | |||
| 56 | =head1 DESCRIPTION | ||
| 57 | |||
| 58 | This package provides the global C<true> value used in L<Venus::Boolean> and | ||
| 59 | the L<Venus/true> function. | ||
| 60 | |||
| 61 | =cut | ||
| 62 | |||
| 63 | =head1 METHODS | ||
| 64 | |||
| 65 | This package provides the following methods: | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | =head2 value | ||
| 70 | |||
| 71 | value() (boolean) | ||
| 72 | |||
| 73 | The value method returns value representing the global C<true> value. | ||
| 74 | |||
| 75 | I<Since C<1.23>> | ||
| 76 | |||
| 77 | =over 4 | ||
| 78 | |||
| 79 | =item value example 1 | ||
| 80 | |||
| 81 | # given: synopsis; | ||
| 82 | |||
| 83 | my $value = $true->value; | ||
| 84 | |||
| 85 | # 1 | ||
| 86 | |||
| 87 | =back | ||
| 88 | |||
| 89 | =cut | ||
| 90 | |||
| 91 | =head1 AUTHORS | ||
| 92 | |||
| 93 | Awncorp, C<awncorp@cpan.org> | ||
| 94 | |||
| 95 | =cut | ||
| 96 | |||
| 97 | =head1 LICENSE | ||
| 98 | |||
| 99 | Copyright (C) 2000, Awncorp, C<awncorp@cpan.org>. | ||
| 100 | |||
| 101 | This program is free software, you can redistribute it and/or modify it under | ||
| 102 | the terms of the Apache license version 2.0. | ||
| 103 | |||
| 104 | =cut | ||