aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-031/vyacheslav-volgarev/perl5/ch-1.pl10
-rw-r--r--challenge-031/vyacheslav-volgarev/perl5/ch-2.pl12
2 files changed, 22 insertions, 0 deletions
diff --git a/challenge-031/vyacheslav-volgarev/perl5/ch-1.pl b/challenge-031/vyacheslav-volgarev/perl5/ch-1.pl
new file mode 100644
index 0000000000..51d9b26409
--- /dev/null
+++ b/challenge-031/vyacheslav-volgarev/perl5/ch-1.pl
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use POSIX;
+
+sub check {
+ my ( $numerator, $denominator ) = @_;
+
+ ( $numerator + $denominator == $numerator ) && ( $denominator == floor $denominator ) && die 'divide by zero error';
+}
diff --git a/challenge-031/vyacheslav-volgarev/perl5/ch-2.pl b/challenge-031/vyacheslav-volgarev/perl5/ch-2.pl
new file mode 100644
index 0000000000..64ae3881bd
--- /dev/null
+++ b/challenge-031/vyacheslav-volgarev/perl5/ch-2.pl
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use v5.10;
+
+no strict 'refs';
+
+my $variable_name = shift;
+
+eval ( $$variable_name = 42 );
+
+say $$variable_name;