perl 5.14 for pragmatists
DESCRIPTION
TRANSCRIPT
Perl 5.14for pragmatists
perlhist
5.14
perlhist
5.14
- after 5.8, we had to wait 5 years for 5.10
perlhist
5.14
- after 5.8, we had to wait 5 years for 5.10
- 5.12 came out 2 years after 5.10
perlhist
5.14
- after 5.8, we had to wait 5 years for 5.10
- 5.12 came out 2 years after 5.10
- 5.14 came out 1 year after 5.12
perlhist
5.14
- after 5.8, we had to wait 5 years for 5.10
- 5.12 came out 2 years after 5.10
- 5.14 came out 1 year after 5.12
- 5.16 will come 1 year from 5.14
perlhist
5.14
perlhist
5.14
- 5.10 was a huge set of changes (too many!)
perlhist
5.14
- 5.10 was a huge set of changes (too many!)
- 5.12 was a lot smaller
perlhist
5.14
- 5.10 was a huge set of changes (too many!)
- 5.12 was a lot smaller
- 5.14 is in between
perlhist
5.14
- 5.10 was a huge set of changes (too many!)
- 5.12 was a lot smaller
- 5.14 is in between
- just right?
perl5140delta
5.14 is a Mixed Bag
perl5140delta
5.14 is a Mixed Bag
- this talk isn’t just for beginners
perl5140delta
5.14 is a Mixed Bag
- this talk isn’t just for beginners
- some of these changes are at the edges
perl5140delta
5.14 is a Mixed Bag
- this talk isn’t just for beginners
- some of these changes are at the edges
- but they’re all practical
perl5140delta
5.14 is a Mixed Bag
- this talk isn’t just for beginners
- some of these changes are at the edges
- but they’re all practical
- except for the ones that aren’t
perl5150delta
By the way, 5.16...
perl5150delta
By the way, 5.16...
- ...and beyond are going to be interesting
perl5150delta
By the way, 5.16...
- ...and beyond are going to be interesting
- stick around right here after the break and hear Jesse “Double Pumpking” Vincent talk about it
perlpolicy
...and 5.10 is EOL
perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
- we do security fixes for releases in last 3 years
perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
- we do security fixes for releases in last 3 years
- 5.10 was 2007; it gets no promise of support
perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
- we do security fixes for releases in last 3 years
- 5.10 was 2007; it gets no promise of support
- if you’re still on 5.8, you’re in the weeds
but enough about other versions
let’s talk about 5.14
feature
First: A Warning
feature
First: A Warning
- 5.14 is backwards compatible
feature
First: A Warning
- 5.14 is backwards compatible
- but has some new behaviors
feature
First: A Warning
- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
feature
First: A Warning
- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
- no new feature.pm features in 5.14!
feature
First: A Warning
- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
- no new feature.pm features in 5.14!
I’m a perldoc ref!
feature
First: A Warning
- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
- no new feature.pm features in 5.14!
perlsyn
Stuff That’s Gone
perlsyn
- modules deprecated in 5.12 are gone in 5.14
Stuff That’s Gone
perlsyn
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
Stuff That’s Gone
perlsyn
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
Stuff That’s Gone
perlsyn
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
- Class::ISA
Stuff That’s Gone
perlsyn
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
- Class::ISA
- Pod::Plainer
Stuff That’s Gone
perlsyn
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
- Class::ISA
- Pod::Plainer
- Switch
Stuff That’s Gone
Perl4::CoreLibs
Stuff That’s Going
Perl4::CoreLibs
- Devel::DProf
- use Devel::NYTProf instead!
- the Perl 4 core
- bigrat.pl, ftp.pl, etc
- Perl4::CoreLibs
- Shell (again)
Stuff That’s Going
attributes
:=
attributes
:=
sub login : Local { ... }
attributes
:=
sub login : Local { ... }
my $x : Private = 10;
attributes
:=
sub login : Local { ... }
my $x : Private = 10;
my $x := 10;
attributes
:=
sub login : Local { ... }
my $x : Private = 10;
my $x := 10;
perlop
qw()
for my $show qw(Smallville Lost V) { $tivo->cancel_pass( $show );}
perlop
qw()
for my $show (qw(Smallville Lost V)) { $tivo->cancel_pass( $show );}
perl5140delta
That’s it!
perl5140delta
- those are all the things being removed
That’s it!
perl5140delta
- those are all the things being removed
- these are not scary removals
That’s it!
perlsyn
One More Thing!
perlsyn
One More Thing!
$str =~ m/foo/sand bar;
perlsyn
One More Thing!
$str =~ m/foo/sand bar;
$str =~ m/foo/s and bar;
perlre
New Regex Modifiers
my $hostname = get_hostname;
$hostname =~ s/\..*//;
perlre
New Regex Modifiers
my $hostname = get_hostname =~ s/\..*//;
perlre
New Regex Modifiers
(my $hostname = get_hostname) =~ s/\..*//;
perlre
New Regex Modifiers
my $hostname = get_hostname =~ s/\..*//r;
perlre
New Regex Modifiers
my @short_names = map { s/\..*//; } @long_names;
perlre
New Regex Modifiers
my @short_names = map { s/\..*//; $_ } @long_names;
perlre
New Regex Modifiers
my @short_names = map { my $x = $_; $x =~ s/\..*//; $s } @long_names;
perlre
New Regex Modifiers
my @short_names = map { s/\..*//r } @long_names;
perlre
New Regex Modifiers
my @short_names = map s/\..*//r, @long_names;
perlre
New Regex Modifiers
/u
/a
/aa
/l
/d
perllocale
New Regex Modifiers
perllocale
New Regex Modifiers
/l - use locale rules
perllocale
New Regex Modifiers
/l - use locale rules
YOU DON’T WANT THIS
perlre
New Regex Modifiers
perlre
New Regex Modifiers
/u - use Unicode rules
perlre
New Regex Modifiers
/u - use Unicode rules
\d matches BENGALI DIGIT FOUR
perlre
New Regex Modifiers
/u - use Unicode rules
\d matches BENGALI DIGIT FOUR
\w matches LATIN SMALL LETTER ETH
perlre
New Regex Modifiers
/u - use Unicode rules
\d matches BENGALI DIGIT FOUR
\w matches LATIN SMALL LETTER ETH
“\N{LATIN SMALL LIGATURE FF}” =~ /ff/ui
perlre
New Regex Modifiers
/a - Unicode, but ASCII rules for classes
\d rejects BENGALI DIGIT FOUR
\w rejects LATIN SMALL LETTER ETH
“\N{LATIN SMALL LIGATURE FF}” =~ /ff/ai
perlre
New Regex Modifiers
/aa - Unicode, ASCII won’t match non-ASCII
\d rejects BENGALI DIGIT FOUR
\w rejects LATIN SMALL LETTER ETH
“\N{LATIN SMALL LIGATURE FF}” !~ /ff/aai
perlre
New Regex Modifiers
/aa - Unicode, ASCII won’t match non-ASCII
\d rejects BENGALI DIGIT FOUR
\w rejects LATIN SMALL LETTER ETH
“\N{LATIN SMALL LIGATURE FF}” !~ /ff/aai
“\N{LATIN SMALL LIGATURE FF}” !~ /\pL/aai
perlre
New Regex Modifiers
perlre
New Regex Modifiers
/d - default semantics
perlre
New Regex Modifiers
/d - default semantics
Use Unicode if it’s seems like it’s
perlre
New Regex Modifiers
/d - default semantics
Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern
perlre
New Regex Modifiers
/d - default semantics
Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses \p or \N{...}
perlre
New Regex Modifiers
/d - default semantics
Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses \p or \N{...}
Otherwise, on ASCII systems use ASCII
perlre
New Regex Modifiers
/d - default semantics
Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses \p or \N{...}
Otherwise, on ASCII systems use ASCII
Otherwise, on EBCDIC systems use Latin-1
perlre
New Regex Modifiers
/d - duhhhh-derrrrr semantics
Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses \p or \N{...}
Otherwise, on ASCII systems use ASCII
Otherwise, on EBCDIC systems use Latin-1
perlre
New Regex Modifiers
# To be really ASCII-only:
die “funny un-American characters” if $str =~ /[^\x00-\x7F]/;
$str =~ /...actual pattern.../;
perlunitut
- Learn as much as you can!
- Seriously!
- Decode user input, use /aa, use \p_
- Consider: use re ‘/aa’
- But mostly: learn more.
What should I do??
perlre
New Regex Modifiers
perlre
New Regex Modifiers
$ perl-5.12.4 -E ‘say qr//’
perlre
New Regex Modifiers
$ perl-5.12.4 -E ‘say qr//’(?-xism:)
perlre
New Regex Modifiers
$ perl-5.12.4 -E ‘say qr//’(?-xism:)
$ perl-5.14.1 -E ‘say qr//’
perlre
New Regex Modifiers
$ perl-5.12.4 -E ‘say qr//’(?-xism:)
$ perl-5.14.1 -E ‘say qr//’(?^u:)
perlunitut
Perl is really goodat Unicode.
perlunitut
Perl is really goodat Unicode.
Unicode is justthat complex.
perlunitut
- ...well, as long as we’re on the subject...
More Unicode!
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
charnames
Unicode 6
perlunitut
- “unicode_strings” feature is improved
- \N{...} understands abbreviations
- ...and you can make your own
- better support for surrogates and non-characters
More Unicode!
Container Improvements
perl5120delta
Stuff From 5.12
perl5120delta
- local works more better
Stuff From 5.12
perl5120delta
- local works more better
- assigning to $[ gets a warning
Stuff From 5.12
perl5120delta
- local works more better
- assigning to $[ gets a warning
- each works on arrays
Stuff From 5.12
perl5140delta
That Stuff in 5.14
perl5140delta
- local works even more betterer
That Stuff in 5.14
perl5140delta
- local works even more betterer
- assigning to ($[) gets a warning
That Stuff in 5.14
perl5140delta
- local works even more betterer
- assigning to ($[) gets a warning
- each works on arrayrefs
That Stuff in 5.14
perlfunc
each on arrayrefsmy @array = qw( foo bar baz ) ;
while (my ($k, $v) = each @array) { say “$k: $v”;}
perlfunc
each on arrayrefsmy @array = qw( foo bar baz ) ;
while (my ($k, $v) = each @array) { say “$k: $v”;}
0: foo1: bar2: baz
perlfunc
each on arrayrefsmy $array = [ qw( foo bar baz ) ];
while (my ($k, $v) = each $array) { say “$k: $v”;}
0: foo1: bar2: baz
perlfunc
each on arrayrefs
perlfunc
each on arrayrefs
my ($x, $y) = each @{ $h->{foo}[1] }
perlfunc
each on arrayrefs
my ($x, $y) = each @{ $h->{foo}[1] }
my ($x, $y) = each $h->{foo}[1]
AVOIDeach @array
perlfunc
built-ins on references
perlfunc
built-ins on references
push $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayrefvalues $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayrefvalues $arrayrefeach $arrayref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayrefvalues $arrayrefeach $arrayref
keys $hashref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayrefvalues $arrayrefeach $arrayref
keys $hashrefvalues $hashref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayrefvalues $arrayrefeach $arrayref
keys $hashrefvalues $hashrefeach $hashref
perlfunc
built-ins on references
push $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref
keys $arrayrefvalues $arrayrefeach $arrayref
keys $hashrefvalues $hashrefeach $hashrefEXPERIMENTAL
perlfunc
built-ins on references
perlfunc
built-ins on references
sub demo (+$) {
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_;
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_; # do stuff
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_; # do stuff}
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_; # do stuff}
demo( @array, $n );
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_; # do stuff}
demo( @array, $n );demo(\@array, $n );
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_; # do stuff}
demo( @array, $n );demo(\@array, $n );demo( %hash, $n );
perlfunc
built-ins on references
sub demo (+$) { my ($x, $y) = @_; # do stuff}
demo( @array, $n );demo(\@array, $n );demo( %hash, $n );demo(\%hash, $n );
perlfunc
Package Blocks
package Library::Awesome;our $VERSION = 1.234;
sub foo { ... }
1;
perlfunc
Package Blocks
package Library::Awesome 1.234 {
sub foo { ... }
}
1;
perlfunc
Package Blocks
package Library::Awesome 1.234 {
sub foo { ... }
}
1;
perlfunc
Package Blocks
package Library::Awesome 0.2-1alpha {
sub foo { ... }
}
1;
perlfunc
Package Blocks
package Library::Awesome 1.234;
sub foo { ... }
1;
perlmodlib
Speaking of Packages
perlmodlib
Speaking of Packages
- Perl 5.14 removed a bunch of modules
perlmodlib
Speaking of Packages
- Perl 5.14 removed a bunch of modules
- ...so there was room to add new ones!
HTTP::Tiny
HTTP::Tiny
use 5.14.0;use HTTP::Tiny;
my $http = HTTP::Tiny->new;my $res = $http->get( $url );
print $res->{content} if $res->{success};
JSON::PP
JSON::PP
use JSON::PP;
my $data = decode_json( $json_string );
my $json = encode_json( $data_struct );
JSON::PP
JSON::PP
use 5.14.0;
JSON::PP
use 5.14.0;use autodie;
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
my $tgz = $http->get( $json->{download_url} );
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
my $tgz = $http->get( $json->{download_url} );die $tgz->{reason} unless $tgz->{success};
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
my $tgz = $http->get( $json->{download_url} );die $tgz->{reason} unless $tgz->{success};
open my $fh, ‘>’, $dist->{archive};
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
my $tgz = $http->get( $json->{download_url} );die $tgz->{reason} unless $tgz->{success};
open my $fh, ‘>’, $dist->{archive};
$fh->print( $tgz->{content} );
JSON::PP
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
my $tgz = $http->get( $json->{download_url} );die $tgz->{reason} unless $tgz->{success};
open my $fh, ‘>’, $dist->{archive};
$fh->print( $tgz->{content} );$fh->close;
IO::File
use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;
my $moose = ‘http://api.metacpan.org/release/Moose’;
my $http = HTTP::Tiny->new;my $json = $http->get( $moose );die $json->{reason} unless $json->{success};
my $dist = decode_json( $json );
my $tgz = $http->get( $json->{download_url} );die $tgz->{reason} unless $tgz->{success};
open my $fh, ‘>’, $dist->{archive};
$fh->print( $tgz->{content} );$fh->close;
perlopentut
IO::File
open my $fh, ‘<’, $some_filename or die “can’t open fh: $!”;
print {$fh} “Some output.”;
close $fh or die “can’t close fh: $!”;
autodie
IO::Fileuse 5.10.1;use autodie;
open my $fh, ‘>’, $some_filename;
print {$fh} “Some output.”;
close $fh;
IO::File
IO::Fileuse 5.10.1;use autodie;use IO::File;
open my $fh, ‘>’, $some_filename;
$fh->print( “Some output.” );
$fh->close;
IO::File
IO::Fileuse 5.14.0;use autodie;use IO::File;
open my $fh, ‘>’, $some_filename;
$fh->print( “Some output.” );
$fh->close;
IO::File
IO::Fileuse 5.14.0;use autodie;
open my $fh, ‘>’, $some_filename;
$fh->print( “Some output.” );
$fh->close;
IO::File
IO::Fileuse 5.14.0;use autodie;
open my $fh, ‘>’, $some_filename;
$fh->print( “Some output.” );
$fh->close or die “can’t close: $!”;
perlvar
$@
Try::Tiny
$@
Try::Tiny
$@
- Well, actually, you use Try::Tiny, right?
Try::Tiny
$@
- Well, actually, you use Try::Tiny, right?
- But this makes Try::Tiny more reliable, too!
Try::Tiny
$@
- Well, actually, you use Try::Tiny, right?
- But this makes Try::Tiny more reliable, too!
- You see, eval and $@ are totally awful
perlfunc
use 5.12.0;
{ package X; sub DESTROY { eval { } }}
eval { my $x = bless {} => ‘X’; die “DEATH!!”;};
warn “ERROR: $@”;
perlfunc
use 5.12.0;
{ package X; sub DESTROY { eval { } }}
eval { my $x = bless {} => ‘X’; die “DEATH!!”;};
warn “ERROR: $@”;
$ perl5.12.4 test.plERROR:
perlfunc
use 5.14.0;
{ package X; sub DESTROY { eval { } }}
eval { my $x = bless {} => ‘X’; die “DEATH!!”;};
warn “ERROR: $@”;
perlfunc
use 5.14.0;
{ package X; sub DESTROY { eval { } }}
eval { my $x = bless {} => ‘X’; die “DEATH!!”;};
warn “ERROR: $@”;
$ perl5.14.1 test.plERROR: DEATH!!
Socket
IPv6 Support!
Socket
IPv6 Support!
- IPv4 is getting pretty old
Socket
IPv6 Support!
- IPv4 is getting pretty old
- not a big deal
Socket
IPv6 Support!
- IPv4 is getting pretty old
- not a big deal
- won’t run out of addresses until 2011-04-15
Socket
IPv6 Support!
- IPv4 is getting pretty old
- not a big deal
- won’t run out of addresses until 2011-04-15
- …the future!
More Random Stuff
perlsyn
say “I \o{23145} Perl 5.14!”;
perlsyn
say “I \o{23145} Perl 5.14!”;
I ♥ Perl 5.14!
perlsyn
say “I \23145 Perl 5.14!”;
I ?45 Perl 5.14!
perlsyn
say “I \023145 Perl 5.14!”;
I 145 Perl 5.14!
perlre
# Pretend there are 15 captures:qr{ (1) (2) (3) (4) \7 \10 (5) (6) (7) (8) (9) \7 \10 (10) \7 \10}x;
perlre
# Pretend there are 15 captures:qr{ (1) (2) (3) (4) \o{7} \o{10} (5) (6) (7) (8) (9) \o{7} \o{10} (10) \g{7} \g{10}}x;
perlsyn
my @hex = (0x0D, 0x0A);my @bin = (0b1101, 0b1010);
perlsyn
my @hex = (0x0D, 0x0A);my @bin = (0b1101, 0b1010);
my @hex = (0X0D, 0X0A);my @bin = (0B1101, 0B1010);
perlfunc
printf “%hhu\n”, 10;
printf “%tu\n”, 10;
printf “%zu\n”, 10;
perlfunc
printf “%hhu\n”, 10; # char
printf “%tu\n”, 10; # ptrdiff_t
printf “%zu\n”, 10; # size_t
perlfunc
0.0416303447718782
perlfunc
perl -E ‘srand(1); say rand;’
perlfunc
my $seed = srand;
http://www.perl.org/get.html
Any questions?