Can I condense my export routine in my Perl package?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
My current Perl package export feels long (snippet below). And yes, it's better to type all that just once in one place so my many Perl scripts can accesss it all with just:
use Funx;
Still I was just hoping there would be an easy way to export everything with less typing.
package Funx;
#use strict;
use warnings;
use DBI;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(pdone dbstart dbstop dbc dbcdata numnums $SUCCESS $NOFILE
$COPYFAIL $SOXFAIL $CURLFAIL $OPENFAIL $APPRUNNING $RAWDBEXIISTS $DBCREATEERR $DBCONNECTERR $TMPFILEERR $DBWRITEERR $INVALIDUSER $DBLOCKERR $DBUNLOCKERR WERR);
our $SUCCESS = 0;
our $NOFILE = 1;
our $COPYFAIL = 2;
our $SOXFAIL = 3;
our $CURLFAIL = 4;
our $OPENFAIL = 5;
our $APPRUNNING = 6;
our $RAWDBEXIISTS = 7;
our $DBCREATEERR = 8;
our $DBCONNECTERR = 9;
our $TMPFILEERR = 10;
our $DBWRITEERR = 11;
our $INVALIDUSER = 12;
our $DBLOCKERR = 13;
our $DBUNLOCKERR = 14;
use constant WERR => 100;
perl
add a comment |
My current Perl package export feels long (snippet below). And yes, it's better to type all that just once in one place so my many Perl scripts can accesss it all with just:
use Funx;
Still I was just hoping there would be an easy way to export everything with less typing.
package Funx;
#use strict;
use warnings;
use DBI;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(pdone dbstart dbstop dbc dbcdata numnums $SUCCESS $NOFILE
$COPYFAIL $SOXFAIL $CURLFAIL $OPENFAIL $APPRUNNING $RAWDBEXIISTS $DBCREATEERR $DBCONNECTERR $TMPFILEERR $DBWRITEERR $INVALIDUSER $DBLOCKERR $DBUNLOCKERR WERR);
our $SUCCESS = 0;
our $NOFILE = 1;
our $COPYFAIL = 2;
our $SOXFAIL = 3;
our $CURLFAIL = 4;
our $OPENFAIL = 5;
our $APPRUNNING = 6;
our $RAWDBEXIISTS = 7;
our $DBCREATEERR = 8;
our $DBCONNECTERR = 9;
our $TMPFILEERR = 10;
our $DBWRITEERR = 11;
our $INVALIDUSER = 12;
our $DBLOCKERR = 13;
our $DBUNLOCKERR = 14;
use constant WERR => 100;
perl
What does Funx stand for? It's a good idea to use descriptive names for things. Also, why isuse strict
commented out?
– simbabque
Nov 22 '18 at 15:35
1
Export a function that returns a hash? Or just export a hash directly?
– stevieb
Nov 22 '18 at 15:44
1
My 2 cents: call the packageErr
, and don't export. Then you can usereturn $Err::OPENFAIL;
which is, IMO, clearer anyway.
– Tanktalus
Nov 22 '18 at 15:46
add a comment |
My current Perl package export feels long (snippet below). And yes, it's better to type all that just once in one place so my many Perl scripts can accesss it all with just:
use Funx;
Still I was just hoping there would be an easy way to export everything with less typing.
package Funx;
#use strict;
use warnings;
use DBI;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(pdone dbstart dbstop dbc dbcdata numnums $SUCCESS $NOFILE
$COPYFAIL $SOXFAIL $CURLFAIL $OPENFAIL $APPRUNNING $RAWDBEXIISTS $DBCREATEERR $DBCONNECTERR $TMPFILEERR $DBWRITEERR $INVALIDUSER $DBLOCKERR $DBUNLOCKERR WERR);
our $SUCCESS = 0;
our $NOFILE = 1;
our $COPYFAIL = 2;
our $SOXFAIL = 3;
our $CURLFAIL = 4;
our $OPENFAIL = 5;
our $APPRUNNING = 6;
our $RAWDBEXIISTS = 7;
our $DBCREATEERR = 8;
our $DBCONNECTERR = 9;
our $TMPFILEERR = 10;
our $DBWRITEERR = 11;
our $INVALIDUSER = 12;
our $DBLOCKERR = 13;
our $DBUNLOCKERR = 14;
use constant WERR => 100;
perl
My current Perl package export feels long (snippet below). And yes, it's better to type all that just once in one place so my many Perl scripts can accesss it all with just:
use Funx;
Still I was just hoping there would be an easy way to export everything with less typing.
package Funx;
#use strict;
use warnings;
use DBI;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT = qw(pdone dbstart dbstop dbc dbcdata numnums $SUCCESS $NOFILE
$COPYFAIL $SOXFAIL $CURLFAIL $OPENFAIL $APPRUNNING $RAWDBEXIISTS $DBCREATEERR $DBCONNECTERR $TMPFILEERR $DBWRITEERR $INVALIDUSER $DBLOCKERR $DBUNLOCKERR WERR);
our $SUCCESS = 0;
our $NOFILE = 1;
our $COPYFAIL = 2;
our $SOXFAIL = 3;
our $CURLFAIL = 4;
our $OPENFAIL = 5;
our $APPRUNNING = 6;
our $RAWDBEXIISTS = 7;
our $DBCREATEERR = 8;
our $DBCONNECTERR = 9;
our $TMPFILEERR = 10;
our $DBWRITEERR = 11;
our $INVALIDUSER = 12;
our $DBLOCKERR = 13;
our $DBUNLOCKERR = 14;
use constant WERR => 100;
perl
perl
edited Nov 22 '18 at 15:34
simbabque
44.5k757106
44.5k757106
asked Nov 22 '18 at 15:33
Daniel KaplanDaniel Kaplan
332210
332210
What does Funx stand for? It's a good idea to use descriptive names for things. Also, why isuse strict
commented out?
– simbabque
Nov 22 '18 at 15:35
1
Export a function that returns a hash? Or just export a hash directly?
– stevieb
Nov 22 '18 at 15:44
1
My 2 cents: call the packageErr
, and don't export. Then you can usereturn $Err::OPENFAIL;
which is, IMO, clearer anyway.
– Tanktalus
Nov 22 '18 at 15:46
add a comment |
What does Funx stand for? It's a good idea to use descriptive names for things. Also, why isuse strict
commented out?
– simbabque
Nov 22 '18 at 15:35
1
Export a function that returns a hash? Or just export a hash directly?
– stevieb
Nov 22 '18 at 15:44
1
My 2 cents: call the packageErr
, and don't export. Then you can usereturn $Err::OPENFAIL;
which is, IMO, clearer anyway.
– Tanktalus
Nov 22 '18 at 15:46
What does Funx stand for? It's a good idea to use descriptive names for things. Also, why is
use strict
commented out?– simbabque
Nov 22 '18 at 15:35
What does Funx stand for? It's a good idea to use descriptive names for things. Also, why is
use strict
commented out?– simbabque
Nov 22 '18 at 15:35
1
1
Export a function that returns a hash? Or just export a hash directly?
– stevieb
Nov 22 '18 at 15:44
Export a function that returns a hash? Or just export a hash directly?
– stevieb
Nov 22 '18 at 15:44
1
1
My 2 cents: call the package
Err
, and don't export. Then you can use return $Err::OPENFAIL;
which is, IMO, clearer anyway.– Tanktalus
Nov 22 '18 at 15:46
My 2 cents: call the package
Err
, and don't export. Then you can use return $Err::OPENFAIL;
which is, IMO, clearer anyway.– Tanktalus
Nov 22 '18 at 15:46
add a comment |
2 Answers
2
active
oldest
votes
If you used constants instead of variables,
package Funx;
use strict;
use warnings;
use constant qw( );
use Exporter qw( import );
BEGIN {
my %error_codes = (
FUNX_SUCCESS => 0,
FUNX_NOFILE => 1,
FUNX_COPYFAIL => 2,
FUNX_SOXFAIL => 3,
FUNX_CURLFAIL => 4,
FUNX_OPENFAIL => 5,
FUNX_APPRUNNING => 6,
FUNX_RAWDBEXIISTS => 7,
FUNX_DBCREATEERR => 8,
FUNX_DBCONNECTERR => 9,
FUNX_TMPFILEERR => 10,
FUNX_DBWRITEERR => 11,
FUNX_INVALIDUSER => 12,
FUNX_DBLOCKERR => 13,
FUNX_DBUNLOCKERR => 14,
FUNX_WERR => 100,
);
constant->import(%error_codes);
my @syms = keys(%error_codes);
our @EXPORT_OK = @syms;
our %EXPORT_TAGS = ( ALL => @syms, ERROR_CODES => @syms );
}
On top of addressing the issue you raised, the above
- Fixes the polluting of the user's namespace. Don't dump a bunch of symbols into other namespaces by default!
- Fixes the poor names that could conflict with other modules. You think you're the only module that has a code for
SUCCESS
? - Fixes the polluting of your module's
@ISA
. Funx is not a subclass of Exporter.
Usage:
use Funx; # Imports nothing.
use Funx qw( ); # Imports nothing.
use Funx qw( :ERROR_CODES ); # Imports error codes.
use Funx qw( :ALL ); # Imports error codes.
use Funx qw( FUNX_SUCCESS FUNX_NOFILE ); # Imports specific error codes.
add a comment |
You can use source filter to add some custom preprocessing.
Example:
package MyExport;
use Filter::Util::Call;
sub import {
my ($type) = @_;
my ($ref) = ;
filter_add(bless $ref);
}
sub filter {
my ($self) = @_;
my ($status);
if (($status = filter_read()) > 0) {
s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
}
$status;
}
1;
Usage:
...
use MyExport;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT;
...
our export $SUCCESS = 0;
...
Note that this implementation may be buggy. Basically s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
regexp turns lines like
our export $SUCCESS = 0;
into
push @EXPORT, '$SUCCESS'; our $SUCCESS = 0;
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434203%2fcan-i-condense-my-export-routine-in-my-perl-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you used constants instead of variables,
package Funx;
use strict;
use warnings;
use constant qw( );
use Exporter qw( import );
BEGIN {
my %error_codes = (
FUNX_SUCCESS => 0,
FUNX_NOFILE => 1,
FUNX_COPYFAIL => 2,
FUNX_SOXFAIL => 3,
FUNX_CURLFAIL => 4,
FUNX_OPENFAIL => 5,
FUNX_APPRUNNING => 6,
FUNX_RAWDBEXIISTS => 7,
FUNX_DBCREATEERR => 8,
FUNX_DBCONNECTERR => 9,
FUNX_TMPFILEERR => 10,
FUNX_DBWRITEERR => 11,
FUNX_INVALIDUSER => 12,
FUNX_DBLOCKERR => 13,
FUNX_DBUNLOCKERR => 14,
FUNX_WERR => 100,
);
constant->import(%error_codes);
my @syms = keys(%error_codes);
our @EXPORT_OK = @syms;
our %EXPORT_TAGS = ( ALL => @syms, ERROR_CODES => @syms );
}
On top of addressing the issue you raised, the above
- Fixes the polluting of the user's namespace. Don't dump a bunch of symbols into other namespaces by default!
- Fixes the poor names that could conflict with other modules. You think you're the only module that has a code for
SUCCESS
? - Fixes the polluting of your module's
@ISA
. Funx is not a subclass of Exporter.
Usage:
use Funx; # Imports nothing.
use Funx qw( ); # Imports nothing.
use Funx qw( :ERROR_CODES ); # Imports error codes.
use Funx qw( :ALL ); # Imports error codes.
use Funx qw( FUNX_SUCCESS FUNX_NOFILE ); # Imports specific error codes.
add a comment |
If you used constants instead of variables,
package Funx;
use strict;
use warnings;
use constant qw( );
use Exporter qw( import );
BEGIN {
my %error_codes = (
FUNX_SUCCESS => 0,
FUNX_NOFILE => 1,
FUNX_COPYFAIL => 2,
FUNX_SOXFAIL => 3,
FUNX_CURLFAIL => 4,
FUNX_OPENFAIL => 5,
FUNX_APPRUNNING => 6,
FUNX_RAWDBEXIISTS => 7,
FUNX_DBCREATEERR => 8,
FUNX_DBCONNECTERR => 9,
FUNX_TMPFILEERR => 10,
FUNX_DBWRITEERR => 11,
FUNX_INVALIDUSER => 12,
FUNX_DBLOCKERR => 13,
FUNX_DBUNLOCKERR => 14,
FUNX_WERR => 100,
);
constant->import(%error_codes);
my @syms = keys(%error_codes);
our @EXPORT_OK = @syms;
our %EXPORT_TAGS = ( ALL => @syms, ERROR_CODES => @syms );
}
On top of addressing the issue you raised, the above
- Fixes the polluting of the user's namespace. Don't dump a bunch of symbols into other namespaces by default!
- Fixes the poor names that could conflict with other modules. You think you're the only module that has a code for
SUCCESS
? - Fixes the polluting of your module's
@ISA
. Funx is not a subclass of Exporter.
Usage:
use Funx; # Imports nothing.
use Funx qw( ); # Imports nothing.
use Funx qw( :ERROR_CODES ); # Imports error codes.
use Funx qw( :ALL ); # Imports error codes.
use Funx qw( FUNX_SUCCESS FUNX_NOFILE ); # Imports specific error codes.
add a comment |
If you used constants instead of variables,
package Funx;
use strict;
use warnings;
use constant qw( );
use Exporter qw( import );
BEGIN {
my %error_codes = (
FUNX_SUCCESS => 0,
FUNX_NOFILE => 1,
FUNX_COPYFAIL => 2,
FUNX_SOXFAIL => 3,
FUNX_CURLFAIL => 4,
FUNX_OPENFAIL => 5,
FUNX_APPRUNNING => 6,
FUNX_RAWDBEXIISTS => 7,
FUNX_DBCREATEERR => 8,
FUNX_DBCONNECTERR => 9,
FUNX_TMPFILEERR => 10,
FUNX_DBWRITEERR => 11,
FUNX_INVALIDUSER => 12,
FUNX_DBLOCKERR => 13,
FUNX_DBUNLOCKERR => 14,
FUNX_WERR => 100,
);
constant->import(%error_codes);
my @syms = keys(%error_codes);
our @EXPORT_OK = @syms;
our %EXPORT_TAGS = ( ALL => @syms, ERROR_CODES => @syms );
}
On top of addressing the issue you raised, the above
- Fixes the polluting of the user's namespace. Don't dump a bunch of symbols into other namespaces by default!
- Fixes the poor names that could conflict with other modules. You think you're the only module that has a code for
SUCCESS
? - Fixes the polluting of your module's
@ISA
. Funx is not a subclass of Exporter.
Usage:
use Funx; # Imports nothing.
use Funx qw( ); # Imports nothing.
use Funx qw( :ERROR_CODES ); # Imports error codes.
use Funx qw( :ALL ); # Imports error codes.
use Funx qw( FUNX_SUCCESS FUNX_NOFILE ); # Imports specific error codes.
If you used constants instead of variables,
package Funx;
use strict;
use warnings;
use constant qw( );
use Exporter qw( import );
BEGIN {
my %error_codes = (
FUNX_SUCCESS => 0,
FUNX_NOFILE => 1,
FUNX_COPYFAIL => 2,
FUNX_SOXFAIL => 3,
FUNX_CURLFAIL => 4,
FUNX_OPENFAIL => 5,
FUNX_APPRUNNING => 6,
FUNX_RAWDBEXIISTS => 7,
FUNX_DBCREATEERR => 8,
FUNX_DBCONNECTERR => 9,
FUNX_TMPFILEERR => 10,
FUNX_DBWRITEERR => 11,
FUNX_INVALIDUSER => 12,
FUNX_DBLOCKERR => 13,
FUNX_DBUNLOCKERR => 14,
FUNX_WERR => 100,
);
constant->import(%error_codes);
my @syms = keys(%error_codes);
our @EXPORT_OK = @syms;
our %EXPORT_TAGS = ( ALL => @syms, ERROR_CODES => @syms );
}
On top of addressing the issue you raised, the above
- Fixes the polluting of the user's namespace. Don't dump a bunch of symbols into other namespaces by default!
- Fixes the poor names that could conflict with other modules. You think you're the only module that has a code for
SUCCESS
? - Fixes the polluting of your module's
@ISA
. Funx is not a subclass of Exporter.
Usage:
use Funx; # Imports nothing.
use Funx qw( ); # Imports nothing.
use Funx qw( :ERROR_CODES ); # Imports error codes.
use Funx qw( :ALL ); # Imports error codes.
use Funx qw( FUNX_SUCCESS FUNX_NOFILE ); # Imports specific error codes.
edited Nov 23 '18 at 5:52
answered Nov 23 '18 at 5:42
ikegamiikegami
268k11181407
268k11181407
add a comment |
add a comment |
You can use source filter to add some custom preprocessing.
Example:
package MyExport;
use Filter::Util::Call;
sub import {
my ($type) = @_;
my ($ref) = ;
filter_add(bless $ref);
}
sub filter {
my ($self) = @_;
my ($status);
if (($status = filter_read()) > 0) {
s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
}
$status;
}
1;
Usage:
...
use MyExport;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT;
...
our export $SUCCESS = 0;
...
Note that this implementation may be buggy. Basically s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
regexp turns lines like
our export $SUCCESS = 0;
into
push @EXPORT, '$SUCCESS'; our $SUCCESS = 0;
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
add a comment |
You can use source filter to add some custom preprocessing.
Example:
package MyExport;
use Filter::Util::Call;
sub import {
my ($type) = @_;
my ($ref) = ;
filter_add(bless $ref);
}
sub filter {
my ($self) = @_;
my ($status);
if (($status = filter_read()) > 0) {
s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
}
$status;
}
1;
Usage:
...
use MyExport;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT;
...
our export $SUCCESS = 0;
...
Note that this implementation may be buggy. Basically s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
regexp turns lines like
our export $SUCCESS = 0;
into
push @EXPORT, '$SUCCESS'; our $SUCCESS = 0;
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
add a comment |
You can use source filter to add some custom preprocessing.
Example:
package MyExport;
use Filter::Util::Call;
sub import {
my ($type) = @_;
my ($ref) = ;
filter_add(bless $ref);
}
sub filter {
my ($self) = @_;
my ($status);
if (($status = filter_read()) > 0) {
s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
}
$status;
}
1;
Usage:
...
use MyExport;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT;
...
our export $SUCCESS = 0;
...
Note that this implementation may be buggy. Basically s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
regexp turns lines like
our export $SUCCESS = 0;
into
push @EXPORT, '$SUCCESS'; our $SUCCESS = 0;
You can use source filter to add some custom preprocessing.
Example:
package MyExport;
use Filter::Util::Call;
sub import {
my ($type) = @_;
my ($ref) = ;
filter_add(bless $ref);
}
sub filter {
my ($self) = @_;
my ($status);
if (($status = filter_read()) > 0) {
s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
}
$status;
}
1;
Usage:
...
use MyExport;
use Exporter;
our @ISA = 'Exporter';
our @EXPORT;
...
our export $SUCCESS = 0;
...
Note that this implementation may be buggy. Basically s/^(.*)s+exports+(S+)(.*)$/push @EXPORT, '$2'; $1 $2 $3/;
regexp turns lines like
our export $SUCCESS = 0;
into
push @EXPORT, '$SUCCESS'; our $SUCCESS = 0;
answered Nov 22 '18 at 17:03
UjinT34UjinT34
2,0711316
2,0711316
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
add a comment |
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
Please don't seriously suggest source filters for anything more than trivial oneliners...
– Grinnz
Nov 23 '18 at 19:58
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434203%2fcan-i-condense-my-export-routine-in-my-perl-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What does Funx stand for? It's a good idea to use descriptive names for things. Also, why is
use strict
commented out?– simbabque
Nov 22 '18 at 15:35
1
Export a function that returns a hash? Or just export a hash directly?
– stevieb
Nov 22 '18 at 15:44
1
My 2 cents: call the package
Err
, and don't export. Then you can usereturn $Err::OPENFAIL;
which is, IMO, clearer anyway.– Tanktalus
Nov 22 '18 at 15:46