Page 1 of 1

Perl goodies #1

Posted: Tue Apr 06, 2004 9:24 pm
by ^rooker
[small function for following a frameset]

------------------------------------------------------------------
sub followFrameSet {
my ($content, $frameName) = @_;

print "Checking for frameset... ";
if ($content =~ /<FRAME.*name=$frameName.*src="(.*)"/) {
print "found. - ";
print "following frame-src: $1\n";
return $1;
}
print "negative.";
return;
}
------------------------------------------------------------------

Perl and Text-to-speech

Posted: Tue Apr 06, 2004 9:43 pm
by ^rooker
[Speaking text using 'festival']

------------------------------------------------
sub say_something {
my $text = shift;
open(FESTIVAL, '| festival --tts --pipe');
print FESTIVAL $text;
}
------------------------------------------------