Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

perl-beginner · Perl Beginners Mailing List

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 3765
  • Category: Perl
  • Founded: Aug 2, 1998
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 9196 - 9225 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#9196 From: "scott.list" <scott.list@...>
Date: Tue Mar 5, 2002 2:57 am
Subject: Re: Redirection
msws_1
Send Email Send Email
 
Slow?  Thats an understatement.  I access the messages from their interface and
it's been down completely all day (groups.yahoo.com).

Thanks for the suggestion but it does not work either.  It also says ". If you
use redirection like this, you should not print out a header as well."

In this app, the page (and the header of course) is already there.  There's the
issue, - can't redirect automatically after the page prints "Processing
complete".

Thanks,
Scott

   ----- Original Message -----
   From: Kyle Hamar
   To: scott.list@...
   Sent: Monday, March 04, 2002 8:34 PM
   Subject: Redirection


   The list is slow tonight. (Sending via direct mail)


     Date: Mon, 04 Mar 2002 18:08:44 -0600
     To: perl-beginner@yahoogroups.com
     From: Kyle Hamar <khamar@...>
     Subject: RE: [PBML] [#2] cgi progressive displaying script ?

     direct from
http://www.perldoc.com/perl5.6.1/lib/CGI.html#GENERATING-A-REDIRECTION-HEADER

     GENERATING A REDIRECTION HEADER

     print $query->redirect('http://somewhere.else/in/movie/land');

     Sometimes you don't want to produce a document yourself, but simply redirect
the browser elsewhere, perhaps choosing a URL based on the time of day or the
identity of the user.
     The redirect() function redirects the browser to a different URL. If you use
redirection like this, you should not print out a header as well.
     One hint I can offer is that relative links may not work correctly when you
generate a redirection to another document on your site. This is due to a
well-intentioned optimization that some servers use. The solution to this is to
use the full URL (including the http: part) of the document you are redirecting
to.
     You can also use named arguments:
         print $query->redirect(-uri=>'http://somewhere.else/in/movie/land',
                                 -nph=>1);

     At 11:13 PM 3/4/2002 +0800, you wrote:

       I thought redirects didn't work if you have already printed a header?


       rgds

       Frank

       -----Original Message-----
       From: msws_1 [mailto:scott.list@...]
       Sent: Monday, 4 March 2002 11:04 PM
       To: perl-beginner@yahoogroups.com
       Subject: Re: [PBML] [#2] cgi progressive displaying script ?


       > Try this and let me know if it works! ;-)

       OK, here's the changes and output.  Still no redirect happening:
       --------------------------------------
       #!/usr/bin/perl
       use CGI;
       $|=1; # Turn on autoflush
       print "Content-type: text/html\n\n";
       print "<html><body>";
       print "Please wait, processing.";

       # file "stop" exists for this test...
       while (!-e "stop") {
         sleep 2;
         print " .";
       }

       print "<BR><BR>Done, processing......\n\n\n";
       print "</body></html><BR><BR>\n\n";

       # Create a new instance of CGI
       my $query = new CGI;

       # Get the URL to which the user should be directed
       my $target = "http://www.yahoo.com/";

       # Now redirect to the target
       print $query->redirect($target);

       exit;

       ----------------------------
       The result web page (source):
       ----------------------------
       Please wait, processing.

       Done, processing......
       <BR><BR>

       Status: 302 Moved
       Location: http://www.yahoo.com/
       ----------------------------

       Thanks again for the help.
       Scott









[Non-text portions of this message have been removed]

#9197 From: "Greg Krieser" <greg@...>
Date: Tue Mar 5, 2002 3:30 pm
Subject: Passing two variables through one checkbox
krieser
Send Email Send Email
 
Hello Everyone,

Is it possible to pass two variables to a script through one check box?  If a
check box is selected I'd like it to pass the script a description and a price. 
I could put both in the checkbox value, i.e. description|9.99.  Once I've parsed
the form data how would I break this value into two variables?

Thanks for all of your help,

Greg

#9198 From: "Nguyen, David M" <david.m.nguyen@...>
Date: Mon Mar 4, 2002 3:45 pm
Subject: Date comparison
david.m.nguyen@...
Send Email Send Email
 
In my report, I have two lines that prints out timestamp, I'd like to
compare these twos by subtracting them then print out result ONLY if it is 7
minutes difference.  How do I do that?

Line 1:      Mon Mar 4 07:54:52 EST 2002

Line 2:      2002:03:04:07:57:16

Thanks,

David





[Non-text portions of this message have been removed]

#9199 From: Jeff 'japhy' Pinyan <japhy@...>
Date: Tue Mar 5, 2002 6:39 pm
Subject: Re: [PBML] regex giving incorrect result.
evilffej
Send Email Send Email
 
On Mar 5, Franki said:

>anyway, if I print out $file_path
>/websites/resadmin/kv-e

I get

   /websites/resadmin/kv-e/www/cgi-bin/kv-e/store/123.456

>instead of this (which is what it should be):
>E:/websites/resadmin/kv-e/www/cgi-bin/kv-e/store/123.456

You don't allow : as a valid character.

>my $directory_path = 'E:/websites/resadmin/kv-e/www/cgi-bin/kv-e/store';
>
>$cart_id = $form_data{'cart_id'};
>$file_path = "$directory_path/${cart_id}.cart";
>$file_path =~ /([\w\-\=\+\/]+)\.(\w+)/;

Include : in the character class:

   ($file_path) = $file_path =~ m{([-\w=+/]+\.\w+)};

--
Jeff "japhy" Pinyan      japhy@...      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]

#9200 From: Justin Virgo <tropicalwebsites@...>
Date: Tue Mar 5, 2002 4:50 pm
Subject: server is changing my script?
tropicalwebs...
Send Email Send Email
 
Hi all,

I have some trouble here,

Everytime I try to get my script to run my server
changes 2 different values in my script? It makes
%CCodes gets changed to Ìodes? and %Days is changed to
Úy

I have NO IDEA why this is happening? Any ideas?

Thanks everyone

Justin


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

