Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: return vars from Perl to Flash |
From: | Helen Triolo |
Date: | Tue, 9 May 2000 19:40:30 +0100 |
Geoff Choo wrote:
>
> Hi,
>
> Here's a bit of Perl script that will take a text string and URLencode the
> spaces, control and punctuation characters.
>
> This code fragment assumes that you have a field variable named "list" in
> our flash movie.
>
> $string = "This is the string to encode";
>
> # We URL encode the text string here #
> $string =~ s/(\W)/sprintf("%%%x", ord($1))/eg;
>
> print "Content-type: text/text\n\n";
> print "list=$string";
>
Thanks Geoff. I'll stash that away for the future--I'm sure it'll be
useful (and nothing makes you feel more like a competent programmer than
having a few good complicated-looking regex's around!)
And Laura, yes you're right about both the /n's being necessary. I had
thought they wouldn't be -- since aren't they just carriage returns? --
but I tried it again with none and with just one and neither worked. I
guess whatever looks at the perl expects the content-type-defining line
to end with a real end-of-line.
So thanks to Rebecca and Laura and Geoff for all the good info.
Helen
----------------------------------------
helen triolo � http://i-technica.com
designeri-technica [dot] com � 301-424-6037
----------------------------------------
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml
Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: return vars from Perl to Flash, Geoff Choo
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]