Commit | Line | Data |
---|---|---|
eb8d423f | 1 | package Some::Module; |
2 | use strict; | |
3 | use warnings; | |
4 | use base qw(Exporter); | |
5 | ||
6 | our @EXPORT_OK = qw(some_sub); | |
7 | ||
8 | # This is an example of a subroutine that returns (undef, $msg) | |
9 | # to signal failure. | |
10 | ||
11 | sub some_sub { | |
12 | my ($arg) = @_; | |
13 | ||
14 | if ($arg) { | |
15 | return (undef, "Insufficient credit"); | |
16 | } | |
17 | ||
18 | return (1,2,3); | |
19 | } | |
20 | ||
21 | 1; |