On Mon, Nov 22, 2004 at 01:21:35PM -0700, Siegfried Heintze wrote: > In my perl script I have put my javascript code in a separate file with the > extension of js. I reference it with a javascript tag in the HTML. I have > some code in there that is not in a procedure: it just executes prior to the > body of the page loading as inline statements. > > Now I discover I need some of those URLs in my external javascript file to > change depending on some perl parameters. > > This is not a procedure so I cannot just change some javascript procedure > parameters. Perl does not process this file so it won't do the variable > interpolation I want either. > > Below is the code that is causing the problem. > > I think the only way to resolve this is to cut the code below and move it to > the perl code where I can use interpolation (which I would prefer not to do > because it will really clutter up the main program -- oh well). > > Can anyone suggest a better approach?
I'd suggest loading the js file using HTML::Template. Substitute the code you want with a <TMPL_VAR />, and write some logic so that if the query string contains foo.js (a slight oversimplification) that it loads that template, prints it, then exits. Does that make sense to you? Anyone else? -- ===================== Shaun Fryer ===================== http://sourcery.ca/ ph: 416-544-9461 ===================== -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>