[16998] in Perl-Users-Digest
Perl-Users Digest, Issue: 4410 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 23 00:05:31 2000
Date: Fri, 22 Sep 2000 21: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: <969681909-v9-i4410@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 22 Sep 2000 Volume: 9 Number: 4410
Today's topics:
Re: "not in string" - how to do it? <ren.maddox@tivoli.com>
Re: "not in string" - how to do it? <fpuzvqgxcrnpu@tgr.arg>
Re: "not in string" - how to do it? <fpuzvqgxcrnpu@tgr.arg>
Re: "not in string" - how to do it? <jeff@vpservices.com>
- For this type of use (see msg), should I favor Perl o <vemba72@hotmail.com>
- For this type of use (see msg), should I use Perl of <vemba72@hotmail.com>
Re: /me bangs head agains't brick wall <darryl@work-thicker.co.uk>
Re: /me bangs head agains't brick wall <darryl@work-thicker.co.uk>
Re: /me bangs head agains't brick wall <krahnj@acm.org>
basic question about an exercise in "Learning Perl" <myc1@nospam.earthlink.net>
Re: Candidate for the top ten perl mistakes list (Keith Calvert Ivey)
Re: delimiter problem <carlfox@surplusnet.com>
Re: Does Perl have C API? (Martien Verbruggen)
Re: Does Perl have C API? <xliu@cs.sunysb.edu>
Re: getting images with LWP? <bbowden@mitre.org>
Re: getting images with LWP? <bwalton@rochester.rr.com>
Re: getting images with LWP? <bbowden@mitre.org>
I meant \50, not \70 Re: Simple one? How do I escape th <robert@chalmers.com.au>
Re: MSXML.dll (Eric Bohlman)
Re: MSXML.dll <idbugm@idbugm.com>
Re: MSXML.dll <idbugm@idbugm.com>
Re: multiple replaces one line at a time <godzilla@stomp.stomp.tokyo>
Re: multiple replaces one line at a time (Abigail)
Re: Perl Online Questions Updated <schmelter_tim@hotmail.com>
Re: REQ how to create one line of text (Abigail)
Re: REQ how to create one line of text <uri@sysarch.com>
Simple one? How do I escape the '(" in a string? <robert@chalmers.com.au>
Re: Simple one? How do I escape the '(" in a string? <bwalton@rochester.rr.com>
Re: Simple one? How do I escape the '(" in a string? (Abigail)
Re: Simple one? How do I escape the '(" in a string? <robert@chalmers.com.au>
Re: Simple one? How do I escape the '(" in a string? <robert@chalmers.com.au>
Re: Simple one? How do I escape the '(" in a string? (Abigail)
Re: Thnaks to the Gurus! (David Wall)
Time Zone conversion <noone@nospam.com>
Re: too many errors in my program (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Sep 2000 18:03:24 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: "not in string" - how to do it?
Message-Id: <m33dist4g3.fsf@dhcp11-177.support.tivoli.com>
"Kurt Schmidt" <fpuzvqgxcrnpu@tgr.arg> writes:
> Let's say that I have arbitrary strings like
>
> aklklsdjjf
> ssdalkfj
> srwokgfl
> jkljsdpitl;
> skkdddk
> dlkliujgmn
> klksddffd
>
> and so on
> I want to match all strings EXCEPT those that have one or more d in it.
I would probably reverse the match and then reverse the surrounding
logic, with something like:
print unless /d.*d/s; # s-modifier for any embedded newlines
But if you really want to match the other way, you could use:
print if /^[^d]*d?[^d]*$/;
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Sat, 23 Sep 2000 01:39:51 GMT
From: "Kurt Schmidt" <fpuzvqgxcrnpu@tgr.arg>
Subject: Re: "not in string" - how to do it?
Message-Id: <HRTy5.2912$bm4.292907@paloalto-snr1.gtei.net>
Does this qualify as the next time?
--
Address protection: to reply by email directly, please apply "rot13"
decryption to the address and then remove the fruit from the address
fpuzvqgxcrnpu@tgr.arg. I regret any inconvenience but this is there to
limit the deluge of opportunities provided by our mass mailing, spamming
brethren. Your newsreader should have a handy "rot13" feature; I also found
a convenient one on http://www.rtg.se/~niclas/rot13.htm
"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:39CBF35A.B84284DF@vpservices.com...
> Kurt Schmidt wrote:
> >
> > Thanks, but... actually, it is a little more complicated than just the
"not
> > d,"
>
> Then next time please explain your real problem.
>
> --
> Jeff
------------------------------
Date: Sat, 23 Sep 2000 01:42:01 GMT
From: "Kurt Schmidt" <fpuzvqgxcrnpu@tgr.arg>
Subject: Re: "not in string" - how to do it?
Message-Id: <JTTy5.2925$bm4.293935@paloalto-snr1.gtei.net>
Thanks very much to all who provided the clever solution. Yes, of course,
*now* that I see it is clear!
Thanks again!
Kurt
--
Address protection: to reply by email directly, please apply "rot13"
decryption to the address and then remove the fruit from the address
fpuzvqgxcrnpu@tgr.arg. I regret any inconvenience but this is there to
limit the deluge of opportunities provided by our mass mailing, spamming
brethren. Your newsreader should have a handy "rot13" feature; I also found
a convenient one on http://www.rtg.se/~niclas/rot13.htm
"Ren Maddox" <ren.maddox@tivoli.com> wrote in message
news:m33dist4g3.fsf@dhcp11-177.support.tivoli.com...
> "Kurt Schmidt" <fpuzvqgxcrnpu@tgr.arg> writes:
>
> > Let's say that I have arbitrary strings like
> >
> > aklklsdjjf
> > ssdalkfj
> > srwokgfl
> > jkljsdpitl;
> > skkdddk
> > dlkliujgmn
> > klksddffd
> >
> > and so on
> > I want to match all strings EXCEPT those that have one or more d in it.
>
> I would probably reverse the match and then reverse the surrounding
> logic, with something like:
>
> print unless /d.*d/s; # s-modifier for any embedded newlines
>
> But if you really want to match the other way, you could use:
>
> print if /^[^d]*d?[^d]*$/;
>
> --
> Ren Maddox
> ren@tivoli.com
------------------------------
Date: Fri, 22 Sep 2000 18:56:35 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: "not in string" - how to do it?
Message-Id: <39CC0DD3.3C0401E@vpservices.com>
Kurt Schmidt wrote:
>
> Does this qualify as the next time?
Not for me it doesn't. You say what is the first letter of the
alphabet? I say 'A'. You say, I meant the first letter after 'A'. I
stop playing.
But oh, what the heck:
> The full problem is that the string must match certain criteria
> and must not match certain other; something like "have a "wxyz"
> followed by "mrst" and a q in between them but there must
> not be a "d" in between them.
print if /wxyz(.+)mrst/ && $1 !~ /d/ && $1 =~ /q/;
Or use Larry's answer which is probably oodles more effecient than this.
--
Jeff
------------------------------
Date: Fri, 22 Sep 2000 23:25:30 -0400
From: "Jon" <vemba72@hotmail.com>
Subject: - For this type of use (see msg), should I favor Perl or PHP3?
Message-Id: <qpVy5.2062$YP1.101329@weber.videotron.net>
I am launching a new site and I have the option of having all my file
splicing and parsing (templates and whatnot) done either via Perl (.cgi) or
PHP (.phtml) That will be 90% of the use of the script... assemble
templates + raw files, breaking files down into multiple "click here for
page 2/3/etc" pages... etc...
ASP is not an option, I'm on UNIX.
I keep hearing different stories about which of the two (Perl vs CGI)
performs better on large loads (you'd think I was talking about a laundry
detergent wouldn't you?)
All my links will be drawn up one way or another... so which way should I be
investing my time in (I'll be hiring someone to do the script)?
Perl or PHP3?
PS: The server admin told me he had to shut down several sites earlier this
year because of Perl scripts... too many hits, and every hit ran the
template-grabbing CGI. He said sites that get less hits but use Perl tax
the server more than sites that get more hits but use PHP... somehow, PHP
opens and closes fewer files (that's how it was explained to me) so he's
strongly pushing for PHP. Is this all just BS?
Jon
------------------------------
Date: Fri, 22 Sep 2000 23:29:11 -0400
From: "Jon" <vemba72@hotmail.com>
Subject: - For this type of use (see msg), should I use Perl of PHP3?
Message-Id: <LsVy5.2075$YP1.97885@weber.videotron.net>
I am launching a new site and I have the option of having all my file
splicing and parsing (templates and whatnot) done either via Perl (.cgi) or
PHP (.phtml) That will be 90% of the use of the script... assemble
templates + raw files, breaking files down into multiple "click here for
page 2/3/etc" pages... etc...
ASP is not an option, I'm on UNIX.
I keep hearing different stories about which of the two (Perl vs CGI)
performs better on large loads (you'd think I was talking about a laundry
detergent wouldn't you?)
All my links will be drawn up one way or another... so which way should I be
investing my time in (I'll be hiring someone to do the script)?
Perl or PHP3?
PS: The server admin told me he had to shut down several sites earlier this
year because of Perl scripts... too many hits, and every hit ran the
template-grabbing CGI. He said sites that get less hits but use Perl tax
the server more than sites that get more hits but use PHP... somehow, PHP
opens and closes fewer files (that's how it was explained to me) so he's
strongly pushing for PHP. Is this all just BS?
Jon
------------------------------
Date: Sat, 23 Sep 2000 02:03:09 +0100
From: "CJ Llewellyn" <darryl@work-thicker.co.uk>
Subject: Re: /me bangs head agains't brick wall
Message-Id: <bu3hq8.944.ln@paulweller>
"Ben Coleman" <oloryn@mindspring.com> wrote in message
news:39cbd316.27150870@news.mindspring.com...
-snip-
> not to mention perldoc File::Find
I looked at using find but it's not quite what I wanted.
--
Regards, CJ Llewellyn
http://www.cjll.uklinux.net/
------------------------------
Date: Sat, 23 Sep 2000 02:04:28 +0100
From: "CJ Llewellyn" <darryl@work-thicker.co.uk>
Subject: Re: /me bangs head agains't brick wall
Message-Id: <bu3hq8.9441.ln@paulweller>
"Henry Hartley" <hartleh1@westat.com> wrote in message
news:39CBCE12.134FA0D@westat.com...
>
> CJ Llewellyn wrote:
> >
> > closedir(DIR);
>
> What is the scope of DIR? What happens when you reuse and close it?
I'm assuming that all occurrances are closed, just reading the perldoc
DirHandle now.
--
Regards, CJ Llewellyn
http://www.cjll.uklinux.net/
------------------------------
Date: Fri, 22 Sep 2000 20:10:59 -0700
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: /me bangs head agains't brick wall
Message-Id: <39CC1F43.22BB3C06@acm.org>
CJ Llewellyn wrote:
>
> I'm having trouble with a script that recurses through directories.
>
> #!/usr/bin/perl -w
>
> read_dir("/usr");
>
> sub read_dir {
> my $dirname = $_[0];
local( *DIR );
> opendir(DIR , $dirname) or die "Unable to open directory : $dirname\n";
> while (defined($file = readdir(DIR))){
> # ignore . and .. directory pointers
> if(! ($file eq '.' || $file eq '..')){
> if(-d "$dirname/$file") {
> $readdir = "$dirname/$file";
> read_dir($readdir);
> } else {
> print "$dirname/$file\n";
> }
> }
> }
> closedir(DIR);
> }
>
> The problem is that when the script reaches the last file in the lowest
> directory the script terminates, any suggestions ?
The global variable 'DIR' is being over-written every time you call the
sub 'read_dir'.
HTH
John
------------------------------
Date: Sat, 23 Sep 2000 03:50:00 GMT
From: "Mike Chao" <myc1@nospam.earthlink.net>
Subject: basic question about an exercise in "Learning Perl"
Message-Id: <ILVy5.16988$ks.674444@newsread1.prod.itd.earthlink.net>
hi all,
I am a perl newbie. The following is some code from the book "Learning
Perl" 2nd ed. It's the exercise answer from Chapter 4, question 3.
1 #!/usr/bin/perl
2 print "Enter a number (999 to quit): ";
3 chomp ($n = <STDIN>);
4 while ($n =!
5 999) {
6 $sum += $n;
7 print "Enter another number (999 to quit): ";
8 chomp ($n = <STDIN>);
9 }
10 print "The sum is $sum.\n";
If I want to initialize the value of $sum so that it's not undef when I
start out, I understand that I should do $sum = 0. However, if I put
$sum = 0 between lines 2 and 3, the program runs fine. However, if
I put $sum = 0 between lines 3 and 4, I get the following errors:
syntax error at ./add.pl line 8, near "print"
syntax error at ./add.pl. line 10, near "}"
(not sure if the line numbers match 100%). I don't understand what
is the difference?
Thanks for any help, this is really bothering me!
Mike
------------------------------
Date: Sat, 23 Sep 2000 02:00:35 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39cc0c4e.914381@news.newsguy.com>
Russ Jones <russ_jones@rac.ray.com> wrote:
>Abigail wrote:
>> However, in most cases, none of them are actually mistakes.
>>
>Oh boy, another one. "However, in most cases none of them IS actually
>a mistake.
What's the point of your message? To be as offensive as
possible? It's off-topic, rude, and ill-informed.
H.W. Fowler can hardly be called a permissive in matters of
grammar, and here's what he had to say on the subject:
none. 1. It is a mistake to suppose that the pronoun is
singular only and must at all costs be followed by singular
verbs etc.; the OED explicitly states that the plural
construction is commoner.
Can you find any usage guide that agrees with your condemnation,
or are you just remembering something your junior-high English
teacher said? If you can, it's probably an obscure one, but in
any case I don't think anybody in this newsgroup wants to hear
about it.
(By the way, the OED also has "seldomly" as an obsolete
variation on "seldom", with citations from 1549 and 1620, so
Abigail was obviously just trying to lend her prose an air of
archaism.)
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Fri, 22 Sep 2000 22:05:36 -0700
From: Carl Fox <carlfox@surplusnet.com>
Subject: Re: delimiter problem
Message-Id: <39CC3A1F.436269D3@surplusnet.com>
Maybe I did not explain my problem well. I want the inch symbol to be placed
into the database file, from the HTML Form Field. As far as I can tell, this
is not a matter for escaping a character, (as in \"). I am trying to send the
the inch symbol, which one enters into the HTML Form Field, into the perl
generated Flat Database text file. What happens Instead, whenever one enters
the inch symbol into the Form Field, the delimiter is placed into the file
instead of the inch symbol being placed there.
*******************
Rob wrote:
> \"
>
> --
> The email address should read - rob at cowsnet dot com
>
> "Carl Fox" <carlfox@surplusnet.com> wrote in message
> news:39CB7B7B.18EC8B45@surplusnet.com...
> > Can anyone help me solve this flat DB problem?
> >
> > I'm writing to a flat database file, (using delimiters) but each time
> > the inch symbol (double quotes) is entered into the description field,
> > and written to the flat database file, it is replaced by the delimiter.
> >
> > Example: I write a description and put 12" (12 inches). Instead
> > of the " being entered, the delimiter is placed into the line.
> >
> > How do I get the " placed in the line?
> >
> > It's got to be something real simple I've overlooked, but I can't figure
> > it out.
> >
> > Thanks.
> >
------------------------------
Date: Sat, 23 Sep 2000 12:27:34 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Does Perl have C API?
Message-Id: <slrn8so1o6.jr6.mgjv@martien.heliotrope.home>
On Fri, 22 Sep 2000 17:01:04 -0400,
Xiaoyan Liu <x.liu@xsb.com> wrote:
> Hi, all,
>
> Does Perl have a C API for programmers to call from outside a perl engine?
> My intention is to use Perl regular expression in Java through Java Native
> Interface.
# perldoc perlembed
But, if all you want is the regular expressions, there are classes
available that implement various regexp schemes, one claiming to be
perl-compatible. No links, just do a web search.
Martien
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Fri, 22 Sep 2000 23:48:56 -0400
From: Xiaoyan Liu <xliu@cs.sunysb.edu>
Subject: Re: Does Perl have C API?
Message-Id: <39CC2828.D80577E@cs.sunysb.edu>
I'm currently using GNU package for Java. However, we'd like to see how the
performance
will be if regular expressions are processed in C. There are C/C++ Regex
packages that
don't support Perl syntax.
Martien Verbruggen wrote:
> On Fri, 22 Sep 2000 17:01:04 -0400,
> Xiaoyan Liu <x.liu@xsb.com> wrote:
> > Hi, all,
> >
> > Does Perl have a C API for programmers to call from outside a perl engine?
> > My intention is to use Perl regular expression in Java through Java Native
> > Interface.
>
> # perldoc perlembed
>
> But, if all you want is the regular expressions, there are classes
> available that implement various regexp schemes, one claiming to be
> perl-compatible. No links, just do a web search.
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | The world is complex; sendmail.cf
> Commercial Dynamics Pty. Ltd. | reflects this.
> NSW, Australia |
------------------------------
Date: Fri, 22 Sep 2000 22:22:34 -0400
From: Bruce Bowden <bbowden@mitre.org>
Subject: Re: getting images with LWP?
Message-Id: <39CC13EA.2C70C4B@mitre.org>
thanks for the reply...
In comp.lang.perl.misc, Eli the Bearded wrote:
> Check to see that $image is not undef at this point, since that
> is hole get() returns its errors:
>
> die "get failed," unless defined($image);
not sure I followed your directions correctly, I did:
$image=get('http://host.domain.com/dir/file.jpg') or die "get failed,"
unless defined($image);
and there was no change.
> Hmmm. Does getstore($url, $file) work on NT? I have no idea if
> it does the right thing with binmode(). The return value from
> getstore() is the three digit HTTP status code which would be
> useful to know. If it is 200 the download 'worked' (in the
> sense that you got something without any error notification).
>
> head($url) might be useful to try too, for diagnostics. (Some
> servers don't allow/support HEAD requests, though.)
>
> I can imagine server configurations that would allow a file.jpg to
> be downloaded by a typical browser, when viewed as part of a web
> page, but not when linked to directly (Referer: checking) or when
> accessed by special download tools (browser sniffing). So it might
> not be a problem in your script.
As far as the rest of this stuff... to be honest it is beyond me. I
really have no idea what you are talking about here, but you can be sure
I will be spending some time looking into it. I am not much of a
programmer (yet).
------------------------------
Date: Sat, 23 Sep 2000 02:20:48 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: getting images with LWP?
Message-Id: <39CC1392.B9207843@rochester.rr.com>
Bruce Bowden wrote:
>
> Sorry if this is a rudimentary question or better suited to a Perl CGI
> group (which I do not have access to...), but I am not getting anywhere
> with this problem with my current resources.
>
> I am trying to retrieve an image from a website. I know the exact URL to
> the image. I have tried to use LWP::Simple as follows:
>
> use LWP::Simple;
> $picfile="C:/somepath/image.jpg";
> $image=get('http://host.domain.com/dir/file.jpg');
> open(FILE, ">$picfile");
> binmode FILE; #ADDED FOR NT SERVER
> print FILE $image;
> close(FILE);
>
> The file http://host.domain.com/dir/file.jpg definitely exists, I can
> see it with a browser. The script creates a jpg file with the right name
> on my local file system, but it has a size of 0kb. The script is
> actually a bit more complicated than this (it is outputting a web page
> after performing a database query...) but I don't think that this part
> is dependent on the rest of the script. I am running NT4 Server with
> Activestate Perl 5.005 (build 521). Anybody have an idea what I am
> missing?
>
> Three things to note:
> 1. I do not have FTP access to the host in question.
> 2. In the context of my CGI program, the page that is output never stops
> loading, it seems to be stuck on this piece (again, I don't think this
> is the result of any other part of the script - or to be more accurate,
> I KNOW that it is not dependent on the rest of the script, as it runs
> fine without this piece).
> 3. LWP is working fine on my machine:
> get('http://host.domain.com/dir/file.htm') works great every time.
>
> p.s. one more thing - the dir in question has a dot (.) in the
> dirname... can't imagine that this makes a difference but you never
> know.
I don't think your problem is with LWP, as it retrieves JPEG's from web
sites just fine (I tried it just now, no problem). You don't have an
"or die" clause on your open statement, so I'll bet you will find your
open is failing (although you state it is creating the empty file???).
Make your open look like:
open FILE,">$picfile" or die "Oops, $!\n";
and see what happens.
--
Bob Walton
------------------------------
Date: Fri, 22 Sep 2000 22:47:38 -0400
From: Bruce Bowden <bbowden@mitre.org>
Subject: Re: getting images with LWP?
Message-Id: <39CC19CA.3635CE7A@mitre.org>
Bob Walton wrote:
> I don't think your problem is with LWP, as it retrieves JPEG's from web
> sites just fine (I tried it just now, no problem). You don't have an
> "or die" clause on your open statement, so I'll bet you will find your
> open is failing (although you state it is creating the empty file???).
> Make your open look like:
>
> open FILE,">$picfile" or die "Oops, $!\n";
>
> and see what happens.
> --
> Bob Walton
no difference... but I appreciate the reply.
------------------------------
Date: Sat, 23 Sep 2000 12:58:09 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: I meant \50, not \70 Re: Simple one? How do I escape the '(" in a string?
Message-Id: <gTUy5.29$Nw5.1981@nsw.nnrp.telstra.net>
I give up --- I meant \50 octal 50
"Robert Chalmers" <robert@chalmers.com.au> wrote in message
news:gLTy5.19$Nw5.1846@nsw.nnrp.telstra.net...
>
>
> trying to do this, (it's on line 92 of the program...)
>
> print (DB "\(\n");
>
> produces this,,
>
> $ perl -w beta.pl
> print (...) interpreted as function at beta.pl line 92.
>
> Although it doesn't crash the program, it produces that annoyong warning!
> But - It should be escaping it?
>
> thank for any cluse to why this is happening ...
>
> Robert
>
>
>
------------------------------
Date: 23 Sep 2000 01:56:54 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: MSXML.dll
Message-Id: <8qh2l6$58j$1@slb6.atl.mindspring.net>
IDBugM (idbugm@idbugm.com) wrote:
: I'm in a bit of a bind. I'm trying to use Perl to post an XML string to
: a secure server. Since I'm running this script on a Win32 system using
: Net::SSLeay would be very difficult to use.
Are you aware that Net::SSLeay has been compiled for Win32 and is
available from ActiveState?
: I've used the MSXML.DLL for ASP but I've never tried accessing the DLL's
: from Perl. I've tried looking into all these groups for an answer but
: maybe I'm making it more difficult than it really is. Here is the basic
: code I use in VB that I'm trying to convert into Perl.
:
: dim anXMLhttpObject, strResult
: Set anXMLhttpObject = Server.CreateObject("microsoft.XMLHttp")
: anXMLhttpObject.open "POST",TransactionURL,false
: anXMLhttpObject.setRequestHeader "Content-type", "text/xml"
: anXMLhttpObject.send RequestXMLstring
: strResult = anXMLhttpObject.responseText
:
: Anyone know how to convert this using the Win32::API module for Active
: State? Please help if you know how to do this. Thanks
Since MSXML has a COM interface, you probably want to use Win32::OLE to
access it.
------------------------------
Date: Sat, 23 Sep 2000 02:25:50 GMT
From: IDBugM <idbugm@idbugm.com>
Subject: Re: MSXML.dll
Message-Id: <8qh4au$h3r$1@nnrp1.deja.com>
I've looked all over the place for Net::SSLeay for a Win32 system but
all I've found is the Unix one that needs to be compiled. I've pulled
my hair out trying to get it to work on a Win32 system. Where would I
begin looking? I didn't find it on activestate.com
In article <8qh2l6$58j$1@slb6.atl.mindspring.net>,
ebohlman@netcom.com (Eric Bohlman) wrote:
> IDBugM (idbugm@idbugm.com) wrote:
> : I'm in a bit of a bind. I'm trying to use Perl to post an XML
string to
> : a secure server. Since I'm running this script on a Win32 system
using
> : Net::SSLeay would be very difficult to use.
>
> Are you aware that Net::SSLeay has been compiled for Win32 and is
> available from ActiveState?
>
> : I've used the MSXML.DLL for ASP but I've never tried accessing the
DLL's
> : from Perl. I've tried looking into all these groups for an answer
but
> : maybe I'm making it more difficult than it really is. Here is the
basic
> : code I use in VB that I'm trying to convert into Perl.
> :
> : dim anXMLhttpObject, strResult
> : Set anXMLhttpObject = Server.CreateObject("microsoft.XMLHttp")
> : anXMLhttpObject.open "POST",TransactionURL,false
> : anXMLhttpObject.setRequestHeader "Content-type", "text/xml"
> : anXMLhttpObject.send RequestXMLstring
> : strResult = anXMLhttpObject.responseText
> :
> : Anyone know how to convert this using the Win32::API module for
Active
> : State? Please help if you know how to do this. Thanks
>
> Since MSXML has a COM interface, you probably want to use Win32::OLE
to
> access it.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 23 Sep 2000 02:48:37 GMT
From: IDBugM <idbugm@idbugm.com>
Subject: Re: MSXML.dll
Message-Id: <8qh5m0$idq$1@nnrp1.deja.com>
: dim anXMLhttpObject, strResult
: Set anXMLhttpObject = Server.CreateObject("microsoft.XMLHttp")
: anXMLhttpObject.open "POST",TransactionURL,false
: anXMLhttpObject.setRequestHeader "Content-type", "text/xml"
: anXMLhttpObject.send RequestXMLstring
: strResult = anXMLhttpObject.responseText
Forgive my ignorance with this project. Windows is not where my
experience in Perl has been. This would be done using Win32::OLE like
the following?
my anXMLhttpObject=Win32::OLE->Server.CreateObject("microsoft.XMLHttp");
anXMLhttpObject->open "POST", TransactionURL, false;
anXMLhttpObject->setRequestHeader "Content-type", "text/xml";
anXMLhttpObject->send RequestXMLstring;
my strResult = anXMLhttpObject->responseText;
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 22 Sep 2000 18:12:51 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: multiple replaces one line at a time
Message-Id: <39CC0393.7675F39F@stomp.stomp.tokyo>
Larry Rosler wrote:
> Godzilla! wrote:
> > code to make this work:
> > $do_it = substr ($string, 9, 9, $replace);
> Hmmm. The fourth argument to substr() was introduced in Perl 5.005:
ooppss..
> I thought that in your view everything 'good' already existed in Perl 4.
> But here you are using a feature from Perl 5, and a relatively late
> addition at that. What else are you hiding?
Well, I invest a lot of effort into hiding my big butt.
Vertical stripes and support hose, this is the ticket.
> Nevertheless, this use of substr() isn't optimal, as you copy the
> removed content into $do_it but then don't use it.
Why throw away perfectly usable characters? I love characters!
Especially wild and woolly characters such as myself!
> It would be better to use the lvalue form of the
> three-argument substr(), as I and others have posted.
Nope, same results, different technique and, I get to
keep some wild and woolly characters. You don't! HA!
Besides, my method doesn't invoke a regex engine which
uses more memory and slows down your script by at least
ten milliseconds. HA! HA!
> By the way, when you put your sample program after your signature cut-
> line, intelligent newsreaders cut it out of the quoted material, and I'm
> too lazy to put it back manually. Hence the quote from the body of the
> text.
Ahem, I do this as a courtesy so those who have me in their
killfiles, when they respond, my test scripts won't be
plastered all over. Ain't I about the most thoughtful
person you ever read?
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: 23 Sep 2000 01:22:39 GMT
From: abigail@foad.org (Abigail)
Subject: Re: multiple replaces one line at a time
Message-Id: <slrn8so1ck.5fq.abigail@alexandra.foad.org>
Larry Rosler (lr@hpl.hp.com) wrote on MMDLXXX September MCMXCIII in
<URL:news:MPG.1435993fb0bc963198adb9@nntp.hpl.hp.com>:
-:
-: Then possible solutions would be:
-:
-: substr($_, 9, 9) = do { (my $x = substr $_, 9, 9) =~ s/[\w\s]/•/g; $x };
But since substr() returns an l-value, this hocus pocus with do {} and
temp variables is unnecessary:
substr ($_, 9, 9) =~ s/[\w\s]/\x95/g;
(Although the OP said 'alphanum or space', and the above replaces underscores
and all whitespace).
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
Date: Fri, 22 Sep 2000 20:22:46 -0500
From: "Tim Schmelter" <schmelter_tim@hotmail.com>
Subject: Re: Perl Online Questions Updated
Message-Id: <JBTy5.42787$XT1.679553@news5.giganews.com>
"amonotod" <amonotod@netscape.net> wrote in message
news:8qbbq6$o83$1@nnrp1.deja.com...
> In article <8qb9hh$l99$1@nnrp1.deja.com>,
> cd_root@my-deja.com wrote:
> > We've also corrected some typos thanks to the watchful eyes of
> > pervious visitors. :-)
> ^^^
> HA!
>
> amonotod
>
> --
> `\|||/ amonotod@
> (@@) netscape.net
> ooO_(_)_Ooo________________________________
> _____|_____|_____|_____|_____|_____|_____|_____|
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
I choose to believe this was not a typo. From www.dictionary.com:
"per-vi-ous (pur v -s) adj. 1. Open to passage or entrance; permeable. 2.
Open to arguments, ideas, or change; approachable."
I'd wager definition 2 describes at least some of the visitors to the site.
If we want to get risque', definition 1 probably does, too. ;-)
--
Tim Schmelter
schmelter_tim@hotmail.com
------------------------------
Date: 23 Sep 2000 01:24:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: REQ how to create one line of text
Message-Id: <slrn8so1ge.5fq.abigail@alexandra.foad.org>
Uri Guttman (uri@sysarch.com) wrote on MMDLXXX September MCMXCIII in
<URL:news:x71yycc4xu.fsf@home.sysarch.com>:
][ >>>>> "A" == Abigail <abigail@foad.org> writes:
][
][ A> Uri Guttman (uri@sysarch.com) wrote on MMDLXXIX September MCMXCIII in
][ A> <URL:news:x74s38cdi6.fsf@home.sysarch.com>:
][ A> \\ >>>>> "CF" == Chris Fedde <cfedde@u.i.sl3d.com> writes:
][ A> \\
][ A> \\ CF> Golf anyone?
][ A> \\ CF> perl -lpe 'BEGIN{$/=""}s/\n/ | /g'
][ A> \\
][ A> \\ perl -00l12pe 'y/\n//d'
][ A> \\
][ A> \\ this also works and is 2 chars shorter.
][ A> \\
][ A> \\ perl -00l12pey/\\n//d
][
][ A> Not if we assume the data fields have to be separated by ' | ' if no
][ A> newline acts as a separator.
][
][ yeah, the spec wasn't clear and i missed that. if only a | is needed as
][ a separator (why the extra blanks?) then this works.
Because in the given example, fields on the same line were separated
by ' | '.
][ perl -00l12pe'y/\n/|/d'
No need for the /d, is there?
Abigail
--
$_ = "\112\165\163\1648\141\156\157\164\150\145\1628\120\145"
. "\162\1548\110\141\143\153\145\162\0128\177" and &japh;
sub japh {print "@_" and return if pop; split /\d/ and &japh}
------------------------------
Date: Sat, 23 Sep 2000 03:58:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: REQ how to create one line of text
Message-Id: <x7ya0jbvy6.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@foad.org> writes:
A> Because in the given example, fields on the same line were separated
A> by ' | '.
true but not specified. i doubt the real separator is defined as ' | '.
A> ][ perl -00l12pe'y/\n/|/d'
A> No need for the /d, is there?
leftover from my previous version.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sat, 23 Sep 2000 11:41:26 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: Simple one? How do I escape the '(" in a string?
Message-Id: <gLTy5.19$Nw5.1846@nsw.nnrp.telstra.net>
trying to do this, (it's on line 92 of the program...)
print (DB "\(\n");
produces this,,
$ perl -w beta.pl
print (...) interpreted as function at beta.pl line 92.
Although it doesn't crash the program, it produces that annoyong warning!
But - It should be escaping it?
thank for any cluse to why this is happening ...
Robert
------------------------------
Date: Sat, 23 Sep 2000 02:01:33 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Simple one? How do I escape the '(" in a string?
Message-Id: <39CC0F0F.FCBE6399@rochester.rr.com>
Robert Chalmers wrote:
>
> trying to do this, (it's on line 92 of the program...)
>
> print (DB "\(\n");
>
> produces this,,
>
> $ perl -w beta.pl
> print (...) interpreted as function at beta.pl line 92.
>
> Although it doesn't crash the program, it produces that annoyong warning!
> But - It should be escaping it?
>
> thank for any cluse to why this is happening ...
>
> Robert
In
perldoc -f print
it states that the print function has the syntaxes:
print FILEHANDLE LIST;
and
print LIST;
You gave it
print (SOMETHING "some text\n");
The warning (and BTW, congrats on using -w -- that is a good thing) is
telling you that Perl interpreted this perhaps ambiguous construction as
a function. It is not 100% clear what you intend to accomplish. If you
want to print to open filehandle DB, use:
print DB "\)\n";
You can get more info on the warning with
use diagnostics;
in your program. Also see:
perldoc perlop
--
Bob Walton
------------------------------
Date: 23 Sep 2000 02:16:56 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Simple one? How do I escape the '(" in a string?
Message-Id: <slrn8so4if.5fq.abigail@alexandra.foad.org>
Robert Chalmers (robert@chalmers.com.au) wrote on MMDLXXX September
MCMXCIII in <URL:news:gLTy5.19$Nw5.1846@nsw.nnrp.telstra.net>:
..
..
.. trying to do this, (it's on line 92 of the program...)
..
.. print (DB "\(\n");
..
.. produces this,,
..
.. $ perl -w beta.pl
.. print (...) interpreted as function at beta.pl line 92.
That is a very annoying warning, and I don't see what good it does.
It isn't that people aren't used to functions.
.. Although it doesn't crash the program, it produces that annoyong warning!
.. But - It should be escaping it?
Your escaping of the ( inside the string is pointless. It won't do anything.
Try one of:
print DB "(\n";
print +(DB "(\n");
Of course, the perldiag manpage could have told you in less time than it
take me to write this.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
Date: Sat, 23 Sep 2000 12:45:40 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: Re: Simple one? How do I escape the '(" in a string?
Message-Id: <CHUy5.26$Nw5.2057@nsw.nnrp.telstra.net>
I found one way around it.
print (DB "\70 \n"); Which is \70 = octal 70 = (
print (DB "\(\n"); simply doesnt work.
It's actually the opening quote of a set of brackets that are closed further
down.
print (DB "\)\n"); works fine by the way - the bracket is facing the other
way..
thanks for the help,
Robert
"Robert Chalmers" <robert@chalmers.com.au> wrote in message
news:gLTy5.19$Nw5.1846@nsw.nnrp.telstra.net...
>
>
> trying to do this, (it's on line 92 of the program...)
>
> print (DB "\(\n");
>
> produces this,,
>
> $ perl -w beta.pl
> print (...) interpreted as function at beta.pl line 92.
>
> Although it doesn't crash the program, it produces that annoyong warning!
> But - It should be escaping it?
>
> thank for any cluse to why this is happening ...
>
> Robert
>
>
>
------------------------------
Date: Sat, 23 Sep 2000 12:57:28 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: Re: Simple one? How do I escape the '(" in a string?
Message-Id: <ESUy5.28$Nw5.2095@nsw.nnrp.telstra.net>
> Your escaping of the ( inside the string is pointless. It won't do
anything.
> Try one of:
>
> print DB "(\n";
> print +(DB "(\n");
> Of course, the perldiag manpage could have told you in less time than it
> take me to write this.
which doesn't explain why
print (DB "\(\n");
doesn't work.... when everthing else in the file does. written the same way.
nor does
print (DB "(\n");
thanks
Robert
------------------------------
Date: 23 Sep 2000 03:12:26 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Simple one? How do I escape the '(" in a string?
Message-Id: <slrn8so7qh.5fq.abigail@alexandra.foad.org>
Robert Chalmers (robert@chalmers.com.au) wrote on MMDLXXX September
MCMXCIII in <URL:news:ESUy5.28$Nw5.2095@nsw.nnrp.telstra.net>:
$$ > Your escaping of the ( inside the string is pointless. It won't do
$$ anything.
$$ > Try one of:
$$ >
$$ > print DB "(\n";
$$ > print +(DB "(\n");
$$ > Of course, the perldiag manpage could have told you in less time than it
$$ > take me to write this.
$$
$$
$$ which doesn't explain why
$$ print (DB "\(\n");
$$ doesn't work.... when everthing else in the file does. written the same way.
$$ nor does
$$ print (DB "(\n");
"Doesn't work" just by itself is a meaningless statement. What does
happen, and what do you expect it to happen? Witness:
$ rm -f /tmp/foo
$ perl -w
open DB, "> /tmp/foo" or die $!;
print (DB "\(\n");
print (...) interpreted as function at - line 2.
__END__
$ cat /tmp/foo
(
$
See? It _does_ work.
Although I have to say that:
print +(DB "\(\n");
isn't correct, as that would make DB an argument to print, (and hence a
syntax error).
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
------------------------------
Date: 22 Sep 2000 21:58:26 -0400
From: darkon@one.net (David Wall)
Subject: Re: Thnaks to the Gurus!
Message-Id: <8FB7D4311darkononenet@206.112.192.118>
spragg@cs.ucdavis.edu (Adam Trace Spragg) wrote in
<8qgp7u$mc2$1@mark.ucdavis.edu>:
>alphazerozero@my-deja.com wrote:
>: ps (Especial thanks to Larry Wall, and to the many who wrote some of
>: the funniest docs ive ever read.)
>
>In "Programming Perl" the footnote for the sqrt function says:
>
>"Don't try either of these approaches with negative numbers, as that poses
>a slightly more complex problem."
>
>THAT is comedy. Whoever wrote that has my deepest admiration.
I've often thought that the humor in the Camel and other Perl docs is more
effective at explaining something than any amount of "serious" exposition.
I love the definition of "loop" in the glossary of the Camel, and have
shown it to several people who appreciated the joke even though they don't
do any programming.
--
David Wall
darkon@one.net
------------------------------
Date: Fri, 22 Sep 2000 19:12:32 -0600
From: "Michael Love" <noone@nospam.com>
Subject: Time Zone conversion
Message-Id: <39cc042e.0@oracle.zianet.com>
I'm trying to find a way to convert a time from one timezone into a time for
another timezone while compensating for daylight savings time. The basic
conversion is easy, but with so many countries that use dst having different
rules for when it starts and ends, it is rapidly becoming too complex for
what I want to do with it.
Is there a module that will do this? I've checked out Time::Zone and a
couple of others, but they don't do the dst compensation part.
------------------------------
Date: 23 Sep 2000 01:26:20 GMT
From: abigail@foad.org (Abigail)
Subject: Re: too many errors in my program
Message-Id: <slrn8so1jk.5fq.abigail@alexandra.foad.org>
Dan and Shelly (wedeking@msa.attmil.ne.jp) wrote on MMDLXXX September
MCMXCIII in <URL:news:8qgt1a$ad8$1@newsflood.tokyo.att.ne.jp>:
## I wrote a perl script that has so many error messages when I try to run it
## that they scroll right past the end of the screen.
##
## How can I capture these error messages into a file so I can step through
## each one and try to fix them one at a time?
$ perl -wc 'program' 2> errors
Assuming you have a decent shell.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
# Eleven young girls sit
# beside a lake. Two purring
# kitties. Two ravens nest.
------------------------------
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 4410
**************************************