Skip to content

Instantly share code, notes, and snippets.

@tbrowder
Created November 2, 2016 16:09
Show Gist options
  • Save tbrowder/90c50fff31beb1ee03da1f8b1a7552d0 to your computer and use it in GitHub Desktop.
Save tbrowder/90c50fff31beb1ee03da1f8b1a7552d0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
my $f = 'test-file.txt';
my $sr = 'text';
say "Testing on IO::Handle";
my $fh = open $f, :w;
$fh.say: $sr;
say "== Reporting False:";
say so $fh.t;
say so $fh.d;
say "== Reporting True:";
say so $fh.e;
say so $fh.f;
say so $fh.r;
say so $fh.w;
#say so $fh.rw;
say "Smart match:";
say "== Reporting False:";
say $fh ~~ :t;
say $fh ~~ :d;
say "== Reporting True:";
say so $fh ~~ :e;
say so $fh ~~ :f;
say so $fh ~~ :r;
say so $fh ~~ :w;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment