3 Web::Simple::AntiquatedPerl - the slides from the talk
7 Web::Simple was originally introduced in a talk at the Italian Perl Workshop,
8 entitled Antiquated Perl.
10 The video is available on the Shadowcat site: <http://www.shadowcat.co.uk/archive/conference-video/ipw-2009/antiquated>
12 If you don't particularly want to watch me confusing a bunch of Italian perl
13 mongers, the slides are reproduced below.
92 select((select(FOO),$|++)[0])
102 select((select(FOO),$|++)[0])
130 perl -MMoose -e'print ~~keys %INC'
148 loc("_[0] bar", $foo)
156 /bar/ and return do {
165 my ($self, $str) = @_;
167 /match1/gc and return
168 $self->_subparse_1($_)
187 *{"${package}::${name}"}
198 local (@ARGV, $/) = $file;
212 sub strict_and_warnings::import {
217 use strict_and_warnings;
224 = bless($foo, 'My::Foo');
226 sub My::Foo::DESTROY {
228 delete ${$package}{myimport}
282 sub (GET + /) { ... },
283 sub (GET + /user/*) { ... }
286 foreach my $sub (@$dispatch) {
287 my $proto = prototype $sub;
288 $parser->parse($proto);
292 push @match, $self->_parse_spec_section($spec)
293 or $self->_blam("Unable to work out what the next section is");
294 last PARSE if (pos == length);
295 /\G\+/gc or $self->_blam('Spec sections must be separated by +');
296 } until (pos == length) };
299 my ($self, $error) = @_;
300 my $hat = (' ' x pos).'^';
301 die "Error parsing dispatch specification: ${error}\n
310 sub (GET + /user/*) {
311 my ($self, $user) = @_;
318 = \${"${app}::self"};
323 my ($self, $run, @args) = @_;
324 my $class = ref($self);
326 local *{"${class}::self"} = \$self;
346 tie *{"${app}::${name}"},
347 'XML::Tags::TIEHANDLE',
350 sub TIEHANDLE { my $str = $_[1]; bless \$str, $_[0] }
351 sub READLINE { ${$_[0]} }
354 my ($into, @names) = @$_[0];
368 ${CORE::GLOBAL::}{glob};
371 use XML::Tags qw(div);
372 <div>, "foo!", </div>;
378 my $stuff = 'foo"bar';
385 glob('a href="'.$stuff.'"');
388 bless(\'a href="', 'MagicTag')
390 .bless(\'"', 'MagicTag')
403 $self->render_html($_[1])
409 'Web::Simple::ResponseFilter'
412 if ($self->_is_response_filter($result)) {
413 return $self->_run_with_self(
415 $self->_run_dispatch_for($new_env, \@disp)
430 Matt S. Trout <mst@shadowcat.co.uk>
434 Copyright (c) 2010 Matt S. Trout <mst@shadowcat.co.uk>
438 This text may be distributed under the GPL (v2 or later), the Artistic License
439 (v1 or later), the Creative Commons Attribution (CC BY v3 or later), the
440 Mozilla Public License (v1 or later, in honour of the license of the
441 takahashi.xul system I used to write these slides originally), or the
442 WTFPL (see <http://sam.zoy.org/wtfpl/COPYING>).
444 If you'd like me to add another license, please ask.