[11141] in Perl-Users-Digest
Perl-Users Digest, Issue: 4741 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 25 08:07:46 1999
Date: Mon, 25 Jan 99 05:00:34 -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 Mon, 25 Jan 1999 Volume: 8 Number: 4741
Today's topics:
Can perl make popup window like Javascript leostar@mailcity.com
Re: CGI.pm ? How can i install CGI.pm to my Unix server <eugene@snailgem.org>
Re: CGI.pm File Upload <Steve_Kilbane@cegelecproj.co.uk>
Re: Cmpare PerlScript to VBScript and JScript <matthew.sergeant@eml.ericsson.se>
Re: Do you know a good Perl debugger free ? (Clay Irving)
FAQ: Ping Under Win32 (David Moore)
Re: Getting UNIX Filesystems list? <iqbal@orangenet.co.uk>
How I can use post method without form tag ? <claudio@ed-it.net>
Re: How I can use post method without form tag ? (brian d foy)
Re: Need a script to split an archive <era@iki.fi>
Re: OLE, parameter by reference, VARIANT DATE <matthew.sergeant@eml.ericsson.se>
Re: Perl & IIS problem <Steve_Kilbane@cegelecproj.co.uk>
Re: Perl Criticism [summary] <iqbal@orangenet.co.uk>
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism (Bart Lateur)
Re: Problem with dbm hash (Michael R Weholt)
UNIX fix_cr command exits something in DOS / Windows ? <claudio@ed-it.net>
Re: using search pattern <sasho@staff.mgu.bg>
Re: Web Based E-mail service in Perl? <iqbal@orangenet.co.uk>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 25 Jan 1999 10:19:56 GMT
From: leostar@mailcity.com
Subject: Can perl make popup window like Javascript
Message-Id: <78hgg8$aep$1@nnrp1.dejanews.com>
Hi
I just want to know that can perl/CGI make a Popup Window like
Jacascript. Because I see some page in Fortune city homepage when I click at
edit page, it will popup a new window. But when I look at the page source. I
can't see any code in Javascript Language.
Would anyone tell me how they do that? I would use it in my project.
Thanks for your help.
Red Wine
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 24 Jan 1999 23:37:37 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
To: Penta kathir <kspenta@netcom.ca>
Subject: Re: CGI.pm ? How can i install CGI.pm to my Unix server ..t hank
Message-Id: <36ABF511.89595CD7@snailgem.org>
Penta kathir wrote:
>
> Hi there
> I would like to install cgi.pm to my unix server ..could you please tell me
> how can i do it .. thanks in advance ..
http://stein.cshl.org/WWW/software/CGI/cgi_docs.html#installation
--
Eugene
"I have an Apache Web Server that uses CGI forms written in COBOL."
Post in clpm
------------------------------
Date: 25 Jan 1999 10:28:28 GMT
From: Steve Kilbane <Steve_Kilbane@cegelecproj.co.uk>
Subject: Re: CGI.pm File Upload
Message-Id: <78hh0c$28n$2@news.cegelecproj.co.uk>
In article <36A985EB.4C15974@earthling.net>, FK <fknetworxs@earthling.net> writes:
> running the script on the linux server the file is transfered
> correctly to the server and stored with the correct filename
> und file extension.
> running the programm under nt the file is also transferred
> to the server, but not with the correct filename and without
> any file extension (eg CGITEMP214243)
This is posting from the same machine, right? Sounds weird,
because AFAIK, what filename information is available is
entirely at the discretion of the browser, and they're all
different. Which means it's best not to rely on it anyway. :-/
steve
--
<Steve_Kilbane@cegelecproj.co.uk> - All opinions are mine alone.
IIS4+Perl5 FAQ: http://www.whitecrow.demon.co.uk/steve/iis4.html
------------------------------
Date: Mon, 25 Jan 1999 10:00:15 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Cmpare PerlScript to VBScript and JScript
Message-Id: <36AC40AF.DB57D802@eml.ericsson.se>
voronezh@geocities.com wrote:
>
> Can somebody compare PerlScript to VBScript or/and JScript from ASP point of
> view.
> I'd like to try using PerlScript instead of VB/JScript. I need to work with
> COM/MTS components and regular Web development stuff.
Well, if you like Perl, use PerlScript. If you like pain, use VBScript.
See my website for complete ASP documentation for PerlScript.
--
<Matt email="matt@teamamiga.org" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: 25 Jan 1999 07:59:21 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Do you know a good Perl debugger free ?
Message-Id: <78hpr9$ljd$1@panix.com>
In <78f7cf$idu$1@front3.grolier.fr> Jean Carfantan <jean@spirituel.com> writes:
>Do you know a good Perl debugger free ?
http://reference.perl.com/query.cgi?debug
--
Clay Irving
clay@panix.com
------------------------------
Date: Mon, 25 Jan 1999 12:06:38 GMT
From: djmoore@uh.edu (David Moore)
Subject: FAQ: Ping Under Win32
Message-Id: <36ac5653.192064524@news.uh.edu>
Frequently Asked Questions: How do I Ping With Win32 Perl?
VER: 0.01 (first draft)
DATE: 25 Jan 1999
AUTH: Dave Moore == djmoore@uh.edu
DISCLAIMER
I'm just figuring all this ou...
AAARRRRGGGGHHH! THE SUSPENSE IS KILLING ME! HOW DO I GET
PERL-5.004-OR-LATER PING TO WORK ON MY WIN32 SYSTEM?
Invoke Ping with:
$p = Net::Ping->new("icmp");
This overides the udp default protocol, which requires an
open echo port on the target host. For security reasons,
most sysadmins will not leave this port open to incoming
traffic.
Don't slam the door on your way out.
Now, as I was saying:
DISCLAIMER
I'm just figuring all this out as I go along. I'm a rank
newbie at Perl, so I don't have all the answers and some of
the ones I think I have are probably wrong.
Although everything here works for me, I haven't tested it
on anything other than my own desktop, an AMD K6 running NT
Workstation 4.0, SP3, build 1381. I'm using the Active
State port of Perl 5.005, build 509.
Use the information herein strictly at your own risk. It's
not my fault if you use this info in evil or foolish ways.
In particular, if you mess about in the control panels,
it's not my fault. Don't screw with it if it scares you.
If dizzyness, rash, or nausea occur, consult your doctor,
or give up your wicked silicon ways and take work in an
ice-house.
COPYRIGHT
This work is copyright 1999 by David John Moore, and is
released into the public domain for non-commercial use, if
anybody cares. But please, if you reproduce it, include
this notice. Email me at djmoore@uh.edu to discuss
commercial use. (As if.)
IS THERE IN FACT A PERL PING CLIENT THAT RUNS UNDER WIN32?
No. Go away and leave us alone.
WHAT?
Ha, ha, ha! Of course there's a Win32 Ping client, silly.
WELL, I THOUGHT SO, BUT I COULDN'T FIND IT AND I'VE LOOKED
/EVERYWHERE/.
*Sigh* I think "everywhere" does not mean what you think it
means. You're in large company, though. This question gets
asked repeatedly on the newsgroup comp.lang.perl.misc,
which is probably where you are now, since that's the only
place I've posted this to. Perhaps you've heard of
DejaNews....
JEEZ, DON'T BE SUCH A JERK. JUST TELL ME WHERE IT IS.
It's the same ping that works under UN*X. You can find it
in the Perl distribution, in drv:\Perl\lib\Net.
The documentation is in drv:\Perl\html\Net.
WHERE DO I GET THE PERL DISTRIBUTION?
<Kosh>You are not ready for Perl.</Kosh>
HA, HA, HA! NO, REALLY, WHERE DO I GET IT?
<Kosh>In fire.</Kosh>
Still with me? OK, then. Next question.
I CAN ONLY FIND SOMETHING CALLED PINGECHO. WHEN I TRY TO
USE IT, I GET AN "UNIMPLEMENTED FUNCTION" ERROR MESSAGE.
You are running a version of Perl older than 5.004, which
doesn't support Win32 process control. Pingecho depends on
alarm, a UN*X process control function, for time out;
therefore Pingecho just won't play on Win32. Get the update
and be done with it.
If anyone has a version of ping that will run on Win32
under older Perls, please email me at djmoore@uh.edu.
I'VE GOT 5.004 OR BETTER, I'M NOT CALLING PINGECHO, AND I
DON'T GET THE ERROR MESSAGE. WHY DOES THE SYNOPSIS EXAMPLE
JUST PAUSE FOR A SECOND OR TWO, THEN RETURN NOTHING?
You mean code like this, slightly modified from the
synopsis:
use Net::Ping;
$host = "yourhost.com";
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping($host);
$p->close();
YEAH, LIKE THAT.
First off, the Ping module defaults to the UDP protocol. A
UDP pinger requires that an UDP Echo port (port 7) be open
on the target host. While simple to code for, UDP is not
very robust or secure, and therefore, many admins don't
want to leave this port open for incoming traffic.
(You might also be trying to reach a bad hostname. In this
event, though, the delay will be much longer.)
OK, WHAT OTHER OPTIONS DO I HAVE?
The quick fix is to specify the ICMP protocol in your call,
thus:
$p = Net::Ping->new("ICMP");
But I decided to change the ping.pm code, so I'd never
have to worry about it again. (This example refers to
Russell Mosemann's code in the ActiveState Perl 5.005
distribution.)
About 31 lines down, under # Constants, find:
$def_proto = "udp"; # Default protocol to use for pinging
Change "udp" to "icmp", save the file, and you should be
good to go.
WHAT'S ICMP?
The Internet Control Message Protocol. It's a required part
of every TCP/IP installation which provides all kinds of
services for testing and managing one's network. In
particular, ICMP ping packets are very small. For a quick
review, see Microsoft's Knowledge Base article,
Q170292 Internet Control Message Protocol (ICMP) Basics.
(Get it over the Web from http:\\support.microsoft.com).
HEY! IT WORKS! HOW COME THAT'S NOT THE DEFAULT?
Because Perl was originally a UN*X tool, and most UN*X
systems require you to have root (admin) access to issue
ICMP requests (although all systems respond to them).
WELL, DUMMY, WHAT ABOUT TCP, AS IN TCP/IP? THAT'S GOT TO BE
EVERYWHERE, DOESN'T IT?
Try it. Go ahead, I'll wait.
OH. "The Unsupported function alarm function is
unimplemented at drv:\Perl\lib/Net/Ping/pm line 310.
WHA...??
Yeah, I thought that "function alarm function" was pretty
funny, too.
UH...I MEANT, WHAT DOES THE MESSAGE MEAN?
If you got this message, you are indeed working on a Win32
system. UN*X, which Perl was originally written for, has a
process control mechanism called "alarm" which can force an
overdue process to abort. Alarm is not supported on Win32,
which has really lousy process and threading capabilities
(or so I'm told by people who claim to know what they're
talking about).
For reasons I don't understand, Ping-TCP uses alarm for
timeouts. As noted above in the Pingecho discussion, this
used to be the only way, but UDP and ICMP work without it
now, so why not TCP? If nothing else, shouldn't the
protocol itself time out? If someone can explain this,
email me at djmoore@uh.edu, and I'll put it in the next
version of the FAQ.
I'M ON A REAL COMPUTER, BOY. THIS WORKED FINE FOR ME.
If this worked for you on UN*X, then I guess it should be
your default. Be careful with it though, because while TCP
is robust, reasonably secure, and certainly ubiquitous, it
also generates a lot of overhead traffic, so you don't want
to use it to, say, continually scan the thousands of
machines in your sprawling empire. If you need to do that,
you are probably an admin, have the requisite privileges,
already know all this, and are laughing at me for
staggering around dragging a stinking LoseMT box from my
scrawny, luser neck. If you're not an admin, why do you
think you need to do that? Talk to your admin and apologize
when she pulls a weapon on you. Maybe she won't call
security if you're humble enough, and bring along plenty of
chocolate-covered coffee beans to appease her with.
AREN'T THERE ANY WORKAROUNDS? I SPECIFICALLY NEED TO PING
THE TCP PORTS.
I think so, since the 5.004 build, anyway. See
drv:\Perl\html\lib\site\Win32\Process and Semaphore.
I don't understand Perl well enough yet to actually do the
conversion, plus there's this job thingy that I really,
really, really need to start paying some attention to....
Plus my Mom's in town this week, and I haven't gone over to
my sister's yet to see her.
I SPECIFICALLY NEED TO PING UDP OR TCP PORTS. HOW CAN I BE
SURE THESE PORTS ARE OPEN ON THE TARGET?
Use the Windows Telnet client to connect to the target's
Echo port. You will get a Connect Failed! dialogue if the
port is not open (if it is open, you can type). Or do some
fooling around with the "simple client" on page 261 of the
gecko book.
GECKO...?
/Learning Pearl on Win32 Systems./ See "Where Did You Get
Your Answers?", towards the bottom of this FAQ.
NO, NEITHER THE UDP OR THE TCP PORTS ARE THERE. MY TARGET
HOST IS A WINDOWS NT 4.0 BOX I HAVE ADMIN RIGHTS ON. HOW DO
I OPEN THEM?
How did you get admin rights without knowing this? Ahh,
never mind; Microsloth hides it pretty well. It took me a
whole thirty minutes to find it.
Simple TCP/IP Services provides TCP and UDP ports for
Echo(7), Daytime(13), Quote of the Day(17), and Character
Generator(19). It must be installed via the Network Control
Panel.
FAIR WARNING: If, after doing this, your mission-critical
enterprise NT server quits working; or crackers break in,
steal your secrets, infest your harddrive with viruses,
and impregnate your cat, it's NOT MY FAULT. Don't mess with
it unless you know what you're doing and are willing to
accept the consequences.
Are you sure icmp won't work for you?
Last chance...
OK, then.
- Be prepared to reboot, and have the CD to hand.
- Open up the Network control panel, and click on the
Services tab.
- Click Add... and select Simple TCP/IP Services.
- Click OK. Insert the CD if necessary.
- After you reboot the machine, re-install your last
service pack. Reboot again.
SIMPLE TCP/IP SERVICES IS THERE, BUT PING STILL DOESN'T
WORK.
- See above disclaimer.
- Be prepared to reboot.
- Reopen the Network CP.
- Click on the Protocols tab, select TCP/IP Protocol, and
click Properties....
- On the IP Address tab, click Advanced....
- If Enable Security is checked, click Configure.
Else, Cancel out of Network CP. #This isn't the problem.
- You should now be in the TCP/IP Security dialog.
Under the protocol of interest, be sure that either
Permit All is checked, or that the Echo port is listed
under Permit Only....
- You will, of course, have to reboot if you change any of
these settings.
OK, THAT'S ALL THERE. STILL DOESN'T WORK. NEXT?
Open the Services control panel, and make sure Simple
TCP/IP Services have been started.
TCP IS OK, BUT UDP STILL WON'T TALK TO ME.
There may be an additional issue if you or your target host
is running NT Server 4.0 Service Pack 4; I didn't have this
problem, though, so I didn't spend any time on it and
don't know a thing about it. See:
Q197511 "UDP Broadcast Issues with Service Pack 4 "
and related material on the MS support site.
ALL THAT'S FINE. PING STILL DOESN'T WORK, DAG NAB IT!
You have my sympathies. When you figure it out, email me at
djmoore@uh.edu, and I'll get it in the next version of this
FAQ.
DAVE, YOU ARE LIKE UNTO A VERY GOD! BUT THIS HUMBLE ONE
CRAVES FURTHER ENLIGHTENMENT. WHAT ABOUT...?
I've already written just about everything I know about
this, and probably wrote more than I ought. Post questions
to comp.lang.perl.misc, so we can learn together. I'm
egotistical enough that I'll be following the group closely
for a week or two after this first posting.
DAVE, YOU RAVING IDIOT! YOU HAVE NO IDEA WHAT YOU'RE
TALKING ABOUT!
Most Excellent! A learning opportunity! If you think the
questions are important enough to complain about my
answers, email me at djmoore@uh.edu, and I'll incorporate
your corrections in the next version. Or, of course, you
can always write your own FAQ.
NICE TRY, DAVE, BUT SOO N. SOUGH EXPLAINED IT TONS BETTER
IN HIS FAQ.
Glad to hear it. Please post the URL, or email it to me.
At least give me a good search term for DejaNews.
SPEAKING OF URLS, WHAT'S YOURS?
Uh...no do got. It's next on my list, I swear.
Email me at djmoore@uh.edu, subject: PingFAQ, and I'll
reply with a current copy. (Of this FAQ, not my to-do
list.)
I'M WILLING TO HOST IT ON MY WEBSITE.
You're making fun of the new guy, right? No? Well, then,
thank you very much. Please email me at djmoore@uh.edu with
the details.
WHERE DID YOU FIND YOUR ANSWERS?
To begin with, the CPAN and ActiveState docs, .pm and .pl
source, of course.
Dan Peterson routinely replies to "How do I ping...?" on
the comp.lang.perl.* hierarchy with a piece of code that
clued me in to icmp. Thanks for your patience with us
newbies, sir.
And Thank You, Deja News.
R.L. Schwartz, E. Olson, & T. Christiansen: /Learning Perl
on Win32 Systems/ (The gecko book), O'Reilly, 1997.
(The index needs to double in size, guys. And where's all
the Win32 process and network stuff I bought the book for
in the first place? Otherwise, great book, and well worth
the money. I can go a long way on this. The simple client
was crucial; I learned a lot playing with it.)
Microsoft:
Q170292 "Internet Control Message Protocol (ICMP) Basics"
Q197511 "UDP Broadcast Issues with Service Pack 4"
and
http://premium.microsoft.com/msdn/library/specs/platfrm2
/d1/s11962.htm
and
http://support.microsoft.com/support/ntserver/serviceware
/10140467.asp?FR=0
[Note: These URLs are subject to change. Use Advanced
Search at support.microsoft.com; that's what I did. Curse
MS for not putting reference numbers on everything!]
...And two, no, three everloving days of screwing around
with this crap instead of doing the simple little thing I
learned all this to do but don't have time for now. I hope
this FAQ saves someone else the trouble.
DAVE, YOU INSUFFERABLE JERK! I COME HERE FOR HELP AND YOU
INSULT ME BECAUSE I DON'T KNOW HOW TO GET THE DISTRIBUTION!
YOU DON'T KNOW HOW TO SPELL! YOU'RE POLLUTING THE PRECIOUS
BODILY FLUIDS OF PERL, USENET, AND OSS WITH GATESWARE! YOU
OFFENDED MY DEITY! YOU REQUESTED RESPONSES IN EMAIL! YOU
WASTED VALUABLE BANDWIDTH ON A TRIVIAL ISSUE I FIGURED OUT
TEN YEARS AGO! YOU USED ALL CAPS SO IT LOOKS LIKE I'M
SHOUTING ALL THE TIME!
You're shouting now, aren't you?
!!! YOU FREAKING LUSER PENCIL-DI...
>plonk<
--
Dave Moore == DJMoore@UH.EDu == I Speak For Me.
"...what we have here is not merely a one-time
lapse but rather a chronic silliness...."
-- Edward R. Tufte
------------------------------
Date: Mon, 25 Jan 1999 11:26:27 +0000
From: iqbal <iqbal@orangenet.co.uk>
Subject: Re: Getting UNIX Filesystems list?
Message-Id: <36AC54E3.177FB0F8@orangenet.co.uk>
Hi
Cant you just read the fstab file, or have I missed something
iqbal
Jonathan Stowe wrote:
>
> On Thu, 07 Jan 1999 16:20:56 GMT lethr@my-dejanews.com wrote:
> > Is there a good way to get a list of mounted filesystems within perl? (other
> > than using a system call or reading fstab). Ideally, I'd like to get results
> > similar to:
> >
> > df -k |awk '{print $7}' (or whatever field might have the filesystem /dir )
> >
>
> I would do *that* like:
>
> #!/usr/bin/perl
>
> open(DF,"/bin/df -k |") || die "Cant execute df - ";
>
> while(<DF>)
> {
> print +(split(' ',$_))[5],"\n" unless (/mounted/i);
> }
> close(DF) || die "Error in df";
>
> In effect you're going to have to something like that are read fstab
> without getting messy with some very system dependent stuff.
>
> /J\
> --
> Jonathan Stowe <jns@btinternet.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 25 Jan 1999 11:04:24 +0100
From: "Claudio Villa Santa" <claudio@ed-it.net>
Subject: How I can use post method without form tag ?
Message-Id: <78hfhh$adh$1@news0-alterdial.uu.net>
Hi,
I have a little problem I need to do a direct calling of a perl program,
something about this:
<a src="database.cgi?first=34&second=67">Send values</a>
but with more variable, and standard GET method send only first 256byte.
How I can send it whit POST method?
Thanks to all.
Claudio
------------------------------
Date: Mon, 25 Jan 1999 05:14:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How I can use post method without form tag ?
Message-Id: <comdog-ya02408000R2501990514110001@news.panix.com>
In article <78hfhh$adh$1@news0-alterdial.uu.net>, "Claudio Villa Santa" <claudio@ed-it.net> posted:
> Hi,
>
> I have a little problem I need to do a direct calling of a perl program,
> something about this:
>
> <a src="database.cgi?first=34&second=67">Send values</a>
>
> but with more variable, and standard GET method send only first 256byte.
>
> How I can send it whit POST method?
to do it directly with HTML you will need a form. however, you may
consider creating a wrapper for your CGI script that will supply
the appropriate values so you can have a tag like
<a href="db_wrapper?setup1">Send values</a>
there are a variety of ways to accomplish this, and CGI.pm with saved
states would greatly ease the pain :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 25 Jan 1999 14:22:25 +0200
From: era eriksson <era@iki.fi>
To: dans@ans.net (Dan Simoes)
Subject: Re: Need a script to split an archive
Message-Id: <rb3e4zy22m.fsf@tuuri.ling.helsinki.fi>
On 24 Jan 1999 14:21:50 -0500, dans@ans.net (Dan Simoes) posted to
comp.mail.misc, comp.lang.perl.misc:
> I'm looking for a script that does the following:
> Input is an archive named foo, with mail messages from several dates.
> Output should be files in the format:
> foo.YYMMDD
> where only messages from that date are contained in that file.
Procmail is very good at stuff like this, with all the twists that you
asked for. The date parsing can be a bit tough, though. Try adding
Alan Stebbens' library to the soup and you should be all set.
See <http://www.iki.fi/~era/procmail/links.html>
/* era */
--
.obBotBait: It shouldn't even matter whether <http://www.iki.fi/~era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>
------------------------------
Date: Mon, 25 Jan 1999 10:01:37 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: OLE, parameter by reference, VARIANT DATE
Message-Id: <36AC4101.BB98AF31@eml.ericsson.se>
voronezh@geocities.com wrote:
>
> I'm trying to understand if ActiveSatte Perl and PerlScript meets my needs. I
> have couple questions: -- I have COM component (C++) with method foo( [out]
> VARIANT *p1 ). Can I call this method from Perl and get data beck into p1 ? I
> mean that paramenter should be passed by reference. Does it work? Dow it work
> with all VARIANT subtypes? -- I'm useing OLE DATE type in my COM components.
> I would like to have set of functions to work with this type of DATE, e.g.
> add/subtract dates, get week day, convert to string, etc. Is it possible from
> Perl ? Is there any special library/module to do it?
perldoc Win32::OLE::Variant
That'll tell you all the good news you want.
--
<Matt email="matt@teamamiga.org" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: 25 Jan 1999 10:24:28 GMT
From: Steve Kilbane <Steve_Kilbane@cegelecproj.co.uk>
Subject: Re: Perl & IIS problem
Message-Id: <78hgos$28n$1@news.cegelecproj.co.uk>
In article <36A8F3B4.D5009615@u.washington.edu>, "E. Kolve" <drdoctor@u.washington.edu> writes:
> I have installed activestate's perl distribution for NT and I am able to
> run your basic "hello world" app, but when I try to run a perl script
> that uses the WIN32 module, or any module for that matter, the program
> crashes and no output is returned.
Is it just me, or is this purely a Perl question? I.e. not involving IIS?
In which case, the comp.lang.perl hierarchy would be more appropriate.
However...
>From what I've read, ActiveState's more recent ports are based on
the common Perl source, and I'm therefore not convinced that they
use the win32 modules any more - I thought that they were a
stop-gap. But *please* don't take my word for it, because I've never
used either myself, and this is just from memory. I'm offering it
as an avenue to explore, not as an answer.
steve
--
<Steve_Kilbane@cegelecproj.co.uk> - All opinions are mine alone.
IIS4+Perl5 FAQ: http://www.whitecrow.demon.co.uk/steve/iis4.html
------------------------------
Date: Mon, 25 Jan 1999 11:10:59 +0000
From: iqbal <iqbal@orangenet.co.uk>
Subject: Re: Perl Criticism [summary]
Message-Id: <36AC5143.5C56BD0D@orangenet.co.uk>
Hi
Dont suppose anyone has a summary to this thread :-)
Iqbal
------------------------------
Date: 25 Jan 1999 11:07:24 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7aok3d.doa.dformosa@godzilla.zeta.org.au>
In article <78gor6$pvb$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <36aba8a7.291102@news.skynet.be>,
[...]
>> This is one of my favorite examples too. The second solution (let's call
>> it "the C-like version") feels patricularily awkward, because it puts
>> the stress on the "if". The fact that it opens a file, is a mere side
>> effect which could just a well be ignored. Well, that what it looks
>> like.
>>
>
>How do you measure where the "stress" is?
Eany Meany miny mo
Catch a nicker by the toe
If he screams let him go
Eany Meany miny mo
How do you measure where the stress is in that simple poem? Stress is
a concept of lituriturs. Its the idear that two sentences that have
equivelent meaning can have a different ambionce. In essence your
getting an addtional leavle of documentation.
>IF statements are very important to program flow.
>I also think it is a mistake to put an 'end program'
>to the far right.
But its not an end program, its a "throw excption". Now in most
cases this is equivelent to end program but it has a very diffrent
meaning. It means "Something when horrably wrong" while "exit" means,
i've finshed.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: 25 Jan 1999 11:12:30 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7aokcu.doa.dformosa@godzilla.zeta.org.au>
In article <78gpaq$qa9$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
[...]
>> 2. Your main complaint against Perl seems to be that there is more
>> than one way to do something, and you especcialy dislike using
>> shortcut boolean operators in place of conditionals.
>
>
>"Shortcut" I think not. My language suggestions provide for:
>
>
>If not open(handle,filename) do die "Cant open $filename$"
I think yoiu missunderstand the meaning of "shortcut" with regards to
boolean operators. Now in most langages a very simple optimisation is
done. Basicly if the compliler/interprator works out that a logical
espression's value can be retured without further evaluation it
doesn't continue with the operation. This is noramly call "shortcut
booleans".
Because of this nature they can be used to emulate control structures
such as ifs.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: 25 Jan 1999 11:19:23 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7aokps.doa.dformosa@godzilla.zeta.org.au>
In article <78gq6h$qq2$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <fl_aggie-2401991214540001@aggie.coaps.fsu.edu>,
> fl_aggie@thepentagon.com (I R A Aggie) wrote:
[...]
>> Because it allows you to express beauty in your code? topmind would likely
>> ban Perl Poetry.
>
>"express beauty in your code?" Exactly what is that?
If have not yet understood the estetics of code, if you have not
understood why some forms are considered butifal and outhers ugly, if
you don't understand what is the art of computer programing, then you
will not understand perl.
>Is that a selling point in your Perl brochure?
It is to perl programers.
>"How will that help my bottom line?" a manager may ask.
I will allow me to remain relativly sane and not tare my fur out
struggling with things I can't do because you just don't do things
like that in that langage.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: Mon, 25 Jan 1999 11:34:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Criticism
Message-Id: <36ac5310.4130744@news.skynet.be>
topmind@technologist.com wrote:
>How do you measure where the "stress" is?
To me, it's the first thing that hits ytou in the face when you see a
statement.
>IF statements are very important to program flow.
Indeed. So the first thionk you see is "It's an if. Control flow."
That is wrong. The stress should be: "It's a file open. It has a fail
check."
>I also think it is a mistake to put an 'end program'
>to the far right.
Except that it's actually an error. VB for example simply pops up a
messagebox saying "Cannot open file", and then quits the program.
NOTHING in the code indicates this can happen.
>Anyhow, I prefer that OPEN *return* a file handle, which
>is negative if error. Example:
>
> handle = open(filename)
> if handle < 0
> die "Problem opening file $filename$"
> endif
At least, the sequence is apparent in this snippet. That is good.
But talk about programming dangers: There's nothing to stop C inspired
programmers from converting into:
if (handle = open(filename)) < 0 then
die "Problem opening file $filename$"
endif
which feels wrong.
While we're at it, this question was recently asked in the VB newgroup
by a newbie (paraphrased):
> Is VB intelligent enough to know in an OR expression to know, if the
> left side of the OR is True, that it doesn't need to calculate the
> right side as well?
If a() or b() then
do something
else
do something else
end if
TYhe answer is: NO. b() can be a very longwinded function call, and if
a() yields true, the answer of b() is irrelevant. But VB first
calculates both results, and *then* combines the results.
So a efficiency aware programmer must convert this into:
if a() then
do something
else if b() then
do something
else
do something else
end if
Note that now, you need to repeat the SAME statements in the first and
second conditional. That is FAR WORSE than short-circuiting in the OR.
One more example:
if b = 0 or a / b > 2 then
do something
end if
You *need* the short-cicuiting here, because if b is zero, executing the
second statement would give you a fatal error. Do you really prefer
that?
Bart.
------------------------------
Date: Mon, 25 Jan 1999 12:21:26 GMT
From: awnbreel@panix.com (Michael R Weholt)
Subject: Re: Problem with dbm hash
Message-Id: <78hnk6$rg_002@mrw.panix.com>
In article <36abd950.1027010068@news.coredcs.com>,
root@coredcs.com (Steve) wrote:
>
>On a related note to MLDBM - maybe I'm just not grasping the concept
>of how to optimize it. Are there any other docs or examples working
>with it other than the docs and man page for it?
Getting MLDBM to work for you is probably the best solution (I can't
help you there since I've never used it). However, depending on how
much data you are talking about in the $value, there's a quick&dirty
solution I use that might work for you. I just '.' the separate
"fields" with a tab character (\t) and store them as one scalar, and
then to retrieve I split on the tab. I'm just using the db stuff that
comes with the standard distribution of perl (SDBM) which limits the
size of the $value to 1KB, but I don't believe the others (NDBM, GDBM)
have that limitation. It's probably a hokey solution, but it has
nevertheless worked for me so far.
In short:
to store:
$hash{$key} = $date."\t".$author."\t".$subject;
to retrieve:
($date,$author,$subject) = split /\t/, $hash{$key};
--
mrw
------------------------------
Date: Mon, 25 Jan 1999 11:06:34 +0100
From: "Claudio Villa Santa" <claudio@ed-it.net>
Subject: UNIX fix_cr command exits something in DOS / Windows ?
Message-Id: <78hfla$aee$1@news0-alterdial.uu.net>
Hi,
Someone Know if exist a DOS or Windows program that doing some work of
'fix_cr' UNIX command ?
Thanks
Claudio
------------------------------
Date: Mon, 25 Jan 1999 12:25:51 +0200
From: Alexander Avtanski <sasho@staff.mgu.bg>
Subject: Re: using search pattern
Message-Id: <36AC46AF.D066C726@staff.mgu.bg>
> How would I extract the last.html file from the string below?
>
> /dir/dir/last.html
m!/([^/]*)$!
What you need is in $1
------------------------------
Date: Mon, 25 Jan 1999 12:02:09 +0000
From: iqbal <iqbal@orangenet.co.uk>
Subject: Re: Web Based E-mail service in Perl?
Message-Id: <36AC5D41.5A339BCC@orangenet.co.uk>
Hi
I've wriiten a few systems like that, using both perl and Cold Fusion.
They allow users to come onto the site create their email boxes amend
passwords etc etc and also change ther email address.
Problem is with the backend. I run Mysql for the DB, with cucipop as my
pop server and exim as my MTA, this allows me to configure everything
that I require.
The reason I use this combo, is that I can get the web page to
authenticate from the DB, then pull up the addresses from the DB, make
alteration, and then run cron job to write out the new details to the
alias files or system password files.
Iqbal
Pim Megens wrote:
>
> Hi,
>
> I want to offer my site visitors a free e-mail account like
> <name>@<mypage.com>. Does anyone know if there's a Perl script available on
> the www what can do this for me?
>
> I like to hear from you soon!
>
> Kindest regards,
>
> P. Megens
> The Netherlands
------------------------------
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 4741
**************************************