#9201 From: "Franki" <frankieh@...>
Date: Tue Mar 5, 2002 6:59 pm
Subject: RE: [PBML] Re: Redirection
frankieh@...
Send Email Send Email
 
Well, if worse comes to worse, you do have a way out..

print something like this into the html after the "processing" html:

<SCRIPT LANGUAGE ="JavaScript">
<!--
location.replace('http://www.mypage.com')
//-->
</SCRIPT>

I think that works in all the browsers, and it doens't matter if a header
was set or not because its not server side.

Its better then nothing. I have used it myself a few times.


rgds

Frank



-----Original Message-----
From: scott.list [mailto:scott.list@...]
Sent: Tuesday, 5 March 2002 10:58 AM
To: Kyle Hamar; perl-beginner@yahoogroups.com
Subject: [PBML] Re: Redirection


Slow?  Thats an understatement.  I access the messages from their interface
and it's been down completely all day (groups.yahoo.com).

Thanks for the suggestion but it does not work either.  It also says ". If
you use redirection like this, you should not print out a header as well."

In this app, the page (and the header of course) is already there.  There's
the issue, - can't redirect automatically after the page prints "Processing
complete".

Thanks,
Scott

   ----- Original Message -----
   From: Kyle Hamar
   To: scott.list@...
   Sent: Monday, March 04, 2002 8:34 PM
   Subject: Redirection


   The list is slow tonight. (Sending via direct mail)


     Date: Mon, 04 Mar 2002 18:08:44 -0600
     To: perl-beginner@yahoogroups.com
     From: Kyle Hamar <khamar@...>
     Subject: RE: [PBML] [#2] cgi progressive displaying script ?

     direct from
http://www.perldoc.com/perl5.6.1/lib/CGI.html#GENERATING-A-REDIRECTION-HEADE
R

     GENERATING A REDIRECTION HEADER

     print $query->redirect('http://somewhere.else/in/movie/land');

     Sometimes you don't want to produce a document yourself, but simply
redirect the browser elsewhere, perhaps choosing a URL based on the time of
day or the identity of the user.
     The redirect() function redirects the browser to a different URL. If you
use redirection like this, you should not print out a header as well.
     One hint I can offer is that relative links may not work correctly when
you generate a redirection to another document on your site. This is due to
a well-intentioned optimization that some servers use. The solution to this
is to use the full URL (including the http: part) of the document you are
redirecting to.
     You can also use named arguments:
         print $query->redirect(-uri=>'http://somewhere.else/in/movie/land',
                                 -nph=>1);

     At 11:13 PM 3/4/2002 +0800, you wrote:

       I thought redirects didn't work if you have already printed a header?


       rgds

       Frank

       -----Original Message-----
       From: msws_1 [mailto:scott.list@...]
       Sent: Monday, 4 March 2002 11:04 PM
       To: perl-beginner@yahoogroups.com
       Subject: Re: [PBML] [#2] cgi progressive displaying script ?


       > Try this and let me know if it works! ;-)

       OK, here's the changes and output.  Still no redirect happening:
       --------------------------------------
       #!/usr/bin/perl
       use CGI;
       $|=1; # Turn on autoflush
       print "Content-type: text/html\n\n";
       print "<html><body>";
       print "Please wait, processing.";

       # file "stop" exists for this test...
       while (!-e "stop") {
         sleep 2;
         print " .";
       }

       print "<BR><BR>Done, processing......\n\n\n";
       print "</body></html><BR><BR>\n\n";

       # Create a new instance of CGI
       my $query = new CGI;

       # Get the URL to which the user should be directed
       my $target = "http://www.yahoo.com/";

       # Now redirect to the target
       print $query->redirect($target);

       exit;

       ----------------------------
       The result web page (source):
       ----------------------------
       Please wait, processing.

       Done, processing......
       <BR><BR>

       Status: 302 Moved
       Location: http://www.yahoo.com/
       ----------------------------

       Thanks again for the help.
       Scott









[Non-text portions of this message have been removed]



Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

#9202 From: "ROB Technology" <rob@...>
Date: Tue Mar 5, 2002 6:07 pm
Subject: Rate System
rob@...
Send Email Send Email
 
Hello. I have a question and it may be off topic but I have a simple
link-indexing script that needs to be modified so users can rate the link.
Can anyone do this for me and if so, how much (I am on a tight budget).? I
need this modification ASAP so please reply to rob@... for
more details or just reply to this message.

*.*.*.* ROB Technology *.*.*.*
<.<.<.< CEO, Rob Buschbom >.>.>.>

#9203 From: Denny Malloy <denny.malloy@...>
Date: Tue Mar 5, 2002 7:51 pm
Subject: translating special characters
denny.malloy@...
Send Email Send Email
 
I am having trouble hiding special character using tr.
I want to convert an ASCII period to EBCDIC.

   $tran =~ tr/\./\x4B/;
   I am not getting '4B' I am getting 'D2' which is an ASCII 'K'.

Is there something special I have to do since I am using translate?

Thanks for any help.

Dennis Malloy

#9204 From: "ROB Technology" <rob@...>
Date: Tue Mar 5, 2002 2:00 am
Subject: Rate Script
rob@...
Send Email Send Email
 
Hello. I am looking for someone who is able to modify a simple link indexing
script I have so that users can rate a link and it displays the rating. I
have a tight budget but can pay. Please let me know. Thanks.

*.*.*.* ROB Technology *.*.*.*
<.<.<.< CEO, Rob Buschbom >.>.>.>
.::.::. rob@... .::.::.

#9205 From: "coo_t2" <coo_t2@...>
Date: Tue Mar 5, 2002 9:17 pm
Subject: Re: Perl EXE ?
coo_t2
Send Email Send Email
 
You can use one of the following products to turn you script into an
exe file.

PerlApp, this comes with activestate's Perl Dev Kit.
http://activestate.com/Products/Perl_Dev_Kit/

Or, perl2exe .
http://www.indigostar.com/

They both cost money but are available for evaluation.  Not sure if
the exe's can run as a cgi or not though.. They probably can though,
but I wouldn't assume it.

The exe files these products produce can be used on machines that do
not have perl installed.  The perl run time is bundled up with the
exe.  Because of this the minimum size of the executables produced is
somewhere around 700k.

--ed

--- In perl-beginner@y..., Gordon Stewart <gordonisnz@y...> wrote:
>
> Hi, I know yahoo is down now, - this will be sent/received when its
up...
>
> before i forget, can someone explain any benefits of a perl exe
file ? - I
> havnt used/created executable files before
>
> Im just querying,
>
> If I have other people that want an automated process to
upload/download
> files via FTP to a server..  & their Pc does *NOT* have perl
installed..
>
> If I create a perl EXE programme, Will it contain enough perl
code /
> process to operate.. - or does each person need to install perl on
their pc's ?
>
> (Theyre not computer-literate)...
>
> PS - if so - (how i imagine it) - Where / How do i download the
programme /
> file to convert CGI scripts to EXE files ?
>
> G.
>
>
>
> New Zealand websites :-
> Im giving away FREE banner ads :-
> http://n-zealand.hypermart.net/cgi-bin/mylinks/help.shtml#advertise

#9206 From: Kyle Hamar <khamar@...>
Date: Wed Mar 6, 2002 2:33 am
Subject: RE: [PBML] Re: Redirection
kylehamar
Send Email Send Email
 
Frank,
He got the code below to work. (Great minds think alike.)

  >Scott
Kyle:
Below worked like a charm. Web page prints with continuing ".." until
I create the file called "stop". Then the script tacks on your Java.
I used:
print << "END"
<script language="javascript" type="text/javascript">
<!--
window.setTimeout('window.location="http://www.yahoo.com/"',500);
// -->
</script>
END
Then the page redirects all by itself. Beautiful. Thanks very much
for the help!
Scott



At 02:59 AM 3/6/2002 +0800, you wrote:
>Well, if worse comes to worse, you do have a way out..
>
>print something like this into the html after the "processing" html:
>
><SCRIPT LANGUAGE ="JavaScript">
><!--
>location.replace('http://www.mypage.com')
>//-->
></SCRIPT>
>
>I think that works in all the browsers, and it doens't matter if a header
>was set or not because its not server side.
>
>Its better then nothing. I have used it myself a few times.
>
>
>rgds
>
>Frank

#9207 From: "b_harnish" <bharnish@...>
Date: Tue Mar 5, 2002 10:55 pm
Subject: Re: Passing two variables through one checkbox
b_harnish
Send Email Send Email
 
--- In perl-beginner@y..., "Greg Krieser" <greg@k...> wrote:
> Hello Everyone,
>
> Is it possible to pass two variables to a script through one check box?  If a
check box is selected I'd like it to pass the script a description and a price. 
I could put both in the checkbox value, i.e. description|9.99.  Once I've parsed
the form data how would I break this value into two variables?
>
> Thanks for all of your help,
>
> Greg

see the split function

#9208 From: "msws_1" <scott.list@...>
Date: Mon Mar 4, 2002 3:46 pm
Subject: Re: [PBML] [#2] cgi progressive displaying script ?
msws_1
Send Email Send Email
 
> I thought redirects didn't work if you have already printed a
header?

Well, that's what I gathered as well from hunting info, but I a
beginner at this (why I'm here), and it would be nice if the redirect
was automatic.  Worst case, with Jonathon's original message, I took
it to mean it was possible (msg# 9180).

Worst case, since the "display as you go" is working, I can have a
link presented after a forked program finishes for the user to click
on for a redirect.  Main thing was to get the "progressive" display
happening which it is.

But if there's a way to cause a redirect automatically, I'm all ears
(fingers<g>).

Thanks,
Scott


> OK, here's the changes and output.  Progressive display working,
No "automatic" redirect happening:
> --------------------------------------
> #!/usr/bin/perl
> use CGI;
> $|=1; # Turn on autoflush
> print "Content-type: text/html\n\n";
> print "<html><body>";
> print "Please wait, processing.";
>
> # file "stop" exists for this test...
> while (!-e "stop") {
>   sleep 2;
>   print " .";
> }
>
> print "<BR><BR>Done, processing......\n\n\n";
> print "</body></html><BR><BR>\n\n";
>
> # Create a new instance of CGI
> my $query = new CGI;
>
> # Get the URL to which the user should be directed
> my $target = "http://www.yahoo.com/";
>
> # Now redirect to the target
> print $query->redirect($target);
>
> exit;
>
> ----------------------------
> The result web page (source):
> ----------------------------
> <html><body>Please wait, processing.<BR><BR>Done, processing......
>
>
> </body></html><BR><BR>
>
> Status: 302 Moved
> Location: http://www.yahoo.com/
> ----------------------------

#9209 From: "Greg Krieser" <greg@...>
Date: Wed Mar 6, 2002 2:00 am
Subject: Re: [PBML] translating special characters
krieser
Send Email Send Email
 
Are there other 'tr's that could be changing the 4B?
 
 
The following message was sent by Denny Malloy <denny.malloy@...> on Tue,
5 Mar 2002 14:51:14 -0500.

> <html><body>
>
>
> <tt>
> I am having trouble hiding special character using tr.<BR>
> I want to convert an ASCII period to EBCDIC.<BR>
>  <BR>
>   $tran =~ tr/\./\x4B/;<BR>
>   I am not getting '4B' I am getting 'D2' which is an ASCII 'K'.<BR>
> <BR>
> Is there something special I have to do since I am using translate?<BR>
> <BR>
> Thanks for any help.<BR>
> <BR>
> Dennis Malloy<BR>
> </tt>
>
> <br>
>
> <!-- |**|begin egp html banner|**| -->
>
> <table border=0 cellspacing=0 cellpadding=2>
> <tr bgcolor=#FFFFCC>
> <td align=center><font size="-1" color=#003399><b>Yahoo! Groups
Sponsor</b></font></td>
> </tr>
> <tr bgcolor=#FFFFFF>
> <td align=center width=470><table border=0 cellpadding=0 cellspacing=0><tr><td
> align=center><font face=arial size=-2>ADVERTISEMENT</font><br><a
href="http://rd.yahoo.com/M=217097.1902236.3412362.1261774/D=egroupweb/S=1705006\
951:HM/A=991349/R=0/*http://service.bfast.com/bfast/click?bfmid=29150849&siteid=\
39282504&bfpage=account"
> target=_top><img
src="http://us.a1.yimg.com/us.yimg.com/a/ne/netstock_direct/300x250_green_ira.gi\
f"
> alt="" width="300" height="250" border="0"></a></td></tr></table></td>
> </tr>
> <tr><td><img alt="" width=1 height=1
src="http://us.adserver.yahoo.com/l?M=217097.1902236.3412362.1261774/D=egroupmai\
l/S=1705006951:HM/A=991349/rand=826050860"></td></tr>
> </table>
>
> <!-- |**|end egp html banner|**| -->
>
>
> <br>
> <tt>
> Unsubscribing info is here: <a
href="http://help.yahoo.com/help/us/groups/groups-32.html">http://help.yahoo.com\
/help/us/groups/groups-32.html</a></tt>
> <br>
>
> <br>
> <tt>Your use of Yahoo! Groups is subject to the <a
href="http://docs.yahoo.com/info/terms/">Yahoo!
> Terms of Service</a>.</tt>
> </br>
>
> </body></html>
>

#9210 From: "scott.list" <scott.list@...>
Date: Tue Mar 5, 2002 3:41 pm
Subject: Re: Redirection
msws_1
Send Email Send Email
 
Kyle:

Below worked like a charm.  Web page prints with continuing ".." until
I create the file called "stop".  Then the script tacks on your Java.
I used:

print << "END"
<script language="javascript" type="text/javascript">
<!--
window.setTimeout('window.location="http://www.yahoo.com/"',500);
// -->
</script>
END

Then the page redirects all by itself.  Beautiful.  Thanks very much
for the help!

Scott


> ----- Original Message -----
> From: "Kyle Hamar" <khamar@...>
> To: "scott.list" <scott.list@...>
> Sent: Monday, March 04, 2002 9:06 PM
> Subject: Re: Redirection
>
>
> > This should work then,
> >
> > This JavaScript example opens the new site in the same browser
window
> after displaying the current page in the window for 2 seconds (2000
ms):
> >  <script language="javascript" type="text/javascript">
> >      <!--
> >
window.setTimeout('window.location="http://www.pa.msu.edu/services/";
> ',2000);
> >      // -->
> >  </script>
> >
> > (Note that this does exactly what the HTML META tag above does,
but as the
> META tag method does not depend on the browser's having JavaScript
available
> and active, in most cases the META tag method would be preferable).
> > The next JavaScript example opens the new site in a new* browser
window:
> >  <script language="javascript" type="text/javascript">
> >      <!--
> >      Newsite=
window.open("http://www.pa.msu.edu/services/","newsite");
> >      // -->
> >  </script>
> >
> > * sometimes, the "new" window is one of those already opened in
the
> session; this seems to be somewhat random, and I don't know if it's
a
> browser bug or a "JavaScript thing" with the window.open command.
Just note
> that browser behavior may not always be consistent if you use this
script
> (or the next one, which also uses window.open). -- GJP.
> > This JavaScript example opens the new site in a new browser window
after a
> 4.5 second (4500 ms) delay:
> >  <script language="javascript" type="text/javascript">
> >      <!--
> >
>
window.setTimeout('window.open("http://www.pa.msu.edu/services/","news
ite")'
> ,4500);
> >      // -->
> >  </script>
> >
> >
> > WARNING: With these capabilities for automatic redirection to
other web
> pages, it is possible to set up a redirection loop -- try to avoid
making it
> a no-wait-time infinite loop! (An infinite loop with a reasonable
delay, on
> the other hand, might have its uses as a sort of slide show, among
other
> possibilities).
> >
> >

> >         OK, here's the changes and output.  Still no redirect
happening:
> >         --------------------------------------
> >         #!/usr/bin/perl
> >         use CGI;
> >         $|=1; # Turn on autoflush
> >         print "Content-type: text/html\n\n";
> >         print "<html><body>";
> >         print "Please wait, processing.";
> >
> >         # file "stop" exists for this test...
> >         while (!-e "stop") {
> >           sleep 2;
> >           print " .";
> >         }
> >
> >         print "<BR><BR>Done, processing......\n\n\n";
> >         print "</body></html><BR><BR>\n\n";
> >
> >         # Create a new instance of CGI
> >         my $query = new CGI;
> >
> >         # Get the URL to which the user should be directed
> >         my $target = "http://www.yahoo.com/";
> >
> >         # Now redirect to the target
> >         print $query->redirect($target);
> >
> >         exit;
> >
> >         ----------------------------
> >         The result web page (source):
> >         ----------------------------
> >         Please wait, processing.
> >
> >         Done, processing......
> >         <BR><BR>
> >
> >         Status: 302 Moved
> >         Location: http://www.yahoo.com/
> >         ----------------------------
> >
> >         Thanks again for the help.
> >         Scott

#9211 From: Justin Virgo <tropicalwebsites@...>
Date: Tue Mar 5, 2002 4:58 pm
Subject: server is changing my script?
tropicalwebs...
Send Email Send Email
 
Oh also my error log says:

  [Tue Mar  5 11:39:48 2002] [error] [client
209.180.237.234] File does not exist:
/home/surfsity/public_html/500.shtml
[Tue Mar  5 11:39:48 2002] [error] [client
209.180.237.234] Premature end of script headers:
/home/surfsity/public_html/cgi-bin/ezstatvu.pl
Unrecognized character \xCC at
/home/surfsity/public_html/cgi-bin/ezstatvu.pl line
68.


----
Hi all,

I have some trouble here,

Everytime I try to get my script to run my server
changes 2 different values in my script? It makes
%CCodes gets changed to Ìodes? and %Days is changed to
Úy

I have NO IDEA why this is happening? Any ideas?

Thanks everyone

Justin


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

#9212 From: "erichawkins_2000" <erichawkins_2000@...>
Date: Tue Mar 5, 2002 6:51 pm
Subject: Please help me optimize my Perl keyword parser for large files
erichawkins_...
Send Email Send Email
 
I have a working Perl script that looks through a file for keywords.
If it finds a keyword in the file it lets me know. The file is BIG
and the script is SLOW and I am interested in speeding things up. I
run my script using Perl v5.6.1 for sun4-solaris.

Typically, I parse through an ASCII text file around 100MB in size.
The keywords I search for change, so I load them from a file. Usually
I only parse for, at most, 20 different keywords. Once I find one
keyword I don't care about duplicates. Knowing of the existence of a
keyword in a file is satisfactory.

I am including a copy of my script. Please be ruthless. I want to
learn how to write quick, efficient, elegant Perl. I learned Perl by
studying coworkers code. They learned Perl the same way. Bad habits
have probably been propagated. I sacrifice my dignity here so I don't
have to do it in front of my design manager.

>>>>>>>>>>>>>>> BEGIN SCRIPT <<<<<<<<<<<<<<<<<<<

#!/tooldist/vlsi_local/solrs/perl
eval 'exec perl -S $0 "$@"'
     if 0;
# I'm pretty sure that the above is no longer necessary?

# This is my standard method for getting command line options
use Getopt::Long;

my @optl = ("help", "infile=s");
GetOptions @optl;

if (($opt_infile) && (!$opt_help)) {
         if (! (-e $opt_infile) ) {
                 print "$0: ERROR: Can't see $opt_infile, where is it?
\n";
                 exit 2;
         } else {
                 open (INFILE, "<$opt_infile") or die "$0: ERROR:
Can't open $opt_infile\n";
         }
} else { &print_usage; }

# The unsupported constructs file is usually very small ~100 bytes
open (SYNOPSYS_UNSUPPORTED, "<.synopsys_unsupported_constructs") ||
die "$0: ERROR: Cannot open .synopsys_unsupported_constructs\n";

# Should I slurp this, or does it matter?
while(<SYNOPSYS_UNSUPPORTED>) { chomp; push @CONSTRUCTS, $_;} close
SYNOPSYS_UNSUPPORTED;

# Is the subroutine call okay, or do you think too much overhead?
while (<INFILE>) {
         chomp;
         next if (/^$/);
         $_ = check_sdf($_);
         push @OUTFILE, "$_\n" if $_; # store results if nonzero
}

close INFILE;

# I want to print all the results. Right now I pipe this through
# a "sort -u" filter to only show me unique occurances. What is
# the better way from within this script?
foreach $item (0 .. $#OUTFILE) {
         print "$0: RESULTS: Unsupported found: $OUTFILE[$item]\n";
}

# I'm not computer programmer, I'm electrical design engineer. This
# is a pretty lame keyword search - what is better way? Also, how
# do I delete a keyword from the CONSTRUCTS array once I find it?
# I think this would speed things up, but I don't know how to
# do it.
sub check_sdf {
         my $input = $_[0];
         my $output;
         foreach $pinname ( 0 .. $#CONSTRUCTS ) {
                 $regex = $CONSTRUCTS[$pinname];
                 $output = ( $input =~ /[() ]$regex[() ]/) ? $regex :
0;
                 last if $output;
         }
         $output;
}

# Just part of my standard way of doing things. I try to include this
# in all my scripts.
sub print_usage {
print <<END_HELP;

Usage: $0: -infile=<input_file> [-help]

           -infile    : Input SDF file
           -help      : Usage info


           NOTE: Need to create a .synopsys_unsupported_constructs file


END_HELP
exit 1;
}

>>>>>>>>>>>>>>> END SCRIPT <<<<<<<<<<<<<<<<<<<

Thanks in advance for your help!

#9213 From: "Charles K. Clarkson" <cclarkson@...>
Date: Wed Mar 6, 2002 2:32 am
Subject: Re: [PBML] server is changing my script?
charlesclarkson
Send Email Send Email
 
"Justin Virgo" <tropicalwebsites@...>

: Oh also my error log says:
:
:  [Tue Mar  5 11:39:48 2002] [error] [client
: 209.180.237.234] File does not exist:
: /home/surfsity/public_html/500.shtml
: [Tue Mar  5 11:39:48 2002] [error] [client
: 209.180.237.234] Premature end of script headers:
: /home/surfsity/public_html/cgi-bin/ezstatvu.pl
: Unrecognized character \xCC at
: /home/surfsity/public_html/cgi-bin/ezstatvu.pl line
: 68.

     Looks like line 68 has a typo. Have you run the script with
strictures and warnings? Has it produced the same errors from
the command line?

: Everytime I try to get my script to run my server
: changes 2 different values in my script? It makes
: %CCodes gets changed to Ìodes? and %Days is changed to
: Úy
:
: I have NO IDEA why this is happening? Any ideas?

     Show us the code. At least lines 50 - 80. More if you think
it relevant.

Charles K. Clarkson
--
Clarkson Energy Homes, Inc.
CJ Web Works - Domains for Real Estate Investors.

E Pluribus Unum -- One from many.

#9214 From: "Jonathan E. Paton" <jonathanpaton@...>
Date: Wed Mar 6, 2002 9:11 am
Subject: Re: [PBML] Please help me optimize my Perl keyword parser for large files
jonathanpaton@...
Send Email Send Email
 
> #!/tooldist/vlsi_local/solrs/perl
> review 'exec perl -S $0 "$@"'
>     if 0;
> # I'm pretty sure that the above is no longer necessary?

It does nothing - that 'if 0' condition never changes.  I
recommend changing the shebang line to:

#!/tooldist/vlsi_local/solrs/perl -w

and adding into the script:

use strict;

> # This is my standard method for getting command line
options

Kill useless comments.

> use Getopt::Long;
>
> my @optl = ("help", "infile=s");
> GetOptions @optl;

my %param = (
     help    => undef,
     infile  => undef,
     outfile => undef
);

GetOptions(
     "help"    => \$param{help},
     "infile"  => \$param{infile},
     "outfile" => \$param{outfile}
);

> if (($opt_infile) && (!$opt_help)) {
>         if (! (-e $opt_infile) ) {
>                 print "$0: ERROR: Can't see $opt_infile,
where is it?
\n";
>                 exit 2;
>         } else {
>                 open (INFILE, "<$opt_infile") or die "$0:
ERROR:
> Can't open $opt_infile\n";
>         }
> } else { &print_usage; }

help() if $param{help};
help() unless defined $param{infile};

unless (-e $param{infile}) {
     warn "$0: ERROR: Can't see $param{infile}, where is
it?\n";
     exit 2;
}

open INFILE, $param{infile} or die "$0: ERROR: Can't open
$infile\n";

> # The unsupported constructs file is usually very small
~100 bytes
> open (SYNOPSYS_UNSUPPORTED,
"<.synopsys_unsupported_constructs")
>     or die "$0: ERROR: Cannot open
.synopsys_unsupported_constructs\n";

# Make minor change to above || to "or".

> # Should I slurp this, or does it matter?
> while (<SYNOPSYS_UNSUPPORTED>) { chomp; push @CONSTRUCTS,
$_;} close
> SYNOPSYS_UNSUPPORTED;

my @Constructs = <SYNOPSYS_UNSUPPORTED>;
close SYNOPSYS_UNSUPPORTED or warn "Didn't close
properly\n";

# We have a good candidate for a subroutine here.

> # Is the subroutine call okay, or do you think too much
overhead?

Too much overhead.

> while (<INFILE>) {
         chomp;
         next if (/^$/);
         $_ = check_sdf($_);
         push @OUTFILE, "$_\n" if $_; # store results if
nonzero
}

close INFILE;

> # I want to print all the results. Right now I pipe this
through
> # a "sort -u" filter to only show me unique occurances.
What is
> # the better way from within this script?
> foreach $item (0 .. $#OUTFILE) {
>         print "$0: RESULTS: Unsupported found:
$OUTFILE[$item]\n";
> }

Eak... a "sort -u" filter.  Need to rethink this, somehow.
Maybe use a hash for seen values - see Perl Cookbook.

>
>
>
>
> # I'm not computer programmer, I'm electrical design
engineer. This
> # is a pretty lame keyword search - what is better way?
Also, how
> # do I delete a keyword from the CONSTRUCTS array once I
find it?
> # I think this would speed things up, but I don't know
how to
> # do it.

You want to generate Perl on the fly, and then evaluate it
using eval().  Doing this is quickest, and is also in the
cookbook :)  Beg, borrow or steal for this recipe :)

> sub check_sdf {
>         my $input = $_[0];
>         my $output;
>         foreach $pinname ( 0 .. $#CONSTRUCTS ) {
>                 $regex = $CONSTRUCTS[$pinname];
>                 $output = ( $input =~ /[() ]$regex[() ]/)
? $regex : ;
>                 last if $output;
>         }
>         $output;
> }

Why is it slow?  Because this subroutine is doing it the
brain dead way... a regex takes time to compile - and this
does it for every line of the file.

I'd expect Perl to be about 2-5 times slower at performing
this task than a simple 'cat infile' - that means you've
got someway to go!

Apologies for the broken bits of sample code above.

Jonathan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

#9215 From: Adrian Stovall <AdrianS@...>
Date: Tue Mar 5, 2002 10:40 pm
Subject: RE: [PBML] Date comparison
AdrianS@...
Send Email Send Email
 
well, assuming that seconds don't matter...

$timea = "Mon Mar 4 07:54:52 EST 2002";
$timea =~ s/^.*?\W\d{2}:(\d{2}).*/$1/;
$timeb = "2002:03:04:07:57:16";
$timeb =~ s/^\d{4}:\d{2}:\d{2}:\d{2}:(\d{2}).*/$1/;
print "time a: $timea\ntime b: $timeb\n";
$diff = $timeb - $timea;
if ($diff == 7) {
	 print "Difference is $diff minutes.\n";
}
else{
	 print "Wrong time difference ($diff minutes).\n";
}

or something similar...

-----Original Message-----
From: Nguyen, David M [mailto:david.m.nguyen@...]
Sent: Monday, March 04, 2002 9:46 AM
To: Perl-Beginner (E-mail)
Subject: [PBML] Date comparison


In my report, I have two lines that prints out timestamp, I'd like to
compare these twos by subtracting them then print out result ONLY if it is 7
minutes difference.  How do I do that?

Line 1:      Mon Mar 4 07:54:52 EST 2002

Line 2:      2002:03:04:07:57:16

Thanks,

David





[Non-text portions of this message have been removed]



Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

#9216 From: "b_harnish" <bharnish@...>
Date: Tue Mar 5, 2002 7:19 pm
Subject: Re: Set Cookie through SSI
b_harnish
Send Email Send Email
 
--- In perl-beginner@y..., Juni Adi <skiper@a...> wrote:
> Hello folks,
> This is my  1st time dealing with
> cookie. Basically I just want to know wether it's
> the first time a client accessing my index.shtml
> or they just "refresh" the page. Thinking that it
> would be done through cookie thing, I wrote
> cookie.cgi that will be called from index.shtml
> through SSI.
>
> index.shtml looks like:
> <html>
> <!--#exec cgi="cgi-bin/cookie.cgi" -->
> </html>
>
> -----end of index.html----
>
> cookie.cgi looks like:
>
> #!/usr/bin/perl
> #cookie.cgi
> use CGI;
> $q=new CGI;
>
> #set cookie
> $me='skiper';
> $path='/';
> $cookie=$q->cookie(-name=>"user_name",-value=>$me, -path=>$path);
> print $q->header(-type=>'text/html',-cookie=>$cookie);
>
> #accessing cookie  (if there is cookie)
> $user=$q->cookie(-name=>'user_name');
>
> if ($user){
> print "$user\n";
> }
> else{
> print "no cookie\n";
> }
>
> --- end of cookie.cgi----
>
> Now comes the problem.
> It seems like it failed to set cookie. When user
> "refresh" index.shtml page (that supposed to
> send back the cookie to the script), the script
> got no cookie at all.
>
> Then I try to call the script directly from
> URL. First time I call the script, I got "no
> cookie". Then "refresh" the page, and get the
> cookie printed out.
>
> It would be great if any of you could give me
> explanations.

The problem is that when done through SSI, the header information (Content-type,
length, ...) has already been sent to the browser, so your script can't do
Set-Cookie.

When you call the script directly, the header info has NOT been sent, and thus,
your script can do Set-Cookie, and works fine.

AFAIK, the only way to set a cookie after the header info has been sent is to
use a clientside script (i.e. javascript).

  - Brian

#9217 From: "Jenda Krynicky" <Jenda@...>
Date: Wed Mar 6, 2002 10:31 am
Subject: Re: [PBML] Please help me optimize my Perl keyword parser for large files
jendaperl
Send Email Send Email
 
From:            "Jonathan E. Paton" <jonathanpaton@...>

> > #!/tooldist/vlsi_local/solrs/perl
> > review 'exec perl -S $0 "$@"'
> >     if 0;
> > # I'm pretty sure that the above is no longer necessary?
>
> It does nothing - that 'if 0' condition never changes.  I
> recommend changing the shebang line to:

Well ... it does nothing if executed by perl, but if the file gets
processed by sh or csh then the
	 review 'exec perl -S $0 "$@"'
will get called.

Not sure exactly what purpose serves it here (I'm not a Unix guy),
but you can see similar stuff around.

> > # I'm not computer programmer, I'm electrical design
> engineer. This
> > # is a pretty lame keyword search - what is better way?
> Also, how
> > # do I delete a keyword from the CONSTRUCTS array once I
> find it?
> > # I think this would speed things up, but I don't know
> how to
> > # do it.
>
> You want to generate Perl on the fly, and then evaluate it
> using eval().  Doing this is quickest, and is also in the
> cookbook :)  Beg, borrow or steal for this recipe :)
>
> > sub check_sdf {
> >         my $input = $_[0];
> >         my $output;
> >         foreach $pinname ( 0 .. $#CONSTRUCTS ) {
> >                 $regex = $CONSTRUCTS[$pinname];
> >                 $output = ( $input =~ /[() ]$regex[() ]/)
> ? $regex : ;
> >                 last if $output;
> >         }
> >         $output;
> > }
>
> Why is it slow?  Because this subroutine is doing it the
> brain dead way... a regex takes time to compile - and this
> does it for every line of the file.

I'd recomend looking at qr// ... you can precompile the regexps
(with the [() ] part of course) to speed things up. You'll have to have
two arrays then though. One containing the regexps and second
containing the "texts" :

	 while(<SYNOPSYS_UNSUPPORTED>) {
		 chomp;
		 push @CONSTRUCTS, $_;
		 push @CONSTRUCTS_RE, qr/[() ]$_[() ]/;
	 }
	 ...
	 sub check_sdf {
		 my $input = $_[0];
		 my $output;
		 foreach $pinname ( 0 .. $#CONSTRUCTS ) {
			 $regex = $CONSTRUCTS_RE[$pinname];
			 return $CONSTRUCTS[$pinname]
				 if $input =~ /$regex/;
		 }
		 return '';
	 }

I assume that the .synopsys_unsupported_constructs file contains
RegExps. If it's supposed to contain words and the dots,
questionmarts and other special characters are to be matched
literaly you'll want to change the regexp to

		 push @CONSTRUCTS_RE, qr/[() ]\Q$_\E[() ]/;

Jenda

=========== Jenda@... == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
					 --- me

#9218 From: "Jenda Krynicky" <Jenda@...>
Date: Wed Mar 6, 2002 10:31 am
Subject: Re: [PBML] Re: Redirection
jendaperl
Send Email Send Email
 
From: "scott.list" <scott.list@...>

> Kyle:
>
> Below worked like a charm.  Web page prints with continuing ".." until
> I create the file called "stop".  Then the script tacks on your Java.
> I used:
>
> print << "END"
> <script language="javascript" type="text/javascript">

Aaagrrr. It says JavaScript here, not Java!
DO NOT CONFUSE THE TWO!

Jenda

=========== Jenda@... == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
					 --- me

#9219 From: "Jenda Krynicky" <Jenda@...>
Date: Wed Mar 6, 2002 10:31 am
Subject: Re: [PBML] server is changing my script?
jendaperl
Send Email Send Email
 
From: Justin Virgo <tropicalwebsites@...>

> Oh also my error log says:
>
>  [Tue Mar  5 11:39:48 2002] [error] [client
> 209.180.237.234] File does not exist:
> /home/surfsity/public_html/500.shtml
> [Tue Mar  5 11:39:48 2002] [error] [client
> 209.180.237.234] Premature end of script headers:
> /home/surfsity/public_html/cgi-bin/ezstatvu.pl
> Unrecognized character \xCC at
> /home/surfsity/public_html/cgi-bin/ezstatvu.pl line
> 68.
>
>
> ----
> Hi all,
>
> I have some trouble here,
>
> Everytime I try to get my script to run my server
> changes 2 different values in my script? It makes
> %CCodes gets changed to Ìodes? and %Days is changed to
> Úy

How do you upload it?

Jenda

=========== Jenda@... == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
					 --- me

#9220 From: "Senthill Kumar V" <senthillkumar.vasu@...>
Date: Wed Mar 6, 2002 1:48 pm
Subject: reg GDBM files..
vsenthill
Send Email Send Email
 
Hi,

I have some following error, when i tie a GDBM file while creating.
It gives the following error,

    --> Can't locate object method "TIEHASH" via package "GDBM_File"

I am using AnyDBMFile.

Can any one tell the difference btw GDBM_File and AnyDBMFile ?

thanks
Senthill

   ----------

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.


  ********************************************************************


[Non-text portions of this message have been removed]

#9221 From: sgharms@...
Date: Wed Mar 6, 2002 2:38 pm
Subject: Re: [PBML] Date comparison
parmenides777
Send Email Send Email
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adrian  Stovall <AdrianS@...> writes:

Assuming you're on a UNIX-like system, the Right way to do this is to
look at the time modules available at CPAN.  What you're really
wanting is a way to get $date1 in terms of the Epoch and then get
$dat.2 in terms of the Epoch and then compare them.


This makes the date entries both in terms of an arbitrarily fixed
point in the past.  Comparison and diffs are very easy from that point
on.

steven


> well, assuming that seconds don't matter...
>
> $timea = "Mon Mar 4 07:54:52 EST 2002";
> $timea =~ s/^.*?\W\d{2}:(\d{2}).*/$1/;
> $timeb = "2002:03:04:07:57:16";
> $timeb =~ s/^\d{4}:\d{2}:\d{2}:\d{2}:(\d{2}).*/$1/;
> print "time a: $timea\ntime b: $timeb\n";
> $diff = $timeb - $timea;
> if ($diff == 7) {
>  print "Difference is $diff minutes.\n";
> }
> else{
>  print "Wrong time difference ($diff minutes).\n";
> }
>
> or something similar...
>
> -----Original Message-----
> From: Nguyen, David M [mailto:david.m.nguyen@...]
> Sent: Monday, March 04, 2002 9:46 AM
> To: Perl-Beginner (E-mail)
> Subject: [PBML] Date comparison
>
>
> In my report, I have two lines that prints out timestamp, I'd like to
> compare these twos by subtracting them then print out result ONLY if it is 7
> minutes difference.  How do I do that?
>
> Line 1:      Mon Mar 4 07:54:52 EST 2002
>
> Line 2:      2002:03:04:07:57:16
>
> Thanks,
>
> David
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Unsubscribing info is here:
> http://help.yahoo.com/help/us/groups/groups-32.html
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
> Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

- --
http://www.obsidiansunrise.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard
<http://www.gnupg.org/>

iD8DBQE8hin00Fa/d+hASL8RAh+/AJ4zISwMr1kXHAx38OxspiYBAyLByQCeLdLI
gmYatQcIL6tL1r8MSIUHd1Q=
=zS2Q
-----END PGP SIGNATURE-----

#9222 From: "msws_1" <scott.list@...>
Date: Wed Mar 6, 2002 2:48 pm
Subject: [PBML] Re: Redirection
msws_1
Send Email Send Email
 
> Aaagrrr. It says JavaScript here, not Java!
> DO NOT CONFUSE THE TWO!
>
> Jenda

OK, OK.  I'm learning.  Javascript it is.

#9223 From: Jason Larson <jasonl@...>
Date: Wed Mar 6, 2002 2:54 pm
Subject: RE: [PBML] regex giving incorrect result.
jclarson2002
Send Email Send Email
 
> -----Original Message-----
> From: Jeff 'japhy' Pinyan [mailto:japhy@...]
> Subject: Re: [PBML] regex giving incorrect result.
>
   <snip>
>
> Include : in the character class:
>
>   ($file_path) = $file_path =~ m{([-\w=+/]+\.\w+)};
>
> --
> Jeff "japhy" Pinyan      japhy@...

Man, I really hate to correct Japhy, but looks like there might be a typo
here... Did you mean to say:

  Include : in the character class:

    ($file_path) = $file_path =~ m{([-:\w=+/]+\.\w+)};


Hope this helps (and I'm not sticking my proverbial foot in my mouth)...
Jason


CONFIDENTIALITY NOTICE:

************************************************************************

The information contained in this ELECTRONIC MAIL transmission
is confidential.  It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s).  If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.

************************************************************************


[Non-text portions of this message have been removed]

#9224 From: "b_harnish" <bharnish@...>
Date: Wed Mar 6, 2002 3:29 pm
Subject: OT: Breaking the rules (was Re: [PBML] regex giving incorrect result.)
b_harnish
Send Email Send Email
 
--- In perl-beginner@y..., Jason Larson <jasonl@s...> wrote:
> CONFIDENTIALITY NOTICE:
>
> ************************************************************************
>
> The information contained in this ELECTRONIC MAIL transmission
> is confidential.  It may also be privileged work product or proprietary
> information. This information is intended for the exclusive use of the
> addressee(s).  If you are not the intended recipient, you are hereby
> notified that any use, disclosure, dissemination, distribution [other
> than to the addressee(s)], copying or taking of any action because
> of this information is strictly prohibited.
>
> ************************************************************************

If I show this message to a friend, am I guilty of breaking the law? Am I an
"addressee(s)/intended recipient"? If not, then I just took an action because of
the information above by replying to it. Technicaly, even if I am an
"addressee(s)/intended recipient" I still took an action, but thats just
splitting hairs.

CONFIDENTIALITY NOTICE:
*******************************************************
Reading the above message is strictly prohibited unless you are underwater while
taking the aforementioned action. You will forget that this message even
existed. Not complying with this notice is strictly prohibited. If you insist on
reading the above message, you agree to the terms and conditions below:
I) You will wear pajama pants on only one leg for a week.
II) You will not critisize my spelling.
III) You waive all rights to naming your first born anything other than Brian.
IIII) You won't notice that this should be IV.
V) This thread was over before it started.
*******************************************************

  - Brian

