substituting text in a var (beginner question) 
Author Message
 substituting text in a var (beginner question)

<snip>

Quote:
>###
>$referer=$ENV{"HTTP_REFERER"};

This is a different name to the one you refer below

Quote:
>$hiddenreferrer="<INPUT TYPE=\"hidden\" NAME=\"myreferrer\" VALUE=\
>"$myreferer\">";
>###

$hiddenreferrer="<INPUT TYPE='hidden' NAME='myreferrer' VALUE='" .
$myreferrer . "'>";

Perhaps.

/J\
Jonathan Stowe
See the MetaFaq at http://www.*-*-*.com/ ~gellyfish/resources/wwwfaq.htm



Mon, 25 Sep 2000 03:00:00 GMT  
 substituting text in a var (beginner question)

.

Quote:
>$referer=$ENV{"HTTP_REFERER"};
>$hiddenreferrer="<INPUT TYPE=\"hidden\" NAME=\"myreferrer\" VALUE=\
>"$myreferer\">";

   ^^^^^^^^^ What's the connection between this and $referrer ?
.

Quote:
>###

>Then, in my template file, I place:

How are you outputting this template ? $hiddenreferrer should contain
the value of $myreferer based on what you have above

--
Jason Gloudon



Mon, 25 Sep 2000 03:00:00 GMT  
 substituting text in a var (beginner question)

: I'm new to Perl and have one quick problem with a program. In the program, I
: am establishing the following variables:
:
: ###
: $referer=$ENV{"HTTP_REFERER"};
: $hiddenreferrer="<INPUT TYPE=\"hidden\" NAME=\"myreferrer\" VALUE=\
: "$myreferer\">";

Notice that you define '$referer', but then use '$myreferer' in the
string.  Also, you can't seem to decide how many Rs there are in
'referer'. :) If this is your actual code, that's one problem -- though it
wouldn't account for your symptom.

Also, your string would be a lot easier to write using the qq syntax:

  qq!<INPUT TYPE="hidden" NAME="myreferrer" VALUE="$myreferer">!;

: Then, in my template file, I place:
:
:    $hiddenreferrer
:
: When I view the HTML source it writes:
:
:    <INPUT TYPE="hidden" NAME=myreferrer" VALUE="$myreferrer">
:
: What it should read is:
:
:    <INPUT TYPE="hidden" NAME=myreferrer" VALUE="http://domain.com/file.html">

Are you really missing the " between 'NAME=' and 'myreferrer'?

: It looks like Perl is resolving it almost correctly. Am I not escaping it
: correctly to write the full referrer?

Given the typo-laden nature of the code above, I suspect we're not seeing
your actual running code...and one character misplaced could explain a
lot, in this case.  Please either clean up the name and spelling errors,
or post the clean actual code, and I'll take another look.

---------------------------------------------------------------------

 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/  
       "Every man and every woman is a star."



Mon, 25 Sep 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. BEGINNER'S question re searching for text

2. Beginner's question on clearing Entry/Text boxes

3. Beginner Question about Text Box

4. split and substitute, substitute, substitute

5. substituting string of text

6. Substituting variables in a text file

7. Need help substituting text except when in an HTML anchor

8. methods to insert/substitute blocks of text?

9. Copying /var/spool/mail and /var/spool/news with perl

10. Expand ENV var within another ENV var

11. search text file, find substring, beginner help pls.

12. my( $var ) vs my $var

 

 
Powered by phpBB® Forum Software