What can you do here?
If you are a beginner, or would like to refresh your Perl programming knowledge,
you can go over the Perl tutorial.
You will find a few advanced articles too, though most of the advanced articles are available to the
subscribers of the Perl Maven Pro service only.
If you are interested to listen to or even see other Perl developers,
the Perl Maven TV Show is a collection of such interviews.
Want to make sure you don't miss any of the Perl Maven articels?
Sign up to the newsletter!
Often there are cases your Perl application has some default values that can be overridden
by a value in a configuration file or on the command line. The same can be the case
for individual functions in perl that accept arguments. In case the arguments
are not provided, the function will use its default values.
Let's see how to set default values.
How to set default values in Perl
There are many modules with function that would give a warning in certain situations. This can be a deprecation warning,
when the function is left in to provide backward compability, but you actually want to remove it in the future.
Or, it can be warning of improper input values if for some reason you do not want to throw an exception.
In either case, the warning must stay there as changes are made to the code-base. That warning is now part of API of the module
and as such we should write a test that will make sure the warning isn't removed by accident or by someone who
likes to eliminate warnings....
Test for expected warnings
The Perl Maven site was based
on the Perl Dancer web framework, more specifically
on Dancer, the first major version of the framework.
Dancer has a couple of issues I encountered that caused a lot of headache. I had several choices
- Leave Dancer and Write it based on plain PSGI/Plack.
- Abandon Dancer and write in it some other framework such as Mojolicious or Catalyst.
- Fix the issues in Dancer
- Migrate to Dancer2
I decided to try to migrate to Dancer 2. This article is (going to be) both a diary of the process,
and hopefully a helping guide to others who would like to make similar migration.
Migrating (the Perl Maven site) from Dancer 1 to Dancer2