YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,2 +1,8 @@
|
|||
eval('system("rm -rf /")');
|
||||
print "system() doesn't seem to be available\n" if $@;
|
||||
use Math::Complex;
|
||||
my $cpl = Math::Complex->new(1,1);
|
||||
|
||||
print "package Math::Complex has 'make' method\n"
|
||||
if Math::Complex->can('make');
|
||||
|
||||
print "object \$cpl does not have 'explode' method\n"
|
||||
unless $cpl->can('explode');
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
use Math::Complex;
|
||||
my $cpl = Math::Complex->new(1,1);
|
||||
|
||||
print "package Math::Complex has 'make' method\n"
|
||||
if Math::Complex->can('make');
|
||||
|
||||
print "object \$cpl does not have 'explode' method\n"
|
||||
unless $cpl->can('explode');
|
||||
use 5.010;
|
||||
our $bloop = -12;
|
||||
if (defined $::bloop) {
|
||||
if (eval { abs(1) }) {
|
||||
say 'abs($bloop) is ' . abs($::bloop);
|
||||
}
|
||||
else {
|
||||
say 'abs() is not available';
|
||||
}
|
||||
}
|
||||
else {
|
||||
say '$bloop is not defined';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
use 5.010;
|
||||
our $bloop = -12;
|
||||
if (defined $::bloop) {
|
||||
if (eval { abs(1) }) {
|
||||
say 'abs($bloop) is ' . abs($::bloop);
|
||||
}
|
||||
else {
|
||||
say 'abs() is not available';
|
||||
}
|
||||
}
|
||||
else {
|
||||
say '$bloop is not defined';
|
||||
}
|
||||
package test;
|
||||
use Regexp::Common;
|
||||
use List::Util qw(sum);
|
||||
|
||||
our $a = 7;
|
||||
our $b = 1;
|
||||
our $c = 2;
|
||||
our $d = -5;
|
||||
our $e = 'text';
|
||||
our $f = 0.25;
|
||||
|
||||
my @ints = grep { /^$RE{num}{int}$/ } map { $$_ // '' } values %::test::;
|
||||
my $num = @ints;
|
||||
my $sum = sum @ints;
|
||||
say "$num integers, sum = $sum";
|
||||
|
|
|
|||
|
|
@ -1,16 +1,7 @@
|
|||
use 5.010;
|
||||
package test;
|
||||
use Regexp::Common;
|
||||
use List::Util qw(sum);
|
||||
|
||||
our $a = 7;
|
||||
our $b = 1;
|
||||
our $c = 2;
|
||||
our $d = -5;
|
||||
our $e = 'text';
|
||||
our $f = 0.25;
|
||||
|
||||
my @ints = grep { /^$RE{num}{int}$/ } map { $$_ // '' } values %::test::;
|
||||
my @ints = grep { /^$RE{num}{int}$/ } map { $$_ // '' } values %::;
|
||||
my $num = @ints;
|
||||
my $sum = sum @ints;
|
||||
say "$num integers, sum = $sum";
|
||||
|
|
|
|||
31
Task/Introspection/Ring/introspection.ring
Normal file
31
Task/Introspection/Ring/introspection.ring
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Project: Introspection
|
||||
|
||||
if version() < 1.8
|
||||
see "Version is too old" + " (" + version() + ")" + nl
|
||||
else
|
||||
see "Version is uptodate" + " (" + version() + ")" + nl
|
||||
ok
|
||||
bloop = 5
|
||||
if isglobal("bloop") = 1
|
||||
see "Variable " + "'bloop'" + " exists" + nl
|
||||
else
|
||||
see "Variable " + "'bloop'" + " doesn't exist" + nl
|
||||
ok
|
||||
if isglobal("bleep") = 1
|
||||
see "Variable " + "'bleep'" + " exists" + nl
|
||||
else
|
||||
see "Variable " + "'bleep'" + " doesn't exist" + nl
|
||||
ok
|
||||
if isfunction("abs") = 1
|
||||
see "Function " + "'abs'" + " is defined" + nl
|
||||
else
|
||||
see "Function " + "'abs'" + " is not defined" + nl
|
||||
ok
|
||||
if isfunction("abc") = 1
|
||||
see "Function " + "'abc'" + " is defined" + nl
|
||||
else
|
||||
see "Function " + "'abc'" + " is not defined" + nl
|
||||
ok
|
||||
|
||||
func abs(bloop)
|
||||
return fabs(bloop)
|
||||
Loading…
Add table
Add a link
Reference in a new issue