Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Friday May 07, 2004
03:47 AM

Fixing stupid web server mishacks.

[ #18664 ]

The folks at use PHP to generate a thing that is supposed to tell RealPlayer which Akamai server to talk to (isn't Akamai supposed to do that transparently?).

The PHP puts in some extra line breaks though, and my RealPlayer barfs on it. So, out comes the Perl. I write a CGI wrapper to get the PHP output, create some SMIL content, and throw that back at my browser.

use LWP::Simple qw(get);
my $data = get( "" );
$data =~ s/^\s*|\s*$//g;
print <<"HERE";
Content-type: application/smil
Content-dispostion: filename=marketplace.smil
        <meta name="title" content="Marketplace"/>
        <audio src="$data"/>

Now the major disappointment sets in. Firefox apparently ignore the content type and tries to save the file. I have to resort to the old Internet Explorer kludge of adding /marketplace.smil in the path info. Ugh.

Still, it works, and that's all I need.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.