Welcome future Perl Maven!

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!

Recent Articles

Short-circuit in boolean expressions

Short-circuit means that an expression returns a value before evaluating all the parts in the expression. There are several areas where this can apply. Here we take a look at boolean expressions. Statements with and, or, and not keywords combined.

When there is a complex boolean expression Perl will execute it according to the Operator Precedence and Associativity, and will return some kind of a true or false value.

If it finds the final answer before it calculated the whole expression, it will return immediately.

Short-circuit in boolean expressions

CPAN, mcpan, MetaCPAN

Searching for a Perl module on Google will most probably lead you to a page on search.cpan.org, the old front-end of CPAN. By typing the letter 'm' in front of cpan.org in the URL, you can easily switch to MetaCPAN.

CPAN, mcpan, MetaCPAN

Pro: Testing timeout with cmp_ok

As mentioned earlier, the is() function compares the values using string-eq which is correct in 99% of the cases, but if you'd like to compare the values with numerical-== you can do it using the cmp_ok.

More than that, with cmp_ok you can compare the two values with any operator, so you can check if the actual value is, let's say, smaller than an expected value.

For example when measuring timeout, we cannot expect the result to be exact on the millisecond.

Testing timeout with cmp_ok

Do you want to improve your Perl?

Register to the FREE Perl Maven newsletter here.
or to the Perl Weekly newletter over there