[19167] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1362 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 23 18:10:39 2001

Date: Mon, 23 Jul 2001 15:10:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <995926216-v10-i1362@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 23 Jul 2001     Volume: 10 Number: 1362

Today's topics:
        passing parameters through Win32::Service? (Dar-Shyang Lee)
    Re: perl wrapper for java <gnarinn@hotmail.com>
    Re: Re: Escaped period! Someone apprehend it! <jnurick@zdnetonebox.com>
    Re: redirecting system() call output into variable <pne-news-20010723@newton.digitalspace.net>
    Re: Regular Expression Experts <ghed9@netzero.net>
    Re: Regular Expression Experts <EvR@compuserve.com>
    Re: Remote updating of my website <spamhater@keepyourfilthyspamtoyourself.co.uk>
    Re: Removing .coms <pne-news-20010723@newton.digitalspace.net>
        sending commands <hoss@chungk.com>
    Re: sending commands (Logan Shaw)
    Re: Sendmail with Win32 <newspost@coppit.org>
        Simple Substitute Question <brad_watts@attcanada.net>
    Re: Simple Substitute Question <jeff@vpservices.com>
    Re: Simple Substitute Question <godzilla@stomp.stomp.tokyo>
    Re: Simple Substitute Question <brad_watts@attcanada.net>
    Re: Simple Substitute Question <jeff@vpservices.com>
        Sorting an array of strings by 'closeness' to another s <jpixton@dircon.co.uk>
        Split Question <mark.riehl@agilecommunications.com>
    Re: Split Question <krahnj@acm.org>
        Stupid Question ? How to test a form with post method o (Kev)
    Re: Stupid Question ? How to test a form with post meth <buggs-clpm@splashground.de>
    Re: Stupid Question ? How to test a form with post meth <godzilla@stomp.stomp.tokyo>
    Re: Stupid Question ? How to test a form with post meth <jeff@vpservices.com>
        Trying perl -MO=C on windows (nobody)
        Tutorials? <nathan.randle@ntlworld.com>
    Re: Tutorials? <tom.hoffmann@worldnet.att.net>
    Re: Who can help me about the confused (..) operator? <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Jul 2001 14:55:04 -0700
From: ds_lee@yahoo.com (Dar-Shyang Lee)
Subject: passing parameters through Win32::Service?
Message-Id: <769c15ef.0107231355.23bf3d91@posting.google.com>

Hi,

I am using Win32::Service to control an NT service.  But I can not
figure out how to pass in starting parameters (as one can do through
Service Control Manager's property->parameters field)?  Can anyone
help?  Thanks.

Dar-Shyang


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

Date: Mon, 23 Jul 2001 18:33:32 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: perl wrapper for java
Message-Id: <995913212.272762340027839.gnarinn@hotmail.com>

In article <9jfk0f$m71$1@uranium.btinternet.com>,
Neil Morris <Neilmorris@btinternet.com> wrote:
>Hi
>I have written in the most part a perl wrapper to execute java and to pass
>environment variables plus data sent by the post/get method. My question is
>I understand that the following code opens a program and "prints" data to
>it.
>
>$DATA=getCgiData();
>open(JAVA,"| /usr/local/bin/java javaprogram\n");
>print JAVA "$DATA";
>
>Does the print statement above prints to the standard input for java as I
>have a java code starting as follows.
>
>class ProcessData {
>
>public static void main(String args[]) { \* getting data from perls print
>statement hopefully!
>....
>...
>}
>}
>

literally, yes your print prints to standard input of whatever program
is invoked in your open(), in this case java

but using the PSI module, i have the impression you are asking
if the printed data will appear in the args[] array, then the answer is no,
unless java is weirder than i thought.

of course, it could well be that i need to upgrade PSI.pm :-)

gnari





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

Date: Mon, 23 Jul 2001 21:18:06 +0100
From: John Nurick <jnurick@zdnetonebox.com>
Subject: Re: Re: Escaped period! Someone apprehend it!
Message-Id: <i91plto892afp5c5plqe9tnvn1jumubu74@4ax.com>

On Mon, 23 Jul 2001 20:05:30 GMT, "--Rick" <no_trick@my-de(remove the
obvious)ja.com> wrote:

