This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env raku | |
# Perl Weekly Challenge #236 Task 1 | |
# © 2023 Shimon Bollinger. All rights reserved. | |
# Last modified: Sat 30 Sep 2023 11:29:05 PM EDT | |
# Version 0.0.1 | |
# always use the latest version of Raku | |
use v6.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env raku | |
# Perl Weekly Challenge #236 Task 2 | |
# © 2023 Shimon Bollinger. All rights reserved. | |
# Last modified: Sat 30 Sep 2023 06:51:22 PM EDT | |
# Version 0.0.1 | |
# always use the latest version of Raku | |
use v6.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 (callwith-test.raku line 6) | |
multi sub count (IO::Path $filehandle!) { | |
ENTER { say "begin count (IO::Path)" } | |
my $count = $filehandle.slurp.lines.elems; | |
say "{$filehandle.basename} has $count lines"; | |
LEAVE { say "end count (IO::Path)"; } | |
} # end of multi sub count (IO::Path $filehandle!) | |
15 (callwith-test.raku line 13) | |
multi sub count (Str $filename!) { | |
ENTER { say "begin count (Str)" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env raku | |
use v6.*; | |
multi MAIN ( ) { | |
my class A { | |
state $count = 0; say "Using a state variable"; | |
# our $count = 0; say "Using an our variable"; | |
# my $count = 0; say "Using a my variable"; | |
submethod TWEAK { $count++; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary of my perl5 (revision 5 version 36 subversion 0) configuration: | |
Platform: | |
osname=darwin | |
osvers=22.1.0 | |
archname=darwin-thread-multi-2level | |
uname='darwin ventura 22.1.0 darwin kernel version 22.1.0: sun oct 9 20:14:54 pdt 2022; root:xnu-8792.41.9~2release_x86_64 x86_64 ' | |
config_args='-des -Dinstallstyle=lib/perl5 -Dinstallprefix=/usr/local/Cellar/perl/5.36.0 -Dprefix=/usr/local/opt/perl -Dprivlib=/usr/local/opt/perl/lib/perl5/5.36 -Dsitelib=/usr/local/opt/perl/lib/perl5/site_perl/5.36 -Dotherlibdirs=/usr/local/lib/perl5/site_perl/5.36 -Dperlpath=/usr/local/opt/perl/bin/perl -Dstartperl=#!/usr/local/opt/perl/bin/perl -Dman1dir=/usr/local/opt/perl/share/man/man1 -Dman3dir=/usr/local/opt/perl/share/man/man3 -Duseshrplib -Duselargefiles -Dusethreads' | |
hint=recommended | |
useposix=true |