#!/usr/bin/perl -w # Plain Text File Reader # Speaking version use strict; use Win32::OLE; my $voice; $voice = Win32::OLE->new("Speech.VoiceText") or die("TTS failed"); $voice->Register("", "$0"); $voice->{Enabled} = 1; $voice->{Speed}=150; my $myfile = shift; main(); sub nl { print $/; } sub main{ open (FILE, "$myfile"); my @thefile = ; close (FILE); foreach my $line (@thefile) { talk("$line"); nl(); } } sub talk{ my $line = shift; print $line,$/; $voice->Speak($line, 1); while ($voice->IsSpeaking()) { sleep 1; } } #### perl -le '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat!\n"; } else { print "Thats a dog\n"; }'