Baz has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my @colors = ( [167,45,37,56,65,67,56,78,231,35,142,20,187,137,19,107 +,117,127,137], # ... [221,245,237,0,0,0,0,0,235,235,145,220,218,146,194,46, +133,127,45,32] # ... ); print "Content-type: image/svg+xml\n\n"; open DATA, '<g3.svg' or die $!; local $" = ','; # localise $" ($LIST_SEPARATOR) and set it to b +e a comma s/^var colors(\d+) = \[\];/var colors$1 = "[@{ $colors[$1 - 1] }]";/ and print # and print it if it matched or print # otherwise just print them while <DATA>; close DATA or warn $!;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending SVG to Client
by dws (Chancellor) on Aug 25, 2002 at 00:20 UTC | |
by Baz (Friar) on Aug 25, 2002 at 01:01 UTC | |
by peschkaj (Pilgrim) on Aug 25, 2002 at 06:41 UTC | |
|
Re: Sending SVG to Client
by fglock (Vicar) on Aug 25, 2002 at 02:07 UTC | |
by Baz (Friar) on Aug 25, 2002 at 02:30 UTC | |
|
Re: Sending SVG to Client
by BrowserUk (Patriarch) on Aug 25, 2002 at 05:25 UTC | |
by Baz (Friar) on Aug 25, 2002 at 10:43 UTC |