#!/usr/bin/perl -w use strict; my $chordfile = "/home/majcher/data/banjo.chords"; my %chords; my $key = shift || &usage; # build chord table open(F, $chordfile) || die $!; while() { chomp; my ($key, @fing) = split(' '); $key =~ s/\d+$//; push @{$chords{$key}}, \@fing; } close(F); # print neck with chords print "\n"; for (1..22) { printf(" %2d ",$_); } print "\n"; print " " . "-"x89 . "\n"; my @strings = qw(D G B D); for (my $string=3;$string>=0;$string--) { print "$strings[$string] "; for my $bar (1..23) { my $ok = 0; for my $chord (0 .. $#{$chords{$key}}) { if ($bar == $chords{$key}[$chord][$string]) { $ok = 1; } } print $ok?"| * ":"| "; } print "\n"; } print " " . "-"x89 . "\n"; print " "x17 . "I" . "-"x73 . "\n"; print " "x16 . "(=)\n"; print "\n"; ##### sub usage { print <