RE: perl and threads for webstress purpose

2002-02-12 Thread Michael Dreksler

Eric P. wrote
> I don't have the URL right now, but I recall that Lincoln Stien wrote an
> excellent article in "Web Techniques" about using perl to stress test a
> web server. One warning, however: Lincoln's script requires two machines -
> a web server and a client to test the web server.

http://stein.cshl.org/~lstein/torture/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Malformed Header

2002-02-12 Thread Stephen.Hurley

Hi,
Not sure if this is entirely a perl problem, but it is certainly related. I
made some minor changes to one of my CGI scripts (to get the page to include
the current date), and Apache started to give me a 500 error on it. The
syntax of the script is perfect, and I'm using CGI.pm to generate the
header. I've shown the various error messages below. I have a meeting in 18
minutes where I have to show this working. I suppose if I get desperate I'll
just dike out the CGI.pm stuff and generate the header by hand, but I'd like
to know why this doesn't work. Any ideas ?


what's generated...

http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd";>
http://www.w3.org/1999/xhtml"; lang="en-US">

how I'm generating it...
print start_html(-title=>"Events");

what Apache's error log says...
[Tue Feb 12 12:32:41 2002] [error] [client 136.xxx.xxx.xxx] malformed header
from script. Bad header=


RE: Malformed Header

2002-02-12 Thread Al Hospers

do you have an end_header() tag as well?


> what's generated...
> 
>  "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd";>
> http://www.w3.org/1999/xhtml"; lang="en-US">
>
> how I'm generating it...
> print start_html(-title=>"Events");
>
> what Apache's error log says...
> [Tue Feb 12 12:32:41 2002] [error] [client 136.xxx.xxx.xxx]
> malformed header
> from script. Bad header= d:/path/to/events.cgi



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: perl and threads for webstress purpose

2002-02-12 Thread Randal L. Schwartz

> "Thierry" == Thierry Forest <[EMAIL PROTECTED]> writes:

Thierry> I create the request without too much trouble but the load is not
Thierry> enought .. 
Thierry> So i was thinking t use the threads to load up the client and the server
Thierry> , but Threads are really obscur for me , i don't really know if that
Thierry> will be the better solution to make my programe more powerfull , and if
Thierry> there is other ways to connect more than one client at the same time .. 
Thierry> so i start to have a look to the thread perl documentation , but now i
Thierry> don't really know wich type of threads is the more appropriate for the
Thierry> purpose of stressing a web server .. 

In unix, thread is spelled "f o r k", so if you're using Unix, you can
steal my "web form stress tester" from
.


Thierry> 
Thierry> This email and any files transmitted with it are confidential 
Thierry> and intended solely for the use of the individual or entity to
Thierry> whom they are addressed. If you have received this email
Thierry>  in error please notify the postmaster at the address below.

Thierry>  [EMAIL PROTECTED]

Thierry> This footnote also confirms that this email message has been
Thierry> checked the presence of computer viruses.

Thierry> **

You have exceeded the 4-line .sig boilerplate limit with a worthless
unenforcable disclaimer.  Please remove this text from future postings
to this mailing list.  If you cannot do so for mail from your domain,
please get a freemail account and rejoin the list from there.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Counter in Perl

2002-02-12 Thread Octavian Rasnita

Hi all,
I made a counter in Perl and if a visitor refreshes the page, the counter
increases.
Can I modify the Perl script so that won't happend?
Thanks.
Teddy,
My dear email address is [EMAIL PROTECTED]



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Windows Text editor

2002-02-12 Thread Michael Dreksler

/* There is nothing like a discussion on text editors to get the emails
flowing :-) */

I have been using Text pad for the past few months - it is refreshingly
lightweight and has masses of user-written add-ons available for download.

It does syntax highlighting for 40+ languages, multilingual, spell checks,
line numbers, integrates with tools well, 'clip books' of frequently used
snippits etc. etc.