>"Eric Bohlman" <ebohlman@omsdev.com> wrote in message
>news:9jhotu$rt8$1@bob.news.rcn.net...
>| Jay <ReplyToTheGroup@donotemailme.com> wrote:
>| >     Sorry for the pun in the subject.  I had the following in a
>program.
>|
>| > if(/\d+\.?\d+/) {
>| >     print "OK!";
>| > }
>|
>| > Now what I wanted was it to accept numbers which can be either whole
>numbers
>| > or decimal numbers(hence the period).  This doesn't work, though.
>It
>| > accepts numbers alright, and anything else too.  If I put it as
>/\d+\.\d+/
>|
>| That's because you haven't anchored the pattern at both ends, so it
>will
>| match if there's a number anywhere in the string.  Also, it won't
>match
>| single-digit numbers as written; you need to make the part after the
>| decimal point optional as well.  Try /^\d+(?:\.\d+)$/.
>|
>Please bear with me as I'm still new to perl.  This solution didn't work
>at all for me.  If it does work, then I would love to learn how.  I
>suspect that there is a question-mark missing just ahead of the tail
>anchor that is needed to make the decimal portion optional.  When I
>tested it, only whole numbers would pass.  To get decimals I think it
>should look like this:  /^\d+(?:\.\d+)?$/.
>
>That was better, but I made the mistake of including a number like .04
>in my test cases.  I'm sure there is a pretty way, and I still haven't
>gotten all the cases, but to accept the bare decimal, I came up with
>this kludged expression:  /^\.\d+$|^\d+(?:\.\d+)?$/

This

perl -ne"print qq(OK!\n) if m/^\d*(?:\d|\.\d|\d\.)\d*$/"

(you can tell I'm using Windows) handled everything I threw at it
(including .04) but doesn't look very elegant.

--
John

Please reply to the newsgroup and not by e-mail.
split $q,q[ acehJklnoPrstu]; $q.=$_[$_] for map hex, unpack
q,a,x29,q;89D010B3170A3B7041263B01D0177;;print qq;...$q.\n;


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

Date: Mon, 23 Jul 2001 21:16:01 +0200
From: Philip Newton <pne-news-20010723@newton.digitalspace.net>
Subject: Re: redirecting system() call output into variable
Message-Id: <f2toltcpit0r56k8i6cn8jd0d94vpibgu8@4ax.com>

On 23 Jul 2001 03:22:12 -0700, graham@aledrinker.co.uk (Graham) wrote:

> Also, how do you get the output of wrap to format itself to the width
> of the terminal instead of 80 characters.

Are you using Text::Wrap? Then RTFM:

:  Lines are wrapped at $Text::Wrap::columns columns.
:  $Text::Wrap::columns should be set to the full width of your
:  output device.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Mon, 23 Jul 2001 18:41:43 GMT
From: "Gerard Lapidario" <ghed9@netzero.net>
Subject: Re: Regular Expression Experts
Message-Id: <Hd_67.21$ft1.206589@paloalto-snr2.gtei.net>

<ctcgag@hotmail.com> wrote in message
news:20010723114743.501$iZ@newsreader.com...
> "Gerard Lapidario" <ghed9@netzero.net> wrote:
> > Hello group,
> >
> > I need your help with regular expression.  I need to extract strings
> > which fit the format of (\d+)(/(\d+)+
> >
> > example:
> > 1) asdf132/123-1432
> >     I should get 132/123
> > 2) atm212/32
> >     I should get 212/32
> > 3) a233/322/32
> >     I should get 233/322/32
> > 4) 232/31/232/21/221/21
> >     I should get 232/31/232/21/221/21
>
>
> What should you get for "Hello there"?
> for "56/dog"?
A: None
> for "dog/42"?
A: None
> for "hi1/2there3/4"?
A: For above case, we have no entry in the database with more than 1
combination of (\d+)(/\d+)+

Jonas query is getting the correct reasult.  Do you know a web site or pdf
download that covers Regular Expression intensively?

Thanks and regards.


>
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
>                     Usenet Newsgroup Service




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

