(view source code of midititl.pl as plain text)
#! perl# Store help text in a variable$syntax = "\nMidiTitl.pl, Version 0.50 BETA\n";
$syntax = $syntax."Display titles of specified MIDI file(s)\n\n";
$syntax = $syntax."Usage: MIDITITL.PL filespec.mid\n\n";
$syntax = $syntax."Where: filespec.mid is a (list of) MIDI file(s);\n";
$syntax = $syntax." (wildcards allowed)\n\n";
$syntax = $syntax."Written by Rob van der Woude\nhttp://www.robvanderwoude.com\n";
# Check command line argument(s), open specified MIDI fileif ( !@ARGV[0] or @ARGV[1] ) {
die( $syntax );
} else {
$midi = @ARGV[0];
open( STDIN, "< $midi" ) or die "\nCannot open file $midi\n $!\n $^E\n\n$syntax";
}# Read MIDI file$line = "";
while ( <STDIN> ) {
$line = "$line $_";
}# Close MIDI fileclose STDIN;
# Remove excess white space$line =~ s/\s\s/ /g;
# Filter relevant output$string = "";
$count = 0;
while ( $line ) {
$count = $count + 1;
if ( $line =~ m/([-_A-Z0-9\/\.,\s\(\)]{5,})(.*)$/i ) {
chomp( $string = "$string $1" );
$line = $2;
} # Abort after 1000 iterationsif ( $count > 1000 ) {
$line = undef;
}}# Remove everything before first tabif ( $string =~ m/\t(.*)/ ) {
$string = $1;
}# Display outputprint "\n$string\n";
page last modified: 2025-10-11; loaded in 0.0088 seconds