[dancer-users] Why do warnings cause Dancer to fail?

Maxwell Carey mcarey at ucar.edu
Tue May 6 18:49:10 BST 2014


On 05/06/2014 11:40 AM, Warren Young wrote:
> On 5/5/2014 16:51, Robert Stone wrote:
>>
>> my $foo = params 'foo' // '';
>
> Alas for those of us who still must support Perl 5.8.  That operator 
> was introduced in 5.10.

A pre-5.10 equivalent to defined-or that avoids the pitfall with falsey 
values:

     my $foo = ( defined params 'foo' ) ? params 'foo' : '';


More information about the dancer-users mailing list