Date: Mon, 23 Jul 2001 13:19:14 -0600
From: "Richard A. Evans" <EvR@compuserve.com>
Subject: Re: Regular Expression Experts
Message-Id: <9jht4b$7fk$1@suaar1aa.prod.compuserve.com>

> Do you know a web site or pdf
> download that covers Regular Expression intensively?
>

Try Mastering Regularly Expressions from O'Reilly.  It is the best work on
RegEx I've ever seen.  It is intense, but probably address everything you
could ever want to know on the topic.  Significant portions of the book are
dedicated to perl.

Regards,

Rick Evans




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

Date: Mon, 23 Jul 2001 12:42:45 -0700
From: Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk>
Subject: Re: Remote updating of my website
Message-Id: <e4b6ba9e4a.spamhater@keepyourfilthyspamtoyourself.co.uk>

In message <3B5C0C77.1E63FF3@lmf.ericsson.se>
          Deneb Pettersson <Deneb.Pettersson@lmf.ericsson.se> wrote:

> That sounds nice, you need a script that is run on your ISP's server, which
> just calls up their mail server , checks if you have mail, and then if it
> sees the subject it would write it into your web page...
> 
> Some problems with this approach :
>  -  Your webserver   They either have both on different servers, or they just
> don't like scripts running stuff like that on their computers...
>  - If i send a mail wiht the same subject it will get posted onto your
> webpage....

Well he could get aound that by including a password in the subject
line.

The ideal solution would be if your ISP allows you to redirect mail to a
script. Then you can extract the appropriate mails and put the contents
in a file where they can be picked up by another script that displays
your page. Any other mails can be forwarded to their recipients. I have
such a system running on my site which enables me to process mail in
many different ways.

The main problem is that IME very few ISPs allow you to do this unless
you pay through the nose for a 'professional' hosting service.

Alan


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

Date: Mon, 23 Jul 2001 21:15:58 +0200
From: Philip Newton <pne-news-20010723@newton.digitalspace.net>
Subject: Re: Removing .coms
Message-Id: <mvsoltojrc4iriflcmia1oh2qspqub67lc@4ax.com>

On 23 Jul 2001 09:49:38 GMT, dkcombs@panix.com (David Combs) wrote:

[learn regexes]
> Nor will anyone else, save maybe for a guy named "Ilya".

I hear Hugo is making a pretty valiant attempt at maintaining that part
of Perl. I presume understanding is part of that :)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Mon, 23 Jul 2001 20:00:39 GMT
From: "Devon Perez" <hoss@chungk.com>
Subject: sending commands
Message-Id: <Hn%67.35801$k33.3483200@typhoon.kc.rr.com>

how do i send a command to the operating system, with a cgi script?




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

Date: 23 Jul 2001 15:44:43 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: sending commands
Message-Id: <9ji2br$pp3$1@charity.cs.utexas.edu>

In article <Hn%67.35801$k33.3483200@typhoon.kc.rr.com>,
Devon Perez <hoss@chungk.com> wrote:
>how do i send a command to the operating system, with a cgi script?

system().  I'm not sure why it should be any different from a CGI
script than from some other script.

  - Logan
-- 
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)


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

Date: Mon, 23 Jul 2001 14:49:51 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: Sendmail with Win32
Message-Id: <3B5C71CF.5010406@coppit.org>

Jeff Hill wrote:
> What I would like to know is if anyone knows of a sendmail utility
> that works on Windows NT with Exchange server.  The reason I'd like to
> use a sendmail compatible program is for portability.

Use Mail::Sendmail -- a Perl-only implementation of Sendmail.



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

Date: Mon, 23 Jul 2001 14:18:39 -0400
From: Brad <brad_watts@attcanada.net>
Subject: Simple Substitute Question
Message-Id: <3B5C6A7F.1966C21@attcanada.net>

Hi there,

I'm getting strange characters at the beginning of a text file. I'd like
to substitute these strange characters ^H^H^H^H with nothing (below):

^H^H^H^H^H^H^H^H^H2/0.95

Something like

s/^H//g;

but this doesn't work, as I need to define this type of character
(beginning of line character??).

Thanks,
Brad



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

