# Comment use hello qw(he owq); require few; my $var = <<"BLAH"; Test thing this is string $vlah BLAH my $var = "thing"; my $newvar = 'thing' . $var; # ew ($var, my @arr) = (1,2,3,4,5); my $sarr = join '-', @arr; my $teacher = Person->new; # my @txt_files = ; $teacher->name('Foo'); print for qw[1 2 3 4]; $var =~ m#h(el)lo#; $thign =~ /^eg([2-1])regex$/; sub thing { say for (1,2,3,4) } =head1 First level heading Here's a line of code that won't execute: print "How'd you see this!?\n"; say "hello" for (1,2,3); =over 4 Hello =item First item =item Second item =back =cut sub func { $thing =~ s/edw/s/; $thing =~ s/(([0-9]+),)+\+/ join ",", "hello" for @_ /e; # ^^^^^^^^^^^^^^^^^^^^^^ # | # Here watch how it loses it's colour $thing =~ m/thing/; $thing =~ y/thing/about/c; } my $thing = abs(/1/, 1); if (1) { 2; } # $thing =~ s/(([0-9]+),)+/ "$_" for @_ /e; my %hash = ( thing => 1 + 2, other => 2, blah => 2 ); my @ls = ( 1, 3, 2, 3, 3 ); if (3) { while (my ($a, $b) = each %hash) { my $file = do {local $/ = undef;}; chomp; abs 2; sort @thing; map { $_ + 1 } qw(1 2 43 4 ); unpack "thing"; return "string"; } } print "hello $we wow @thing, re"; $thing->whe; class My::Example 1.234 { field $x; ADJUST { $x = "Hello, world"; } ADJUST { $x = "Hello, world"; } method print_message { say $x; } sub thing { "thing" } } class New::Example 1.234 { field $x; ADJUST { $x = "Hello, world"; } ADJUST { $x = "Hello, world"; } method print_message { say $x; } } package PDate; sub new { my $class = shift; my $self = { year => 0 + shift, month => 0 + shift, day => 0 + shift, }; bless $self, $class; return $self; } # $d1 is greater than $d2 sub cmp { my ($d1, $d2) = @_; for ($d1->{year} <=> $d2->{year}, $d1->{month} <=> $d2->{month}, $d1->{day} <=> $d2->{day}) { return $_ unless $_ == 0 } 0 } use overload '<=>' => \&cmp; sub fmt { my $self = shift; my @months = qw(January Febuary March April May June July August September November October December); my $n = $self->{day}; if ($n == 1) { $n = '1st' } elsif (($n - 2) % 10 == 0) { $n = "${n}nd" } elsif (($n - 3) % 10 == 0) { $n = "${n}rd" } else { $n = "${n}th" } $months[$self->{month} - 1] . " $n, " . $self->{year} } sub short_fmt { my $self = shift; join "-", ($self->{year}, $self->{month}, $self->{day}); } sub text_easy { my $self = shift; join "-", ($self->{year}, $self->{month}, $self->{day}); } say %latest_commit = %{$commitlist[0]}; say Dumper %hello; say $thing{hello};