Well worth the registration fee in my opinion (and I don't often say that!).

www.textpad.com

Michael

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Counter in Perl

2002-02-12 Thread Bob Showalter

> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 11:24 AM
> To: [EMAIL PROTECTED]
> Subject: Counter in Perl
> 
> 
> Hi all,
> I made a counter in Perl and if a visitor refreshes the page, 
> the counter
> increases.
> Can I modify the Perl script so that won't happend?
> Thanks.
> Teddy,
> My dear email address is [EMAIL PROTECTED]

Give him a cookie that expires after a while (a day maybe?).

If he sends the cookie, don't increment your counter.

Of course, if he refuses your cookie, this won't work.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Malformed Header

2002-02-12 Thread Briac Pilpré

On Tue, 12 Feb 2002 12:58:23 +, Stephen.Hurley <[EMAIL PROTECTED]> wrote:
> Hi,
> Not sure if this is entirely a perl problem, but it is certainly
> related. I made some minor changes to one of my CGI scripts (to get
> the page to include the current date), and Apache started to give me a
> 500 error on it. The syntax of the script is perfect, and I'm using
> CGI.pm to generate the header. I've shown the various error messages
> below. I have a meeting in 18 minutes where I have to show this
> working. I suppose if I get desperate I'll just dike out the CGI.pm
> stuff and generate the header by hand, but I'd like to know why this
> doesn't work. Any ideas ?

 The header Apache is expecting is not the same as the beginning of the
 HTML document.
 try with:
 print header(), start_html(-title=>"Events");


 You can see what is being sent as header:
 perl -M'CGI qw(:standard)' -e'print header()'


-- 
briac
 << dynamic .sig on strike, we apologize for the inconvenience >>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Counter in Perl

2002-02-12 Thread Marty Landman

At 09:45 AM 2/12/02 -0500, Bob Showalter wrote:

> > I made a counter in Perl and if a visitor refreshes the page,
> > the counter
> > increases.
> > Can I modify the Perl script so that won't happend?
>
>Give him a cookie that expires after a while (a day maybe?).
>If he sends the cookie, don't increment your counter.
>Of course, if he refuses your cookie, this won't work.

Why even put an expiration on the cookie? If there is no expiration date 
than it's a session cookie so it only lasts as long as the browser is 
active. You may also want to set the page url on the cookie otherwise if 
they click to another page your counter won't increment... see what I mean?

hth,

Marty

SIMPL(tm) Content Management & WebSite Creation
http://face2interface.com/Home/Demo.shtml
Complementary Color Picker
http://face2interface.com/WebSafe


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Counter in Perl

2002-02-12 Thread Sir Douglas Cook

I am very new to perl, Ok, I know nothing.
Although I am wondering if you did something like


if (Remote_host NotEqual LastRemote_host) {
 LastRemote_host==env{remote_host};
 Counter++;
 Open counter_File;
 Update counter_File(Counter,,, blah i have no idea);
 Close counter_File;
}

Or something... I am just wondering if this is remotely a valid idea.

Later
[EMAIL PROTECTED]



- Original Message -
From: "Marty Landman" <[EMAIL PROTECTED]>
To: "Bob Showalter" <[EMAIL PROTECTED]>; "'Octavian Rasnita'"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 7:26 AM
Subject: RE: Counter in Perl


> At 09:45 AM 2/12/02 -0500, Bob Showalter wrote:
>
> > > I made a counter in Perl and if a visitor refreshes the page,
> > > the counter
> > > increases.
> > > Can I modify the Perl script so that won't happend?
> >
> >Give him a cookie that expires after a while (a day maybe?).
> >If he sends the cookie, don't increment your counter.
> >Of course, if he refuses your cookie, this won't work.
>
> Why even put an expiration on the cookie? If there is no expiration date
> than it's a session cookie so it only lasts as long as the browser is
> active. You may also want to set the page url on the cookie otherwise if
> they click to another page your counter won't increment... see what I
mean?
>
> hth,
>
> Marty
>
> SIMPL(tm) Content Management & WebSite Creation
> http://face2interface.com/Home/Demo.shtml
> Complementary Color Picker
> http://face2interface.com/WebSafe
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




OpenSRS

2002-02-12 Thread Scott Lutz

Has anyone customized the configuration of OpenSRS Perl client?
I am using the flow of 
1. Gather all the domains to be registered and the registration info
2. Calculate all of the applicable taxes that are to be paid in Canada,
since we are in Canada
3. Connect to the third party payment processor to get an authorization
4. Once authorization is received, connect back to OpenSRS to register
domains
5. Then once domains are secured, connect back to the payment processor
to secure funds.

What I am having a problem with is wondering how to do all of this with
having to rely on cookies (if possible), yet maintain state and
security.

Does anyone have any good pointers and/or advice here?



Scott Lutz

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl parameter in html-tag

2002-02-12 Thread Terje Bremnes

Hi,

maybe this is more of an html-problem, but since perl is often used in
connection to html I hope someone can help me.

I have made a simple search script that takes its input search string
from a web-form. It produces a webpage with a list of the files on the
search area in which the string was found.

$testvalue=$value[0];
$word = `grep -inlsh $testvalue Catalog/*`;
print "The string $testvalue was found in these files :
$word";


What I want to do, is to create a html-link to each of those files. I have
tried
adding a  but that links all the files to the
same
URL which is invalid if more than one file since all files are concatenated
into
the same URL. Example : path/file1file2file3 and so on...

Any ideas here? Do I need to split the $word into an array (vector) in order
to separate URL-links?

Cheers,
Ted


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl parameter in html-tag

2002-02-12 Thread Briac Pilpré

On Tue, 12 Feb 2002 22:54:36 +0100 (MET), Terje Bremnes
<[EMAIL PROTECTED]> wrote:
> Any ideas here? Do I need to split the $word into an array (vector) in order
> to separate URL-links?

 That's the idea, though the backtick operator can be used in list
 context, like this:

#!/usr/bin/perl -Tw
use strict;
@ENV{qw(PATH BASH_ENV)} = ('',''); 
my $value = $ARGV[0];

   $value =~ m/^(\w+)/; # untaint
   $value = $1;

 chomp(my @results = `/bin/grep -inlsh $value perl/*`);
 
 print "The string '$value' was found in these files:\n";
 foreach (@results){
 print qq'$_\n';
 }
 print "";

__END__



-- 
briac
 << dynamic .sig on strike, we apologize for the inconvenience >>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Session.pl

2002-02-12 Thread Margarita Perez

Hi,

I am using Sesion.pm for the first time. I running Windows 2000 and using
Active Perl. Does Session.pm work in this environment. I am using trying to
get an example to work from
http://jan.netcomp.monash.edu.au/ecommerce/perl_session.html and the wierd
thing is that I can run the first script but the second one does not work. I
enter my name and then enter a hobby but when I hit submit I get a 404
error?
Any ideas?


Margarita Perez
Computer Technician
[EMAIL PROTECTED]
(559) 230-4569


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




use, require, do... which is appropriate?

2002-02-12 Thread W P

my problem is simple.  i have a number of scripts on my server, and i would like all 
of them to initially run a function defined by me.  however, it would be burdensome to 
write that function over for every script.  creating a custom module, however, doesn't 
really seem that much easier.  i have read the chapter on modules in Programming Perl, 
and i am still not sure about a few things.  if i were to create my own module, what 
directory does it go in?

is there an easier way to import a single block of code into each script?





Re: use, require, do... which is appropriate?

2002-02-12 Thread Brett W. McCoy

On Tue, 12 Feb 2002, W  P wrote:

> my problem is simple.  i have a number of scripts on my server, and i
> would like all of them to initially run a function defined by me.
> however, it would be burdensome to write that function over for every
> script.  creating a custom module, however, doesn't really seem that
> much easier.  i have read the chapter on modules in Programming Perl,
> and i am still not sure about a few things.  if i were to create my own
> module, what directory does it go in?

While writing a module is more work, it's better and safer, IMHO.  'use'
actually does a require, but has some other things it does, like proerply
imports exported sub names, etc.

As for which directory, use any directory you wish.  You can always put
the directory in the PERL5LIB environment variable, or, do this in your
files:

use lib '/path/to/Module'; #adds /path/to/Module to @INC
use Module;

BTW, . is already included in @INC, so you can put the moduel in the saem
directory as your script.

-- Brett
  http://www.chapelperilous.net/

Where there's a will, there's a relative.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]