Debian logoDebian Screenshots >

libscalar-listify-perl

module that produces an array/arrayref from a scalar value or array ref

Description

A lot of Perl code ends up with scalars having either a single scalar value or a reference to an array of scalar values. In order to handle the two conditions, one must check for what is in the scalar value before getting on with one's task. Ie:

 $text_scalar = 'text';

 $aref_scalar = [ 1.. 5 ];

 print ref($text_scalar) ? (join ':', @$text_scalar) : $text_scalar;

Upload more screenshots

Please help extend the collection of screenshots. Just make a screenshot and upload it here. You don't need to register or anything.


Homepage

https://metacpan.org/release/Scalar-Listify


Statistics

553 other people were interested in this package here. The newest known version of this software is 0.03-2 (Information last updated 1 day ago.)