[15559] in Perl-Users-Digest
Perl-Users Digest, Issue: 2972 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 7 14:05:40 2000
Date: Sun, 7 May 2000 11:05:10 -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: <957722710-v9-i2972@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 7 May 2000 Volume: 9 Number: 2972
Today's topics:
Re: @array holding %hash <rick.delaney@home.com>
Re: [problem solved] sorting hashes by value rather tha (Randal L. Schwartz)
Re: beginner: read in variable <david@celtic1888.fsbusiness.co.uk>
Re: beginner: read in variable <david@celtic1888.fsbusiness.co.uk>
Re: beginner: read in variable <david@celtic1888.fsbusiness.co.uk>
Re: beginner: read in variable <david@celtic1888.fsbusiness.co.uk>
Re: beginner: read in variable <jeff@vpservices.com>
Re: beginner: read in variable <dave@dave.org.uk>
Re: beginner: read in variable <jeff@vpservices.com>
BerkeleyDB3.0.55 (Rob)
Re: Best way to connect to MS-SQL Server from Perl? <greg2@surfaid.org>
Re: converting input to <p></p> pairs via perl (Bart Lateur)
Re: converting input to <p></p> pairs via perl <nospam@devnull.com>
Re: DCOM in Perl <no@spam.net>
Re: How do I get the subroutine name of a coderef? (Tad McClellan)
Re: How do I get the subroutine name of a coderef? <rootbeer@redcat.com>
Re: How do I get the subroutine name of a coderef? (Bart Lateur)
Idiots guide to PERL Modules <greg2@surfaid.org>
Re: Idiots guide to PERL Modules <rootbeer@redcat.com>
Microsoft IIS problems? tingtingchung@my-deja.com
Re: Microsoft IIS problems? <rootbeer@redcat.com>
Re: More CPerl-mode problems under NT <aperrin@davis.DEMOG.Berkeley.EDU>
Re: parsing Unix mailbox <jb@yperite.demon.co.uk>
Re: Perl and odbc:win32 <gellyfish@gellyfish.com>
Re: Please Explain ... print "Location: http:etc."; <gellyfish@gellyfish.com>
Re: running Windows program from perl script <peter.mcgarrigle@ntlworld.com>
Using LWPng <webmaster@urpsearch.com>
Re: VBscript to Perl Conversion <rootbeer@redcat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 07 May 2000 14:02:37 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: @array holding %hash
Message-Id: <391578D0.497EDE20@home.com>
The WebDragon wrote:
>
> | > >
> | > > | + @{ $AoA[$i] } = @array; # way too tricky for most
> | > > | programmers
> | > >
> In article <MPG.137eb2ba1425abd298aa1d@nntp.hpl.hp.com>, Larry Rosler
> <lr@hpl.hp.com> wrote:
>
> |
> | But that has different semantics. The exact equivalent is:
> |
> | $AoA[$i] = [ @array ];
> |
> | And why anyone would choose to write it the 'way too tricky' way is
> | beyond me!
>
> that's why I want to know ! I mean, there HAS to be a reason that such a
> method of parsing the line was included, aside from the possibility that
> it was accidental. =;)
Because it is not exactly equivalent.
my @a = qw/a b c/;
my @b = qw/x y z/;
my @AoA;
$AoA[0] = \@a;
# $AoA[0] = [ @b ]; # output = a b c
@{ $AoA[0] } = @b; # output = x y z
print "@a\n";
Swap the comment on the lines marked "output" and see how the output
changes.
$AoA[$i] = \@array;
This gives you two ways to access the *same* array. So $AoA[$i][1]
always refers to the same thing (memory location) as $array[1].
$AoA[$i] = [@array];
This creates a new array with the same contents as @array. Accessing
$AoA[$i][1] has no relation to accessing $array[1].
@{$AoA[$i]} = @array;
This copies the contents of @array into the array referenced by
$AoA[$i]. This is only equivalent to the previous case if $AoA[$i] is
undefined, in which case a new array will be created to hold the
contents of @array.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 07 May 2000 10:04:00 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: [problem solved] sorting hashes by value rather than by key in a foreach loop
Message-Id: <m1snvuwav3.fsf@halfdome.holdit.com>
>>>>> "The" == The WebDragon <nospam@devnull.com> writes:
The> the docs REALLY need to be more succinct about the possibilities of
The> generating that error..
The> you see, an inadvertant use of an 'undef' value can also trigger that
The> response.. even if you would think it would assume a zero value for
The> comparison purposes if you are used to other similar languages... :)
If you turn on warnings, you are warned for each detected questionable
operation. I would certainly want to know if I was passing undef to
spaceship (<=>), because I wouldn't expect to do that. :)
In this case, the warning system worked as documented, and it would
have been easy for you to look up the message in perldiag(1), which
would quickly point out where your error was.
The docs are probably just fine on this point, unless you think it
possible for the docs to read something like "WebDragon, be careful!
For this particular operation [and any others, now that we think about
it], don't pass undef to <=>!". In practice, this is not possible.
You are expected to be able to put some text from one section together
with some text from another to synthesize a larger understanding.
print "Just another Perl hacker," unless undef;
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL: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!
------------------------------
Date: Sun, 7 May 2000 15:57:25 +0100
From: "David" <david@celtic1888.fsbusiness.co.uk>
Subject: Re: beginner: read in variable
Message-Id: <8f40q6$bqm$1@news6.svr.pol.co.uk>
Dave Cross wrote:
> I think that the OP's question was more about reading a user's input
> from the keyboard so that a user can enter a number from 1 to 5 and
> the script displays the appropriate name.
yes, that's right...
> If I'm right, then he should probably read the section on I/O
> operators in the perlop man page.
okay, thanks- so will I have this on my PC or is it on the net somewhere?
--David--
------------------------------
Date: Sun, 7 May 2000 15:59:43 +0100
From: "David" <david@celtic1888.fsbusiness.co.uk>
Subject: Re: beginner: read in variable
Message-Id: <8f40q7$bqm$2@news6.svr.pol.co.uk>
Godzilla! wrote:
> My script with which to test, modify and play:
>
> =========
>
> #!/usr/local/bin/perl
>
> print "Content-Type: text/html\n\n";
>
> print "
> <HTML><HEAD><TITLE>Test Arrays</TITLE></HEAD></BODY>
> <CENTER>
That's not quite what i'm looking for, i'm not interested in CGI or server
stuff at this stage...
--David--
------------------------------
Date: Sun, 7 May 2000 16:04:56 +0100
From: "David" <david@celtic1888.fsbusiness.co.uk>
Subject: Re: beginner: read in variable
Message-Id: <8f40q8$bqm$3@news6.svr.pol.co.uk>
Jeff Zucker wrote:
> David, to answer the question you asked :
>
> print "Type a number between 0 and 5 and then press enter: ";
> my $foo = <STDIN>;
> chomp $foo;
>
> Will pause for input from a user, then put whatever they typed into the
> variable named $foo after they press enter. If you want to ensure it's
> a digit or within a certain range, you can validate, then ask for more
> input if needed. If you want to only read one character without waiting
> for enter, that is more complex, see the FAQ on readining input.
okay, thanks a lot... i think that should do me for now :-)
p.s. where can I get hold of the FAQ? or will it already be installed on my
machine?
--David--
------------------------------
Date: Sun, 7 May 2000 16:07:05 +0100
From: "David" <david@celtic1888.fsbusiness.co.uk>
Subject: Re: beginner: read in variable
Message-Id: <8f40q8$bqm$4@news6.svr.pol.co.uk>
Tony Curtis wrote:
> Arrays are normally subscripted from 0. To access a
> particular member,
>
> $array[$i]
yeah, that's about what I can do so far...
> The first part of your question is a bit vague. Do you
> want to take the array index from the command line? Or
> prompt the user for the value from standard input?
um... i'm not sure???
--David--
------------------------------
Date: Sun, 07 May 2000 10:21:14 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: beginner: read in variable
Message-Id: <3915A60A.E199EB78@vpservices.com>
David wrote:
>
> Jeff Zucker wrote:
>
> > David, to answer the question you asked :
> >
> > print "Type a number between 0 and 5 and then press enter: ";
> > my $foo = <STDIN>;
> > chomp $foo;
> >
> > Will pause for input from a user, then put whatever they typed into the
> > variable named $foo after they press enter. If you want to ensure it's
> > a digit or within a certain range, you can validate, then ask for more
> > input if needed. If you want to only read one character without waiting
> > for enter, that is more complex, see the FAQ on readining input.
>
> okay, thanks a lot... i think that should do me for now :-)
> p.s. where can I get hold of the FAQ? or will it already be installed on my
> machine?
It should already be installed. Just type "perldoc perldoc" at a
command line to read its own documentation. There's also a pod2html
installed which will turn any given FAQ or document into an HTML page.
If you are on windoze, that has already been done for all the docs and
can be found via start-menu/programs/activeperl/online-documentation.
If for some bizarre reason none of those work, the docs are online in
HTML format in many places including http://www.perl.com/ and
http://www.cpan.org/.
--
Jeff
------------------------------
Date: Sun, 07 May 2000 18:26:20 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: beginner: read in variable
Message-Id: <im9bhsg2ac3slnbfiev979cqb7dkhcpgqu@4ax.com>
On Sun, 7 May 2000 15:57:25 +0100, "David"
<david@celtic1888.fsbusiness.co.uk> wrote:
>Dave Cross wrote:
>
>> I think that the OP's question was more about reading a user's input
>> from the keyboard so that a user can enter a number from 1 to 5 and
>> the script displays the appropriate name.
>
>yes, that's right...
Good!
>> If I'm right, then he should probably read the section on I/O
>> operators in the perlop man page.
>
>okay, thanks- so will I have this on my PC or is it on the net somewhere?
If you're using ActivePerl, it will have installed a documentation
item on your start menu. It's in there under Core Perl Docs.
hth,
Dave...
--
dave@mag-sol.com
Magnum Solutions Limited <http://www.mag-sol.com>
Agency Rating System <http://www.ars.org>
London Perl M[ou]ngers <http://london.pm.org>
------------------------------
Date: Sun, 07 May 2000 10:26:52 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: beginner: read in variable
Message-Id: <3915A75C.7D17F21@vpservices.com>
David wrote:
>
> Tony Curtis wrote:
>
> > Arrays are normally subscripted from 0. To access a
> > particular member,
> >
> > $array[$i]
>
> yeah, that's about what I can do so far...
>
> > The first part of your question is a bit vague. Do you
> > want to take the array index from the command line? Or
> > prompt the user for the value from standard input?
>
> um... i'm not sure???
If you want to go the command line route, rather than prompting for user
input, look up @ARGV in the docs and/or the shift operator. A line like
this will read the first parameter a user types from the command line or
if they don't enter one, tell them they should:
my $foo = shift or die "SYNTAX: $0 digit-between-1-and-5";
In that line $0 will become whatever you named your script.
--
Jeff
------------------------------
Date: Sun, 07 May 2000 17:17:36 GMT
From: rob@[remove]mwv.org (Rob)
Subject: BerkeleyDB3.0.55
Message-Id: <3915a374.102830296@news.ncia.net>
Howdy All,
Building Perl5.6 on Solaris8/SunUltra/BerkeleyDB and continue to get
core dumps on make test regarding BerkeleyDB3.0.55 and also failed
during Perl make test.
Any suggestions welcomed..
Rob
-----------
make test
PERL_DL_NONLAZY=1 /bin/perl -Iblib/arch -Iblib/lib
-I/usr/local/lib/perl5/5.6.0/sun4-solaris -I/usr/local/lib/perl5/5.6.0
-e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests
@ARGV;' t/*.t
t/btree.............dubious
Test returned status 0 (wstat 138, 0x8a)
test program seems to have generated a core
t/destroy...........dubious
Test returned status 0 (wstat 138, 0x8a)
test program seems to have generated a core
------------------------------
Date: Sun, 07 May 2000 14:29:29 +0100
From: Greg Griffiths <greg2@surfaid.org>
To: Tom Williamson <tom.williamson@home.com>
Subject: Re: Best way to connect to MS-SQL Server from Perl?
Message-Id: <39156FB9.46FA0E83@surfaid.org>
try WIN32::ODBC by Tim Roth http://www.roth.net or the DBI module
Tom Williamson wrote:
>
> Hello -
>
> I'm looking for some information - facts and/or advice - on the best way to
> connect to a SQL Server 7 database running on NT, from a Linux box using
> Perl. So far I have checked www.perl.org, www.perl.com and the CPAN archive
> including the FAQs and the DBI/DBD readme files (those I have been able to
> locate). I have discovered the following:
>
> 1) There is not, so far as I can tell, a DBD::SQLServer module or anything
> like it (why?);
> 2) The DBD::ODBC module (my second choice) cheerfully announces itself as
> "ALPHA SOFTWARE - YOUR MILEAGE MAY VARY". Is there another (non-alpha)
> module that people can use for ODBC?
>
> Is anyone out there actually interfacing Perl to SQL Server? And please -
> how are you doing it? If you are using ODBC, how are you creating your DSN
> on the Unix client box?
>
> Thanks....
------------------------------
Date: Sun, 07 May 2000 15:58:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: converting input to <p></p> pairs via perl
Message-Id: <3915900f.15419479@news.skynet.be>
The WebDragon wrote:
>well, since the input is coming from a TEXTAREA input field and being
>passed to the *same* script (since the entire form is being generated
>via CGI.pm) the while( <> ) construct won't work for me ..
Indeed. But you can still do:
@paragraphs = split /\n\n+/;
tr/\n \t/ /s;
s/</</g foreach @paragraphs;
$out = map { "<p>$_</p>\n" } @paragraphs;
You'll have to "disarme" the contents of the paragraphs too, for
included html tags. All I did was disable the "<" characters.
--
Bart.
------------------------------
Date: 7 May 2000 17:22:42 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: converting input to <p></p> pairs via perl
Message-Id: <8f48p2$9dr$0@216.155.33.54>
In article <slrn8hakcj.ph.efflandt@efflandt.xnet.com>,
efflandt@xnet.com wrote:
| On 7 May 2000 02:09:15 GMT, The WebDragon <nospam@devnull.com> wrote:
| >In article <8f2a7e$cvg$0@216.155.33.54>, The WebDragon
| > | this text will eventually be input from a TEXTAREA field in a
| > | cgi-generated html form, but the perlish problem still remains,
| > | hence my
| > | posting it here, rather than over there.
| >
| >breaking this down into a two-pass procedure, what I can derive that I
| >need to do is this:
| >
| >first search for every \n that is not also followed by another \n, and
| >replace it with <br>
|
| How do you know what lines end with? Even from a Linux Netscape
| textarea
| they end with \r\n. Not sure about Mac. It is wise to not assume.
|
| >then for every chunk of data terminated with \n\n, surround the chunk
| >with <p></p> and put the \n\n after the </p>
|
| Newlines are not required (except for easier "view source" reading).
|
| >if the last chunk of data has no \n\n after it, or has a <br> at the
| >end
| >(from the first pass), be sure to also wrap it in a <p></p> pair and
| >REMOVE the terminating <br>, adding back a \n\n after the final </p>
| >
| >if that looks correct mostly, how would I write sugh beasts using
| >regexps? Anyone?
|
| #!/usr/bin/perl
| $_ = <<EOF;
| Paragraph one
| second line
|
| Paragraph two
| EOF
| # These work with any line ending
| s/(\r\n\r\n|\n\n|\r\r)/<\/p><p>/g;
| s/(\r\n|\n|\r)/<br>/g;
| s/<p>$//; # strip trailing <p>
| s/<br>$/<\/p>/; # convert trailing <br>
| s/(<br>)/$1\n/g; # optional \n
| s/(<\/p>)/$1\n\n/g; # optional \n\n
| print "<p>$_";
|
*sigh*
essentially this gives me the same result as before only this time with
EXTRA <br> tags in there, and still only one <p></p> surrounding the
whole thing. again, NOT what I want..
-=-results:
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero
eros et accumsan et iusto odio dignissim qui blandit praesent luptatum
zzril delenit augue duis dolore te feugait nulla facilisi.<br>
<br>
<br>
If you want lines to break <br>
<br>
like this, then enter it that way. <br>
<br>
<br>
The parser will automatically produce the correct paragraph and
linebreak tags so please DO NOT enter them on your own... they'll get
removed =)<br>
<br>
<br>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero
eros et accumsan et iusto odio dignissim qui blandit praesent luptatum
zzril delenit augue duis dolore te feugait nulla facilisi.<br>
</p>
-=-end results
also obviously, the trailing <br></p> should just be </p>
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Sun, 07 May 2000 17:18:36 GMT
From: "Dave Godwin" <no@spam.net>
Subject: Re: DCOM in Perl
Message-Id: <MzhR4.37513$g4.994495@newsread2.prod.itd.earthlink.net>
http://www.activestate.com/overview.htm
<dpao@go.to> wrote in message news:sh5q7utogbn89@corp.supernews.com...
> Greetings,
>
> Does anyone know of a Perl module that allows DCOM access.
> Has anyone ever done anything with DCOM in Perl?
> If you did please give me some pointers/resources.
>
>
>
>
> --
> Posted via CNET Help.com
> http://www.help.com/
>
------------------------------
Date: Sun, 7 May 2000 08:17:26 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I get the subroutine name of a coderef?
Message-Id: <slrn8hanmm.9gs.tadmc@magna.metronet.com>
On Sun, 07 May 2000 00:21:25 -0700, Steve Leibel <stevel@coastside.net> wrote:
>
>Suppose I have a coderef:
>
>$fooref = \&foo;
>
>Later in the program for debugging purposes I would like to recover the
>name of the referenced subroutine from the coderef. In other words given
>$fooref, how do I get "foo"?
What would you want to "get" if
$fooref = sub { print "I am a sub without a name\n" };
A ref might be to an anonymous sub, which does not _have_ a name.
So you cannot do what you ask in the general case.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 7 May 2000 07:30:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How do I get the subroutine name of a coderef?
Message-Id: <Pine.GSO.4.10.10005070727510.3921-100000@user2.teleport.com>
On Sun, 7 May 2000, Steve Leibel wrote:
> Later in the program for debugging purposes I would like to recover
> the name of the referenced subroutine from the coderef. In other
> words given $fooref, how do I get "foo"?
As others have pointed out, the sub may not have a name. But maybe you
want something else. You could make a hash of the named subs when you
create the references, something like this:
my $foo_ref = \&foo;
$sub_name{$foo_ref} = 'foo';
my $bar_ref = \&bar;
$sub_name{$bar_ref} = 'bar';
Later, you could look up a reference in the hash and get the corresponding
name. (Of course, the keys of the hash are now strings, not references.
But there are several ways you could work around that, if you need to.)
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 07 May 2000 15:57:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How do I get the subroutine name of a coderef?
Message-Id: <391690f5.15649450@news.skynet.be>
Steve Leibel wrote:
>Suppose I have a coderef:
>
>$fooref = \&foo;
>
>Later in the program for debugging purposes I would like to recover the
>name of the referenced subroutine from the coderef. In other words given
>$fooref, how do I get "foo"?
A few weeks ago, I posted code here that did just that. I dobn't really
feel like repeating myself, but you know it's there. Using
<http://www.deja.com/home_ps.shtml>, looking articles from me including
the word "stash", you should be able to find it.
Ooh, found it. The date is 21 st of april, 2000. Deja seems to mangle my
code formatting, though.
--
Bart.
------------------------------
Date: Sun, 07 May 2000 14:31:08 +0100
From: Greg Griffiths <greg2@surfaid.org>
Subject: Idiots guide to PERL Modules
Message-Id: <3915701C.576D35C1@surfaid.org>
Does anyone know of an idiots guide to writing your own PERL modules ?
The ones I've seen so far seem pretty confusing. thanks
------------------------------
Date: Sun, 7 May 2000 07:43:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Idiots guide to PERL Modules
Message-Id: <Pine.GSO.4.10.10005070740470.3921-100000@user2.teleport.com>
On Sun, 7 May 2000, Greg Griffiths wrote:
> Does anyone know of an idiots guide to writing your own PERL modules ?
Idiots shouldn't be writing modules. We've got enough troubles as it is
without having to write modules, too! :-)
> The ones I've seen so far seem pretty confusing. thanks
"Thanks" for making them confusing? :-)
Try reading the docs again, but skip over any parts about XS (since you
should probably start with a non-XS module). Does that help any? Or, of
you have a specific question that's not clearly answered in the docs, you
can try asking it here.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 07 May 2000 14:47:06 GMT
From: tingtingchung@my-deja.com
Subject: Microsoft IIS problems?
Message-Id: <8f3vl6$ff1$1@nnrp1.deja.com>
Hi,
I used <FILE> to read web pages by line in my spider. It worked most of
the time with one exception. Whenever the spider reads the page
www.wabash.edu/ROUSSEAU/, it seems to fail to recognize the body of the
page. It gets the headers, which shows that the page is from a Microsoft
IIS server, Besides, when I had the spider read the body in bytes, it
was able to return bits of the body.
I copied this page onto my machine, and had the spider read it from
there instead. This time it read the whole document. This made me
suspect that it had something to do with non-UNIX servers (my spider
runs on a Solaris machine).
So my thoery is that the remote server returned the entire web page
complete with headers, but for some reason the Perl program was unable
to recognize the line-feeds and/or EOF (remember I was using <FILE>) so
it never knew where the first line ended, and was forever waiting for
the first line to end.
I'd like to see if anyone has experienced similar problems, and whether
there's a known cause and/or solution.
Best,
Rachel Chung
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 7 May 2000 08:30:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Microsoft IIS problems?
Message-Id: <Pine.GSO.4.10.10005070817170.3921-100000@user2.teleport.com>
On Sun, 7 May 2000 tingtingchung@my-deja.com wrote:
> So my thoery is that the remote server returned the entire web page
> complete with headers, but for some reason the Perl program was unable
> to recognize the line-feeds and/or EOF (remember I was using <FILE>)
Maybe the data were in a different format than your program expected. Some
servers don't follow the HTTP spec, and thus give different line-ending
characters than they should.
http://www.w3.org/Protocols/
http://www.w3.org/Protocols/rfc2616/rfc2616.html
If the server isn't following the spec, complain! :-)
But appendix 19.3 of the spec suggests that this:
The line terminator for message-header fields is the sequence CRLF.
However, we recommend that applications, when parsing such headers,
recognize a single LF as a line terminator and ignore the leading CR.
Doesn't LWP do this? If you're not using LWP, you're probably not being
lazy enough. But in any case, since you've got Perl on your side, you can
probably kick the returned value into shape. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 07 May 2000 08:43:54 -0700
From: Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU>
Subject: Re: More CPerl-mode problems under NT
Message-Id: <u5kvh0qs6v9.fsf@davis.DEMOG.Berkeley.EDU>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> [A complimentary Cc of this posting was sent to Andrew Perrin - Demography
> <aperrin@davis.DEMOG.Berkeley.EDU>],
> who wrote in article <u5kitwr5f4d.fsf@davis.DEMOG.Berkeley.EDU>:
> > This behavior is reproducible under the following condition:
>
> [etc]
>
> Not with 4.29. ;-) [I did not make it the default yet.]
>
> Ilya
Nor with 4.30, which I just grabbed. Thanks!
ap
--
---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography - University of California at Berkeley
2232 Piedmont Avenue #2120 - Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199
------------------------------
Date: Sun, 07 May 2000 18:27:40 +0100
From: jb <jb@yperite.demon.co.uk>
Subject: Re: parsing Unix mailbox
Message-Id: <3915A78C.250C01AF@yperite.demon.co.uk>
Christopher Adams wrote:
>
> I am just starting to plan a routine that will run something like this:
>
[snip]
> a good one and if anyone has done this sort of thing before. Are there
> any scripts that I could look at to get some ideas?
Warning: no perl content
You might consider using procmail by itself to solve this problem. It
should be able to do all this given the appropriate rules.
------------------------------
Date: 1 May 2000 09:08:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl and odbc:win32
Message-Id: <8eje16$8i9$1@orpheus.gellyfish.com>
On Thu, 27 Apr 2000 14:32:28 +0200 Enrique Puente Buenestado wrote:
> I need help. I'm doing my first program. If I execute my cgi, the
> browser say:
>
> CGI Error
>
> The specified CGI application misbehaved by not returning a complete set
> of HTTP headers. The headers it did return are:
>
> Can't call method "Sql" without a package or object reference at
> d:\inetpub\wwwroot\quique\cgi-bin\conexion.cgi line 5.
>
> If I execute this program in the server (COMMAND), OK it's successfully
>
> WHY I can`t call to Sql from a Web???
>
On NT the user that CGI programs are run as has an extremely limited
set of permissions to access system resources which includes the network
which will almost certainly will be required for access to your database
server. You will want to ask in some group that discusses the setup of
NT servers to find out how to configure it so that the user does have
access to the network.
/J\
--
Don't eat me. I have a wife and kids. Eat them.
--
fortune oscar homer
------------------------------
Date: 1 May 2000 08:46:12 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Please Explain ... print "Location: http:etc.";
Message-Id: <8ejco4$4gd$1@orpheus.gellyfish.com>
On Sun, 30 Apr 2000 22:06:05 -0400 Drew Simonis wrote:
>
>
> "Alan J. Flavell" wrote:
>
>> Again to be pedantic, RFC2616 (which obsoleted RFC2068) specifies the
>
> <lots of impressive info snipped>
>
>> all the best
>
>
> Where do you learn all this???
Largely from the published internet standards :
<http://www.rfc-editor.org/>
/J\
--
There you go again, always taking someone else's side. Flanders, the
water department, God...
--
fortune oscar homer
------------------------------
Date: Sun, 7 May 2000 17:34:45 -0700
From: "Peter McGarrigle" <peter.mcgarrigle@ntlworld.com>
Subject: Re: running Windows program from perl script
Message-Id: <EUgR4.541$Eu2.12066@news2-win.server.ntlworld.com>
"Lyndon Leggate" <lyndon@xellent.co.uk> wrote in message
news:39143fe6@news.server.worldonline.co.uk...
> I have a similar problem ... if anyone can help that'll be great.
>
> Thanks,
>
> Lyndon
>
> <colardelle@my-deja.com> wrote in message
> news:8ebvtt$l6a$1@nnrp1.deja.com...
> > Hello,
> >
> > I am quite new with perl, so it may be a very simple question. I am
> > writing perl scripts on a W95 PC and I would like to run Windows
> > programs (ie NOTEPAD) from a Perl script.
> >
system("start notepad.exe openthisfile.txt");
Works fine for NT4/Win2000; I thnk it should work ok on Win95/98 as well.
------------------------------
Date: Sun, 7 May 2000 17:52:15 +0200
From: "Erwin de Villeneuve" <webmaster@urpsearch.com>
Subject: Using LWPng
Message-Id: <39159195$0$16140@reader1.casema.net>
Hi everyone
I building a script which connects to a server (HTTP protocol), and makes a
few requests to that server, without reconnecting.
Therefor I was planning to use LWPng, but I can't figure out how this module
works
the manual says I have to do something like this:
use LWP::Conn::HTTP;
$conn = LWP::Conn::HTTP->new(ManagedBy => $mgr,
Host => "server.com",
Port => '80');
but what is $mgr and how can I make a request to the server with my own
header etc..
I hope somebody can help me with solving this problem
Erwin de Villeneuve
------------------------------
Date: Sun, 7 May 2000 07:51:38 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: VBscript to Perl Conversion
Message-Id: <Pine.GSO.4.10.10005070748130.3921-100000@user2.teleport.com>
On Sat, 6 May 2000, Chris Ottinger wrote:
> but I was wondering if someone could help me convert it tho PERL...
Surely you don't want to hire a programmer?
> If anyone can recommend any good reference material-books websites,
> ect...-for learning PERL with ADSI or ADO I would greatly appreciate
> the referral....
Well, I don't know what ADSI and ADO are. (And ect seems mysterious, too.
:-) But the question of what books or websites to start with comes up in
this newsgroup every month. If you use a Usenet archive (like Deja) to see
what people have suggested in the past, does that help?
http://www.deja.com/
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 2972
**************************************