Browse Source

add typebound.pl

git-svn-id: file:///usr/local/svn/util/trunk@4 29942e26-f7dc-dc11-b955-0002b3153201
master
leto 16 years ago
parent
commit
a06f26df8f
  1. 6
      bin/colortest
  2. 16
      typebound.pl

6
bin/colortest

@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# Simple Perl test suite colorizer
# Jonathan Leto <jonathan@leto.net>
# Sat Feb 16 17:20:50 EST 2008
# Wed Feb 20 19:30:21 EST 2008
use strict;
use Term::ANSIColor qw(:constants);
@ -13,7 +13,9 @@ $Term::ANSIColor::AUTORESET = 1;
# }
while (<>){
if(/^ok/ || /Result: PASS/ || /All tests successful/){
if (/SKIP/) {
print YELLOW $_;
} elsif(/^ok/ || /Result: PASS/ || /All tests successful/){
print BOLD GREEN $_;
} elsif( /^not ok/ || /Dubious/ || /Result: FAIL/ || /Bad plan/ || /Failed/ || /Non-zero exit status/ ){
print BOLD RED $_;

16
typebound.pl

@ -0,0 +1,16 @@
#!/usr/bin/perl -w
use strict;
use Math::MatrixReal;
# Example code to show type bound operator overloading
# that returns the same stuff
my $matrix = Math::MatrixReal->new_from_rows([[3,6,9]]);
my $a = (2/3) * $matrix;
my $b = 2 * $matrix / 3;
print "\$a is a " . (ref $a) . "\n";
print "\$b is a " . (ref $b) . "\n";
print "\$a=\n";
print $a;
print "\$b=\n";
print $b;
Loading…
Cancel
Save