#9225 From: "b_harnish" <bharnish@...>
Date: Wed Mar 6, 2002 3:34 pm
Subject: Re: server is changing my script?
b_harnish
Send Email Send Email
 
--- In perl-beginner@y..., Justin Virgo <tropicalwebsites@y...> wrote:
> Oh also my error log says:
>
>  [Tue Mar  5 11:39:48 2002] [error] [client
> 209.180.237.234] File does not exist:
> /home/surfsity/public_html/500.shtml
> [Tue Mar  5 11:39:48 2002] [error] [client
> 209.180.237.234] Premature end of script headers:
> /home/surfsity/public_html/cgi-bin/ezstatvu.pl
> Unrecognized character \xCC at
> /home/surfsity/public_html/cgi-bin/ezstatvu.pl line
> 68.
>
>
> ----
> Hi all,
>
> I have some trouble here,
>
> Everytime I try to get my script to run my server
> changes 2 different values in my script? It makes
> %CCodes gets changed to Ìodes? and %Days is changed to
> Úy
>
> I have NO IDEA why this is happening? Any ideas?
>
> Thanks everyone
>
> Justin

The problem may be in the way you're uploading it. If you're uploading it b=
y a web interface, that could be it. The symptoms look like something is try=
ing to URL decode your script. It's basically doing this:
s/%([a-fA-F0-9]{2})/pack('H*',$1)/ge;

  - Brian

Messages 9196 - 9225 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help