[17272] in Perl-Users-Digest
Perl-Users Digest, Issue: 4694 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 23 06:05:37 2000
Date: Mon, 23 Oct 2000 03:05:13 -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: <972295513-v9-i4694@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 23 Oct 2000 Volume: 9 Number: 4694
Today's topics:
can perl do a unix find command? mr_potato_head@my-deja.com
Re: can perl do a unix find command? <gellyfish@gellyfish.com>
Re: can perl do a unix find command? (Logan Shaw)
code error, pls help <gapming@hotmail.com>
Re: code error, pls help (Bernard El-Hagin)
Re: code error, pls help <dj.peppone@gmx.net>
Re: Comments <gellyfish@gellyfish.com>
Convert time string to number <beb@bjornetjenester.no>
Re: Convert time string to number <gellyfish@gellyfish.com>
Re: coran??? <gellyfish@gellyfish.com>
Re: Dynamic Regex building? <gellyfish@gellyfish.com>
Re: File locking <bart.lateur@skynet.be>
Re: File locking (Logan Shaw)
Formatting of the "make test" output <moell@ID-PRO.de>
Re: getting the file w/ enctype=multipart/form-data <gellyfish@gellyfish.com>
Re: help printing variable in table <gellyfish@gellyfish.com>
Re: Help with array concatenation <gellyfish@gellyfish.com>
Re: here and filehandle <gellyfish@gellyfish.com>
Re: here and filehandle <gellyfish@gellyfish.com>
Re: I need a source to paste data on another website <gellyfish@gellyfish.com>
Is it so difficult to help? <miriamsmit@zonnet.nl>
Re: Is it so difficult to help? <mbudash@sonic.net>
Re: lenght of query string??? <gellyfish@gellyfish.com>
Re: Looking for source of function to read/write config <gellyfish@gellyfish.com>
Re: New at perl, help needed <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 23 Oct 2000 08:04:38 GMT
From: mr_potato_head@my-deja.com
Subject: can perl do a unix find command?
Message-Id: <8t0rek$g38$1@nnrp1.deja.com>
Hi,
Can anyone show me how to do a "find . -name <file.lo*>" in perl?
I'm using this command in a csh script and I want to put it into a perl
script. I know about the opendir command in perl but this requires
other commands to finally get to the file. I'd like to do this in 1 or
2 commands in perl and return the same results as the unix find command.
Thanks in advance...
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 23 Oct 2000 08:30:08 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: can perl do a unix find command?
Message-Id: <kGSI5.3114$7u4.60028@news.dircon.co.uk>
On Mon, 23 Oct 2000 08:04:38 GMT, mr_potato_head@my-deja.com Wrote:
> Hi,
> Can anyone show me how to do a "find . -name <file.lo*>" in perl?
> I'm using this command in a csh script and I want to put it into a perl
> script. I know about the opendir command in perl but this requires
> other commands to finally get to the file. I'd like to do this in 1 or
> 2 commands in perl and return the same results as the unix find command.
You can always use the 'find' command in the backticks i.e. :
@files = `find . -name 'blah' -print`;
Or you might want to read about the File::Find module that comes as
standard with Perl. There is a find2perl utility that will spit out the
equivalent Perl program for a given find command line.
/J\
------------------------------
Date: 23 Oct 2000 03:48:55 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: can perl do a unix find command?
Message-Id: <8t0u1n$s8v$1@provolone.cs.utexas.edu>
In article <8t0rek$g38$1@nnrp1.deja.com>, <mr_potato_head@my-deja.com> wrote:
> Can anyone show me how to do a "find . -name <file.lo*>" in perl?
>I'm using this command in a csh script and I want to put it into a perl
>script. I know about the opendir command in perl but this requires
>other commands to finally get to the file. I'd like to do this in 1 or
>2 commands in perl and return the same results as the unix find command.
You want the File::Find module.
Also, have a look at the "find2perl" program that is installed with
perl. It converts "find" commands to Perl code. While you probably
don't want to directly use the code it generates, it should get
you going in the right direction. Try, for instance, typing
"find2perl . -print" and then try "find2perl . -type f -print" to
see what it outputs for each one.
Hope that helps.
- Logan
------------------------------
Date: Mon, 23 Oct 2000 15:44:33 +0800
From: "Arthur" <gapming@hotmail.com>
Subject: code error, pls help
Message-Id: <8t0q55$dib$1@news.ctimail.com>
The error when compiled:
Name "main::d" used only once: possible typo at ./concat.pl line 23.
Part of the source code:
open(CUST_ID, $cust_id_file) or die "$cust_id_file: $!\n";
while (<CUST_ID>) {
chomp;
$line = $_;
line 23: ($d, $n) = split /\t/, $line;
^^^^^^^^^^^^^^^^^^
}
What is the problem?
Thanks.
------------------------------
Date: 23 Oct 2000 07:54:49 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: code error, pls help
Message-Id: <slrn8v7rot.28m.bernard.el-hagin@gdndev25.lido-tech>
On Mon, 23 Oct 2000 15:44:33 +0800, Arthur <gapming@hotmail.com> wrote:
>The error when compiled:
>
>Name "main::d" used only once: possible typo at ./concat.pl line 23.
>
>Part of the source code:
>
>
>open(CUST_ID, $cust_id_file) or die "$cust_id_file: $!\n";
> while (<CUST_ID>) {
> chomp;
> $line = $_;
>
>line 23: ($d, $n) = split /\t/, $line;
> ^^^^^^^^^^^^^^^^^^
> }
>
>
>What is the problem?
Are you using the variable $d anywhere else in the code? I doubt it.
You're getting a warning message (not an error message) which should
tell you that you've used the variable $d in only one place in your code
which is a silly thing to do, actually.
Cheers,
Bernard
--
perl -le'
($B,$e,$r,$n,$a,$r,$d)=q=$B$e$r$n$a$r$d==~m;
\$(.);xg;print$B.$e.$r.$n.$a.$r.$d;'
------------------------------
Date: Mon, 23 Oct 2000 10:34:18 +0200
From: Alexander Nietzschmann <dj.peppone@gmx.net>
Subject: Re: code error, pls help
Message-Id: <39F3F80A.A3FB1D11@gmx.net>
Hi,
Arthur wrote:
>
> Name "main::d" used only once: possible typo at ./concat.pl line 23.
This message means that You don't do anything with "$d".
> Part of the source code:
>
> open(CUST_ID, $cust_id_file) or die "$cust_id_file: $!\n";
> while (<CUST_ID>) {
> chomp;
> $line = $_;
>
> line 23: ($d, $n) = split /\t/, $line;
> ^^^^^^^^^^^^^^^^^^
> }
>
> What is the problem?
Try this after splitting:
print "$d, $n";
What does You script say?
Greets, Alex
------------------------------
Date: 23 Oct 2000 08:16:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Comments
Message-Id: <8t0oji$u38$1@orpheus.gellyfish.com>
On 21 Oct 2000 02:42:29 GMT Josiah wrote:
> Corey French <blah.xyathn@yahoo.com> wrote in message
> news:o05I5.16369$cO4.396072@nntp3.onemain.com...
>> I know that you can comment out a line or end of line with the # key, but
> is
>> there a way to comment out an entire section. For those of you that are
>> familiar with c/c++ what I'm looking for is something like the /* */
>> commands.
>
> multiline comment? well, don't try this in production code, (often), but
> this works:
>
> __CODE__
>
> print "Hahaha!";
>
> =begin comment
>
> print "you can't see me!";
>
> =cut
>
> print "boo!"
>
> __END__
>
> Everything between a =begin and =cut pair is commentted out, the perl
> compiler ignores it.
>
Why "don't try this in production code" ? Nearly all the modules in CPAN
have embedded pod in them, and surely a lot of them are being used in
production code. Using POD is the method decribed in the FAQ for
commenting out blocks of code.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Mon, 23 Oct 2000 08:57:29 GMT
From: "Bjørn Erik Bjørnstad" <beb@bjornetjenester.no>
Subject: Convert time string to number
Message-Id: <Z3TI5.2$Pqb.181995008@news.telia.no>
I am looking for a function that converts a time string (e.g. "Mon Oct 23
10:04 MET 2000") to a number (e.g. seconds since 01.01.1970). I have
previously used "timelocal" on Unix, but now I work on Windows and I use
perl v5.6.0 built for MSWin32-x86-multi-thread.
Thanks
Bjorn
------------------------------
Date: Mon, 23 Oct 2000 09:22:12 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Convert time string to number
Message-Id: <8rTI5.3118$7u4.60028@news.dircon.co.uk>
On Mon, 23 Oct 2000 08:57:29 GMT, "Bjørn Erik Bjørnstad" Wrote:
> I am looking for a function that converts a time string (e.g. "Mon Oct 23
> 10:04 MET 2000") to a number (e.g. seconds since 01.01.1970). I have
> previously used "timelocal" on Unix, but now I work on Windows and I use
> perl v5.6.0 built for MSWin32-x86-multi-thread.
>
You have Time::Local on Windows too. It is part of the standard Perl
distribution.
/J\
------------------------------
Date: 23 Oct 2000 07:23:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: coran???
Message-Id: <8t0lgo$tv4$1@orpheus.gellyfish.com>
On Fri, 20 Oct 2000 21:46:36 -0400 Randy Harris wrote:
> Jeff Zucker <jeff@vpservices.com> wrote in message
> news:39F0D961.FE35E0B4@vpservices.com...
>> pape_98@my-deja.com wrote:
>> >
>> > Has anyone heard of coran????
>> > My boss just told me to read about it and said that it was designed
> to
>> > make scripts run themselves.
>>
>> Coran ... that's the French spelling of The Holy Koran. And, yes,
>> believers say it can make scripts run themselves, among other things.
>>
>> Is there any chance you mean "cron", the Unix utility?
>>
>> --
>> Jeff
>
>
>>Clay Irving <clay@panix.com> wrote
>>
>>s/o//;
>>s/a/o/;
>
> You guys must be psychic.
>
Its judicious use of the PSI::ESP module.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 08:29:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dynamic Regex building?
Message-Id: <8t0pdi$u4e$1@orpheus.gellyfish.com>
On 21 Oct 2000 15:03:45 GMT Michael Hoffman wrote:
>
<WRT Godzilla>
> You know, while searching for an answer on this forum, I noticed that people
> don't seem to like you.
Ignore the Troll.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Mon, 23 Oct 2000 08:44:05 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: File locking
Message-Id: <elt7vs8g12fe3ui537qhvkjf39a0nmf4uc@4ax.com>
Geoff Soper wrote:
>Its conceivable
>that two occurances of the same script or occurances of two different
>scripts will try and access the same files. Do I need to use locks when
>reading files? Am I right in assuming the operating system takes care of
>that?
No. It is conceivable that another script modifies your files while
you're reading it. File locking on Unix systems depends entirely on
cooperation between the programs, they can set their own rules --
actually, their own traffix lights.
>I am assuming I need to lock files when writing to them though, is
>this correct?
Best. For writing, you want an exclusive lock, which means nobody else
can lock the file in any way. For reading, you can lock the file
non-exclusively, which means that any number of programs can read the
file at the same time. But if that traffic is heavy, the program that
wants to write to it, may have to wait a long time, because all
non-exclusive locks will have to have disappeared first.
There is another way, but it has its own set of problems. You can write
to a NEW file, and rename it to the old name when you've finished. That
way, programs that were reading the old file, will be able to continue
reading the old version. The file they're reading is a ghost file, no
longer attached to that file name. Programs that open the file for
reading after the new file has beeen renamed, will see the new version
instead.
The old file will finally be deleted, when all handles which have it
open, have been closed.
Problems: A) file ownership. The new file can easily have a different
owner and file permissions as the old one. In fact, if you don't look
out, a CGI script can make files, which are owned by user "www" (or
similar), and that you, as the owner of the site, can not remove
manually, because you don't have the permission! So, at least make sure
that you can delete any unwanted files by hand.
B) File locking isn't trivial. You probably will need a semaphore file,
i.e. independent traffic lights, because you are modifying more than one
file at once. You don't want several programs writing a new version of
the file all at once! This semaphore file can simply be an empty file
that your program opens with write access, and locks exclusively. Write
the new version of the data file, close it, rename it to replace the old
data file, and now release the semaphore file. Make sure your script
locks the semaphore file before reading the data file, making sure it
has the latest version of the data, before modifying it itself!
>I notice the flock command waits indefinitely for a file to
>become unlocked, what happens if a process with a lock open crashed? Will
>any other process waiting for that lock hang too?
No. AFAIK, if your program crashes, all locks by it are automatically
released by the OS.
--
Bart.
------------------------------
Date: 23 Oct 2000 03:56:58 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: File locking
Message-Id: <8t0ugq$sb2$1@provolone.cs.utexas.edu>
In article <elt7vs8g12fe3ui537qhvkjf39a0nmf4uc@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
>Geoff Soper wrote:
>>I am assuming I need to lock files when writing to them though, is
>>this correct?
>
>Best.
:
:
>There is another way, but it has its own set of problems. You can write
>to a NEW file, and rename it to the old name when you've finished.
There's yet another way of doing it.
When writing, lock the file.
When reading, don't lock the file. Instead, check the modification
time on the file and make sure it's in the past. Then, read the file.
Then, check the modification time again. If it hasn't changed, great.
If it has, then discard everything you've read from it. Then, wait for
an appropriate period of time, and start the whole process over again.
How do you know how long to wait? You can either sleep for a random
length of time, or (better) put a blocking shared lock on the file and
then immediately unlock it when you succeed in locking it.
This is a bit of a weird approach. The advantage is that serialized
writes are never blocked by reads. It could be useful on a system like
a mail server, where it's probably more important for the server to be
able to write to the mailbox in a timely fashion than for the mail
client to be able to read from it in a timely fashion.
- Logan
------------------------------
Date: Mon, 23 Oct 2000 10:27:19 +0200
From: Volker Moell <moell@ID-PRO.de>
Subject: Formatting of the "make test" output
Message-Id: <39F3F667.A041C139@ID-PRO.de>
Hi, all!
I have a little question concerning the output of "make test". Under
"normal" circumstances you get someting like this:
t/AssociatorNames...ok
t/Associators.......ok
t/ExtrinsicMethods..ok
t/GetClass..........ok
But when the name of the test scripts become longer the output is no
longer nice formated:
t/GetClass..........ok
t/GetInstance-PaulA_User.ok
t/GetInstance.......ok
t/GetProperty-PaulA_User.ok
Is there a way to make the output look better? Ok, it's by far not a
important question, but... :-)
-volker
--
Volker Moell <moell@ID-PRO.de> (Products & Developement)
* ID-PRO Deutschland GmbH * Am Hofgarten 20 * D-53113 Bonn
* Tel. +49 (0) 2 28-4 21 54-0 * Fax -3 59
* http://open-for-the-better.com
------------------------------
Date: 23 Oct 2000 08:32:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: getting the file w/ enctype=multipart/form-data
Message-Id: <8t0pj0$u4r$1@orpheus.gellyfish.com>
On Fri, 20 Oct 2000 15:22:29 -0700 Jeff Zucker wrote:
> Henry wrote:
>>
>> Can someone point me in the right direction?
>> I have a web form where users can submit a file to be uploaded to the
>> server. The HTML looks like this, which I'm pretty sure is a correct
>> example:
>>
>> <form method="POST" action="../cgi-bin/get_file.pl"
>> enctype="multipart/form-data">
>> <input type="file" name="file" size="20"><input type="submit"></form>
>>
>> The script is receiving the file. I can even put the contents of the file in
>> a variable and print it if it's a text file. But how do i grab the file and
>> save it if it's not a text file
>
> Use the CGI.pm module. It has methods to safely and easily handle file
> uploads. It comes with Perl and includes ample documentation.
>
Infact there is an example of a file upload handler in the documentation.
If the OP was to search Deja News on this group for 'file upload' I am
sure more examples would be forthcoming too.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 07:57:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: help printing variable in table
Message-Id: <8t0nh7$u1i$1@orpheus.gellyfish.com>
<dejeopardised>
On Sat, 21 Oct 2000 15:50:32 -0500 Erin M. McDaniel wrote:
> Drew Simonis wrote:
>
>> "Erin M. McDaniel" wrote:
>> >
>> > I have a variable, $comments, which is a long text field stored in a
>> > mysql database. When I try to print that variable's value in a table, it
>> > won't work. If I use:
>> >
>> > print $comments;
>> >
>> > it works fine.
>> >
>> > If I print other variables which are only a word or two long, in a table
>> > that works fine. But trying to print $comments in a table is not
>> > working. Here's that portion of my code:
>>
>> "not working" helps no one to work on this problem with you.
>> Can you be more specific? If the output isn't as you expect,
>> what is it? Is there any output at all? Have you tried
>> debugging from a command line? Be as specific as possible.
>
> there is no output at all. However, if I just use
>
> print $comments;
>
> the output is perfect. There is no output however if it is placed inside a
> table.
>
Then it is highly unlikely that you have a Perl problem. What, pray tell,
is actually in $comments? It wouldnt perchance contain HTML ?
I assume that this is part some CGI program and that you are attempting
to view the results in a browser, what do you get if you run the program
at the command line or view the source of the generated HTML ?
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 08:06:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with array concatenation
Message-Id: <8t0o2j$u2c$1@orpheus.gellyfish.com>
On Sat, 21 Oct 2000 12:40:58 -0400 Jody Fedor wrote:
> Uri Guttman wrote in message ...
>>>>>>> "JF" == Jody Fedor <Jodyman@usa.net> writes:
>>
> <snip>
>>-w is good. why no use strict?
>>
>
> I'm a lazy programmer! :-)
>
>>
>> JF> $yr = "2000"; # Hard code for testing
>> JF> @days = (31,28,31,30,31,30,31,31,30,31,30,31);
>> JF> if ($yr%4 == 0) {$days[1] = 29} else {$days[1] = 28};
>>
>>DUH!! that code is seriously broken. it will fail in 2100, 2200,
>>etc. you are lucky that 2000 is divisible by 400 or it would have failed
>>this year.
>
> This I know, once again, I'll be dead in 2100 so I won't have to worry
> about it!
>
Are you sure ? I'm pretty certain that there were a large number of
programmers in the 70's who thought similar only to be dragged out
of retirement in 1999 to fix stuff.
More importantly someone might be tempted to use this code for a program
where the time frame is not limited to the current century.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 07:16:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: here and filehandle
Message-Id: <8t0l39$tuk$1@orpheus.gellyfish.com>
On Sat, 21 Oct 2000 13:43:10 -0400 Arthur Dalessandro wrote:
> Here is my current code example:
> # Writes out an SMB conf file, and dates.
> $SMB_CONF_FILE = '/tmp/artd.testing';
> open SMB_CONF,">${SMB_CONF_FILE}" or die "Can't create
> $SMB_CONF_FILE\n";
> print SMB_CONF <<END_OF_FILEHANDLE; # line 67 **
>
<snip>
> It produces this error:
> Use of uninitialized value at ./artd.test.escalateaddcompany.pl line 67.
> Use of uninitialized value at ./artd.test.escalateaddcompany.pl line 67.
>
That is not an error but a warning indicating that one of the variables
you are interpolating into the here document has no value at the time
you use it. This will almost certainly manifest itself in your output
by something you expected to be printed being missing.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 07:18:07 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: here and filehandle
Message-Id: <8t0l6v$tun$1@orpheus.gellyfish.com>
On 21 Oct 2000 21:10:41 GMT Ryan Travis Tate wrote:
> |> print SMB_CONF <<EOF;
>
> goddamnit everyone -- QUOTE MARKS!!
>
> print SMB CONF <<"EOF";
>
> like that. i pulled out my camel book and everything ...
Why ? The deafult is implicit double quotes. There is only a necessity
to supply the explicit quotes if you want to use single quotes or backticks.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 07:41:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I need a source to paste data on another website
Message-Id: <8t0mig$u0i$1@orpheus.gellyfish.com>
On Sun, 22 Oct 2000 00:56:51 GMT programmer4k@my-deja.com wrote:
> Hello. I need a source to make a form that takes the data gathered from
> the form and pastes it into a table on another website. For exampple:
> User types in following in a form:
> Name: Fred
> Number: 31
>
> This data is then submited into a table on the same server just a
> different site...
> Name Number
> Fred 31
>
Which part of this are you having difficulty with ? You will have a
program (most likely using the CGI module) that receives the parameters
from a form and then opens the output file and writes out the data in
the appropriate format. It will also need to return some appropriate
response for the browser.
In the first instance I would recommend :
perldoc CGI
perldoc -f open
perldoc -f print
You might also wish to ask in the group comp.infosystems.www.authoring.cgi
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Mon, 23 Oct 2000 09:11:53 +0200
From: "Michel Wouterse" <miriamsmit@zonnet.nl>
Subject: Is it so difficult to help?
Message-Id: <4tRI5.25065$tL4.295223@zonnet-reader-1>
Hi group,
I am trying to POST something into another script. It has to reach the
script as if it were posted from an HTML-FORM.
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
$url = 'http://www.myserver.com/cgi-bin/login.cgi';
$browser = new LWP::UserAgent;
@param ( 'username' -> 'myself' , 'password'-> 'mypass' );
$htres = $browser->request(POST $url, \@param);
Now...this code:
A is it correct, but won't it work, because it's not the way to do it?
B is it not correct and won't it work, because it's total shit?
C is it correct, but I should use it slightly different?
Please, return the correct answer and try to explain. I am trying to learn
here.
Meanwhile I'll keep looking everywhere, as I did the last two days, for the
correct syntax or way to accomplish this.
thanks,
Michel
------------------------------
Date: Mon, 23 Oct 2000 00:26:46 -0700
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Is it so difficult to help?
Message-Id: <mbudash-214B83.00264623102000@news.pacbell.net>
In article <4tRI5.25065$tL4.295223@zonnet-reader-1>, "Michel Wouterse"
<miriamsmit@zonnet.nl> wrote:
> Hi group,
>
> I am trying to POST something into another script. It has to reach the
> script as if it were posted from an HTML-FORM.
>
> use LWP::UserAgent;
> use HTTP::Request::Common qw(POST);
> $url = 'http://www.myserver.com/cgi-bin/login.cgi';
> $browser = new LWP::UserAgent;
> @param ( 'username' -> 'myself' , 'password'-> 'mypass' );
> $htres = $browser->request(POST $url, \@param);
>
> Now...this code:
>
> A is it correct, but won't it work, because it's not the way to do it?
> B is it not correct and won't it work, because it's total shit?
> C is it correct, but I should use it slightly different?
>
> Please, return the correct answer and try to explain. I am trying to
> learn
> here.
> Meanwhile I'll keep looking everywhere, as I did the last two days, for
> the
> correct syntax or way to accomplish this.
>
> thanks,
>
> Michel
>
>
i don't know what documentation you're using, but everything you need to
know about LWP is in the lwpcook.pod file included with the libwww-perl
package at cpan...
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Mon, 23 Oct 2000 08:42:05 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: lenght of query string???
Message-Id: <xRSI5.3115$7u4.60028@news.dircon.co.uk>
On 20 Oct 2000 18:31:42 +0100, nobull@mail.com Wrote:
> Stefan Glimne <Glimne@gmx.net> writes:
>
>> Does anyone know how long the "query string" can be.
>
> I think that URLs are limited to about 1024.
>
From RFC2068:
(3.2.1)
The HTTP protocol does not place any a priori limit on the length of
a URI. Servers MUST be able to handle the URI of any resource they
serve, and SHOULD be able to handle URIs of unbounded length if they
provide GET-based forms that could generate such URIs. A server
SHOULD return 414 (Request-URI Too Long) status if a URI is longer
than the server can handle (see section 10.4.15).
Note: Servers should be cautious about depending on URI lengths
above 255 bytes, because some older client or proxy implementations
may not properly support these lengths.
I think it is probably the Note bit that the OP is running into.
/J\
------------------------------
Date: 23 Oct 2000 07:25:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Looking for source of function to read/write config files
Message-Id: <8t0llm$tvf$1@orpheus.gellyfish.com>
On Sat, 21 Oct 2000 16:49:48 +0200 Eldy wrote:
> I'm looking for the source of a function to read/write parameters in a
> config file,
> just like GetProfileString/WriteProfileSting in C++.
> I want this function to have only 2 or 3 parameters:
> Name of variable
> Value
>
Sounds just like the IniConf module that can be found at CPAN.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 08:26:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: New at perl, help needed
Message-Id: <8t0p7a$u4a$1@orpheus.gellyfish.com>
On Sat, 21 Oct 2000 00:14:27 GMT Bart Lateur wrote:
> tmg123@hotmail.com wrote:
>
>>I have been looking at a bunch of examples
>>and cannot figure out what the module Use Strict does
>
> It's "use strict". Perl is case sensitive. strict.pm is a pragma module,
> that's why it starts with a lower case latter.
>
> So WTH is a pragma? If you look at the source of the mopdule, all you'll
> see is that some bits of a variable are being set, or reset. The
> variable is $^H.
>
It might be worth mentioning that the perlvar manpage has a warning regarding
the use of this variable - it should probably not be used in user code
without some extremely compelling reason.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4694
**************************************