Help!

PLEASE HELP ME!!! P E R L!!!


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Web Developers RSS
Next:  Nine in 10 PCs infected with spyware  
Author Message




User: inactive
Posts:



PostPosted: Sun Aug 27, 2006 7:32 am    Post subject: PLEASE HELP ME!!! P E R L!!!

PLEASE HELP ME!!! P E R L!!!

I have a CGI (PERL) file namely 'test.cgi' and it has the correct permission (755) on the FTP server and it is within the CGI path.

I have the following code in it:

===================================
1: #!/usr/bin/perl
2:
3: $cr = '???';
4: $decrypted ="Something";
5: $decrypted =~ s/$cr/\r/g;
6:
7: print $decrypted;
===================================

The code works pretty well when I comment out Line#5 but whenever I want to use Line#5, it throws me the following error!

=========================================
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster.TakeThisOut@wildwildsearch.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
=========================================

Please help me, this is an URGENT. PLEASE PLEASE PLEASE.
Back to top




User: inactive
Posts:



PostPosted: Thu Aug 31, 2006 8:28 am    Post subject: Re: PLEASE HELP ME!!! P E R L!!! [Login to view extended thread Info.]

lloks like the "???" input is messing up the substitution. I below they are being translated. You need to check the replacement string for valid input.
Back to top
penumbra



Joined: Aug 28, 2004
Posts: 1



PostPosted: Sat Sep 02, 2006 3:50 am    Post subject: Re: PLEASE HELP ME!!! P E R L!!! [Login to view extended thread Info.]

I'm not too sure what you are tryng to achieve, but mebbe this amended example might help you - note that a ? means something in regular expressions... I've escaped them with backslashes to make it work (but it still might not be what you want.

Using the q() structore to quoet things iin this example is a personal preference, but there are occasions where it is the only way to do it - so I use it all the time.

I've tested this under Windoze and ActiveState Perl, so if your system is markedly different, you might see anomalies from my results...

HTH

Bill

--------------
1. #!/usr/bin/perl
2.
3. $cr = q(\?\?\?);
4. $decrypted ="Something";
5. $decrypted =~ s/$cr/\r/g;
6.
7. print $decrypted
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Web Developers All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum