Pacific-Design.com

    
Home Index

1. Perl5

2. Types

+ Arrays

+ Constants

+ Formatting

+ Hash

+ HashRef

+ Is Number

+ Lexical

+ Package

+ Reference

+ Storable

+ Structures

Perl5 / Types /

Generic Collection

Generic Collection is a flexible data structure
that can hold heterogeneous objects
where the elements may have any reference type.

Fail computation on non-numeric values

#!/usr/bin/perl
use strict;
use warnings FATAL => 'numeric';

my $str = "hello fail";
my $int = 100;

my $result = $int + $str;

print "--- This line will never print ---\n";