Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use feature qw(say);
use LWP::Simple;
my $content = get("http://aur.archlinux.org/packages/modern-perl/modern-perl/PKGBUILD");
say substr($content, 281, 11);
#!/usr/bin/perl
use strict;
use warnings;
use feature qw(say);
use LWP::Simple;
my $content
= get('http://aur.archlinux.org/packages/perl-moose/perl-moose/PKGBUILD');
say substr($content, 281, 11);
#!/usr/bin/perl
use strict;
use warnings;
use feature qw(say);
use LWP::Simple;
my $content
= get('http://aur.archlinux.org/packages/perl-moose/perl-moose/PKGBUILD');
my $pos = index($content, 'pkgname');
#!/usr/bin/perl
use strict;
use warnings;
use feature qw(say);
use LWP::Simple;
my $content
= get('http://aur.archlinux.org/packages/perl-moose/perl-moose/PKGBUILD');
( my $pkgname ) = ( $content =~ /pkgname=\'([\w-]+)\'/ );
#!perl
use strict;
use warnings;
use Template::Test;
my $tt = Template->new();
my $vars = {
var => 'world',
};
my $template =
ref($what) eq 'ARRAY'
? join( ' + ', @{$what} )
: ref($what)
? $what->name
: $what;
my $template
# conditional # set $template to
= ref($what) eq 'ARRAY' ? join( ' + ', @{$what} )
: ref($what) ? $what->name
: $what
;
my $template
# conditional # set $template to
= ref($what) eq 'ARRAY' ? join( ' + ', @{$what} )
: ref($what) eq 'SCALAR' ? '(evaluated block)'
: ref($what) ? $what->name
: $what
;
my $template
# conditional # set $template to
= ref($what) eq 'Template::Document' ? $what->name
: ref($what) eq 'ARRAY' ? join( ' + ', @{$what} )
: ref($what) eq 'SCALAR' ? '(evaluated block)'
: $what
;

HELLO

world