aboutsummaryrefslogtreecommitdiff
path: root/challenge-108/colin-crain/perl/ch-1.pl
blob: 15515e99db40cf36da573e68eea0569306449fe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use warnings;
use strict;
use feature ":5.26";
use feature qw(signatures);
no  warnings 'experimental::signatures';
use Devel::Peek qw(Dump);


my $foo = "this is a string";
my $foo_ref = \$foo;
$foo_ref =~ m/(SCALAR|ARRAY|HASH)\((.*)\)/;

say "The variable head is stored at $2";
my $det = $1 eq 'ARRAY' ? 'an' : 'a';
say "The variable is $det \L$1";
say "-" x 25;
say '';

Dump $foo;