Perl
From Syntax
Contents |
[edit] ActiveState
[edit] Installing packages
Apparently these can't be installed from the stock ActiveState servers at the time of this writing. Use this new repository to install the following modules, and more.
- List::MoreUtils
- Soap::Lite
- XML::Parser::Lite
- WWW::Mechanize
ppm repo add http://cpan.uwinnipeg.ca/PPMPackages/10xx/
For IO::CaptureOutput, do the following:
ppm install http://www.bribes.org/perl/ppm/Scalar-List-Utils.ppd ppm install http://www.bribes.org/perl/ppm/PathTools.ppd ppm install IO-CaptureOutput
For more information about this repository, see http://www.bribes.org/perl/ppmdir.html.
[edit] Anonymous scalar
bless \do { my $foo }, 'Foo';
[edit] Numeric context
A scalar can either be a string or a number, though this nature is usually transparent in its use. To force a string that looks like a number into numeric context, stripping it of it's trailing zeroes and decimal places, add zero to it.
my $a = "2.40000"; $a += 0; # $a == 2.4
