Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

CGI::SSI #if problem

by hethcox (Initiate)
on Dec 09, 2003 at 21:43 UTC ( [id://313555]=perlquestion: print w/replies, xml ) Need Help??

hethcox has asked for the wisdom of the Perl Monks concerning the following question:

I am struggling to get a #if directive working. Do you know where there are some good examples? When I do this:
[<!--#echo var="raloption" -->]<br> <!--#if expr="'\$raloption' =~ /dd/" --> Some stuff <!--#endif -->
the #echo prints the value the I set() in the cgi. But the #if statement is never true. (perl 5.6.1, ActiveState, Win2K)

Code tags - dvergin 2003-12-09

Replies are listed 'Best First'.
Re: CGI::SSI #if problem
by Joost (Canon) on Dec 09, 2003 at 23:01 UTC
      It prints the value that I set using $ssi->set()
Re: CGI::SSI #if problem
by pingo (Hermit) on Jul 17, 2007 at 09:41 UTC
    This answer may be considered a bit... late. But since I happened to stumble over this question, here goes. It might possibly help someone else.

    You may want to remove the backslash from the expr. At least with a current CGI::SSI, with the backslash it evals this:

    '$raloption' =~ /dd/

    Whereas without the backslash, the module evals this:

    'abcdde' =~ /dd/

    (Or whatever $raloption is.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://313555]
Approved by Roger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-23 06:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found