If you upgrade to 5.10 you get:
- say
- state
- defined-or (//)
- Switch (given/when)
- Module::CoreList - List the modules your Perl has in core
If you upgrade to 5.12 you get:
ack -f --perl | ack '^\s*use ([^\s;(]+)' --output='$1' --noheading -h -x > ~/modules.txt | |
sort < ~/modules.txt | uniq -c | sort -k 1 -n -r |
#----------------- Carp::longmess | |
use Carp qw( longmess ); | |
sub foo { bar() } | |
sub bar { baz() } | |
sub baz { print Carp::longmess } | |
foo(); |
package My::Test; | |
use strict; | |
use warnings; | |
use Import::Into; | |
use Module::Runtime qw( use_module ); | |
sub import { | |
my ( $class, %args ) = @_; | |
my %modules = ( |
# Space too late. Run the command you wanted to run but you hit the space bar one | |
# character too late | |
# | |
# Usage: | |
# ln -s space-too-late gitp | |
# gitp ush | |
# gitc ommit | |
# | |
# Unlike its counterpart, space too soon, this one must be named differently based | |
# on which misspelling you frequently have |
USAGE=" | |
\t$(basename $0) <BRANCH>... -- <COMMIT>...\ | |
" | |
usage() { | |
echo "Usage:" | |
echo -e $USAGE | |
} |
package Test::Imports; [9/680] | |
use strict; | |
use warnings; | |
use base 'Test::Builder::Module'; | |
use Test::More; | |
use Capture::Tiny qw( capture_merged ); | |
our @EXPORT_OK = qw( :all does_import_strict does_import_warnings does_import_sub does_import_class); | |
our %EXPORT_TAGS = ( | |
'all' => [ grep { !/^:/ } @EXPORT_OK ], # All is everything except tags |
If you upgrade to 5.10 you get:
If you upgrade to 5.12 you get:
package MyApp; | |
use Mojo::Base 'Mojolicious'; | |
=attr rest_url | |
The URL to the REST API | |
=cut |
--- | |
title: A Test Post | |
author: preaction | |
content: | | |
# Markdown content goes here. | |
This is a new post using the brand-new command system. | |
Don't forget to maintain the indentation. |
use Test::MockTime qw( set_absolute_time ); | |
# Use the Pure-Perl loop so we can do janky things with time | |
use AnyEvent::Loop; | |
# set_absolute_time will update what time AnyEvent thinks it is | |
# Then you can run AnyEvent::Loop::one_event to run the event loop | |
# until something happens. | |
# | |
# AnyEvent::Loop::one_event will call _update_clock to get the current time. If |