[11235] in Perl-Users-Digest
Perl-Users Digest, Issue: 4835 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 5 19:07:20 1999
Date: Fri, 5 Feb 99 16:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 5 Feb 1999 Volume: 8 Number: 4835
Today's topics:
Re: [PATCH]5.005_54 (pod2html) Generate Relative URLs (Erland Sommarskog)
C->Perl->C Problem (Robert J. Irwin)
Re: compilation fails on Aix 4.3.2.0 <jglascoe@giss.nasa.gov>
Re: DBI + ODBC + MS Access <andrewf@beausys.demon.co.uk>
Re: DBI + ODBC + MS Access <andrewf@beausys.demon.co.uk>
Re: Dynamically Naming Array Variables <aqumsieh@matrox.com>
Re: Help with data structure <jglascoe@giss.nasa.gov>
Re: Help with data structure <aqumsieh@matrox.com>
Re: How do I get local IP Address ? <rlamb@compuserve.com>
Re: how to query errno.h info <bmb@ginger.libs.uga.edu>
Re: how to query errno.h info <jglascoe@giss.nasa.gov>
Math::TrulyRandom on RH Linux <palincss@his.com>
Max Value <abukar@insidewire.com>
Re: Max Value <bmb@ginger.libs.uga.edu>
NEWBIE regexp for web server conf file <scott@iPartner.net>
Re: NEWBIE regexp for web server conf file (Bill Moseley)
Performance Statistics <Monty.Scroggins@mci.com>
Re: Python vs. Perl vs. tcl ? <aqumsieh@matrox.com>
Re: regex Help bob.pruett@cox.com
regular expression <jd.anderson@boeing.com>
Server Push in IE3/4 <jsilver@multisoft.com>
Re: Simple Question About a Scalar <bmb@ginger.libs.uga.edu>
Using HTTPS <jwhitesel@wcom.net>
Using HTTPS <jwhitesel@wcom.net>
What's happening with this hash? (John Moreno)
Re: Win32::NetAdmin::UserGetAttributes problem <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Would love UNIX program that could read Excel binary fi <wsherrin@eccms1.dearborn.ford.com>
Re: Would love UNIX program that could read Excel binar (Rob Nicholson)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 05 Feb 1999 22:39:41 GMT
From: sommar@algonet.se (Erland Sommarskog)
Subject: Re: [PATCH]5.005_54 (pod2html) Generate Relative URLs
Message-Id: <79frvb$o9q$2@cubacola.tninet.se>
Barrie Slaymaker <rbs@telerama.com> skriver:
>The only bug I know of is that I haven't dealt with the code that builds
>index files like perlfunc yet. That's coming soon.
One thing which have irritated me, but which I have been to lazy to
submit a proper error report for is that Perl variables like $blaha are
automatically put in <CODE> tags. (Or some other tags that gives a fixed; I
haven't checked the HTML.) The problems is that this is not performed
consistently. If there is a punctionation character following, because the
variable happens to be the last word of clause or a sentence, the variable
is not put in tags. You can see one example on
http://www.algonet.se/~sommar/mssql/mssql-dblib.html#dbnextrow2.
Personally I would favour leaving the variables alone. If the programmer
wants to have the variables in fixed font, he can add C<> himself. That
is what you have to today, to get a consistent appearence.
(This applies to 5.004_04 and 5.005_02. I haven't tried 5.005_54.)
--
Erland Sommarskog, Stockholm, sommar@algonet.se
This could have been my two cents worth, but alas the Swedish
government has decided that I am not to have any cents.
------------------------------
Date: 5 Feb 1999 15:58:52 -0500
From: rjirwin@top.cis.syr.edu (Robert J. Irwin)
Subject: C->Perl->C Problem
Message-Id: <36bb5b8c.0@news.syr.edu>
I'm trying to arrange things so that a C program with an embedded Perl
interpreter can call a function in the Perl code it parses, and that
Perl function can in turn call a C function in an XS module "use"d by
that Perl code.
My current software configuration:
Perl 5.005_02, gcc 2.91.57, (Sparc) Solaris 2.5
own C program which has embedded Perl interpreter
own Perl code that is parsed and interpreted by the C program
(the C program calls functions defined in this Perl code)
own XS module to be "use"d by Perl code above
The C->Perl set-up has worked for me previously, but that ended when
I changed the Perl code to "use" the XS module I wrote -- i.e., when I
tried a C->Perl->C route. Specifically, I get a msg to the effect
that my perl wasn't built for dynamic loading, so my XS module can't
be loaded.
However, when I interpreted the changed Perl code with 'perl' at the
command line, it successfully called functions in my XS module, so the
Perl->C bit works, at least under those conditions. (Thus, my 'perl'
executable *was* built to support dynamic loading. I would have
guessed that the Perl library used to embed the Perl interpreter in my
C program would also support dynamic loading -- aren't the perl
executable and library built from the same objects?)
So...I can get C->Perl and Perl->C to work separately, but I can't get
C->Perl->C working. The material in perlxs, perlxstut, perlembed, and
"Advanced Perl Programming" do not seem to address this issue directly.
Any help would be greatly appreciated.
Thanks,
Robert
------------------------------
Date: Fri, 05 Feb 1999 17:02:26 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Jaap Voets <nlx7043@nl.ibm.com>
Subject: Re: compilation fails on Aix 4.3.2.0
Message-Id: <36BB6A72.D10D1C95@giss.nasa.gov>
Jaap Voets wrote:
>
> the weird thing is, we compiled perl a few weeks earlier on the same
> system, but Runinng AIX 4.3.1 without a flaw, it's probably a linker
> thing, but I'm not a C-guru that knows what's going wrong
>
yeah, I have an rs6k/397 box running AIX 4.3.1.0
I had no problems getting perl to compile.
> does anyone have a clue?
>
no. I'm beginning to suspect that IBM is adding
more bugs than it fixes on each new AIX upgrade.
good luck,
Jay
--
http://www.giss.nasa.gov/cgi-bin/csci/change.pl
------------------------------
Date: Fri, 5 Feb 1999 10:03:26 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: DBI + ODBC + MS Access
Message-Id: <bLFoGBAuHsu2Ewz0@beausys.demon.co.uk>
In article <aUWYxBAjGju2Ewii@beausys.demon.co.uk>, Andrew Fry
<andrewf@beausys.demon.co.uk> writes
>Oops! I think this is because I havent registered the
>file with the 32bit ODBC Data Source Administrator.
>
>However, there seems to be a bug in the Administrator... :(
For those of you who are interested in this... there is a
SR available at www.microsoft.com/odbc which fixes this bug.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
------------------------------
Date: Fri, 5 Feb 1999 23:56:27 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: DBI + ODBC + MS Access
Message-Id: <IP0sXBArU4u2EwQV@beausys.demon.co.uk>
In article <79f48t$8qe@wendy.mad.servicom.es>, Pablo Navascues
<navascues@usa.net> writes
>Uhh, i4m not an expert but the error is asking for a DSN(Data Source Name).
>generally you make ODBC connections to DSN not the database file. You have
>to set this up in the Operative System In windows its via the ODBC Data
>Source Administrator>System DSN>Add. Following steps are trivial.
>
>--
>bye,
>Pablo
Yes ... I kinda figured that out eventually ... see my subsequent
postings. I am new to Access, but the various web sites/pages on DBI
were vague about this and didnt explain precisely what a DSN is, or
how one might go about creating DSN. (In fact, I found only one that
did explain to some extent - a page by Selena Sol).
So, then I found a bug in the Administrator, which I fixed by means
of applying a SR (downloaded from Microsoft).
Then, I finally created a (system) DSN, called afdb1 ... associated with
the database file afdb1.mdb. So, now the connect call looks like this:
$dbh = DBI->connect('dbi:ODBC:afdb1','','');
I can see the new DSN in the Registry now, and I had more hope that the
connect call would work ... but it doesnt ... I still get the same
error!
Hmmm......
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
------------------------------
Date: Fri, 5 Feb 1999 14:23:01 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Dynamically Naming Array Variables
Message-Id: <x3yr9s4r6y2.fsf@tigre.matrox.com>
Thomas Bjorn Andersen <bjorn@daimi.au.dk> writes:
> "George H" <george@tapestry.net> writes:
>
> > push(@$affiliate,$_); ###THIS IS MY PROBLEM
>
> push @{$affiliate},$_; should do the trick :-)
>
No it shouldn't. There is absolutely no difference between @$var and
@{$var}. It's only a readability (and precedence) issue. But their is
no precedence ambiguity in this case.
Have a look at perlref for a better answer. Let me also suggest that
you not use symbolic references at all here. I would suggest using a
hash %affiliate, with keys $affiliate.
HTH,
Ala
------------------------------
Date: Fri, 05 Feb 1999 17:18:23 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: "Shawn A. Berg" <berg98@us.ibm.com>, Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Help with data structure
Message-Id: <36BB6E2F.D0FE825@giss.nasa.gov>
"Shawn A. Berg" wrote:
>
> I would like to create a hash of file handles. I cannot figure out how
> to set up and use this kind of structure.
hi,
the Panther book (Sriram?) really likes IO::File
says it's the wave of the future...
So, perldoc IO::File
use IO::File;
use strict;
use vars qw(@FILE_NAMES);
@FILE_NAMES = qw(biz.txt foo.html oof.el);
sub main
{
my %file_hash;
for my $file_name (@FILE_NAMES)
{
# create IO::File object
my $fh = IO::File->new();
# open your file
$fh->open("< $file_name") or die "can't read file: $!";
# put file object in the hash, keyed by file name
$file_hash{"$file_name"} = $fh;
}
# do something with "file_hash"...
}
Jay
--
http://www.giss.nasa.gov/staff/jglascoe.html
------------------------------
Date: Fri, 5 Feb 1999 14:30:38 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Help with data structure
Message-Id: <x3ypv7or6ld.fsf@tigre.matrox.com>
"Shawn A. Berg" <berg98@us.ibm.com> writes:
> I would like to create a hash of file handles. I cannot figure out how
> to set up and use this kind of structure.
What exactly is it that you can't figure out? Did you try writing any
code? If yes, can we see it?
you might also want to have a look at the following modules:
FileHandle
IO::Handle
--HTH,
Ala
------------------------------
Date: Fri, 5 Feb 1999 17:32:45 -0500
From: "Ronald Lamb" <rlamb@compuserve.com>
Subject: Re: How do I get local IP Address ?
Message-Id: <#N0vRYVU#GA.284@ntdwwaaw.compuserve.com>
darylh@trendwestresorts.com wrote in message
<79cm96$t3r$1@nnrp1.dejanews.com>...
>I have a program that uses sockets, but in order to open the socket my
>program needs to know the IP Address of the machine it is running on. Is
>there a function or system call that will get this address for me? I've
>looked through my perl books (which are both pretty useless) and can't find
a
>thing. I guess I need to get a new Perl book.
use Socket
use Sys::Hostname
$addr = gethostbyname(hostname());
------------------------------
Date: Fri, 5 Feb 1999 16:44:09 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
To: Jay Glascoe <jglascoe@giss.nasa.gov>
Subject: Re: how to query errno.h info
Message-Id: <Pine.A41.4.02.9902051629500.56640-100000@ginger.libs.uga.edu>
On Fri, 5 Feb 1999, Jay Glascoe wrote:
> Brad Baxter wrote:
> > use Fcntl;
> yes. Another choice is
> use IO::File;
> ping.
I appreciate the reply, but I'm still stuck with the same situation.
Unless I totally misunderstand the IO::File docs, here's the same code
snippet using IO::File:
#!/usr/local/bin/perl -w
use strict;
use IO::File;
for( my $serial = 1;; ) {
my $fh = new IO::File "x".$serial++, O_WRONLY|O_EXCL|O_CREAT;
last if defined $fh;
#die $! unless $! eq 'File exists'; ### other error
die $! unless $! == 17; ### other error
die "Infinite loop" if $serial > 10; ### last resort
undef $fh;
}
It will still go into an infinite loop if the user doesn't have write
permissions to the directory and if I don't check for $!==17. I admit
that my question is somewhat academic, since I have an easy workaround for
our general purposes. However, I'd like to be able to share this code
with others, and I'd like to be able to say that errno 17 always means
'File exists' for every perl. I just don't know if I can say that.
Regards,
-Brad
------------------------------
Date: Fri, 05 Feb 1999 16:54:23 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: how to query errno.h info
Message-Id: <36BB688F.37440779@giss.nasa.gov>
Brad Baxter wrote:
>
> I appreciate the reply, but I'm still stuck with the same situation.
>
woops, sorry Brad! My post should have gone on
the "Help with data structure" thread; it really
has nothing to do with "errno.h" (whatever that is ;)
Jay
--
http://www.giss.nasa.gov/cgi-bin/csci/change.pl
------------------------------
Date: Fri, 05 Feb 1999 18:07:47 -0500
From: Steve Palincsar <palincss@his.com>
Subject: Math::TrulyRandom on RH Linux
Message-Id: <36BB79C3.3EC5C67C@his.com>
I've tried to build this module from source
from CPAN on my RedHat 5.1 Linux box, and had
no luck: execution would hang on the test
scripts. The documentation did say 'this has
been tested on Solaris only, and if you are
on anything else you are on your own'.
A few minutes ago, I located a pre-built RPM
of this module for RedHat Linux, but when
I tried to install it I got a missing dependency
error to the effect that that /usr/local/bin/perl
was not availabe.
Of course, on RH5.1 perl is in /usr/bin/perl,
but making a symbolic link between /usr/bin
and /usr/local/bin/perl, but I still got the
error.
Any idea how I might work around this (other
than forgetting about using this module)?
------------------------------
Date: Fri, 5 Feb 1999 16:25:51 -0500
From: "Abukar Mohamed" <abukar@insidewire.com>
Subject: Max Value
Message-Id: <36bb6119.0@diana.idirect.com>
Hi
I would like to make a perl script that reads a value from
text file and then increment 1 every time I read that script.
Could you please tell me if such a function MAX exists in perl
and also small example I will appreciate it.
Abukar
------------------------------
Date: Fri, 5 Feb 1999 16:29:07 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
To: Abukar Mohamed <abukar@insidewire.com>
Subject: Re: Max Value
Message-Id: <Pine.A41.4.02.9902051626360.56640-100000@ginger.libs.uga.edu>
You really need a Perl book. The answer is, "no", but you can easily
write your own. On the other hand, what you are describing is covered in
the FAQ for this list. It's well worth reading.
Cheers,
-Brad
On Fri, 5 Feb 1999, Abukar Mohamed wrote:
> Hi
>
> I would like to make a perl script that reads a value from
> text file and then increment 1 every time I read that script.
>
> Could you please tell me if such a function MAX exists in perl
> and also small example I will appreciate it.
>
> Abukar
>
>
>
>
------------------------------
Date: Fri, 05 Feb 1999 14:34:19 -0700
From: Scott Wiersdorf <scott@iPartner.net>
Subject: NEWBIE regexp for web server conf file
Message-Id: <36BB63DB.89EB528F@cs.byu.edu>
Hi all,
I'm trying to match something like this:
<VirtualHost www.carpictures.com carpictures.com>
or this:
<VirtualHost www.carpictures.com>
or this:
<VirtualHost www.something.com something.com anotherthing.com ...
adnauseam.com>
where ... is any number of domain names.
I've tried this:
@host = map{ /(?:<[Vv]irtual[Hh]ost\s+)(?:(\S+)\s*)+>/ig }
which doesn't work, and I've tried other things which will only match
the first domain name. I'd like to grab all of the domain names on the
VirtualHost line (but not "<VirtualHost " or the last ">") and stick
them in an array. Can this be done with a nice regexp? Or should I
just grab the line and split() it?
Scott Wiersdorf (please reply both newsgroup and email if possible)
------------------------------
Date: Fri, 5 Feb 1999 15:33:38 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: NEWBIE regexp for web server conf file
Message-Id: <MPG.11251fafc6af70e69896a3@nntp1.ba.best.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <36BB63DB.89EB528F@cs.byu.edu>, scott@iPartner.net says...
> I'm trying to match something like this:
> <VirtualHost www.carpictures.com carpictures.com>
Oh, I'm really bad at this kind of thing but how about:
$_ = '<VirtualHost www.carpictures.com www.someplace.com>';
/^<VirtualHost/ig;
while ( /([^\s>]+)/gc ) {
print "found '$1'\n";
}
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Fri, 05 Feb 1999 22:44:42 GMT
From: "Monty Scroggins" <Monty.Scroggins@mci.com>
Subject: Performance Statistics
Message-Id: <uvKu2.123$dZ1.5657@news.cwix.com>
Does anybody have any statistics regarding the
performance of Perl versus shells and C ??
There is a study being done here at work as to which language
is to be used for some of our utilities, and there is a
resistance by the group to use any scripted language.
I wanted to see if I could get some statistics to
possibly convince the group that Perl might be the
best way to go..
Thanks
Monty
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Monty Scroggins MCI Telecommunications
Monty.Scroggins@mci.com
vnet: 766-1573 Voice: 972.729.1573
"If you really want something in life you
have to work for it. Now quiet, they're
about to announce the lottery numbers."..
- Homer Simpson
------------------------------
Date: Fri, 5 Feb 1999 16:09:38 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <x3yogn8r20n.fsf@tigre.matrox.com>
epement@jpusa.chi.il.us (Eric Pement) writes:
> Here is yet another Perl-Python comparison, entitled "What's Wrong
> With Perl?" URL is in Norway, but text is in English.
>
> http://www.stud.ifi.uio.no/~larsga/download/artikler/perl.html
I disagree on several points with the author of the above article. I
am not against Python by any means. In fact, I'm starting to read more
and more about it every day. But that specific article bothered me a
bit, and I want to comment on it.
1) He says Perl has lots of operators and special syntaxes. True. But
this can be seen as a feature. No one if forcing you to use
everything. In fact, I don't think anyone knows ALL of Perl!
2) He says "Reading someone else's code is difficult." That depends on
who that someone else is. I read other people Perl code and was able
to decipher everything 100%. But, Perl makes obfuscation easier, if
that's his point. I agree. But a bad programmer, is a bad
programmer. The language is not the issue.
3) He says "the documentation is hard to navigate". He shows an
example of how he was unable to find out how to turn off output
buffering very easily. Well, typing "% perldoc perlvar | grep
buffering" would have given him the answer in 2 seconds. I find
perldoc very handy and easy to use. I rarely consult anything other
than perldoc whenever I'm stuck at something.
4) He says "There are many Perl features built right into the
language." I just can't see why this is a Bad Thing (tm).
5) He says "It is hard to build data structures." He gives an example:
@b = ([(0.8,0.9,1)],2,3,4);
to acess the '0.8' for example, he tried $b[0]. But that pointed him to
the array. So he tried @b[0]. Which is of course wrong. He also claims
to having read perldsc "several times" without being able to get an
answer. If the author was unable to do something as easy as
dereferencing an array of references, then I would not count on his
experience to make any conclusions.
6) He says Python is better than Perl because of readability. That
might be true in general, but it really depends on the programmer.
7) He says that Python documentation is better than Perl's and
mentions a "program" that generates the documentation in various
formats. I wonder if that author knew about perldoc and the pod2*
scripts.
8) He says Python's data structures are easier to use than Perl's. I
wouldn't really comment on that since I don't know much of Python. But
from my limited knowledge I would tend to agree with him there.
My conclusion:
I would base anything on that article. I enjoyed reading it, but I
would rather have another opinion from someone that knows both Perl
and Python very well.
--Ala
PS. I intend to read more on Python in the next few days. I will try
to draw my own conclusions then and compare them with the others.
------------------------------
Date: Fri, 05 Feb 1999 21:16:37 GMT
From: bob.pruett@cox.com
Subject: Re: regex Help
Message-Id: <79fn3a$g8o$1@nnrp1.dejanews.com>
Thanks Larry I will give that a try. The sample code was pulled from my module
so and obviously not meant to run as presented just to show what was being
done. There is error checking and since it is in a module the shift $this is
needed.
I will give the push a try.
Thanks,
Bob
In article <MPG.11244a0558447087989a08@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
> [Posted and a courtesy copy mailed.]
>
> In article <79dud7$ct$1@nnrp1.dejanews.com> on Fri, 05 Feb 1999 05:09:00
> GMT, bob.pruett@cox.com <bob.pruett@cox.com> says...
> ...
> > My environment is Perl 5.004 running on Sun Solaris 2.51
> >
> > Here are the questions:
> >
> > 1. I have read that I can use qr// to precompile the expression. I have
tried
> > this and have had no luck. How do I precompile this expression? Will it
speed
> > the processing?
>
> Your regex is compiled once only, because there are no interpolations in
> it. You cannot speed this up.
>
> > 2. I have made the script use small strings instead of the whole file at
once.
> > This seemed to have sped it up greatly. What other regex tricks should I be
> > using?
>
> Not much that I can see. The '\s*' before '$END' should be eliminated,
> because any spaces will be eaten up into the captured match, but that
> shouldn't make a noticeable difference in speed.
>
> > 3. Should I abandon regex altogether and start walking through the string
> > manually?
>
> That is possible. You could search for '$BEGIN' and '$END' with
> index(), and use substr() to extract the intervening string. It might
> be faster. Only benchmarking will tell you for sure.
>
> > 4. This script does alot of concatenating of strings and I am concerned
about
> > garbage collection. Should I be? What can I do about it?
>
> Push each of the modified lines onto an array, then return join("",
> @array). This will avoid a lot of string concatenation.
>
> > Here is some sample code:
> >
> > open(FILE, $fname)
>
> Where is the test for failure and the terminating semicolon?
>
> > while(<FILE>)
> > {
> > $_ =~ s/\$BEGIN\s*([\w\.\s]*)\s*\$END/proc_tag($1)/ge;
> ^^^^^^ ^^^
> superfluous superfluous
>
> > $template .= $_;
>
> push @array, $_;
>
> > }
> > close(FILE);
> >
> > return $template;
>
> Where is the sub you are returning from?
>
> return join "", @array;
>
> > sub proc_tag {
> > my $this = shift;
> > my $tagstring = shift;
>
> This seems to be a function, not a method. There is only one argument.
> Why are you reading two?
>
> > # Parse template and replace template tags.
> > $replacement = "Do something to process the tags in here";
> >
> > return($replacement);
> > }
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 5 Feb 1999 23:40:46 GMT
From: JD Anderson <jd.anderson@boeing.com>
Subject: regular expression
Message-Id: <36BB817E.395A@boeing.com>
I need a pattern like this X.+Y except it must exclude the instance
XrrY.
------------------------------
Date: Fri, 5 Feb 1999 15:56:21 -0500
From: "Justin M. Silver" <jsilver@multisoft.com>
Subject: Server Push in IE3/4
Message-Id: <79flt2$j3m@netaxs.com>
Does anyone know if it is possible to do server push in IE. I know how to do
it in Netscape, and have found documentation on how to do it with IE 2 for
Mac and Win 3.1 (could anything be more useless?). If anyone knows, please
tell me. also if you have a sample script it would be greatly appreciated.
Thanks in advance,
Justin
--
--------------------------------------------------------
MultiSoft Incorporated
http://www.multisoft.com
Email: jsilver@multisoft.com
--------------------------------------------------------
------------------------------
Date: Fri, 5 Feb 1999 16:08:45 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
To: Pete Holsberg <pjh@mccc.edu>
Subject: Re: Simple Question About a Scalar
Message-Id: <Pine.A41.4.02.9902051605360.56640-100000@ginger.libs.uga.edu>
Try:
$date = `date +%m%d`;
instead of using 'system'. Otherwise you are storing the return code
(0) of 'system' (hey, it worked) in $date.
Cheers,
-Brad
On 5 Feb 1999, Pete Holsberg wrote:
...
> $date=system("date +%m%d");
...
> perl appends the numeric value, 0, and I end up with
...
------------------------------
Date: Fri, 05 Feb 1999 15:40:50 -0500
From: "Joel M. Whitesel" <jwhitesel@wcom.net>
Subject: Using HTTPS
Message-Id: <36BB5752.3AA4@wcom.net>
Everyone,
I would like to periodicly GET several HTML pages from an
internal server to verify that it is responding to requests.
I have a perl script that does this using the HTTP protocol
but was wonder if anyone has experience with the HTTPS protocol?
I would appreciate an example if possible or directions on how to
establish an HTTPS session. (References to documents, modules,
etc. are all welcome.)
Thanks in Advance,
Joel Whitesel
jwhitesel@wcom.net
What follows is part of my HTTP code:
#
# Create a User Agent variable with some default values.
#
my $ua = new LWP::UserAgent;
$ua->agent("Mozilla/3.0");
$ua->timeout(120);
#
# Make the request to the server
#
my $req = new HTTP::Request 'GET', "http://$site:$port/$page";
my $res = $ua->request($req);
#
# Process the response
#
if (! $res->is_success) {
my $server_status=$res->status_line;
# print $res->status_line."\n";
system("logger -p daemon.notice CRITICAL: $site HTTPD returned
$server_status"
);
------------------------------
Date: Fri, 05 Feb 1999 16:13:54 -0500
From: "Joel M. Whitesel" <jwhitesel@wcom.net>
Subject: Using HTTPS
Message-Id: <36BB5F12.36EE@wcom.net>
Everyone,
I would like to periodicly GET several HTML pages from an
internal server to verify that it is responding to requests.
I have a perl script that does this using the HTTP protocol
but was wonder if anyone has experience with the HTTPS protocol?
I would appreciate an example if possible or directions on how to
establish an HTTPS session. (References to documents, modules,
etc. are all welcome.)
Thanks in Advance,
Joel Whitesel
jwhitesel@wcom.net
What follows is part of my HTTP code:
#
# Create a User Agent variable with some default values.
#
my $ua = new LWP::UserAgent;
$ua->agent("Mozilla/3.0");
$ua->timeout(120);
#
# Make the request to the server
#
my $req = new HTTP::Request 'GET', "http://$site:$port/$page";
my $res = $ua->request($req);
#
# Process the response
#
if (! $res->is_success) {
my $server_status=$res->status_line;
# print $res->status_line."\n";
system("logger -p daemon.notice CRITICAL: $site HTTPD returned
$server_status"
);
------------------------------
Date: Fri, 5 Feb 1999 18:44:50 -0500
From: phenix@interpath.com (John Moreno)
Subject: What's happening with this hash?
Message-Id: <1dmrm9r.29a4rt1gk9nxsN@roxboro0-028.dyn.interpath.net>
I've got a short script:
#!perl -w
test();
sub test {
my @keys = qw{1 2 3 4};
my $i;
my %hash;
$\="\n";
foreach $i (@keys) {
print $i;
$hash{$i}++;
for (0..$i) {
$hash{$i}{'test'}++;
print " $i and ".$hash{$i}{'test'};
}
}
$i=1;
$hash{$i++}{'test'}=2;
$hash{$i++}{'test'}=5;
$i=1;
print $hash{$i++}{'test'};
print $hash{$i++}{'test'};
}
which produces:
1
1 and 1
1 and 2
2
2 and 3
2 and 4
2 and 5
3
3 and 6
3 and 7
3 and 8
3 and 9
4
4 and 10
4 and 11
4 and 12
4 and 13
4 and 14
5
5
which isn't what I expected at all, if I delete the loop then what's
left is what I'd expect (2 and 5);
If I use strict, I get a error message:
# Can't use string ("1") as a HASH ref while "strict refs" in use.
File 'Untitled #2'; Line 17
I know hashes aren't my strong suit, but I can't figure out what's going
on. Could someone please tell me what I'm doing wrong?
--
John Moreno
------------------------------
Date: Fri, 5 Feb 1999 14:17:57 -0800
From: "Dave Roth" <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Subject: Re: Win32::NetAdmin::UserGetAttributes problem
Message-Id: <C6Ku2.10729$e65.2288@news1.giganews.com>
keatlim@my-dejanews.com wrote in message
<79f7tt$2e5$1@nnrp1.dejanews.com>...
>I have a problem when using the NetAdmin::UserGetAttributes that the $flags
>come back as a number. Is there a way to convert the flags in numbers into
>readable format??
The following is from my book. It explains what the $Flags value can
represent.
To test the value returned by UserGetAttributes() try this:
print "Account is disabled.\n" if( $Flags & UF_ACCOUNTDISABLE );
print "Account's password does not expire.\n" if( $Flags &
UF_DONT_EXPIRE_PASSWD );
print "Account has been locked out.\n" if( $Flags & UF_LOCKOUT );
print "Account is a normal account.\n" if( $Flags & UF_NORMAL_ACCOUNT );
... you get the idea.
Hope this helps,
dave
----- From chapter 3 --------
The eighth parameter (to Win32::NetAdmin::UserGetAttributes() ) represents
the accounts option flags. These flags can consist of any number of flags
specified in Table 3.2 and one flag from Table 3.3. If you are setting this
then these options are logically OR'ed together. If you are testing for
these
flags you need to logically AND this parameter with the constant to test if
the
flag is set (a TRUE result indicates the flag is set).
Table 3.2 User account flags.
UF_ACCOUNTDISABLE......Disable the account.
When used with the Win32::NetAdmin::UserCreate()
function the account will be created but disabled.
UF_DONT_EXPIRE_PASSWD..The password for the account never expires.
UF_HOMEDIR_REQUIRED....A home directory is required (this flag is ignored
in Windows NT).
UF_PASSWD_CANT_CHANGE..The user will not be able to change the password,
only
Administrators and Account Operators can change it.
UF_PASSWD_NOTREQD......No password is required on this account. This
overrides
any policy that requires all accounts to have
passwords
and passwords must be a particular size.
UF_LOCKOUT.............The account is locked out. This is caused by too many
incorrect attempts to logon. This flag can not be set
but
it can be cleared if already set.
UF_SCRIPT..............This indicates that the logon script was executed.
Usually
you would check for this flag on an account if you
wanted
to know whether the accounts logon script was
executed
the last time the user logged on. For some reason the
Win32 API requires that this flag must be set when
creating
an account.
Table 3.3 Account types specified by a user and computer accounts flags.
UF_INTERDOMAIN_TRUST_ACCOUNT.....This type of account is used between
domains
that indicate a domain trust. This type of
account is used by a primary domain
controller
when connecting to another domain. A
domain
which trusts another domain will have an
account
of this type which the other domains PDC
will
logon using.
UF_NORMAL_ACCOUNT................This is used for a global user account.
This is
the type of user account that is typically
created.
UF_TEMP_DUPLICATE_ACCOUNT........This indicates a local user account. That
is when an
account is in another domain. The user can
use this
account to access the primary domain but
not domains
that trust this domain.
UF_SERVER_TRUST_ACCOUNT..........Backup Domain Controllers have a computer
account
of this type. This type of account
indicates that
this machine is a BDC for the primary
domain.
UF_WORKSTATION_TRUST_ACCOUNT.....This is the type of account that a server
(not a
domain controller) or a workstation
computer . If a
computer logs onto a domain using an
account of this
type then it is a member of the domain.
This is
used only with computer accounts.
--
=================================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
http://www.roth.net the illusion of integrity
Win32, Perl, C++, ODBC, Training
rothd at roth dot net
Our latest Perl book is now available:
"Win32 Perl Programming: The Standard Extensions"
http://www.roth.net/books/extensions/
------------------------------
Date: Tue, 02 Feb 1999 13:13:45 +0000
From: wsherrin <wsherrin@eccms1.dearborn.ford.com>
Subject: Would love UNIX program that could read Excel binary file...
Message-Id: <36B6FA09.A0690378@eccms1.dearborn.ford.com>
Hi techical friends -
Been surfing for a couple of days, but no luck...
Does anyone know of a FREE Magical Perl module or
package that could take an Excel Binary (BIFF) file
that has been ftp'd up to a UNIX (Solaris 2.5.1) Server, and
read the elements of the spreadsheet's cells that will
then eventually be sent to Oracle (v. 7.1.6).
The closest thing we have found so far is the
OLE-Storage module ver. 381. This "thingy" is on
many websites, newsgroups, etc. The source code
is actually pretty good. It only provides a way to read
the header info, however. And even then, I can't
seem to get it to work in tests...
If you are still reading this note, and want to know
the skinny of "why in the world do you want to do that?":
We have 48 end-user sites with many different browser
versions (NS 3 and 4; IE 3 and 4). There cannot be
any Software distribution solution (that is, we can't use
ODBC because of Legacy client server applications
that exist, etc., etc.) Our end-users have these fairly
complex Excel Templates (multiple worksheets,
200 columns, sums, possibly formulas, maybe 100s of
rows) that need to get to our Oracle database. These
are living and breathing documents, so training the users
to do a save as .csv is not ideal, and would have to be done
for each worksheet within the template. Then they would
have to upload through the web page, etc. (painful, huh?).
After watching a Plugin demo, I certainly would be
excited about that type of solution, but we are under
enormous time constraints, and we would still need to
have all of those different browsers and users get the
plugin DLL. The two possibilities right now, if we can't
get UNIX executable (technically doesn't have to be
Perl, but that is what the rest of our Application is written
in - i.e. we could use Java) to do the Excel read, is to
have a VB button in template that would parse out
file to text and ftp it in format we could parse out in
perl... or (backup solution#2) get an NT partition on our
WEB site so we can have access to all the Microsoft
products once the template is uploaded.
It's kinda messy... but fun. Anyway, thoughts and ideas
would be very welcome.
Thanks,
B I L
wsherrin@ford.com
734-266-8585
William A. Sherrin Southfield, MI 48075
IBM GLOBAL SERVICES 18000 West Nine Mile
Road I/T Architect Tel
248-552-6707
Fax 248-552-5669
------------------------------
Date: Fri, 05 Feb 1999 23:52:23 GMT
From: rob.nicholson@zetnet.co.uk (Rob Nicholson)
Subject: Re: Would love UNIX program that could read Excel binary file...
Message-Id: <36bd800c.7263786@news.zetnet.co.uk>
>that exist, etc., etc.) Our end-users have these fairly
>complex Excel Templates (multiple worksheets,
If your end user's have got Excel why not write an Excel addon (VBA)
that convert the workbook into a more usable format which is saved
automatically. They could then FTP this to your server.
It could be set-up so that an option "Export for Oracle" appeared on
the Tools menu.
I'd say you'd have more success attacking it from this end instead of
trying to find something that can read Excel format files which, if
they're anything like the Word format, are a real nightmare.
Rob.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4835
**************************************