Date: Mon, 23 Jul 2001 11:43:44 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Simple Substitute Question
Message-Id: <3B5C7060.A4AB6003@vpservices.com>

Brad wrote:
> 
> I'm getting strange characters at the beginning of a text file. I'd like
> to substitute these strange characters ^H^H^H^H with nothing (below):
> 
> ^H^H^H^H^H^H^H^H^H2/0.95
> 
> Something like
> 
> s/^H//g;

Check out a dec/hex/oct conversion chart such as

   http://www.ils.unc.edu/crenshaw/convert.html

(the first hit on a google for "dec hex oct conversion").

Then use the oct value to remove it:

s/\010//g;

> (beginning of line character??)

Backspace character.

-- 
Jeff



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

Date: Mon, 23 Jul 2001 12:07:12 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Simple Substitute Question
Message-Id: <3B5C75E0.77B6EDB8@stomp.stomp.tokyo>

Brad wrote:

> I'm getting strange characters at the beginning of a text file. I'd like
> to substitute these strange characters ^H^H^H^H with nothing (below):
 
> ^H^H^H^H^H^H^H^H^H2/0.95
 
> Something like
 
> s/^H//g;
 

You have failed to provide clear and concise parameters.
There is no indication of what methodology is creating
this text file. You will do better to determine why
these characters are being generated and resolve this
problem rather than employ a Band-Aid cure.


Godzilla!


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

Date: Mon, 23 Jul 2001 15:23:41 -0400
From: Brad <brad_watts@attcanada.net>
Subject: Re: Simple Substitute Question
Message-Id: <3B5C79BD.42241F35@attcanada.net>

Jeff Zucker wrote:

> Brad wrote:
> >
> > I'm getting strange characters at the beginning of a text file. I'd like
> > to substitute these strange characters ^H^H^H^H with nothing (below):
> >
> > ^H^H^H^H^H^H^H^H^H2/0.95
> >
> > Something like
> >
> > s/^H//g;
>
> Check out a dec/hex/oct conversion chart such as
>
>    http://www.ils.unc.edu/crenshaw/convert.html
>
> (the first hit on a google for "dec hex oct conversion").
>
> Then use the oct value to remove it:
>
> s/\010//g;
>
> > (beginning of line character??)
>
> Backspace character.
>
> --
> Jeff

Thanks for that Jeff...

I'm doin somethin silly here, cause I'm still getting the Backspace charaters
(below):

#!/usr/bin/perl

$file=$ARGV[0];
open (IN, "$file" || die "Can't Open File: $!");
while ($line = <IN>){
      if ($line =~ /^(\w+\d+\/\d+)/ || $line =~ /^(\d+\/\d+)/ ) {
            @words = split(" ",$line);
            print "$words[0]        $words[1]       $words[2]
$words[3]       $words[4]       $words[5]       $words[6]
$words[7]       $words[8]\n";
    }

    elsif ($line =~ /--More--/ ) {
        s/\010//g;
        @words = split(" ",$line);
        print "$words[2]        $words[3]       $words[4]
$words[5]       $words[6]       $words[7]       $words[8]
$words[9]       $words[10]\n";
        }
}


prints out ...

^H^H^H^H^H^H^H^H^H1/0.12        12      0       301     PVC     SNAP
UBR     6500    UP
^H^H^H^H^H^H^H^H^H1/0.23        23      0       311     PVC     SNAP
UBR     13000   UP
^H^H^H^H^H^H^H^H^H1/0.25        25      0       321     PVC     SNAP
UBR     13000   UP
^H^H^H^H^H^H^H^H^H1/0.5 5       0       361     PVC     SNAP    UBR
3900    UP
^H^H^H^H^H^H^H^H^H1/0.399       399     0       399     PVC     SNAP
UBR     4000    UP
^H^H^H^H^H^H^H^H^H1/0.400       400     0       400     PVC     SNAP
UBR     4000    UP
^H^H^H^H^H^H^H^H^H1/0.100       100     3       100     PVC     SNAP
UBR     45000   UP
^H^H^H^H^H^H^H^H^H1/0.108       108     3       108     PVC     SNAP
UBR     25000   UP
^H^H^H^H^H^H^H^H^H2/0.35        35      1       35      PVC     SNAP
UBR     3450    UP
^H^H^H^H^H^H^H^H^H2/0.38        38      1       38      PVC     SNAP
UBR     3450    UP




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

