17 private links
Slides of Tim Bunce's talk on Devel::NYTProf and optimizing perl code at YAPC::NA in June 2014. It covers use of NYTProf and outlines a multi-phase approach to optimizing your perl code.
:dromedary_camel: List of resources about Perl.
:dromedary_camel: List of resources about Perl.
My favorite "failed" project: I was with a company that decided to rewrite a Perl project in C++ because Perl was too slow.
glot.io lets you run and share snippets.
Snippets can be saved as either public or secret. Public snippets will show up in /snippets and will be found by search engines. Secret snippets can only be accessed by those who know the url.
Code is executed inside a temporary container without a network connection. Execution time is limited to 15 seconds and the output can not exceed 100KiB. Memory is limited to 500MB.
Ace is used as the code editor. Make sure to check out the leftmost and rightmost tabs, where you can select language version, set a custom run command and change the editor keybindings.
Are you missing your favorite library or language? Issues and pull requests are gladly accepted here.
BUILD
is called after the constructor, which makes it handy to verify state but not necessarily useful to format incoming arguments.
BUILDARGS
would let you modify incoming arguments before the constructor is called, which makes it a better fit for this case. Your attribute is read-only, so this could work.
But... if you're hungry for static typing, why would you stop after promising "this is a string"? If you create a subtype for ISO8601 strings, you can promise "this is a string and it has X format". Even better, you're doing that in a way that's immediately and trivially portable to other attributes.
I rather doubt the regex below will work for you, but I hope it will get the point across:
#define the type
subtype 'iso8601',
as 'Str',
where { /\d{4}-\d{2}-\d{2}/ },
message { "Not a valid ISO8601 string ($_)" };
#provide a coercion
coerce 'iso8601',
from 'Str',
via { _format_as_iso8601 $_ };
#tell moose to coerce the value
has startdate => (is => 'ro', isa => 'iso8601', required => 1, coerce => 1);
Last Christmas, the inimitable Matt Trout (mst) created an opinionated tour of CPAN where he recommended modules for some common problems. I think its brilliant, useful, and entertaining and I’ve decided to compile a high level overview all on one page in order to create a quick reference.
I’ve tried to distill his wisdom and wit down to a few words. But I recommend clicking the section headers and following the links to Matt’s original posts to see his actual real opinions in their full complexity. This single page can’t replace 16 great posts and he usually includes advice on the best way to use the module. You won’t want to miss that.
'(flycheck-perl-include-path
(quote
("your path to your perl libraries")))
'(flycheck-perl-executable "path to your perl executable")
I've been looking at Gitlab's CI pipeline to automate testing and deployment of a Perl App I've been writing.
Gitlab's documentation on the subject is very comprehensive https://docs.gitlab.com/ee/ci/pipelines.html however there's no Perl example https://docs.gitlab.com/ee/ci/examples/README.html so I did a bit of playing to get a working configuration for those who are interested.
Gitlab makes it extremely easy to use their CI by creating a gitlab-ci.yml file to control the pipeline.
This library provides numerous functional programming utility methods, as well as functional varients of native in-built methods, to allow for consistent, concise code.
Online text tools is a collection of useful text processing utilities. All text tools are simple, free and easy to use. There are no ads, popups or other garbage. Just text utilities that work right in your browser. And all utilities work exactly the same way — load text, get result.
It has always been painful to do ASCII diagrams by hand. This perl application allows you to draw ASCII diagrams in a modern (but simple) graphical interface.
The ASCII graphs can be saved as ASCII or in a format that allows you to modify them later.
A simple status dashboard.
features
- Standalone - just Perl and some modules, no web server or database required
- REST API - including a public read-only one
- RSS feeds
In shell, you can do it in many ways:
cat input | xargs echo | tr ' ' ,
or
perl -pe 's/\r?\n/,/' input > output
I know you wanted this to be longer, but I don't really see the point of writing multi line script to solve such simple task - simple regexp (in case of perl solution) is fully workable, and it's not something artificially shortened - it's the type of code that I would use on daily basis to solve the issue at hand.