Closed Thread Icon

Topic awaiting preservation: Perl CGI i'shoes (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24418" title="Pages that link to Topic awaiting preservation: Perl CGI i&amp;#039;shoes (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Perl CGI i&#039;shoes <span class="small">(Page 1 of 1)</span>\

 
FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 12-16-2004 15:42

brucey - I have an old .cgi file that I need to update and I have an extremely limited knowledge of perl...

I need to integrate the application with a new website, the existing code is about 6 years+ old and contains more presentation elements in the code than content... I?ll be sorting that out!

firstly, rather than PRINT NEWPAGE on every line, research has led me to believe that << EOF then prints out everything from then on until it reaches EOF

code:
<< ENDHTML 

[ html goes here]

ENDHTML



The question is can you have dynamic values within << tags i.e. $shoes that will output the code with the value for shoes?

Also I need to convert the perl script to open links in the same window rather than a pop-up. I think the code for this is a mixture of Javascript and PERL.

Directly after the PRINT NEWPAGE lines have finished I find this:


code:
....
print NEWPAGE "</form></body></html>\n";

close(NEWPAGE);
&new_window;
}

sub new_window {
print <<"END";
<SCRIPT LANGUAGE="JavaScript">
popwin = window.open("http://www.domain.co.uk/domain/jobpages/$cleanval.html","infowin","resizable=no,scrollbars=yes,width=430,height=450,top=35,left=75");
</SCRIPT>
<body onload="document.check.submit(); return true;">
<form method=post action="javascript:history.back()" name="check">
<input type="Hidden" name="dummy" value="dummy">
</form>
</body>

END

exit;



then further down the script we find the call

code:
<a href=\"/cgi-bin/domain/jobsearch.cgi?command=info&val=$refnum&db=$FORM{'call'}\">MORE INFO</a></font></td></tr>\n";



(Edited by FatRod on 12-16-2004 15:44)

(Edited by FatRod on 12-16-2004 16:23)

norm
Paranoid (IV) Inmate

From: [s]underwater[/s] under-snow in Juneau
Insane since: Sep 2002

posted posted 12-16-2004 19:11

<<EOF is known as Heredoc syntax. Herdoc allows you to use single & double quotes without having to escape the characters. Variables may be used inside the Heredoc.

Both Perl and PHP support Heredoc. It is a very convienent way to deal with large blocks of HTML or XML .

BTW- I'm not sure who brucey is, but I hope this helped.

/* Sure, go ahead and code in your fancy IDE. Just remember: it's all fun and games until someone puts an $i out */

FatRod
Bipolar (III) Inmate

From: #UK SURREY
Insane since: May 2002

posted posted 12-21-2004 16:06

Brucey mean bonus, a sarcastic comment, maybe why i didn't get a response on the 2nd question- anyone any ideas about the POP window issue?

« BackwardsOnwards »

Show Forum Drop Down Menu