-
-
29 Nov 2013 18:24:01 UTC
- Distribution: Acme-LookOfDisapproval
- Module version: 0.006
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (2)
- Testers (252 / 0 / 200)
- Kwalitee
Bus factor: 1- 97.73% Coverage
- License: perl_5
- Perl: v5.16.0
- Activity
24 month- Tools
- Download (21.21KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- FUNCTIONS
- BACKGROUND
- SUPPORT
- SEE ALSO
- AUTHOR
- COPYRIGHT AND LICENSE
NAME
Acme::LookOfDisapproval - send warnings with ಠ_ಠ
VERSION
version 0.006
SYNOPSIS
use Acme::LookOfDisapproval; ಠ_ಠ 'you did something dumb';
DESCRIPTION
Use
ಠ_ಠ
whenever you would usewarn
, to express your profound disapproval.FUNCTIONS
ಠ_ಠ
Behaves identically to "warn" in perlfunc.
BACKGROUND
I wrote this as an exercise in using unicode in code, not just in a string. Then, it became an interesting learning experience in how to cleanly map to a core function, and re-exporting symbols.
The first draft did this:
use Carp 'carp'; sub ಠ_ಠ { local $Carp::CarpLevel = $Carp::CarpLevel + 1; carp @_; }
And then it became:
BEGIN { no strict 'refs'; *{__PACKAGE__ . '::ಠ_ಠ'} = *CORE::warn; }
But this is even nicer:
sub ಠ_ಠ { goto &CORE::warn }
I also played around with Import::Into to manage the export of both the utf8 pragma and the
ಠ_ಠ
symbol. However, that's just silly when we can callimport
directly on utf8 (it's a pragma, so the caller doesn't matter -- only when it is called: during the caller's compilation cycle), and then we can export our symbol by using goto to jump to Exporter.I also discovered while writing this distribution that Dist::Zilla is not able to munge files with utf8 characters, therefore I had to switch to packaging this distribution with vanilla ExtUtils::MakeMaker; also, a number of the author and release tests that would have been added by dzil automatically didn't work either (for example, see
t/00-compile.t
--qx(^$X "require $_")
both needs the:binmode
or:encoding(UTF-8)
layer applied toSTDOUT
, and requires the utf8 pragma applied in the sub-perl (leading to more patches).SUPPORT
Bugs may be submitted through the RT bug tracker (or bug-Acme-LookOfDisapproval@rt.cpan.org). I am also usually active on irc, as 'ether' at
irc.perl.org
.SEE ALSO
lambda - another example of unicode sub names
AUTHOR
Karen Etheridge <ether@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Karen Etheridge.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Acme::LookOfDisapproval, copy and paste the appropriate command in to your terminal.
cpanm Acme::LookOfDisapproval
perl -MCPAN -e shell install Acme::LookOfDisapproval
For more information on module installation, please visit the detailed CPAN module installation guide.