| 1 | package Acme::Cavaspazi; | ||||||||||
| 2 | # ABSTRACT: a simple function to remove spaces from strings or lists of strings | ||||||||||
| 3 | |||||||||||
| 4 | 3 | ▶ | use 5.012; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 3 | require Exporter; | |||||||||
| 7 | 3 | our @ISA = qw(Exporter); | |||||||||
| 8 | |||||||||||
| 9 | # Export subroutine cavaspazi | ||||||||||
| 10 | 3 | our @EXPORT = qw(cavaspazi); | |||||||||
| 11 | |||||||||||
| 12 | 3 | $Acme::Cavaspazi::VERSION = "1.0.3"; | |||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | 2 | ▶ | sub cavaspazi { | ||||||||
|
Subroutine
cavaspazi: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 17 | 2 | my @results = (); | |||||||||
| 18 | 2 | for my $i (@_) { | |||||||||
| 19 | 3 | my $result = $i; | |||||||||
| 20 | 3 | $result =~ s/ /_/g; | |||||||||
| 21 | 3 | push @results, $result; | |||||||||
| 22 | } | ||||||||||
| 23 | # if input is a scalar, return a scalar | ||||||||||
| 24 | 2 | ▶ | if (@_ == 1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 1 | return $results[0]; | |||||||||
| 26 | } else { | ||||||||||
| 27 | 1 | return @results; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | 3 | "VITULO"; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||