Venus/String.pm

filter: Statementstmt 100% 163 / 163 Branchbran 89.2% 25 / 28 Conditioncond 56.5% 13 / 23 MC/DCmcdc 16.6% 2 / 12 Subroutinesub 100% 46 / 46 Podpod 81.0% 30 / 37 totaltotal 90.2% 279 / 309 CC 26 SCAR 10.3
CC
26
Cov
94%
substr
8.9
contains
5.1
split
5.0
CRAP 2.8
« Venus/Error.pm ↑ Summary Venus/Meta.pm »
1 package Venus::String;
2  
3 14 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 14 ▶use Venus::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 14 base 'Venus::Kind::Value';
11  
12 use overload (
13 1 ▶ '.' => sub{$_[0]->value . "$_[1]"},
Subroutine __ANON__: called CC=1 SCAR=0.0
14 2 ▶ 'eq' => sub{$_[0]->value eq "$_[1]"},
Subroutine __ANON__: called CC=1 SCAR=0.0
15 2 ▶ 'ne' => sub{$_[0]->value ne "$_[1]"},
Subroutine __ANON__: called CC=1 SCAR=0.0
16 1 ▶ 'qr' => sub{qr/@{[quotemeta($_[0]->value)]}/},
Subroutine __ANON__: called CC=1 SCAR=0.0
17 14 fallback => 1,
18 14 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 # METHODS
21  
22 sub append {
23 1 ▶ my ($self, @args) = @_;
Subroutine append: called CC=1 SCAR=0.0
Pod documented
24  
25 1 return $self->append_with(' ', @args);
26 }
27  
28 sub append_with {
29 2 ▶ my ($self, $delimiter, @args) = @_;
Subroutine append_with: called CC=2 SCAR=7.1
Pod undocumented
30  
31 2 my $data = $self->get;
32  
33 2 ▶ return CORE::join($delimiter // '', $data, @args);
Condition50%1/2
$delimiter // ""
l!l
20
MC/DC0%0/1
$delimiter // ""
$delimiter
Truth table50%1/2
A
A= $delimiter
Aresult
11
00
34 }
35  
36 sub camelcase {
37 1 ▶ my ($self) = @_;
Subroutine camelcase: called CC=1 SCAR=0.0
Pod documented
38  
39 1 my $data = $self->get;
40  
41 1 my $result = CORE::ucfirst(CORE::lc($data));
42  
43 1 $result =~ s/[^a-zA-Z0-9]+([a-z])/\U$1/g;
44 1 $result =~ s/[^a-zA-Z0-9]+//g;
45  
46 1 return CORE::lcfirst($result);
47 }
48  
49 sub chomp {
50 2 ▶ my ($self) = @_;
Subroutine chomp: called CC=1 SCAR=0.0
Pod documented
51  
52 2 my $data = $self->get;
53  
54 2 CORE::chomp($data);
55  
56 2 return $data;
57 }
58  
59 sub chop {
60 1 ▶ my ($self) = @_;
Subroutine chop: called CC=1 SCAR=0.0
Pod documented
61  
62 1 my $data = $self->get;
63  
64 1 CORE::chop($data);
65  
66 1 return $data;
67 }
68  
69 sub comparer {
70 270 ▶ my ($self) = @_;
Subroutine comparer: called CC=2 SCAR=6.9
Pod undocumented
71  
72 270 my $data = $self->get;
73  
74 270 require Scalar::Util;
75  
76 270 ▶ return Scalar::Util::looks_like_number($data) ? 'numified' : 'stringified';
Branch: 1 branch
BranchTrueFalseTotal
&Scalar::Util::looks_like_number($data) ? : 5 265 270
77 }
78  
79 sub concat {
80 1 ▶ my ($self, @args) = @_;
Subroutine concat: called CC=1 SCAR=0.0
Pod documented
81  
82 1 my $data = $self->get;
83  
84 1 return CORE::join('', $data, @args);
85 }
86  
87 sub contains {
88 3 ▶ my ($self, $pattern) = @_;
Subroutine contains: called CC=5 SCAR=16.2
Pod documented
89  
90 3 my $data = $self->get;
91  
92 3 ▶ return 0 unless CORE::defined($pattern);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $pattern 0 3 3
93  
94 3 my $regexp = UNIVERSAL::isa($pattern, 'Regexp');
95  
96 3 ▶ return CORE::index($data, $pattern) < 0 ? 0 : 1 if !$regexp;
Branch: 2 branches
BranchTrueFalseTotal
unless $regexp 2 1 3
CORE::index($data, $pattern) == -1 ? : 1 1 2
97  
98 1 ▶ return ($data =~ $pattern) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$data =~ /$pattern/u ? : 1 0 1
99 }
100  
101 sub default {
102 183 ▶ return '';
Subroutine default: called CC=1 SCAR=0.0
Pod documented
103 }
104  
105 sub hex {
106 1 ▶ my ($self) = @_;
Subroutine hex: called CC=1 SCAR=0.0
Pod documented
107  
108 1 my $data = $self->get;
109  
110 1 return CORE::hex($data);
111 }
112  
113 sub index {
114 3 ▶ my ($self, $substr, $start) = @_;
Subroutine index: called CC=2 SCAR=6.9
Pod documented
115  
116 3 my $data = $self->get;
117  
118 3 ▶ return CORE::index($data, $substr) if not(CORE::defined($start));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $start 2 1 3
119 1 return CORE::index($data, $substr, $start);
120 }
121  
122 sub kebabcase {
123 1 ▶ my ($self) = @_;
Subroutine kebabcase: called CC=1 SCAR=0.0
Pod documented
124  
125 1 my $data = $self->get;
126 1 my $re = qr/[\W_]+/;
127  
128 1 $data =~ s/$re/-/g;
129 1 $data =~ s/^$re|$re$//g;
130  
131 1 return $data;
132 }
133  
134 sub lc {
135 1 ▶ my ($self) = @_;
Subroutine lc: called CC=1 SCAR=0.0
Pod documented
136  
137 1 my $data = $self->get;
138  
139 1 return CORE::lc($data);
140 }
141  
142 sub lcfirst {
143 1 ▶ my ($self) = @_;
Subroutine lcfirst: called CC=1 SCAR=0.0
Pod documented
144  
145 1 my $data = $self->get;
146  
147 1 return CORE::lcfirst($data);
148 }
149  
150 sub length {
151 1 ▶ my ($self) = @_;
Subroutine length: called CC=1 SCAR=0.0
Pod documented
152  
153 1 my $data = $self->get;
154  
155 1 return CORE::length($data);
156 }
157  
158 sub lines {
159 2 ▶ my ($self) = @_;
Subroutine lines: called CC=1 SCAR=0.0
Pod documented
160  
161 2 my $data = $self->get;
162  
163 2 return [CORE::split(/[\n\r]+/, $data)];
164 }
165  
166 sub lowercase {
167 1 ▶ my ($self) = @_;
Subroutine lowercase: called CC=1 SCAR=0.0
Pod documented
168  
169 1 my $data = $self->get;
170  
171 1 return CORE::lc($data);
172 }
173  
174 sub numified {
175 76 ▶ my ($self) = @_;
Subroutine numified: called CC=2 SCAR=6.9
Pod documented
176  
177 76 my $data = $self->get;
178  
179 76 ▶ return $self->comparer eq 'numified' ? (0 + $data) : $self->SUPER::numified();
Branch: 1 branch
BranchTrueFalseTotal
$self->comparer eq 'numified' ? : 5 71 76
180 }
181  
182 sub pascalcase {
183 1 ▶ my ($self) = @_;
Subroutine pascalcase: called CC=1 SCAR=0.0
Pod undocumented
184  
185 1 my $data = $self->get;
186  
187 1 my $result = CORE::ucfirst(CORE::lc($data));
188  
189 1 $result =~ s/[^a-zA-Z0-9]+([a-z])/\U$1/g;
190 1 $result =~ s/[^a-zA-Z0-9]+//g;
191  
192 1 return $result;
193 }
194  
195 sub prepend {
196 1 ▶ my ($self, @args) = @_;
Subroutine prepend: called CC=1 SCAR=0.0
Pod undocumented
197  
198 1 return $self->prepend_with(' ', @args);
199 }
200  
201 sub prepend_with {
202 2 ▶ my ($self, $delimiter, @args) = @_;
Subroutine prepend_with: called CC=2 SCAR=7.1
Pod undocumented
203  
204 2 my $data = $self->get;
205  
206 2 ▶ return CORE::join($delimiter // '', @args, $data);
Condition50%1/2
$delimiter // ""
l!l
20
MC/DC0%0/1
$delimiter // ""
$delimiter
Truth table50%1/2
A
A= $delimiter
Aresult
11
00
207 }
208  
209 sub repeat {
210 2 ▶ my ($self, $count, $delimiter) = @_;
Subroutine repeat: called CC=3 SCAR=11.1
Pod undocumented
211  
212 2 my $data = $self->get;
213  
214 2 ▶ return CORE::join($delimiter // '', CORE::map $data, 1..($count || 1));
Condition75%3/4
$delimiter // ""
l!l
11
$count || 1
l!l
20
MC/DC100%1/1
$delimiter // ""
$delimiter
MC/DC0%0/1
$count || 1
$count
Truth table100%2/2
A
A= $delimiter
Aresult
11
00
Truth table50%1/2
A
A= $count
Aresult
11
00
215 }
216  
217 sub render {
218 1 ▶ my ($self, $tokens) = @_;
Subroutine render: called CC=3 SCAR=11.0
Pod documented
219  
220 1 my $data = $self->get;
221  
222 1 ▶ $tokens ||= {};
Condition50%1/2
$tokens ||= {}
l!l
10
MC/DC0%0/1
$tokens ||= {}
$tokens
Truth table50%1/2
A
A= $tokens
Aresult
11
00
223  
224 1 ▶ while (my($key, $value) = each(%$tokens)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$tokens) 1 1 2
225 1 my $token = quotemeta $key;
226  
227 1 $data =~ s/\{\{\s*$token\s*\}\}/$value/g;
228 }
229  
230 1 return $data;
231 }
232  
233 sub replace {
234 1 ▶ my ($self, $regexp, $replace, $flags) = @_;
Subroutine replace: called CC=1 SCAR=0.0
Pod documented
235  
236 1 require Venus::Regexp;
237  
238 1 return Venus::Regexp->new($regexp)->replace($self->get, $replace, $flags);
239 }
240  
241 sub reverse {
242 1 ▶ my ($self) = @_;
Subroutine reverse: called CC=1 SCAR=0.0
Pod documented
243  
244 1 my $data = $self->get;
245  
246 1 return scalar(CORE::reverse($data));
247 }
248  
249 sub rindex {
250 3 ▶ my ($self, $substr, $start) = @_;
Subroutine rindex: called CC=2 SCAR=6.9
Pod documented
251  
252 3 my $data = $self->get;
253  
254 3 ▶ return CORE::rindex($data, $substr) if not(CORE::defined($start));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $start 2 1 3
255 1 return CORE::rindex($data, $substr, $start);
256 }
257  
258 sub search {
259 1 ▶ my ($self, $regexp) = @_;
Subroutine search: called CC=1 SCAR=0.0
Pod documented
260  
261 1 require Venus::Regexp;
262  
263 1 return Venus::Regexp->new($regexp)->search($self->get);
264 }
265  
266 sub snakecase {
267 1 ▶ my ($self) = @_;
Subroutine snakecase: called CC=1 SCAR=0.0
Pod documented
268  
269 1 my $data = $self->get;
270 1 my $re = qr/[\W_]+/;
271  
272 1 $data =~ s/$re/_/g;
273 1 $data =~ s/^$re|$re$//g;
274  
275 1 return $data;
276 }
277  
278 sub split {
279 4 ▶ my ($self, $pattern, $limit) = @_;
Subroutine split: called CC=5 SCAR=16.2
Pod documented
280  
281 4 my $data = $self->get;
282  
283 4 ▶ $pattern //= '';
Condition50%1/2
$pattern //= ""
l!l
40
MC/DC0%0/1
$pattern //= ""
$pattern
Truth table50%1/2
A
A= $pattern
Aresult
11
00
284  
285 4 my $regexp = UNIVERSAL::isa($pattern, 'Regexp');
286  
287 4 ▶ $pattern = quotemeta($pattern) if $pattern and !$regexp;
Branch: 1 branch
BranchTrueFalseTotal
if $pattern and not $regexp 3 1 4
Condition66%2/3
$pattern and not $regexp
!ll&&!rl&&r
013
MC/DC50%1/2
$pattern and not $regexp
$pattern not $regexp
Truth table66%2/3
A and not(B)
A= $patternB= not $regexp
ABresult
0X0
100
111
288  
289 4 ▶ return [CORE::split(/$pattern/, $data)] if !CORE::defined($limit);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $limit 3 1 4
290 1 return [CORE::split(/$pattern/, $data, $limit)];
291 }
292  
293 sub strip {
294 1 ▶ my ($self) = @_;
Subroutine strip: called CC=1 SCAR=0.0
Pod documented
295  
296 1 my $data = $self->get;
297  
298 1 $data =~ s/\s{2,}/ /g;
299  
300 1 return $data;
301 }
302  
303 sub substr {
304 4 ▶ my ($self, $offset, $length, $replace) = @_;
Subroutine substr: called CC=8 SCAR=21.8
Pod undocumented
305  
306 4 my $data = $self->get;
307  
308 4 ▶ if (CORE::defined($replace)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $replace) { } 2 2 4
309 2 ▶ my $result = CORE::substr($data, $offset // 0, $length // 0, $replace);
Condition50%2/4
$offset // 0
l!l
20
$length // 0
l!l
20
MC/DC0%0/1
$offset // 0
$offset
MC/DC0%0/1
$length // 0
$length
Truth table50%1/2
A
A= $offset
Aresult
11
00
Truth table50%1/2
A
A= $length
Aresult
11
00
310 2 ▶ return wantarray ? ($result, $data) : $data;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 1 1 2
311 }
312 else {
313 2 ▶ my $result = CORE::substr($data, $offset // 0, $length // 0);
Condition50%2/4
$offset // 0
l!l
20
$length // 0
l!l
20
MC/DC0%0/1
$offset // 0
$offset
MC/DC0%0/1
$length // 0
$length
Truth table50%1/2
A
A= $offset
Aresult
11
00
Truth table50%1/2
A
A= $length
Aresult
11
00
314 2 ▶ return wantarray ? ($result, $data) : $result;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 2 2
315 }
316 }
317  
318 sub titlecase {
319 2 ▶ my ($self) = @_;
Subroutine titlecase: called CC=1 SCAR=0.0
Pod documented
320  
321 2 my $data = $self->get;
322  
323 2 $data =~ s/\b(\w)/\U$1/g;
324  
325 2 return $data;
326 }
327  
328 sub trim {
329 1 ▶ my ($self) = @_;
Subroutine trim: called CC=1 SCAR=0.0
Pod documented
330  
331 1 my $data = $self->get;
332  
333 1 $data =~ s/^\s+|\s+$//g;
334  
335 1 return $data;
336 }
337  
338 sub uc {
339 1 ▶ my ($self) = @_;
Subroutine uc: called CC=1 SCAR=0.0
Pod documented
340  
341 1 my $data = $self->get;
342  
343 1 return CORE::uc($data);
344 }
345  
346 sub ucfirst {
347 1 ▶ my ($self) = @_;
Subroutine ucfirst: called CC=1 SCAR=0.0
Pod documented
348  
349 1 my $data = $self->get;
350  
351 1 return CORE::ucfirst($data);
352 }
353  
354 sub uppercase {
355 1 ▶ my ($self) = @_;
Subroutine uppercase: called CC=1 SCAR=0.0
Pod documented
356  
357 1 my $data = $self->get;
358  
359 1 return CORE::uc($data);
360 }
361  
362 sub words {
363 1 ▶ my ($self) = @_;
Subroutine words: called CC=1 SCAR=0.0
Pod documented
364  
365 1 my $data = $self->get;
366  
367 1 return [CORE::split(/\s+/, $data)];
368 }
369  
370 14 1;
371  
372  
373  
374 =head1 NAME
375  
376 Venus::String - String Class
377  
378 =cut
379  
380 =head1 ABSTRACT
381  
382 String Class for Perl 5
383  
384 =cut
385  
386 =head1 SYNOPSIS
387  
388 package main;
389  
390 use Venus::String;
391  
392 my $string = Venus::String->new('hello world');
393  
394 # $string->camelcase;
395  
396 =cut
397  
398 =head1 DESCRIPTION
399  
400 This package provides methods for manipulating string data.
401  
402 =cut
403  
404 =head1 INHERITS
405  
406 This package inherits behaviors from:
407  
408 L<Venus::Kind::Value>
409  
410 =cut
411  
412 =head1 METHODS
413  
414 This package provides the following methods:
415  
416 =cut
417  
418 =head2 append
419  
420 append(Str @parts) (Str)
421  
422 The append method appends arugments to the string using spaces.
423  
424 I<Since C<0.01>>
425  
426 =over 4
427  
428 =item append example 1
429  
430 # given: synopsis;
431  
432 my $append = $string->append('welcome');
433  
434 # "hello world welcome"
435  
436 =back
437  
438 =cut
439  
440 =head2 camelcase
441  
442 camelcase() (Str)
443  
444 The camelcase method converts the string to camelcase.
445  
446 I<Since C<0.01>>
447  
448 =over 4
449  
450 =item camelcase example 1
451  
452 # given: synopsis;
453  
454 my $camelcase = $string->camelcase;
455  
456 # "helloWorld"
457  
458 =back
459  
460 =cut
461  
462 =head2 cast
463  
464 cast(Str $kind) (Object | Undef)
465  
466 The cast method converts L<"value"|Venus::Kind::Value> objects between
467 different I<"value"> object types, based on the name of the type provided. This
468 method will return C<undef> if the invocant is not a L<Venus::Kind::Value>.
469  
470 I<Since C<0.08>>
471  
472 =over 4
473  
474 =item cast example 1
475  
476 package main;
477  
478 use Venus::String;
479  
480 my $string = Venus::String->new;
481  
482 my $cast = $string->cast('array');
483  
484 # bless({ value => [""] }, "Venus::Array")
485  
486 =back
487  
488 =over 4
489  
490 =item cast example 2
491  
492 package main;
493  
494 use Venus::String;
495  
496 my $string = Venus::String->new;
497  
498 my $cast = $string->cast('boolean');
499  
500 # bless({ value => 0 }, "Venus::Boolean")
501  
502 =back
503  
504 =over 4
505  
506 =item cast example 3
507  
508 package main;
509  
510 use Venus::String;
511  
512 my $string = Venus::String->new;
513  
514 my $cast = $string->cast('code');
515  
516 # bless({ value => sub { ... } }, "Venus::Code")
517  
518 =back
519  
520 =over 4
521  
522 =item cast example 4
523  
524 package main;
525  
526 use Venus::String;
527  
528 my $string = Venus::String->new;
529  
530 my $cast = $string->cast('float');
531  
532 # bless({ value => "0.0" }, "Venus::Float")
533  
534 =back
535  
536 =over 4
537  
538 =item cast example 5
539  
540 package main;
541  
542 use Venus::String;
543  
544 my $string = Venus::String->new;
545  
546 my $cast = $string->cast('hash');
547  
548 # bless({ value => { "" => "" } }, "Venus::Hash")
549  
550 =back
551  
552 =over 4
553  
554 =item cast example 6
555  
556 package main;
557  
558 use Venus::String;
559  
560 my $string = Venus::String->new;
561  
562 my $cast = $string->cast('number');
563  
564 # bless({ value => 0 }, "Venus::Float")
565  
566 =back
567  
568 =over 4
569  
570 =item cast example 7
571  
572 package main;
573  
574 use Venus::String;
575  
576 my $string = Venus::String->new;
577  
578 my $cast = $string->cast('regexp');
579  
580 # bless({ value => qr/(?^u:)/ }, "Venus::Regexp")
581  
582 =back
583  
584 =over 4
585  
586 =item cast example 8
587  
588 package main;
589  
590 use Venus::String;
591  
592 my $string = Venus::String->new;
593  
594 my $cast = $string->cast('scalar');
595  
596 # bless({ value => \"" }, "Venus::Scalar")
597  
598 =back
599  
600 =over 4
601  
602 =item cast example 9
603  
604 package main;
605  
606 use Venus::String;
607  
608 my $string = Venus::String->new;
609  
610 my $cast = $string->cast('string');
611  
612 # bless({ value => "" }, "Venus::String")
613  
614 =back
615  
616 =over 4
617  
618 =item cast example 10
619  
620 package main;
621  
622 use Venus::String;
623  
624 my $string = Venus::String->new;
625  
626 my $cast = $string->cast('undef');
627  
628 # bless({ value => undef }, "Venus::Undef")
629  
630 =back
631  
632 =cut
633  
634 =head2 chomp
635  
636 chomp() (Str)
637  
638 The chomp method removes the newline (or the current value of $/) from the end
639 of the string.
640  
641 I<Since C<0.01>>
642  
643 =over 4
644  
645 =item chomp example 1
646  
647 package main;
648  
649 use Venus::String;
650  
651 my $string = Venus::String->new("name, age, dob, email\n");
652  
653 my $chomp = $string->chomp;
654  
655 # "name, age, dob, email"
656  
657 =back
658  
659 =over 4
660  
661 =item chomp example 2
662  
663 package main;
664  
665 use Venus::String;
666  
667 my $string = Venus::String->new("name, age, dob, email\n\n");
668  
669 my $chomp = $string->chomp;
670  
671 # "name, age, dob, email\n"
672  
673 =back
674  
675 =cut
676  
677 =head2 chop
678  
679 chop() (Str)
680  
681 The chop method removes and returns the last character of the string.
682  
683 I<Since C<0.01>>
684  
685 =over 4
686  
687 =item chop example 1
688  
689 package main;
690  
691 use Venus::String;
692  
693 my $string = Venus::String->new("this is just a test.");
694  
695 my $chop = $string->chop;
696  
697 # "this is just a test"
698  
699 =back
700  
701 =cut
702  
703 =head2 concat
704  
705 concat(Str @parts) (Str)
706  
707 The concat method returns the string with the argument list appended to it.
708  
709 I<Since C<0.01>>
710  
711 =over 4
712  
713 =item concat example 1
714  
715 package main;
716  
717 use Venus::String;
718  
719 my $string = Venus::String->new('ABC');
720  
721 my $concat = $string->concat('DEF', 'GHI');
722  
723 # "ABCDEFGHI"
724  
725 =back
726  
727 =cut
728  
729 =head2 contains
730  
731 contains(Str $expr) (Bool)
732  
733 The contains method searches the string for a substring or expression returns
734 true or false if found.
735  
736 I<Since C<0.01>>
737  
738 =over 4
739  
740 =item contains example 1
741  
742 package main;
743  
744 use Venus::String;
745  
746 my $string = Venus::String->new('Nullam ultrices placerat.');
747  
748 my $contains = $string->contains('trices');
749  
750 # 1
751  
752 =back
753  
754 =over 4
755  
756 =item contains example 2
757  
758 package main;
759  
760 use Venus::String;
761  
762 my $string = Venus::String->new('Nullam ultrices placerat.');
763  
764 my $contains = $string->contains('itrices');
765  
766 # 0
767  
768 =back
769  
770 =over 4
771  
772 =item contains example 3
773  
774 package main;
775  
776 use Venus::String;
777  
778 my $string = Venus::String->new('Nullam ultrices placerat.');
779  
780 my $contains = $string->contains(qr/trices/);
781  
782 # 1
783  
784 =back
785  
786 =cut
787  
788 =head2 default
789  
790 default() (Str)
791  
792 The default method returns the default value, i.e. C<''>.
793  
794 I<Since C<0.01>>
795  
796 =over 4
797  
798 =item default example 1
799  
800 # given: synopsis;
801  
802 my $default = $string->default;
803  
804 # ""
805  
806 =back
807  
808 =cut
809  
810 =head2 eq
811  
812 eq(Any $arg) (Bool)
813  
814 The eq method performs an I<"equals"> operation using the argument provided.
815  
816 I<Since C<0.08>>
817  
818 =over 4
819  
820 =item eq example 1
821  
822 package main;
823  
824 use Venus::Array;
825 use Venus::String;
826  
827 my $lvalue = Venus::String->new;
828 my $rvalue = Venus::Array->new;
829  
830 my $result = $lvalue->eq($rvalue);
831  
832 # 0
833  
834 =back
835  
836 =over 4
837  
838 =item eq example 2
839  
840 package main;
841  
842 use Venus::Code;
843 use Venus::String;
844  
845 my $lvalue = Venus::String->new;
846 my $rvalue = Venus::Code->new;
847  
848 my $result = $lvalue->eq($rvalue);
849  
850 # 0
851  
852 =back
853  
854 =over 4
855  
856 =item eq example 3
857  
858 package main;
859  
860 use Venus::Float;
861 use Venus::String;
862  
863 my $lvalue = Venus::String->new;
864 my $rvalue = Venus::Float->new;
865  
866 my $result = $lvalue->eq($rvalue);
867  
868 # 0
869  
870 =back
871  
872 =over 4
873  
874 =item eq example 4
875  
876 package main;
877  
878 use Venus::Hash;
879 use Venus::String;
880  
881 my $lvalue = Venus::String->new;
882 my $rvalue = Venus::Hash->new;
883  
884 my $result = $lvalue->eq($rvalue);
885  
886 # 0
887  
888 =back
889  
890 =over 4
891  
892 =item eq example 5
893  
894 package main;
895  
896 use Venus::Number;
897 use Venus::String;
898  
899 my $lvalue = Venus::String->new;
900 my $rvalue = Venus::Number->new;
901  
902 my $result = $lvalue->eq($rvalue);
903  
904 # 0
905  
906 =back
907  
908 =over 4
909  
910 =item eq example 6
911  
912 package main;
913  
914 use Venus::Regexp;
915 use Venus::String;
916  
917 my $lvalue = Venus::String->new;
918 my $rvalue = Venus::Regexp->new;
919  
920 my $result = $lvalue->eq($rvalue);
921  
922 # 0
923  
924 =back
925  
926 =over 4
927  
928 =item eq example 7
929  
930 package main;
931  
932 use Venus::Scalar;
933 use Venus::String;
934  
935 my $lvalue = Venus::String->new;
936 my $rvalue = Venus::Scalar->new;
937  
938 my $result = $lvalue->eq($rvalue);
939  
940 # 0
941  
942 =back
943  
944 =over 4
945  
946 =item eq example 8
947  
948 package main;
949  
950 use Venus::String;
951  
952 my $lvalue = Venus::String->new;
953 my $rvalue = Venus::String->new;
954  
955 my $result = $lvalue->eq($rvalue);
956  
957 # 1
958  
959 =back
960  
961 =over 4
962  
963 =item eq example 9
964  
965 package main;
966  
967 use Venus::String;
968 use Venus::Undef;
969  
970 my $lvalue = Venus::String->new;
971 my $rvalue = Venus::Undef->new;
972  
973 my $result = $lvalue->eq($rvalue);
974  
975 # 1
976  
977 =back
978  
979 =cut
980  
981 =head2 ge
982  
983 ge(Any $arg) (Bool)
984  
985 The ge method performs a I<"greater-than-or-equal-to"> operation using the
986 argument provided.
987  
988 I<Since C<0.08>>
989  
990 =over 4
991  
992 =item ge example 1
993  
994 package main;
995  
996 use Venus::Array;
997 use Venus::String;
998  
999 my $lvalue = Venus::String->new;
1000 my $rvalue = Venus::Array->new;
1001  
1002 my $result = $lvalue->ge($rvalue);
1003  
1004 # 0
1005  
1006 =back
1007  
1008 =over 4
1009  
1010 =item ge example 2
1011  
1012 package main;
1013  
1014 use Venus::Code;
1015 use Venus::String;
1016  
1017 my $lvalue = Venus::String->new;
1018 my $rvalue = Venus::Code->new;
1019  
1020 my $result = $lvalue->ge($rvalue);
1021  
1022 # 0
1023  
1024 =back
1025  
1026 =over 4
1027  
1028 =item ge example 3
1029  
1030 package main;
1031  
1032 use Venus::Float;
1033 use Venus::String;
1034  
1035 my $lvalue = Venus::String->new;
1036 my $rvalue = Venus::Float->new;
1037  
1038 my $result = $lvalue->ge($rvalue);
1039  
1040 # 0
1041  
1042 =back
1043  
1044 =over 4
1045  
1046 =item ge example 4
1047  
1048 package main;
1049  
1050 use Venus::Hash;
1051 use Venus::String;
1052  
1053 my $lvalue = Venus::String->new;
1054 my $rvalue = Venus::Hash->new;
1055  
1056 my $result = $lvalue->ge($rvalue);
1057  
1058 # 0
1059  
1060 =back
1061  
1062 =over 4
1063  
1064 =item ge example 5
1065  
1066 package main;
1067  
1068 use Venus::Number;
1069 use Venus::String;
1070  
1071 my $lvalue = Venus::String->new;
1072 my $rvalue = Venus::Number->new;
1073  
1074 my $result = $lvalue->ge($rvalue);
1075  
1076 # 0
1077  
1078 =back
1079  
1080 =over 4
1081  
1082 =item ge example 6
1083  
1084 package main;
1085  
1086 use Venus::Regexp;
1087 use Venus::String;
1088  
1089 my $lvalue = Venus::String->new;
1090 my $rvalue = Venus::Regexp->new;
1091  
1092 my $result = $lvalue->ge($rvalue);
1093  
1094 # 0
1095  
1096 =back
1097  
1098 =over 4
1099  
1100 =item ge example 7
1101  
1102 package main;
1103  
1104 use Venus::Scalar;
1105 use Venus::String;
1106  
1107 my $lvalue = Venus::String->new;
1108 my $rvalue = Venus::Scalar->new;
1109  
1110 my $result = $lvalue->ge($rvalue);
1111  
1112 # 0
1113  
1114 =back
1115  
1116 =over 4
1117  
1118 =item ge example 8
1119  
1120 package main;
1121  
1122 use Venus::String;
1123  
1124 my $lvalue = Venus::String->new;
1125 my $rvalue = Venus::String->new;
1126  
1127 my $result = $lvalue->ge($rvalue);
1128  
1129 # 1
1130  
1131 =back
1132  
1133 =over 4
1134  
1135 =item ge example 9
1136  
1137 package main;
1138  
1139 use Venus::String;
1140 use Venus::Undef;
1141  
1142 my $lvalue = Venus::String->new;
1143 my $rvalue = Venus::Undef->new;
1144  
1145 my $result = $lvalue->ge($rvalue);
1146  
1147 # 1
1148  
1149 =back
1150  
1151 =cut
1152  
1153 =head2 gele
1154  
1155 gele(Any $arg1, Any $arg2) (Bool)
1156  
1157 The gele method performs a I<"greater-than-or-equal-to"> operation on the 1st
1158 argument, and I<"lesser-than-or-equal-to"> operation on the 2nd argument.
1159  
1160 I<Since C<0.08>>
1161  
1162 =over 4
1163  
1164 =item gele example 1
1165  
1166 package main;
1167  
1168 use Venus::Array;
1169 use Venus::String;
1170  
1171 my $lvalue = Venus::String->new;
1172 my $rvalue = Venus::Array->new;
1173  
1174 my $result = $lvalue->gele($rvalue);
1175  
1176 # 0
1177  
1178 =back
1179  
1180 =over 4
1181  
1182 =item gele example 2
1183  
1184 package main;
1185  
1186 use Venus::Code;
1187 use Venus::String;
1188  
1189 my $lvalue = Venus::String->new;
1190 my $rvalue = Venus::Code->new;
1191  
1192 my $result = $lvalue->gele($rvalue);
1193  
1194 # 0
1195  
1196 =back
1197  
1198 =over 4
1199  
1200 =item gele example 3
1201  
1202 package main;
1203  
1204 use Venus::Float;
1205 use Venus::String;
1206  
1207 my $lvalue = Venus::String->new;
1208 my $rvalue = Venus::Float->new;
1209  
1210 my $result = $lvalue->gele($rvalue);
1211  
1212 # 0
1213  
1214 =back
1215  
1216 =over 4
1217  
1218 =item gele example 4
1219  
1220 package main;
1221  
1222 use Venus::Hash;
1223 use Venus::String;
1224  
1225 my $lvalue = Venus::String->new;
1226 my $rvalue = Venus::Hash->new;
1227  
1228 my $result = $lvalue->gele($rvalue);
1229  
1230 # 0
1231  
1232 =back
1233  
1234 =over 4
1235  
1236 =item gele example 5
1237  
1238 package main;
1239  
1240 use Venus::Number;
1241 use Venus::String;
1242  
1243 my $lvalue = Venus::String->new;
1244 my $rvalue = Venus::Number->new;
1245  
1246 my $result = $lvalue->gele($rvalue);
1247  
1248 # 0
1249  
1250 =back
1251  
1252 =over 4
1253  
1254 =item gele example 6
1255  
1256 package main;
1257  
1258 use Venus::Regexp;
1259 use Venus::String;
1260  
1261 my $lvalue = Venus::String->new;
1262 my $rvalue = Venus::Regexp->new;
1263  
1264 my $result = $lvalue->gele($rvalue);
1265  
1266 # 0
1267  
1268 =back
1269  
1270 =over 4
1271  
1272 =item gele example 7
1273  
1274 package main;
1275  
1276 use Venus::Scalar;
1277 use Venus::String;
1278  
1279 my $lvalue = Venus::String->new;
1280 my $rvalue = Venus::Scalar->new;
1281  
1282 my $result = $lvalue->gele($rvalue);
1283  
1284 # 0
1285  
1286 =back
1287  
1288 =over 4
1289  
1290 =item gele example 8
1291  
1292 package main;
1293  
1294 use Venus::String;
1295  
1296 my $lvalue = Venus::String->new;
1297 my $rvalue = Venus::String->new;
1298  
1299 my $result = $lvalue->gele($rvalue);
1300  
1301 # 1
1302  
1303 =back
1304  
1305 =over 4
1306  
1307 =item gele example 9
1308  
1309 package main;
1310  
1311 use Venus::String;
1312 use Venus::Undef;
1313  
1314 my $lvalue = Venus::String->new;
1315 my $rvalue = Venus::Undef->new;
1316  
1317 my $result = $lvalue->gele($rvalue);
1318  
1319 # 1
1320  
1321 =back
1322  
1323 =cut
1324  
1325 =head2 gt
1326  
1327 gt(Any $arg) (Bool)
1328  
1329 The gt method performs a I<"greater-than"> operation using the argument provided.
1330  
1331 I<Since C<0.08>>
1332  
1333 =over 4
1334  
1335 =item gt example 1
1336  
1337 package main;
1338  
1339 use Venus::Array;
1340 use Venus::String;
1341  
1342 my $lvalue = Venus::String->new;
1343 my $rvalue = Venus::Array->new;
1344  
1345 my $result = $lvalue->gt($rvalue);
1346  
1347 # 0
1348  
1349 =back
1350  
1351 =over 4
1352  
1353 =item gt example 2
1354  
1355 package main;
1356  
1357 use Venus::Code;
1358 use Venus::String;
1359  
1360 my $lvalue = Venus::String->new;
1361 my $rvalue = Venus::Code->new;
1362  
1363 my $result = $lvalue->gt($rvalue);
1364  
1365 # 0
1366  
1367 =back
1368  
1369 =over 4
1370  
1371 =item gt example 3
1372  
1373 package main;
1374  
1375 use Venus::Float;
1376 use Venus::String;
1377  
1378 my $lvalue = Venus::String->new;
1379 my $rvalue = Venus::Float->new;
1380  
1381 my $result = $lvalue->gt($rvalue);
1382  
1383 # 0
1384  
1385 =back
1386  
1387 =over 4
1388  
1389 =item gt example 4
1390  
1391 package main;
1392  
1393 use Venus::Hash;
1394 use Venus::String;
1395  
1396 my $lvalue = Venus::String->new;
1397 my $rvalue = Venus::Hash->new;
1398  
1399 my $result = $lvalue->gt($rvalue);
1400  
1401 # 0
1402  
1403 =back
1404  
1405 =over 4
1406  
1407 =item gt example 5
1408  
1409 package main;
1410  
1411 use Venus::Number;
1412 use Venus::String;
1413  
1414 my $lvalue = Venus::String->new;
1415 my $rvalue = Venus::Number->new;
1416  
1417 my $result = $lvalue->gt($rvalue);
1418  
1419 # 0
1420  
1421 =back
1422  
1423 =over 4
1424  
1425 =item gt example 6
1426  
1427 package main;
1428  
1429 use Venus::Regexp;
1430 use Venus::String;
1431  
1432 my $lvalue = Venus::String->new;
1433 my $rvalue = Venus::Regexp->new;
1434  
1435 my $result = $lvalue->gt($rvalue);
1436  
1437 # 0
1438  
1439 =back
1440  
1441 =over 4
1442  
1443 =item gt example 7
1444  
1445 package main;
1446  
1447 use Venus::Scalar;
1448 use Venus::String;
1449  
1450 my $lvalue = Venus::String->new;
1451 my $rvalue = Venus::Scalar->new;
1452  
1453 my $result = $lvalue->gt($rvalue);
1454  
1455 # 0
1456  
1457 =back
1458  
1459 =over 4
1460  
1461 =item gt example 8
1462  
1463 package main;
1464  
1465 use Venus::String;
1466  
1467 my $lvalue = Venus::String->new;
1468 my $rvalue = Venus::String->new;
1469  
1470 my $result = $lvalue->gt($rvalue);
1471  
1472 # 0
1473  
1474 =back
1475  
1476 =over 4
1477  
1478 =item gt example 9
1479  
1480 package main;
1481  
1482 use Venus::String;
1483 use Venus::Undef;
1484  
1485 my $lvalue = Venus::String->new;
1486 my $rvalue = Venus::Undef->new;
1487  
1488 my $result = $lvalue->gt($rvalue);
1489  
1490 # 0
1491  
1492 =back
1493  
1494 =cut
1495  
1496 =head2 gtlt
1497  
1498 gtlt(Any $arg1, Any $arg2) (Bool)
1499  
1500 The gtlt method performs a I<"greater-than"> operation on the 1st argument, and
1501 I<"lesser-than"> operation on the 2nd argument.
1502  
1503 I<Since C<0.08>>
1504  
1505 =over 4
1506  
1507 =item gtlt example 1
1508  
1509 package main;
1510  
1511 use Venus::Array;
1512 use Venus::String;
1513  
1514 my $lvalue = Venus::String->new;
1515 my $rvalue = Venus::Array->new;
1516  
1517 my $result = $lvalue->gtlt($rvalue);
1518  
1519 # 0
1520  
1521 =back
1522  
1523 =over 4
1524  
1525 =item gtlt example 2
1526  
1527 package main;
1528  
1529 use Venus::Code;
1530 use Venus::String;
1531  
1532 my $lvalue = Venus::String->new;
1533 my $rvalue = Venus::Code->new;
1534  
1535 my $result = $lvalue->gtlt($rvalue);
1536  
1537 # 0
1538  
1539 =back
1540  
1541 =over 4
1542  
1543 =item gtlt example 3
1544  
1545 package main;
1546  
1547 use Venus::Float;
1548 use Venus::String;
1549  
1550 my $lvalue = Venus::String->new;
1551 my $rvalue = Venus::Float->new;
1552  
1553 my $result = $lvalue->gtlt($rvalue);
1554  
1555 # 0
1556  
1557 =back
1558  
1559 =over 4
1560  
1561 =item gtlt example 4
1562  
1563 package main;
1564  
1565 use Venus::Hash;
1566 use Venus::String;
1567  
1568 my $lvalue = Venus::String->new;
1569 my $rvalue = Venus::Hash->new;
1570  
1571 my $result = $lvalue->gtlt($rvalue);
1572  
1573 # 0
1574  
1575 =back
1576  
1577 =over 4
1578  
1579 =item gtlt example 5
1580  
1581 package main;
1582  
1583 use Venus::Number;
1584 use Venus::String;
1585  
1586 my $lvalue = Venus::String->new;
1587 my $rvalue = Venus::Number->new;
1588  
1589 my $result = $lvalue->gtlt($rvalue);
1590  
1591 # 0
1592  
1593 =back
1594  
1595 =over 4
1596  
1597 =item gtlt example 6
1598  
1599 package main;
1600  
1601 use Venus::Regexp;
1602 use Venus::String;
1603  
1604 my $lvalue = Venus::String->new;
1605 my $rvalue = Venus::Regexp->new;
1606  
1607 my $result = $lvalue->gtlt($rvalue);
1608  
1609 # 0
1610  
1611 =back
1612  
1613 =over 4
1614  
1615 =item gtlt example 7
1616  
1617 package main;
1618  
1619 use Venus::Scalar;
1620 use Venus::String;
1621  
1622 my $lvalue = Venus::String->new;
1623 my $rvalue = Venus::Scalar->new;
1624  
1625 my $result = $lvalue->gtlt($rvalue);
1626  
1627 # 0
1628  
1629 =back
1630  
1631 =over 4
1632  
1633 =item gtlt example 8
1634  
1635 package main;
1636  
1637 use Venus::String;
1638  
1639 my $lvalue = Venus::String->new;
1640 my $rvalue = Venus::String->new;
1641  
1642 my $result = $lvalue->gtlt($rvalue);
1643  
1644 # 0
1645  
1646 =back
1647  
1648 =over 4
1649  
1650 =item gtlt example 9
1651  
1652 package main;
1653  
1654 use Venus::String;
1655 use Venus::Undef;
1656  
1657 my $lvalue = Venus::String->new;
1658 my $rvalue = Venus::Undef->new;
1659  
1660 my $result = $lvalue->gtlt($rvalue);
1661  
1662 # 0
1663  
1664 =back
1665  
1666 =cut
1667  
1668 =head2 hex
1669  
1670 hex() (Str)
1671  
1672 The hex method returns the value resulting from interpreting the string as a
1673 hex string.
1674  
1675 I<Since C<0.01>>
1676  
1677 =over 4
1678  
1679 =item hex example 1
1680  
1681 package main;
1682  
1683 use Venus::String;
1684  
1685 my $string = Venus::String->new('0xaf');
1686  
1687 my $hex = $string->hex;
1688  
1689 # 175
1690  
1691 =back
1692  
1693 =cut
1694  
1695 =head2 index
1696  
1697 index(Str $substr, Int $start) (Str)
1698  
1699 The index method searches for the argument within the string and returns the
1700 position of the first occurrence of the argument.
1701  
1702 I<Since C<0.01>>
1703  
1704 =over 4
1705  
1706 =item index example 1
1707  
1708 package main;
1709  
1710 use Venus::String;
1711  
1712 my $string = Venus::String->new('unexplainable');
1713  
1714 my $index = $string->index('explain');
1715  
1716 # 2
1717  
1718 =back
1719  
1720 =over 4
1721  
1722 =item index example 2
1723  
1724 package main;
1725  
1726 use Venus::String;
1727  
1728 my $string = Venus::String->new('unexplainable');
1729  
1730 my $index = $string->index('explain', 1);
1731  
1732 # 2
1733  
1734 =back
1735  
1736 =over 4
1737  
1738 =item index example 3
1739  
1740 package main;
1741  
1742 use Venus::String;
1743  
1744 my $string = Venus::String->new('unexplainable');
1745  
1746 my $index = $string->index('explained');
1747  
1748 # -1
1749  
1750 =back
1751  
1752 =cut
1753  
1754 =head2 kebabcase
1755  
1756 kebabcase() (Str)
1757  
1758 The kebabcase method converts the string to kebabcase.
1759  
1760 I<Since C<0.09>>
1761  
1762 =over 4
1763  
1764 =item kebabcase example 1
1765  
1766 # given: synopsis;
1767  
1768 my $kebabcase = $string->kebabcase;
1769  
1770 # "hello-world"
1771  
1772 =back
1773  
1774 =cut
1775  
1776 =head2 lc
1777  
1778 lc() (Str)
1779  
1780 The lc method returns a lowercased version of the string.
1781  
1782 I<Since C<0.01>>
1783  
1784 =over 4
1785  
1786 =item lc example 1
1787  
1788 package main;
1789  
1790 use Venus::String;
1791  
1792 my $string = Venus::String->new('Hello World');
1793  
1794 my $lc = $string->lc;
1795  
1796 # "hello world"
1797  
1798 =back
1799  
1800 =cut
1801  
1802 =head2 lcfirst
1803  
1804 lcfirst() (Str)
1805  
1806 The lcfirst method returns a the string with the first character lowercased.
1807  
1808 I<Since C<0.01>>
1809  
1810 =over 4
1811  
1812 =item lcfirst example 1
1813  
1814 package main;
1815  
1816 use Venus::String;
1817  
1818 my $string = Venus::String->new('Hello World');
1819  
1820 my $lcfirst = $string->lcfirst;
1821  
1822 # "hello World"
1823  
1824 =back
1825  
1826 =cut
1827  
1828 =head2 le
1829  
1830 le(Any $arg) (Bool)
1831  
1832 The le method performs a I<"lesser-than-or-equal-to"> operation using the
1833 argument provided.
1834  
1835 I<Since C<0.08>>
1836  
1837 =over 4
1838  
1839 =item le example 1
1840  
1841 package main;
1842  
1843 use Venus::Array;
1844 use Venus::String;
1845  
1846 my $lvalue = Venus::String->new;
1847 my $rvalue = Venus::Array->new;
1848  
1849 my $result = $lvalue->le($rvalue);
1850  
1851 # 1
1852  
1853 =back
1854  
1855 =over 4
1856  
1857 =item le example 2
1858  
1859 package main;
1860  
1861 use Venus::Code;
1862 use Venus::String;
1863  
1864 my $lvalue = Venus::String->new;
1865 my $rvalue = Venus::Code->new;
1866  
1867 my $result = $lvalue->le($rvalue);
1868  
1869 # 1
1870  
1871 =back
1872  
1873 =over 4
1874  
1875 =item le example 3
1876  
1877 package main;
1878  
1879 use Venus::Float;
1880 use Venus::String;
1881  
1882 my $lvalue = Venus::String->new;
1883 my $rvalue = Venus::Float->new;
1884  
1885 my $result = $lvalue->le($rvalue);
1886  
1887 # 1
1888  
1889 =back
1890  
1891 =over 4
1892  
1893 =item le example 4
1894  
1895 package main;
1896  
1897 use Venus::Hash;
1898 use Venus::String;
1899  
1900 my $lvalue = Venus::String->new;
1901 my $rvalue = Venus::Hash->new;
1902  
1903 my $result = $lvalue->le($rvalue);
1904  
1905 # 1
1906  
1907 =back
1908  
1909 =over 4
1910  
1911 =item le example 5
1912  
1913 package main;
1914  
1915 use Venus::Number;
1916 use Venus::String;
1917  
1918 my $lvalue = Venus::String->new;
1919 my $rvalue = Venus::Number->new;
1920  
1921 my $result = $lvalue->le($rvalue);
1922  
1923 # 1
1924  
1925 =back
1926  
1927 =over 4
1928  
1929 =item le example 6
1930  
1931 package main;
1932  
1933 use Venus::Regexp;
1934 use Venus::String;
1935  
1936 my $lvalue = Venus::String->new;
1937 my $rvalue = Venus::Regexp->new;
1938  
1939 my $result = $lvalue->le($rvalue);
1940  
1941 # 1
1942  
1943 =back
1944  
1945 =over 4
1946  
1947 =item le example 7
1948  
1949 package main;
1950  
1951 use Venus::Scalar;
1952 use Venus::String;
1953  
1954 my $lvalue = Venus::String->new;
1955 my $rvalue = Venus::Scalar->new;
1956  
1957 my $result = $lvalue->le($rvalue);
1958  
1959 # 1
1960  
1961 =back
1962  
1963 =over 4
1964  
1965 =item le example 8
1966  
1967 package main;
1968  
1969 use Venus::String;
1970  
1971 my $lvalue = Venus::String->new;
1972 my $rvalue = Venus::String->new;
1973  
1974 my $result = $lvalue->le($rvalue);
1975  
1976 # 1
1977  
1978 =back
1979  
1980 =over 4
1981  
1982 =item le example 9
1983  
1984 package main;
1985  
1986 use Venus::String;
1987 use Venus::Undef;
1988  
1989 my $lvalue = Venus::String->new;
1990 my $rvalue = Venus::Undef->new;
1991  
1992 my $result = $lvalue->le($rvalue);
1993  
1994 # 1
1995  
1996 =back
1997  
1998 =cut
1999  
2000 =head2 length
2001  
2002 length() (Int)
2003  
2004 The length method returns the number of characters within the string.
2005  
2006 I<Since C<0.01>>
2007  
2008 =over 4
2009  
2010 =item length example 1
2011  
2012 # given: synopsis;
2013  
2014 my $length = $string->length;
2015  
2016 # 11
2017  
2018 =back
2019  
2020 =cut
2021  
2022 =head2 lines
2023  
2024 lines() (ArrayRef[Str])
2025  
2026 The lines method returns an arrayref of parts by splitting on 1 or more newline
2027 characters.
2028  
2029 I<Since C<0.01>>
2030  
2031 =over 4
2032  
2033 =item lines example 1
2034  
2035 # given: synopsis;
2036  
2037 my $lines = $string->lines;
2038  
2039 # ["hello world"]
2040  
2041 =back
2042  
2043 =over 4
2044  
2045 =item lines example 2
2046  
2047 package main;
2048  
2049 use Venus::String;
2050  
2051 my $string = Venus::String->new("who am i?\nwhere am i?\nhow did I get here");
2052  
2053 my $lines = $string->lines;
2054  
2055 # ["who am i?", "where am i?", "how did I get here"]
2056  
2057 =back
2058  
2059 =cut
2060  
2061 =head2 lowercase
2062  
2063 lowercase() (Str)
2064  
2065 The lowercase method is an alias to the lc method.
2066  
2067 I<Since C<0.01>>
2068  
2069 =over 4
2070  
2071 =item lowercase example 1
2072  
2073 package main;
2074  
2075 use Venus::String;
2076  
2077 my $string = Venus::String->new('Hello World');
2078  
2079 my $lowercase = $string->lowercase;
2080  
2081 # "hello world"
2082  
2083 =back
2084  
2085 =cut
2086  
2087 =head2 lt
2088  
2089 lt(Any $arg) (Bool)
2090  
2091 The lt method performs a I<"lesser-than"> operation using the argument provided.
2092  
2093 I<Since C<0.08>>
2094  
2095 =over 4
2096  
2097 =item lt example 1
2098  
2099 package main;
2100  
2101 use Venus::Array;
2102 use Venus::String;
2103  
2104 my $lvalue = Venus::String->new;
2105 my $rvalue = Venus::Array->new;
2106  
2107 my $result = $lvalue->lt($rvalue);
2108  
2109 # 1
2110  
2111 =back
2112  
2113 =over 4
2114  
2115 =item lt example 2
2116  
2117 package main;
2118  
2119 use Venus::Code;
2120 use Venus::String;
2121  
2122 my $lvalue = Venus::String->new;
2123 my $rvalue = Venus::Code->new;
2124  
2125 my $result = $lvalue->lt($rvalue);
2126  
2127 # 1
2128  
2129 =back
2130  
2131 =over 4
2132  
2133 =item lt example 3
2134  
2135 package main;
2136  
2137 use Venus::Float;
2138 use Venus::String;
2139  
2140 my $lvalue = Venus::String->new;
2141 my $rvalue = Venus::Float->new;
2142  
2143 my $result = $lvalue->lt($rvalue);
2144  
2145 # 1
2146  
2147 =back
2148  
2149 =over 4
2150  
2151 =item lt example 4
2152  
2153 package main;
2154  
2155 use Venus::Hash;
2156 use Venus::String;
2157  
2158 my $lvalue = Venus::String->new;
2159 my $rvalue = Venus::Hash->new;
2160  
2161 my $result = $lvalue->lt($rvalue);
2162  
2163 # 1
2164  
2165 =back
2166  
2167 =over 4
2168  
2169 =item lt example 5
2170  
2171 package main;
2172  
2173 use Venus::Number;
2174 use Venus::String;
2175  
2176 my $lvalue = Venus::String->new;
2177 my $rvalue = Venus::Number->new;
2178  
2179 my $result = $lvalue->lt($rvalue);
2180  
2181 # 1
2182  
2183 =back
2184  
2185 =over 4
2186  
2187 =item lt example 6
2188  
2189 package main;
2190  
2191 use Venus::Regexp;
2192 use Venus::String;
2193  
2194 my $lvalue = Venus::String->new;
2195 my $rvalue = Venus::Regexp->new;
2196  
2197 my $result = $lvalue->lt($rvalue);
2198  
2199 # 1
2200  
2201 =back
2202  
2203 =over 4
2204  
2205 =item lt example 7
2206  
2207 package main;
2208  
2209 use Venus::Scalar;
2210 use Venus::String;
2211  
2212 my $lvalue = Venus::String->new;
2213 my $rvalue = Venus::Scalar->new;
2214  
2215 my $result = $lvalue->lt($rvalue);
2216  
2217 # 1
2218  
2219 =back
2220  
2221 =over 4
2222  
2223 =item lt example 8
2224  
2225 package main;
2226  
2227 use Venus::String;
2228  
2229 my $lvalue = Venus::String->new;
2230 my $rvalue = Venus::String->new;
2231  
2232 my $result = $lvalue->lt($rvalue);
2233  
2234 # 0
2235  
2236 =back
2237  
2238 =over 4
2239  
2240 =item lt example 9
2241  
2242 package main;
2243  
2244 use Venus::String;
2245 use Venus::Undef;
2246  
2247 my $lvalue = Venus::String->new;
2248 my $rvalue = Venus::Undef->new;
2249  
2250 my $result = $lvalue->lt($rvalue);
2251  
2252 # 0
2253  
2254 =back
2255  
2256 =cut
2257  
2258 =head2 ne
2259  
2260 ne(Any $arg) (Bool)
2261  
2262 The ne method performs a I<"not-equal-to"> operation using the argument provided.
2263  
2264 I<Since C<0.08>>
2265  
2266 =over 4
2267  
2268 =item ne example 1
2269  
2270 package main;
2271  
2272 use Venus::Array;
2273 use Venus::String;
2274  
2275 my $lvalue = Venus::String->new;
2276 my $rvalue = Venus::Array->new;
2277  
2278 my $result = $lvalue->ne($rvalue);
2279  
2280 # 1
2281  
2282 =back
2283  
2284 =over 4
2285  
2286 =item ne example 2
2287  
2288 package main;
2289  
2290 use Venus::Code;
2291 use Venus::String;
2292  
2293 my $lvalue = Venus::String->new;
2294 my $rvalue = Venus::Code->new;
2295  
2296 my $result = $lvalue->ne($rvalue);
2297  
2298 # 1
2299  
2300 =back
2301  
2302 =over 4
2303  
2304 =item ne example 3
2305  
2306 package main;
2307  
2308 use Venus::Float;
2309 use Venus::String;
2310  
2311 my $lvalue = Venus::String->new;
2312 my $rvalue = Venus::Float->new;
2313  
2314 my $result = $lvalue->ne($rvalue);
2315  
2316 # 1
2317  
2318 =back
2319  
2320 =over 4
2321  
2322 =item ne example 4
2323  
2324 package main;
2325  
2326 use Venus::Hash;
2327 use Venus::String;
2328  
2329 my $lvalue = Venus::String->new;
2330 my $rvalue = Venus::Hash->new;
2331  
2332 my $result = $lvalue->ne($rvalue);
2333  
2334 # 1
2335  
2336 =back
2337  
2338 =over 4
2339  
2340 =item ne example 5
2341  
2342 package main;
2343  
2344 use Venus::Number;
2345 use Venus::String;
2346  
2347 my $lvalue = Venus::String->new;
2348 my $rvalue = Venus::Number->new;
2349  
2350 my $result = $lvalue->ne($rvalue);
2351  
2352 # 1
2353  
2354 =back
2355  
2356 =over 4
2357  
2358 =item ne example 6
2359  
2360 package main;
2361  
2362 use Venus::Regexp;
2363 use Venus::String;
2364  
2365 my $lvalue = Venus::String->new;
2366 my $rvalue = Venus::Regexp->new;
2367  
2368 my $result = $lvalue->ne($rvalue);
2369  
2370 # 1
2371  
2372 =back
2373  
2374 =over 4
2375  
2376 =item ne example 7
2377  
2378 package main;
2379  
2380 use Venus::Scalar;
2381 use Venus::String;
2382  
2383 my $lvalue = Venus::String->new;
2384 my $rvalue = Venus::Scalar->new;
2385  
2386 my $result = $lvalue->ne($rvalue);
2387  
2388 # 1
2389  
2390 =back
2391  
2392 =over 4
2393  
2394 =item ne example 8
2395  
2396 package main;
2397  
2398 use Venus::String;
2399  
2400 my $lvalue = Venus::String->new;
2401 my $rvalue = Venus::String->new;
2402  
2403 my $result = $lvalue->ne($rvalue);
2404  
2405 # 0
2406  
2407 =back
2408  
2409 =over 4
2410  
2411 =item ne example 9
2412  
2413 package main;
2414  
2415 use Venus::String;
2416 use Venus::Undef;
2417  
2418 my $lvalue = Venus::String->new;
2419 my $rvalue = Venus::Undef->new;
2420  
2421 my $result = $lvalue->ne($rvalue);
2422  
2423 # 0
2424  
2425 =back
2426  
2427 =cut
2428  
2429 =head2 numified
2430  
2431 numified() (Int)
2432  
2433 The numified method returns the numerical representation of the object. For
2434 string objects this method returns the underlying value, if that value looks
2435 like a number, or C<0>.
2436  
2437 I<Since C<0.08>>
2438  
2439 =over 4
2440  
2441 =item numified example 1
2442  
2443 # given: synopsis;
2444  
2445 my $numified = $string->numified;
2446  
2447 # 11
2448  
2449 =back
2450  
2451 =over 4
2452  
2453 =item numified example 2
2454  
2455 package main;
2456  
2457 use Venus::String;
2458  
2459 my $string = Venus::String->new(1_000_000);
2460  
2461 my $numified = $string->numified;
2462  
2463 # 1000000
2464  
2465 =back
2466  
2467 =cut
2468  
2469 =head2 render
2470  
2471 render(HashRef $tokens) (Str)
2472  
2473 The render method treats the string as a template and performs a simple token
2474 replacement using the argument provided.
2475  
2476 I<Since C<0.01>>
2477  
2478 =over 4
2479  
2480 =item render example 1
2481  
2482 package main;
2483  
2484 use Venus::String;
2485  
2486 my $string = Venus::String->new('Hi, {{name}}!');
2487  
2488 my $render = $string->render({name => 'Friend'});
2489  
2490 # "Hi, Friend!"
2491  
2492 =back
2493  
2494 =cut
2495  
2496 =head2 replace
2497  
2498 replace(Regexp $regexp, Str $replace, Str $flags) (Replace)
2499  
2500 The replace method performs a search and replace operation and returns the
2501 L<Venus::Replace> object.
2502  
2503 I<Since C<0.01>>
2504  
2505 =over 4
2506  
2507 =item replace example 1
2508  
2509 # given: synopsis;
2510  
2511 my $replace = $string->replace('world', 'universe');
2512  
2513 # bless({
2514 # ...,
2515 # "flags" => "",
2516 # "regexp" => "world",
2517 # "string" => "hello world",
2518 # "substr" => "universe",
2519 # }, "Venus::Replace")
2520  
2521 =back
2522  
2523 =cut
2524  
2525 =head2 reverse
2526  
2527 reverse() (Str)
2528  
2529 The reverse method returns a string where the characters in the string are in
2530 the opposite order.
2531  
2532 I<Since C<0.01>>
2533  
2534 =over 4
2535  
2536 =item reverse example 1
2537  
2538 # given: synopsis;
2539  
2540 my $reverse = $string->reverse;
2541  
2542 # "dlrow olleh"
2543  
2544 =back
2545  
2546 =cut
2547  
2548 =head2 rindex
2549  
2550 rindex(Str $substr, Int $start) (Str)
2551  
2552 The rindex method searches for the argument within the string and returns the
2553 position of the last occurrence of the argument.
2554  
2555 I<Since C<0.01>>
2556  
2557 =over 4
2558  
2559 =item rindex example 1
2560  
2561 package main;
2562  
2563 use Venus::String;
2564  
2565 my $string = Venus::String->new('explain the unexplainable');
2566  
2567 my $rindex = $string->rindex('explain');
2568  
2569 # 14
2570  
2571 =back
2572  
2573 =over 4
2574  
2575 =item rindex example 2
2576  
2577 package main;
2578  
2579 use Venus::String;
2580  
2581 my $string = Venus::String->new('explain the unexplainable');
2582  
2583 my $rindex = $string->rindex('explained');
2584  
2585 # -1
2586  
2587 =back
2588  
2589 =over 4
2590  
2591 =item rindex example 3
2592  
2593 package main;
2594  
2595 use Venus::String;
2596  
2597 my $string = Venus::String->new('explain the unexplainable');
2598  
2599 my $rindex = $string->rindex('explain', 21);
2600  
2601 # 14
2602  
2603 =back
2604  
2605 =cut
2606  
2607 =head2 search
2608  
2609 search(Regexp $regexp) (Search)
2610  
2611 The search method performs a search operation and returns the L<Venus::Search>
2612 object.
2613  
2614 I<Since C<0.01>>
2615  
2616 =over 4
2617  
2618 =item search example 1
2619  
2620 # given: synopsis;
2621  
2622 my $search = $string->search('world');
2623  
2624 # bless({
2625 # ...,
2626 # "flags" => "",
2627 # "regexp" => "world",
2628 # "string" => "hello world",
2629 # }, "Venus::Search")
2630  
2631 =back
2632  
2633 =cut
2634  
2635 =head2 snakecase
2636  
2637 snakecase() (Str)
2638  
2639 The snakecase method converts the string to snakecase.
2640  
2641 I<Since C<0.01>>
2642  
2643 =over 4
2644  
2645 =item snakecase example 1
2646  
2647 # given: synopsis;
2648  
2649 my $snakecase = $string->snakecase;
2650  
2651 # "hello_world"
2652  
2653 =back
2654  
2655 =cut
2656  
2657 =head2 split
2658  
2659 split(Str | Regexp $expr, Maybe[Int] $limit) (ArrayRef)
2660  
2661 The split method returns an arrayref by splitting the string on the argument.
2662  
2663 I<Since C<0.01>>
2664  
2665 =over 4
2666  
2667 =item split example 1
2668  
2669 package main;
2670  
2671 use Venus::String;
2672  
2673 my $string = Venus::String->new('name, age, dob, email');
2674  
2675 my $split = $string->split(', ');
2676  
2677 # ["name", "age", "dob", "email"]
2678  
2679 =back
2680  
2681 =over 4
2682  
2683 =item split example 2
2684  
2685 package main;
2686  
2687 use Venus::String;
2688  
2689 my $string = Venus::String->new('name, age, dob, email');
2690  
2691 my $split = $string->split(', ', 2);
2692  
2693 # ["name", "age, dob, email"]
2694  
2695 =back
2696  
2697 =over 4
2698  
2699 =item split example 3
2700  
2701 package main;
2702  
2703 use Venus::String;
2704  
2705 my $string = Venus::String->new('name, age, dob, email');
2706  
2707 my $split = $string->split(qr/\,\s*/);
2708  
2709 # ["name", "age", "dob", "email"]
2710  
2711 =back
2712  
2713 =cut
2714  
2715 =head2 stringified
2716  
2717 stringified() (Str)
2718  
2719 The stringified method returns the object, stringified (i.e. a dump of the
2720 object's value).
2721  
2722 I<Since C<0.08>>
2723  
2724 =over 4
2725  
2726 =item stringified example 1
2727  
2728 # given: synopsis;
2729  
2730 my $stringified = $string->stringified;
2731  
2732 # "hello world"
2733  
2734 =back
2735  
2736 =over 4
2737  
2738 =item stringified example 2
2739  
2740 package main;
2741  
2742 use Venus::String;
2743  
2744 my $string = Venus::String->new("hello\nworld");
2745  
2746 my $stringified = $string->stringified;
2747  
2748 # "hello\\nworld"
2749  
2750 =back
2751  
2752 =over 4
2753  
2754 =item stringified example 3
2755  
2756 # given: synopsis;
2757  
2758 my $stringified = $self->stringified;
2759  
2760 # ...
2761  
2762 =back
2763  
2764 =cut
2765  
2766 =head2 strip
2767  
2768 strip() (Str)
2769  
2770 The strip method returns the string replacing occurences of 2 or more
2771 whitespaces with a single whitespace.
2772  
2773 I<Since C<0.01>>
2774  
2775 =over 4
2776  
2777 =item strip example 1
2778  
2779 package main;
2780  
2781 use Venus::String;
2782  
2783 my $string = Venus::String->new('one, two, three');
2784  
2785 my $strip = $string->strip;
2786  
2787 # "one, two, three"
2788  
2789 =back
2790  
2791 =cut
2792  
2793 =head2 titlecase
2794  
2795 titlecase() (Str)
2796  
2797 The titlecase method returns the string capitalizing the first character of
2798 each word.
2799  
2800 I<Since C<0.01>>
2801  
2802 =over 4
2803  
2804 =item titlecase example 1
2805  
2806 # given: synopsis;
2807  
2808 my $titlecase = $string->titlecase;
2809  
2810 # "Hello World"
2811  
2812 =back
2813  
2814 =cut
2815  
2816 =head2 trim
2817  
2818 trim() (Str)
2819  
2820 The trim method removes one or more consecutive leading and/or trailing spaces
2821 from the string.
2822  
2823 I<Since C<0.01>>
2824  
2825 =over 4
2826  
2827 =item trim example 1
2828  
2829 package main;
2830  
2831 use Venus::String;
2832  
2833 my $string = Venus::String->new(' system is ready ');
2834  
2835 my $trim = $string->trim;
2836  
2837 # "system is ready"
2838  
2839 =back
2840  
2841 =cut
2842  
2843 =head2 tv
2844  
2845 tv(Any $arg) (Bool)
2846  
2847 The tv method performs a I<"type-and-value-equal-to"> operation using argument
2848 provided.
2849  
2850 I<Since C<0.08>>
2851  
2852 =over 4
2853  
2854 =item tv example 1
2855  
2856 package main;
2857  
2858 use Venus::Array;
2859 use Venus::String;
2860  
2861 my $lvalue = Venus::String->new;
2862 my $rvalue = Venus::Array->new;
2863  
2864 my $result = $lvalue->tv($rvalue);
2865  
2866 # 0
2867  
2868 =back
2869  
2870 =over 4
2871  
2872 =item tv example 2
2873  
2874 package main;
2875  
2876 use Venus::Code;
2877 use Venus::String;
2878  
2879 my $lvalue = Venus::String->new;
2880 my $rvalue = Venus::Code->new;
2881  
2882 my $result = $lvalue->tv($rvalue);
2883  
2884 # 0
2885  
2886 =back
2887  
2888 =over 4
2889  
2890 =item tv example 3
2891  
2892 package main;
2893  
2894 use Venus::Float;
2895 use Venus::String;
2896  
2897 my $lvalue = Venus::String->new;
2898 my $rvalue = Venus::Float->new;
2899  
2900 my $result = $lvalue->tv($rvalue);
2901  
2902 # 0
2903  
2904 =back
2905  
2906 =over 4
2907  
2908 =item tv example 4
2909  
2910 package main;
2911  
2912 use Venus::Hash;
2913 use Venus::String;
2914  
2915 my $lvalue = Venus::String->new;
2916 my $rvalue = Venus::Hash->new;
2917  
2918 my $result = $lvalue->tv($rvalue);
2919  
2920 # 0
2921  
2922 =back
2923  
2924 =over 4
2925  
2926 =item tv example 5
2927  
2928 package main;
2929  
2930 use Venus::Number;
2931 use Venus::String;
2932  
2933 my $lvalue = Venus::String->new;
2934 my $rvalue = Venus::Number->new;
2935  
2936 my $result = $lvalue->tv($rvalue);
2937  
2938 # 0
2939  
2940 =back
2941  
2942 =over 4
2943  
2944 =item tv example 6
2945  
2946 package main;
2947  
2948 use Venus::Regexp;
2949 use Venus::String;
2950  
2951 my $lvalue = Venus::String->new;
2952 my $rvalue = Venus::Regexp->new;
2953  
2954 my $result = $lvalue->tv($rvalue);
2955  
2956 # 0
2957  
2958 =back
2959  
2960 =over 4
2961  
2962 =item tv example 7
2963  
2964 package main;
2965  
2966 use Venus::Scalar;
2967 use Venus::String;
2968  
2969 my $lvalue = Venus::String->new;
2970 my $rvalue = Venus::Scalar->new;
2971  
2972 my $result = $lvalue->tv($rvalue);
2973  
2974 # 0
2975  
2976 =back
2977  
2978 =over 4
2979  
2980 =item tv example 8
2981  
2982 package main;
2983  
2984 use Venus::String;
2985  
2986 my $lvalue = Venus::String->new;
2987 my $rvalue = Venus::String->new;
2988  
2989 my $result = $lvalue->tv($rvalue);
2990  
2991 # 1
2992  
2993 =back
2994  
2995 =over 4
2996  
2997 =item tv example 9
2998  
2999 package main;
3000  
3001 use Venus::String;
3002 use Venus::Undef;
3003  
3004 my $lvalue = Venus::String->new;
3005 my $rvalue = Venus::Undef->new;
3006  
3007 my $result = $lvalue->tv($rvalue);
3008  
3009 # 0
3010  
3011 =back
3012  
3013 =cut
3014  
3015 =head2 uc
3016  
3017 uc() (Str)
3018  
3019 The uc method returns an uppercased version of the string.
3020  
3021 I<Since C<0.01>>
3022  
3023 =over 4
3024  
3025 =item uc example 1
3026  
3027 # given: synopsis;
3028  
3029 my $uc = $string->uc;
3030  
3031 # "HELLO WORLD"
3032  
3033 =back
3034  
3035 =cut
3036  
3037 =head2 ucfirst
3038  
3039 ucfirst() (Str)
3040  
3041 The ucfirst method returns a the string with the first character uppercased.
3042  
3043 I<Since C<0.01>>
3044  
3045 =over 4
3046  
3047 =item ucfirst example 1
3048  
3049 # given: synopsis;
3050  
3051 my $ucfirst = $string->ucfirst;
3052  
3053 # "Hello world"
3054  
3055 =back
3056  
3057 =cut
3058  
3059 =head2 uppercase
3060  
3061 uppercase() (Str)
3062  
3063 The uppercase method is an alias to the uc method.
3064  
3065 I<Since C<0.01>>
3066  
3067 =over 4
3068  
3069 =item uppercase example 1
3070  
3071 # given: synopsis;
3072  
3073 my $uppercase = $string->uppercase;
3074  
3075 # "HELLO WORLD"
3076  
3077 =back
3078  
3079 =cut
3080  
3081 =head2 words
3082  
3083 words() (ArrayRef[Str])
3084  
3085 The words method returns an arrayref by splitting on 1 or more consecutive
3086 spaces.
3087  
3088 I<Since C<0.01>>
3089  
3090 =over 4
3091  
3092 =item words example 1
3093  
3094 package main;
3095  
3096 use Venus::String;
3097  
3098 my $string = Venus::String->new(
3099 'is this a bug we\'re experiencing'
3100 );
3101  
3102 my $words = $string->words;
3103  
3104 # ["is", "this", "a", "bug", "we're", "experiencing"]
3105  
3106 =back
3107  
3108 =cut
3109  
3110 =head1 OPERATORS
3111  
3112 This package overloads the following operators:
3113  
3114 =cut
3115  
3116 =over 4
3117  
3118 =item operation: C<(.)>
3119  
3120 This package overloads the C<.> operator.
3121  
3122 B<example 1>
3123  
3124 # given: synopsis;
3125  
3126 my $text = $string . ', welcome';
3127  
3128 # "hello world, welcome"
3129  
3130 =back
3131  
3132 =over 4
3133  
3134 =item operation: C<(eq)>
3135  
3136 This package overloads the C<eq> operator.
3137  
3138 B<example 1>
3139  
3140 # given: synopsis;
3141  
3142 my $result = $string eq 'hello world';
3143  
3144 # 1
3145  
3146 B<example 2>
3147  
3148 package main;
3149  
3150 use Venus::String;
3151  
3152 my $string1 = Venus::String->new('hello world');
3153 my $string2 = Venus::String->new('hello world');
3154  
3155 my $result = $string1 eq $string2;
3156  
3157 # 1
3158  
3159 =back
3160  
3161 =over 4
3162  
3163 =item operation: C<(ne)>
3164  
3165 This package overloads the C<ne> operator.
3166  
3167 B<example 1>
3168  
3169 # given: synopsis;
3170  
3171 my $result = $string ne 'Hello world';
3172  
3173 1;
3174  
3175 B<example 2>
3176  
3177 package main;
3178  
3179 use Venus::String;
3180  
3181 my $string1 = Venus::String->new('hello world');
3182 my $string2 = Venus::String->new('Hello world');
3183  
3184 my $result = $string1 ne $string2;
3185  
3186 # 1
3187  
3188 =back
3189  
3190 =over 4
3191  
3192 =item operation: C<(qr)>
3193  
3194 This package overloads the C<qr> operator.
3195  
3196 B<example 1>
3197  
3198 # given: synopsis;
3199  
3200 my $test = 'hello world' =~ qr/$string/;
3201  
3202 # 1
3203  
3204 =back
« Venus/Error.pm ↑ Summary Venus/Meta.pm »