/usr/share/perl5/Web/Simple/AntiquatedPerl.pod is in libweb-simple-perl 0.031-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | =head1 NAME
Web::Simple::AntiquatedPerl - the slides from the talk
=head1 WHAT?
Web::Simple was originally introduced in a talk at the Italian Perl Workshop,
entitled Antiquated Perl.
The video is available on the Shadowcat site: <http://www.shadowcat.co.uk/archive/conference-video/ipw-2009/antiquated>
If you don't particularly want to watch me confusing a bunch of Italian perl
mongers, the slides are reproduced below.
=head1 SLIDES
Antiquated
Perl
----
Modern
Perl?
----
Post
Modern
Perl
----
Enlightened
Perl
----
everybody
knows
----
Catalyst
Moose
DBIx::Class
----
Modern
Perl?
----
perl5
v10
----
given ($x) {
when (3) {
...
----
~~
----
what's the
opposite?
----
Old
Perl?
----
if it
works
----
Legacy
Perl?
----
not
interesting
----
Stupid
Perl
----
*$&^*(^
FormMail.PL
----
Antiquated
Perl
----
Antique
----
Old *and*
beautiful
----
Simple
Elegant
----
$|++
----
use IO::Handle;
STDOUT->autoflush(1);
----
it's core.
it's fine.
----
but why
think?
----
select((select(FOO),$|++)[0])
----
(select(FOO),$|++)
->
($old_selected_fh,$|)
----
(select(FOO),$|++)[0]
->
$old_select_fh
----
select((select(FOO),$|++)[0])
->
use IO::Handle;
FOO->autoflush(1)
----
~~
----
~~@x
----
~(~(@x))
----
bitwise
negation
----
so ...
----
~@x
->
~(scalar @x)
----
~~$number
->
$number
----
~~@x
->
scalar @x
----
perl -MMoose -e'print ~~keys %INC'
84
----
overload::constant
----
lets you
affect
parsing
----
numbers
strings
----
q qq qr
t s qw
----
i18n.pm
----
~~"$foo bar"
loc("_[0] bar", $foo)
----
for
----
for ($foo) {
/bar/ and ...
----
for ($foo) {
/bar/ and return do {
<code here>
}
----
/foo/gc
----
/\Gbar/gc
----
sub parse {
my ($self, $str) = @_;
for ($str) {
/match1/gc and return
$self->_subparse_1($_)
----
sub _subparse_1 {
my ($self) = @_;
for ($_[1]) {
/\Gsubmatch1/gc ...
----
prototypes
----
sub foo (&) {
----
foo {
...
};
----
prototype \&foo
----
typeglobs
----
*{"${package}::${name}"}
= sub { ... }
----
local
----
local $_
----
local *Carp::croak
= \&Carp::confess;
----
do {
local (@ARGV, $/) = $file;
<>
}
----
strict
and
warnings
----
strict->import
----
affects
compilation
scope
----
sub strict_and_warnings::import {
strict->import;
warnings->import;
}
----
use strict_and_warnings;
----
$^H
%^H
----
$^H |= 0x20000;
$^H{'foo'}
= bless($foo, 'My::Foo');
----
sub My::Foo::DESTROY {
----
delete ${$package}{myimport}
----
B::Hooks::EndOfScope
----
tie
----
tie $var, 'Foo';
----
sub FETCH
sub STORE
----
Scalar
Array
Hash
Handle
----
now ...
----
mst: destruction
testing technology
since March 1983
----
3 days
old
----
2 weeks
early
----
incubator
----
glass box
plastic tray
heater
----
design
flaw
----
BANG
----
so ...
----
interesting
fact
----
prototypes
only warn
when parsed
----
error when
compiled
----
so ...
----
dispatch [
sub (GET + /) { ... },
sub (GET + /user/*) { ... }
];
----
foreach my $sub (@$dispatch) {
my $proto = prototype $sub;
$parser->parse($proto);
...
----
PARSE: { do {
push @match, $self->_parse_spec_section($spec)
or $self->_blam("Unable to work out what the next section is");
last PARSE if (pos == length);
/\G\+/gc or $self->_blam('Spec sections must be separated by +');
} until (pos == length) };
----
sub _blam {
my ($self, $error) = @_;
my $hat = (' ' x pos).'^';
die "Error parsing dispatch specification: ${error}\n
${_}
${hat} here\n";
}
----
Error parsing ...
GET+/foo
^ here
----
sub (GET + /user/*) {
my ($self, $user) = @_;
----
I hate
fetching
$self
----
*{"${app}::self"}
= \${"${app}::self"};
----
use vars
----
sub _run_with_self {
my ($self, $run, @args) = @_;
my $class = ref($self);
no strict 'refs';
local *{"${class}::self"} = \$self;
$self->$run(@args);
}
----
HTML
output
----
templates
----
HTML is
NOT TEXT
----
<div>,
$text,
</div>;
----
<div>
----
<$fh>
----
tie *{"${app}::${name}"},
'XML::Tags::TIEHANDLE',
"<${name}>";
----
sub TIEHANDLE { my $str = $_[1]; bless \$str, $_[0] }
sub READLINE { ${$_[0]} }
----
sub DESTROY {
my ($into, @names) = @$_[0];
no strict 'refs';
delete ${$into}{$_}
for @names;
}
----
</div>
----
glob('/div');
----
*CORE::GLOBAL::glob
= sub { ... };
----
delete
${CORE::GLOBAL::}{glob};
----
sub foo {
use XML::Tags qw(div);
<div>, "foo!", </div>;
}
----
what about
interpolation
----
my $stuff = 'foo"bar';
<a href="$stuff">
----
hmm ...
----
overload::constant!
----
glob('a href="'.$stuff.'"');
----
glob(
bless(\'a href="', 'MagicTag')
.$stuff
.bless(\'"', 'MagicTag')
)
----
use overload
'.' => 'concat';
sub concat {
----
hooking
it up
----
sub (.html) {
filter_response {
$self->render_html($_[1])
}
}
----
bless(
$_[1],
'Web::Simple::ResponseFilter'
);
----
if ($self->_is_response_filter($result)) {
return $self->_run_with_self(
$result,
$self->_run_dispatch_for($new_env, \@disp)
);
}
----
and the result?
----
goto &demo;
----
questions?
----
thank
you
=head1 AUTHOR
Matt S. Trout <mst@shadowcat.co.uk>
=head1 COPYRIGHT
Copyright (c) 2011 Matt S. Trout <mst@shadowcat.co.uk>
=head1 LICENSE
This text is free documentation under the same license as perl itself.
=cut
|