Date: Mon, 23 Jul 2001 13:24:47 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Simple Substitute Question
Message-Id: <3B5C880F.8812C737@vpservices.com>

Brad wrote:

>     elsif ($line =~ /--More--/ ) {
>         s/\010//g;


Should be:  $line =~ s/\010//g;
            ^^^^^^^^

-- 
Jeff



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

Date: Mon, 23 Jul 2001 22:41:24 +0100
From: jbp <jpixton@dircon.co.uk>
Subject: Sorting an array of strings by 'closeness' to another string
Message-Id: <f06plts0n3rdpig7u2moer3b7ess0s9e52@4ax.com>

Howdy

I have a string containing, say, 'transeint' (sic). After some
massaging the string a little, then grepping a dictionary, then some
more massaging, i get an array of strings like so:

anastasia
anisettes
anteaters
assassins
assistant
easterner
enstatite
enteritis
entertain
ernestine
inanities
initiates
insatiate
insensate
insistent
interests
internees
internist
intestate
intestine
irritants
irritates
itinerant
nastiness
nattiness
reasserts
reinserts
reinstate
reiterate
resistant
resisters
restrains
restraint
retainers
satanists
satirises
satirists
starriest
strainers
straitens
tanneries
tarantara
tastiness
tennessee
tenseness
ternaries
terseness
testiness
transient
treatises
trinities
triteness

Now, what I want to do is sort this array into an order such that the
ones near the top of the array (viewing it as a stack) are:

transient
treatises
trinities
 ... etc

How would I go about this? I've looked at String::Approx and one of
the functions would be ideal, except I can't install the module on my
host (the goddamn service provider won't do it). I've installed it on
my local machine, but obviously developing with it would be useless.

*sigh*

Any ideas?

-- 
Joseph Birr-Pixton .:|:. http://ifihada.com .:|:. ICQ#40675236  
<pre><?php $s="sevaw:enis:";for($i=0;$i<=1920;$i++){$c=$i%96;$x=10-$c
%11;$r=floor($i/96);if($i==($r*96))echo"\n";if(10+floor(10*-sin($c/10
))==$r){echo"*";}else{if($r==10){echo$s[$x];}else{echo" ";}}}?></pre>


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

Date: Mon, 23 Jul 2001 18:29:53 GMT
From: "Mark Riehl" <mark.riehl@agilecommunications.com>
Subject: Split Question
Message-Id: <B2_67.23996$O81.9642057@typhoon1.gnilink.net>

All - I'm trying to parse a CSV file (that originated as an Excel file),
here's a sample line:

VALID,,102, 1051,2001-04-03 17:22:00.36,2001-04-03 17:22:00.36,... (total of
42 records per line).  I'm really interested in only the first 10 fields per
line.

and I'm using the following line to split it up:

@array = split(',', $_);

However, some of the lines in second field contain comments that contain
newlines like this:

VALID,TEXT HERE\n ANOTHER LINE OF COMMENT\n,102, 1051,2001-04-03
17:22:00.36,2001-04-03 17:22:00.36,...

It appears that the split is stopping on these premature newlines, and
getting confused.

Is there a way to force split to ignore these newlines?  Can I use the LIMIT
argument for split to make sure that I grab the right number of records (42)
each time - this way, I'm getting a complete line?

Thanks for the help,
Mark




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

Date: Mon, 23 Jul 2001 21:24:08 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Split Question
Message-Id: <3B5C964F.2C276209@acm.org>

Mark Riehl wrote:
> 
> All - I'm trying to parse a CSV file (that originated as an Excel file),
> here's a sample line:
> 
> VALID,,102, 1051,2001-04-03 17:22:00.36,2001-04-03 17:22:00.36,... (total of
> 42 records per line).  I'm really interested in only the first 10 fields per
> line.
> 
> and I'm using the following line to split it up:
> 
> @array = split(',', $_);
> 
> However, some of the lines in second field contain comments that contain
> newlines like this:
> 
> VALID,TEXT HERE\n ANOTHER LINE OF COMMENT\n,102, 1051,2001-04-03
> 17:22:00.36,2001-04-03 17:22:00.36,...
> 
> It appears that the split is stopping on these premature newlines, and
> getting confused.
> 
> Is there a way to force split to ignore these newlines?  Can I use the LIMIT
> argument for split to make sure that I grab the right number of records (42)
> each time - this way, I'm getting a complete line?

split does not have a problem with newlines (or any character) in
strings.

$ cat try.pl
#!/usr/bin/perl -w
use strict;

my @data = (
"VALID,,102, 1051,2001-04-03 17:22:00.36,2001-04-03 17:22:00.36",
"VALID,TEXT HERE\n ANOTHER LINE OF COMMENT\n,102,
1051,2001-04-03,17:22:00.36,2001-04-03 17:22:00.36"
);
for ( @data ) {
        my $i;
        print ++$i, ": $_\n" for split /,/;
        }

$ try.pl
1: VALID
2: 
3: 102
4:  1051
5: 2001-04-03 17:22:00.36
6: 2001-04-03 17:22:00.36
1: VALID
2: TEXT HERE
 ANOTHER LINE OF COMMENT

3: 102
4:  1051
5: 2001-04-03
6: 17:22:00.36
7: 2001-04-03 17:22:00.36


Perhaps you need to get one of the modules from CPAN that handles CSV
files.
http://search.cpan.org/search?mode=module&query=CSV



John
-- 
use Perl;
program
fulfillment


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

Date: Mon, 23 Jul 2001 20:34:17 GMT
From: NOSPAMlekkerinsydney@ozemail.com.au (Kev)
Subject: Stupid Question ? How to test a form with post method only ?
Message-Id: <3b5c8a1b.1502644955@news.ozemail.com.au>

Hi All

We have the following scenario-
 . We would like to test a script that we have
which can only be accessed via a form using the
post method.

Previously with our scripts we would turn them
into full urls and use multiple img srcs to
simulate multiple hits to test the reliability etc
of the script.

This script has been set up not to accept get
methods.

Am I missing something or is there no simple way
to simulate many requests to a post method form ?

Thanks in advance.

Kev


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

Date: Mon, 23 Jul 2001 21:01:53 +0200
From: Buggs <buggs-clpm@splashground.de>
Subject: Re: Stupid Question ? How to test a form with post method only ?
Message-Id: <9jhs28$lfk$02$1@news.t-online.com>

Kev wrote:

> Hi All
> 
> We have the following scenario-
> . We would like to test a script that we have
> which can only be accessed via a form using the
> post method.

I doubt one can't do a POST without a form.

> Previously with our scripts we would turn them
> into full urls and use multiple img srcs to
> simulate multiple hits to test the reliability etc
> of the script.

What version of perl2URL do you use?
That one from UNIVERSE::MY::Drugs::Perl::2::URL
does not work outside UNIVERSE::MY.

> This script has been set up not to accept get
> methods.
>
> Am I missing something or is there no simple way
> to simulate many requests to a post method form ?

Computers may be of help.
 
> Thanks in advance.
> 
> Kev


Sorry, but maybe you should ask in a more CGI centered NG,
after reading a bit about CGI itself.

You could search for documentation here
http://www.google.com/

Maybe you just don't have to ask then:)


Buggs


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

Date: Mon, 23 Jul 2001 12:02:39 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Stupid Question ? How to test a form with post method only ?
Message-Id: <3B5C74CF.2CD5CC2B@stomp.stomp.tokyo>

Kev wrote:

(snipped)

> . We would like to test a script that we have
> which can only be accessed via a form using the
> post method.

> Am I missing something or is there no simple way
> to simulate many requests to a post method form ?


What information about this cgi script will be
yielded by automated hits which will not be 
yielded by hand?


Godzilla!


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

Date: Mon, 23 Jul 2001 13:17:28 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Stupid Question ? How to test a form with post method only ?
Message-Id: <3B5C8658.DB7FB709@vpservices.com>

Buggs wrote:
> 
> Kev wrote:
> 
> > Hi All
> >
> > We have the following scenario-
> > . We would like to test a script that we have
> > which can only be accessed via a form using the
> > post method.

Anything that can be accessed by the post method can be accessed without
a form.  That's one of the reasons never to depend on client-side
scripting to clean forms for you.

> 
> I doubt one can't do a POST without a form.

If your triple negative means that yes, one *can* do a POST without a
form, then you are correct:

my $url      = "http://yourhost/yourpath/yourscript.cgi";
my $username = 'you';
my $password = 'yourpass';
my $content  = {
    'single_field_1'   => 'value1',
    'single_field_2'   => 'value2',
    'multiple_field_1' => [qw/value3 value4 value5/],
};
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
my $ua  = LWP::UserAgent->new;
my $req = POST $url, $content;
$req->authorization_basic($username, $password);
my $res = $ua->request($req);
$res->is_success ? print $res->content
                 : print $res->message;

> Sorry, but maybe you should ask in a more CGI centered NG,
> after reading a bit about CGI itself.

Why?  There is a perfectly perlish answer.

-- 
Jeff



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

Date: Mon, 23 Jul 2001 19:05:18 GMT
From: nobody@nobody.com (nobody)
Subject: Trying perl -MO=C on windows
Message-Id: <Oz_67.76783$E4.2228633@amsnews02.chello.com>



Hi all, 

I'm trying to compile my perl script to c:
using activestate perl build 628:

perl -MO=C myscript.pl > myscript.c

result:

Starting compile
Walking tree
Prescan
Saving methods
Writing output
Loaded B
Loaded IO
Loaded Fcntl
vbsbeaut.pl syntax OK

doing ok so far.
Now I have a myscript.c of about 500 KB.

I'm trying to compile with vc++ (cl)

C:\myscript> cl myscript.c -IC:\perl\lib\core -DWIN32 -link c:\perl\lib\core\perl56.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

myscriptc
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:myscript.exe
c:\perl\lib\core\perl56.lib
myscript.obj

All right! I have an executable!
But when I try to run it, it crashes immeadiately.....

It all seemed so well....

can anyone help?




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

Date: Mon, 23 Jul 2001 20:46:28 +0100
From: "Nathan Randle" <nathan.randle@ntlworld.com>
Subject: Tutorials?
Message-Id: <ub%67.13120$SK6.1588400@news6-win.server.ntlworld.com>

I have recently ventured into Perl only to find that tutorials are often not
very helpful. Does anyone know any good free tutorials aviable over the
internet?

Thanks in advance
Nathan




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

Date: Mon, 23 Jul 2001 21:13:32 GMT
From: Tom Hoffmann <tom.hoffmann@worldnet.att.net>
Subject: Re: Tutorials?
Message-Id: <0s077.49552$C81.4155169@bgtnsc04-news.ops.worldnet.att.net>

On Monday 23 July 2001 15:46, Nathan Randle wrote:

> I have recently ventured into Perl only to find that tutorials are
> often not very helpful. Does anyone know any good free tutorials
> aviable over the internet?

IIRC the tutorials at www.perl.com were useful to me when I was just 
getting started. Use your favorite search engiine and look for "perl 
tutrials" ... I got over 10 pages worth of hits. You might want to 
check some of them out.


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

Date: Mon, 23 Jul 2001 18:58:35 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Who can help me about the confused (..) operator?
Message-Id: <9jhs4r$26fs$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Bart Lateur 
<bart.lateur@skynet.be>], who wrote in article <88onltkjd3pgj80h53krvcvsaaeehpunes@4ax.com>:
> In scalar context, it's called the flip-flop operator, which won't mean
> much to you unless you're into digital electronics.
> 
> It's an operator with built-in (1 bit) memory.

Thinking about it, I discovered that I do not know where this bit is
stored.  On a scratchpad or in a compile tree?  in other words, I do
not know whether this bit is shared between

  a) different calls to the same sub at different recursion depths;

  b) same for calls from different threads;

  c) Calls to different closures with "the same code".

Is it documented anywhere?

Puzzled,
Ilya


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 1362
***************************************


home help back first fref pref prev next nref lref last post