[8172] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1790 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 2 15:12:33 1998

Date: Mon, 2 Feb 98 12:00:29 -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, 2 Feb 1998     Volume: 8 Number: 1790

Today's topics:
    Re: 5 REAL languages (was: Re: AOL SPAM) (John Moreno)
    Re: [utility] submit "unix_command" <*@qz.to>
    Re: ANNOUNCE: YAWP 0.01 jeffiv@cwcinc.com
        Another way to become a Perl Wizard (tm) (Steve Linberg)
    Re: crypt in perl CGI <scottj@mthcsc.wfu.edu>
        dbm files (Carol Lynn Smith)
    Re: don't kill me, but Gerben_Wierda@RnA.nl
    Re: don't kill me, but (Jonathan Stowe)
    Re: Embedded (depth) parseing as a regular expression i <*@qz.to>
    Re: Error with analysis of system () return value on Pe <jdporter@min.net>
    Re: Error with analysis of system () return value on Pe <vallon@fez.fi.bear.com>
    Re: Freidl's book mystery (Ilya Zakharevich)
    Re: Freidl's book mystery (Chip Salzenberg)
        GUIDs returned by recordsets under Win32 (Steven M. Glassman)
    Re: mkdir and mkdir -p (Gabor)
        Multi-line blocks of text <alphen@craxx.com>
    Re: New Perl-Oriented Web Site has materials not availa <jdporter@min.net>
    Re: Parsing Word Docs <cmargoli@world.northgrum.com>
        Perl & HL7 (Larry Flippo)
    Re: perl and dde in windows NT (Gurusamy Sarathy)
        Scripts For Automating Adding Users Via Web Interface <ggraham@micrord.com>
    Re: Survival Of perl <jdporter@min.net>
        tests fail for perl5.004_03 and perl5.004_04 under AIX- (Mark G. Thomas)
    Re: Text::ParseWords vs. Split <vallon@fez.fi.bear.com>
    Re: Trying to find good PERL book (Dave O.)
    Re: Trying to find good PERL book (Gabor)
    Re: TYP21D (was: substitute...) (Tom Grydeland)
    Re: Using Net::SMTP script as WinNT replacement of send (Neil Briscoe)
    Re: Want to determine the subnet networks from a networ <jdporter@min.net>
    Re: When was perl created? <jdporter@min.net>
    Re: White Hats and Black (broadfield)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 2 Feb 1998 13:40:35 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: 5 REAL languages (was: Re: AOL SPAM)
Message-Id: <1d3tocp.19g7sz31moclmhN@roxboro0-012.dyn.interpath.net>

Sitaram Chamarty <sitaram@diac.com> wrote:

> On 28 Jan 1998 12:21:06 -0500, Adam Turoff <ziggy@panix.com> wrote:
> > John Porter  <jdporter@min.net> wrote:
> >>[...]
> >>
> >>This also confirms my suspicion that there are in fact only five
> >>programming languages.  (As if C and Java have anything in common
> >>besides curly braces.)
> >
> >I assume you mean (not necessarily in order):
> > C/C++/Java, FORTRAN, Assembly Language, COBOL, Lithp/Scheme.
> >
> >Where does perl fall into that list?
> 
> One ring to hold them all
> One ring to find them
> One ring to (I forgot)
> And in the darkness bind them

I'ver read about this recently but it went like this:

Recently one of my friends, a computer wizard, payed me a visit.
As we were talking I mentioned that I had recently installed
Windows 95 on my PC, I told him how happy I was with this operating
system and showed him the Windows 95 CD. Too my surprise he threw
it into my micro-wave oven and turned on the oven. Instantly I got
very upset, because the CD had become precious to me, but he said:
'Do not worry, it is unharmed.' After a few minutes he took the CD
out, gave it to me and said: 'Take a close look at it.' To my
surprise the CD was quite cold to hold and it seemed to be heavier
than before. At first I could not see anything, but on the inner
edge of the central hole I saw a inscription, an inscription finer
than anything I have ever seen before. The inscription shone
piercingly bright, and yet remote, as if out of a great depth:

4F6E65204F5320746F2072756C65207468656D20616C6C2C204F6E65204F53
20746F2066696E64207468656D2C204F6E65204F5320746F206272696E67
207468656D20616C6C20616E6420696E20746865206461726B6E657373
2062696E64207468656D

'I cannot understand the fiery letters,' I said.
'No but I can,' he said. 'The letters are Hex, of an ancient mode,
but the language is that of Microsoft, which I shall not utter
here. But in common English this is what it says:'

       One OS to rule them all, One OS to find them,
       One OS to bring them all and in the darkness bind them


-- 
John Moreno


------------------------------

Date: 2 Feb 1998 19:17:38 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: [utility] submit "unix_command"
Message-Id: <qz$9802021405@qz.little-neck.ny.us>

Michael Wang <mwang@alhena.ibk.ml.com> wrote:
>     submit allows you disconnect from the system after submitting a
>     unix_command. submit spawns a child process to execute unix_command, 
>     and then exits. The child process is adopted by init, and runs 
>     independent of the parent. 

Did you just reinvent "nohup unix_command &"?

Elijah
------
fails to see the advantage of this over nohup anyway


------------------------------

Date: Mon, 02 Feb 1998 13:11:53 -0600
From: jeffiv@cwcinc.com
Subject: Re: ANNOUNCE: YAWP 0.01
Message-Id: <886446614.955187201@dejanews.com>

I urge you to add a link to your module in the directory at the URL below.

Kind regards,
Jeff Iverson
--
 The Directory of Computer Consultants & Developers
     http://www.iversonsoftware.com/service.html
     21 Devonshire Pl., Mankato MN  56001-4984
     507-386-6208 - j5rson@iversonsoftware.com

In article <886319374.855441420@dejanews.com>,
  maurice@hevanet.com wrote:
>
> YAWP 0.01 (Yet Another Web Pre-processor)
>
>   This module is an HTML pre-processor for use within CGI scripts.
>   It accepts specially written HTML documents, transforms them, and
>   then displays the resulting HTML.  This helps to separate the
>   code from the display information, and often makes web sites more
>   maintainable, flexible, and pretty.
>
>   YAWP recognizes special, proprietary tags within your HTML
>   documents which, when processed by this module, allow variable
>   interpolation and encoding, flow-control, inclusion of other
>   documents, and the execution of Perl code.
>
> Please see the POD for details.  Comments, suggestions, and criticisms
> may be directed to <maurice@hevanet.com>.
>
> The module may be obtained at:
>
>   http://olympia2.adhost.com/~maurice/YAWP-0.01.tar.gz
>
> Maurice Aubrey <maurice@hevanet.com>
>
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


------------------------------

Date: Mon, 02 Feb 1998 13:14:39 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Another way to become a Perl Wizard (tm)
Message-Id: <linberg-0202981314390001@projdirc.literacy.upenn.edu>

If you want to speed your journey towards Perl Wizardry, here's one
suggestion (besides read the documentation, read it again, write some
code, debug, read more documentation, lather, rinse, repeat  which is
also very good):

Pop into some discussion in c.l.p.m where you have some inkling of
background about what's going on, but where you couldn't really
productively contribute.  For me, I set my newsreader to flag good people
like Randal Schwartz and Tom Christiansen, Tim Bunce, Tom Phoenix, Abigal,
Chip Salzenberg, Brian D Foy, and other helpful folks, which is usually a
good indicator that there's interesting stuff going on.  Find some code
they gave to solve some flailing, suffering soul which you can't make
heads or tails of.  Print it.  Study it.  Find out why it works.  (Bonus
points if you find out that it *doesn't* work AND you can explain why.)

Repeat once a week.  Watch your brain swell.  Amaze your friends!  Then
start answering people's questions.  Planet Earth becomes a better place. 
Everyone lives longer and enjoys the weekends more.

With fond thanks to all of the luminaries in this group that I incessantly
learn from,

Steve Linberg
NCAL Tech Monkey

-- 
Steve Linberg                  |    National Center on Adult Literacy
Systems Programmer etc.        |           University of Pennsylvania
linberg@literacy.upenn.edu     |        http://www.literacyonline.org


------------------------------

Date: Mon, 02 Feb 1998 14:32:05 -0500
From: Kevin Scott <scottj@mthcsc.wfu.edu>
Subject: Re: crypt in perl CGI
Message-Id: <34D61F35.C7720B05@mthcsc.wfu.edu>

Frederic Francken wrote:
> 
> Can anyone help me with writing a small script which generates a 
> password file using the crypt routine as htpasswd does?

[snip]

There was a thread about two weeks ago that addressed this very issue. 
I even posted a crude little script which you could modify to suit your
needs.  You can probably find it at http:\\www.dejanews.com.  

Brian D Foy rightly pointed out in a subsequent post that my little
script does not check for duplicate user names in the generated password
file.

Good luck.

-- 
******  Kevin Scott
********  Department of Mathematics & Computer Science
********  Wake Forest University
******  scottj@mthcsc.wfu.edu

-- 
******  Kevin Scott
********  Department of Mathematics & Computer Science
********  Wake Forest University
******  scottj@mthcsc.wfu.edu


------------------------------

Date: Mon, 02 Feb 1998 19:06:06 GMT
From: carols@sabre.com (Carol Lynn Smith)
Subject: dbm files
Message-Id: <34d617a7.961543@news.amrcorp.com>

Hi,
I have a two-fold question regarding dbmfiles  that I am using to
store employee information:
1.  Is there a size restriction on either the .dir or .pag files?  I
am storing key/value pairs and I can't create my 29th one. 
2.  How do I sort by value?  FYI, my key is a record number I assign,
but I would like to sort by last name, which makes up part of the
value (in essence, I have a value that might look like this -
Smith:Carol:46762:1-8765:13L81:etc.).
Thanks in advance.
Carol


------------------------------

Date: Mon, 2 Feb 1998 17:30:39 GMT
From: Gerben_Wierda@RnA.nl
Subject: Re: don't kill me, but
Message-Id: <EnrHz3.LAy@RnA.NL>

sloop@mailcity.com (Dave O.) wrote:
>Now to run that script all you must do is type its name.  

unless the unlikely case that directory you're in is not part of your path. 
In case you get 'command not found' too, try ./hello.pl instead of hello.pl


-- 
Gerben_Wierda@RnA.nl (Gerben Wierda)
"If you don't know where you're going, any road will take you there"
Paraphrased in Alice in Wonderland, originally from the Talmud.

Dass man fuer die Philosophie ein Interesse zeigt, bezeugt noch keine
Bereitschaft zum Denken -- Martin Heidegger


------------------------------

Date: 2 Feb 1998 19:26:24 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: don't kill me, but
Message-Id: <6b56l0$c0a$1@plutonium.btinternet.com>

In article <34d4b584.85238096@news.xmission.com>, sloop@mailcity.com says...
>
><snip>
>Try this: first enter your account's unix shell and type, "whereis
>perl"
>
If "whereis" doesnt work on your system you may have to use "whence" or
"which" depending on your OS.

but all the rest is the same.

Jonathan



------------------------------

Date: 2 Feb 1998 19:06:01 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Embedded (depth) parseing as a regular expression in Perl??
Message-Id: <qz$9802021351@qz.little-neck.ny.us>

Richard E. Stout <rstout@spry.com> wrote:
> Below is a sample of a parser that I am currently using.
> I have a few simple ( or maybe not so simple ) questions.

Simple questions.

>    Any ideas on how to get embedded (depth) parseing to work correctly
> as a regex?

Don't do it.

Perl regular expressions are powerful, more powerful than
mathematically pure REs, but they cannot do this in a general manner
(yet). The development versions of perl would let you do this, but
it is not pretty, and do you really want to use a development
version of perl?

>    I have worked out a few other ways of doing this, but they all
> involve the burt  
>    force method.  Like creating a second string and re-tagging the start
> and end tags

Your line folding is pretty ugly. The best way to do something like
this is with a proper grammar and a state machine for it.

Elijah
------
a textbook on compiler design may be useful


------------------------------

Date: Mon, 02 Feb 1998 14:28:30 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Error with analysis of system () return value on Perl book page 230
Message-Id: <34D61E5E.2C5E@min.net>

Michael Wang wrote:
> 
>   I believe the example analyzing the return value of system()
> on Perl book page 230 is wrong.

I certainly don't blame you for being confused.  But you're wrong.

The return value is weird bitmasked value.  The upper byte is the
exit status of the child, which it passed to its exit() call.
The lower byte contains the number of the signal which hit the child
-- zero, if no signal.  Also, the high bit of the low byte is set
if the child dumped core.  Generally, the high byte is valid only if
the low byte is 0.

So if the return value was 0x88, that's 0x0088; the low byte is not
zero, so ignore the high byte.  You can see that the high bit (of
the low byte) is set -- that means the child dumped core.  Mask
away that bit, and you have 8.  This is the signal number.
Look up this number in man -s 5 signal (e.g.) and you find SIGFPE:
Floating-point exception.  (You know it's divide by zero.)

hth,
John Porter


------------------------------

Date: 02 Feb 1998 14:44:58 -0500
From: Justin Vallon <vallon@fez.fi.bear.com>
To: mwang@alhena.ibk.ml.com
Subject: Re: Error with analysis of system () return value on Perl book page 230
Message-Id: <x6elnvtn64l.fsf@fez.fi.bear.com>

mwang@alhena.ibk.ml.com (Michael Wang) writes:

> Hello Perl experts:

I'll try my best.

[...]

>   I can use the following example to prove it is wrong:
>      1. compile the following C program to build a.out
>         main()
>         {
>           int i;
>           i = 1 / 0;
>          }

Or:  echo 'kill -SEGV $$' > segv.sh ; chmod +x segv.sh

>       2. perl -e 'system(/path/a.out); print $?;'
>          And the exit code is 136 = 0x88

perl5 -e 'system "./segv.sh"; print $?'
=> 139 = 0x8B = 0x80 + 0x0B = coredumped + signal 11 = coredump + SEGV

>       3. if you use the perl script on the Perl book page 230 to
>          analyze the code, then it would print:
>          ran with non-zero exit status 0
>          which does not make any sense. 

When I run 'EXIT_STATUS(136)', I get: 
   terminated abnormally, signal: 8and coredumped

Which is poorly formattted, but right.

On 139:
   terminated abnormally, signal: 11and coredumped

Which is what I would expect.

> 
>   I have return a subroutine to analyze the return by exactly
> following wait.h, which attached at the end. For above example, 
> it will print:
> 
> terminated abnormally, signal: 8
> and coredumped
> 
> which is correct. 

Agreed.

> 
>   BTW, why WEXITSTATUS 255 (return value from the system() call: 0xFF00)
> means "the command failed"? It is a C tradition or a specification?
> Can you cite me the reference?  

That 255 exit status is different from sh's exit:

  print "system testing ";
  print system "testing";
  print "\n";
  
  print "system testing * ";
  print system "testing *";
  print "\n";

  print "system 'sh -c testing' ";
  print system 'sh -c testing';
  print "\n";

Gives:

  system testing 65280  # 0xFF00
  sh: testing:  not found.
  system testing * 32512  # 0x7F00
  sh: testing:  not found.
  system 'sh -c testing' 32512 # 0x7F00

sh returns 127.  When there are shell meta-characters, perl calls sh.  
Otherwise, it tries to run the command itself.  It seems to be returning 
exit 255 if 'testing' cannot be exec'ed.

>                                 And I do not really know what the 
> "process stopped" and "process continued" mean. Does not mean 
> kill -STOP and kill -CONT? At what conditions it happens?

Process stopped and continued are SIGSTOP and SIGCONT, as you observed.  
You can stop a process cold with 'kill -STOP' and resume it with '-CONT'.
Debuggers may also use the signal.

-- 
-Justin
vallon@bear.com


------------------------------

Date: 2 Feb 1998 18:13:33 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Freidl's book mystery
Message-Id: <6b52cd$hfc$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Chip Salzenberg
<chip@pobox.com>],
who wrote in article <6arltv$9of$1@cyprus.atlantic.net>:
> > ... found the reason in your faulty patch.
> 
> I contest the word "faulty".  The patch fixed access of freed memory.
> In no way can fix be considered a bad thing -- not by those who
> properly value reliability, anyway -- because without the fix, Perl's
> behavior was not always correct.  "If you don't care about getting the
> right answer, I can get it as fast as you want."

I applaud your efforts to make Perl into the clean.

I hate when was working before does not work any more, *and there is
no way to make it work*.  (Yes, sometimes 10000x slowdown is
equivalent to not working.)

I'm sure that you did not know about the slowdown when you created
this patch, so IMO you are clean of any charge.

What is the difference is that IMO on your place most people would
revert your patch the moment you were explained it makes an important
Perl idiom useless outside of toy rooms.

Ilya


------------------------------

Date: Mon, 02 Feb 1998 19:33:16 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Freidl's book mystery
Message-Id: <6b575d$oj1$1@cyprus.atlantic.net>

According to ilya@math.ohio-state.edu (Ilya Zakharevich):
>Chip writes:
>> ... without the fix, Perl's behavior was not always correct.
>> "If you don't care about getting the right answer, I can get
>> it as fast as you want."
>
>I applaud your efforts to make Perl into the clean.

Thank you.

>I hate when was working before does not work any more, *and there is
>no way to make it work*.  (Yes, sometimes 10000x slowdown is
>equivalent to not working.)

First, the "10000" is fiction.

Second, making Perl never report the wrong answer is a bug fix, even
though it be an apparent (I emphasize *apparent*) inconvience.  What
use is a fast program if you can't trust it?

>What is the difference is that IMO on your place most people would
>revert your patch the moment you were explained it makes an important
>Perl idiom useless outside of toy rooms.

Were you to stop your overstating your own case, you would regain
credibility.  (Ever hear the story of the boy who cried "wolf!"?)
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org
           ->  Ask me about Perl training and consulting  <-
             "It's the lemon zester of death!!"   // MST3K


------------------------------

Date: Mon, 02 Feb 1998 18:01:01 GMT
From: sglassman@highground.com (Steven M. Glassman)
Subject: GUIDs returned by recordsets under Win32
Message-Id: <34d606af.282177640@news.connactivity.com>

I am trying to test a database implementation that makes heavy use of
ADO RecordSets.  The system is Windows NT and the problem is this:
I can access any of the text fields of the RecordSet but I can't read
any of the GUID (binary) fields.
Now I don't want to manipulate these fields heavily, I just want to
grab the GUID and hand it back as input to an object that knows how to
deal with it; the GUID-cognizant object either formats it for pretty
output or perform another query using the GUID as input.

What works:
    $UserName = $$RecordSetRef->Fields ("UserName")->Value;
What doesn't work:
    $UserID = $$RecordSetRef->Fields ("StorageUserId")->Value;
      (I get back no value)
What doesn't work:
    $UserID = new OLE::Variant(OLE::VT_UI1, $$RecordSetRef->Fields
("StorageUserId")->Value);

The last case is interesting in that I get back a variant whose value
is an array of 16 values but with bogus data:  there are only two
array entries that have defined data:
[0] has 2048
[6] has 0

One note: those trying the same thing from VB have no problem saving
the returned GUID and handing it back to an object as input.

I haven't been able to find any documentation of receiving binary data
from an object, although there is a small snippet on sending binary
data to an object that I tried to make use of. 

Any help would be appreciated.


------------------------------

Date: 2 Feb 1998 19:13:20 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: mkdir and mkdir -p
Message-Id: <slrn6dc6er.mlk.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Michael Wang <mwang@alhena.ibk.ml.com> wrote :
# Though perl provides "mkdir" but it can not do "mkdir -p",
# for that I have to do system ("mkdir -p ..."); is there
# a better solution? Thanks. 

do your mkdir in a loop going to each dir an seeing if you were
successful, if not then create the dir.


------------------------------

Date: Mon, 2 Feb 1998 19:40:06 +0100
From: "Laurens van Alphen" <alphen@craxx.com>
Subject: Multi-line blocks of text
Message-Id: <6b53t4$75n$1@dinkel.civ.utwente.nl>

h all,

i'm looking for some advice, here's the scenario:

there's a config file virtual.conf (defines virtual hosts
in apache) the file is structured as following:

--- begin of file ---
# /home/www/conf/virtual.conf
# copyright ) 1998, craxx
# all rights reserved

<VirtualHost www.someserver.com>
  ServerName www.someserver.com

  User thisuser
  Group thisgroup

  DocumentRoot /home/thisuser/www
  ScriptAlias /cgi-bin/ /home/thisuser/www/cgi-bin/

  TransferLog /home/www/log/www.someserver.com
</VirtualHost>

<VirtualHost www.otherserver.com>
  ServerName www.otherserver.com

  User thatuser
  Group thatgroup

  DocumentRoot /home/thatuser/www
  ScriptAlias /cgi-bin/ /home/thatuser/www/cgi-bin/

  TransferLog /home/www/log/www.otherserver.com
</VirtualHost>
--- end of file --

that is, the file starts with a few comment lines and an undefined number of
virtual host directives.

what i want is this:

deete an entire <VirtualHost></VirtualHost> block by only specifying the
username (in the User xxx directive).

can this be done using perl? maybe sed, awk, ed, grep? i've not been able to
set up a proper multi-line regex...

thanks,

--
laurens van alphen
alphen@craxx.com





------------------------------

Date: Mon, 02 Feb 1998 14:34:12 -0500
From: John Porter <jdporter@min.net>
Subject: Re: New Perl-Oriented Web Site has materials not available elsewhere
Message-Id: <34D61FB4.5848@min.net>

RAYMOND CHEONG wrote:
> 
> Are you sure the following URL is right??? 'cos I couldn't get thru...
> 
> > <URL:http://www.perl.com/~mjd/perl>
> >
> > Mark-Jason Dominus     mjd@plover.com

This is a typo.  Obviously it should be www.plover.com.
I think M-J's fingers are much more accustomed to typing perl.com than
plover.com :-)

John Porter


------------------------------

Date: Mon, 2 Feb 1998 18:23:07 GMT
From: Charles Margolin <cmargoli@world.northgrum.com>
Subject: Re: Parsing Word Docs
Message-Id: <34D60F0B.96A@world.northgrum.com>

scott@softbase.com wrote:
> 
> newsie (newsspam@weptop.com) wrote:
> > This only works on word 6/95. Has anyone been able to parse a word 97
> > doc?
> 
> Use Automation, and the SaveAs functionality to save the document
> as text!

That's very nice if you are receiving the Word file on a PC with
Word installed, or if you can get the sender to do the SaveAs.
The real problem is when a PC user forwards a Word file to a non-PC
system.

-- 
Charles G. Margolin                   DSSD Internal Information Services
cmargoli@world.northgrum.com          Northrop Grumman Corp. 0624/23
margolin@acm.org                      Hawthorne, California 90250-3277


------------------------------

Date: Mon, 02 Feb 1998 18:47:12 GMT
From: lpflippo@nmhs.net (Larry Flippo)
Subject: Perl & HL7
Message-Id: <34d61478.335182309@nntp.nmhs.net>

Has anyone seen an HL7 module for perl?  If so, where can I get it?

Thanx!

Larry Flippo
North Mississippi Health Services
lpflippo@nmhs.net


------------------------------

Date: 2 Feb 1998 18:26:43 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: perl and dde in windows NT
Message-Id: <6b5353$ni6@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <6b4oc3$nsa$1@mainsrv.main.nc.us>,  <scott@softbase.com> wrote:
>alison@cs.jcu.edu.au wrote:
>
>> I would like to know if Perl for Win32 can communicate with other
>> applications within Windows NT using DDE control stuff.
>
>I have never heard of anyone doing this, no.

Win32::DDE exists on CPAN, and comes complete with a testsuite,
thanks to Douglas Wegscheid.  I even worked on the XS portion of it.

 - Sarathy.
   gsar@umich.edu




------------------------------

Date: Mon, 2 Feb 1998 12:07:34 -0600
From: "George Graham" <ggraham@micrord.com>
Subject: Scripts For Automating Adding Users Via Web Interface
Message-Id: <6b52eh$nd4$1@usenet48.supernews.com>

Does anyone have, or know of, a suite of CGI programs for adding users to a
Linux system via HTML forms? I would like to turn over the taks to people
without official root access via a CGI web interface. I imagine there are
packages, either commercial or otherwise available, but I have not found
any. If anyone can head me in the right direction, I would appreciate it.
Thanks.

George Graham




------------------------------

Date: Mon, 02 Feb 1998 13:19:57 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Survival Of perl
Message-Id: <34D60E4D.6D97@min.net>

Rich Grise wrote:
> 
> And as an "end-user", the only computer I could find with web
> (or "net") access for less than $20,000.00 came with w95. 

Well, just because it came with Win95 doesn't mean you have to
be a prisoner to Win95.  You can get and install Linux for free!


> I have use for programming, except the platform that's available
> to me is the Cyrix 6x86 with w95, and VB.
> ...
> I write utilities for my own use and development work primarily
> in VB, since, as I've said, that's the platform I have. 

You're not stuck.  There is also GNU's gcc, which is free.
And tons of other tools and languages on the net, for which
you won't have to shell out one dime (except on-line fees, maybe).

> (I'm not a high-buck
> consultant who can afford to plunk down another $500.00 for VC++,

Neither am I. Fortunately, life doesn't begin and with Microsoft.

> I cut my teeth on C in PCDos. 
> ...
> I also have close to 10 years' experience with DOS C for those kind
> of command-line driven utilities, if I ever need them.

Excellent.  Now as long as you don't need to drop down to assembly
language level, you can do everything in Perl that you would
otherwise do in C.  And it's free.

> ... all that object crap.)

Whoa there, bucko.  Try to avoid darkening counsel by words without
knowledge.

John Porter


------------------------------

Date: 2 Feb 1998 19:28:15 GMT
From: mark@tiger.misty.com (Mark G. Thomas)
Subject: tests fail for perl5.004_03 and perl5.004_04 under AIX-4.2.1
Message-Id: <slrn6dc7id.8ro.mark@tiger.misty.com>

I'm having trouble with perl5.004_03 and perl5.004_04 under AIX-4.2.1.

Compilation goes fine with all the defaults, but the below tests fail, and 
various local perl scripts don't work properly for what looks like the same 
reasons.  I have tried both gcc-2.7.2.3 and the AIX C compiler, and gotten
the same results.

Any insight greatly appreciated.  Please email me.  Thanks!  -Mark

perl5.004_03:
Failed Test  Status Wstat Total Fail  Failed  List of failed
------------------------------------------------------------------------------
lib/dirhand.t                 5    3  60.00%  2-4
lib/filefind.t                1    1 100.00%  1
lib/findbin.t                 1    1 100.00%  1
op/readdir.t                  3    2  66.67%  2-3
Failed 4/152 test scripts, 97.37% okay. 7/4567 subtests failed, 99.85% okay.

perl5.004_04:
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
lib/dirhand.t                 5    3  60.00%  2-4
lib/dosglob.t     1   256     9    8  88.89%  2-9
lib/filefind.t                1    1 100.00%  1
lib/findbin.t                 1    1 100.00%  1
op/readdir.t                  3    2  66.67%  2-3
Failed 5/153 test scripts, 96.73% okay. 15/4604 subtests failed, 99.67% okay.


----
Mark G. Thomas (Mark@Misty.com -- http://www.misty.com/)


------------------------------

Date: 02 Feb 1998 14:00:16 -0500
From: Justin Vallon <vallon@fez.fi.bear.com>
To: rick@marinweb.com
Subject: Re: Text::ParseWords vs. Split
Message-Id: <x6eoh0pn873.fsf@fez.fi.bear.com>

rick@marinweb.com (Rick Freeman) writes:

> Hi all,
> 
> I'm reading files consisting of single lines that look like this
> 
> fname::rick::lname::smith::age::22::weight::250
> 
> and creating hashes.
> 
> I'm trying to determine if I should use split or Text::ParseWords.  Is
> there an advantage to using the module over doing a simple split?

ParseWords should handle quotes, backslashes, etc:

&quotewords() accepts a delimiter (which can be a regular expression)
and a list of lines and then breaks those lines up into a list of
words ignoring delimiters that appear inside quotes.


Given:

"Bob Smith" 12 34

split /\s+/ gives four words ('"Bob', 'Smith"', 12, 34)

ParseWords /\s+/ gives three words ('"Bob Smith"', 12, 34) if $keep
ParseWords /\s+/ gives three words ('Bob Smith', 12, 34) if !$keep
               etc.


If you can get a field delimiter that you can guarantee will not occur in
any of the fields, you should just use split.  You're probably safe with:

local %m = split /::/, "fname::rick::lname::smith::age::22::weight::250";

-- 
-Justin
vallon@bear.com


------------------------------

Date: Mon, 02 Feb 1998 18:55:45 GMT
From: sloop@mailcity.com (Dave O.)
Subject: Re: Trying to find good PERL book
Message-Id: <34d6153d.175292718@news.xmission.com>

On Mon, 02 Feb 1998 16:22:19 GMT, mcintyres@hjc.cc.md.us (Scott
McIntyre) wrote:

>Hi all,
>
>I have been watching the discussions in this forum and have noticed
>that the name O'Reilly is mentioned quite often.  I have been
>searching for books by this person but don't have enough information
>to find any matches.
>
>Could one of you be so kind as to tell me what this gentleman's
>complete name is.  Any response would be greatly appreciated.
>
I can't imagine any large bookstore not being able to point out the
O'Reilly & Associates, Inc. books.

O'Reilly & Associates, Inc. is a publishing company.

The authors of the various O'Reilly books are as diverse as the
subjects the books cover, but generally among the top minds in each
particular subject.  Many of the O'Reilly books feature some animal on
the cover, and are nicknamed "The <animal> book" (as in "The Camel
book" for Programming Perl).

Perhaps you ought to visit O'Reilly's website: http://www.ora.com.




------------------------------

Date: 2 Feb 1998 19:10:50 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Trying to find good PERL book
Message-Id: <slrn6dc6a5.mlk.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Scott McIntyre <mcintyres@hjc.cc.md.us> wrote :
# Hi all,
# 
# I have been watching the discussions in this forum and have noticed
# that the name O'Reilly is mentioned quite often.  I have been
# searching for books by this person but don't have enough information
# to find any matches.
# 
# Could one of you be so kind as to tell me what this gentleman's
# complete name is.  Any response would be greatly appreciated.
# 
# Thanks.

www.ora.com

gabor.
--
    Although the Perl Slogan is There's More Than One Way to Do It, I
    hesitate to make 10 ways to do something.  :-)
        -- Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>


------------------------------

Date: 2 Feb 1998 18:39:11 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <slrn6dc4mf.5fm.Tom.Grydeland@mitra.phys.uit.no>

On 2 Feb 1998 10:09:19 -0500,
Dave Till <davet@angel.uunet.ca> wrote:

> My point is that, in Perl, you can do this:
> 
> # $var is undefined
> $var += 3;
> 
> and Perl will cheerfully convert undefined to 0, yielding a value
> of 3.  I agree that it's not good practice to do this, but you can do
> it (if you're willing to ignore the -w warning, of course).

Hmm, let's try:

% perl -wle 'print $a+=3'
3
% perl -wle 'print $a+3'
Use of uninitialized value at -e line 1.
3


Seems your factual information is slightly out of date.


-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


------------------------------

Date: 2 Feb 1998 18:14:40 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Using Net::SMTP script as WinNT replacement of sendmail
Message-Id: <memo.19980202181440.61975B@skep.compulink.co.uk.cix.co.uk>

In article <6b4vfl$fht@camel20.mindspring.com>, gbuehler@elsitech.com
(Georg Buehler) wrote:

> Many commonly available CGI scripts like Matt's FormMail usually assume
> the
> presence of sendmail or a similar mail program through which you can
> send
> email.
>
> However, sendmail isn't available on most WinNT web servers. (Well,
> there
> _are_ ports available from MetaInfo and NTmail, but I don't have 'em.)
> I'm
> trying to implement some sort of Perl substititue for sendmail, so that
> scripts like FormMail that assume the existence of a command-line
> mailer can
> still run.
>
> I've made some headway using Net::SMTP. I can build the necessary code
> into
> individual scripts, but I've yet to build a genuine sendmail
> substitute: a
> single Perl script to which another script can send (via a filehandle)
> output to be mailed. Such a script would spare me having to do major
> overhauls in all my sendmail-dependent scripts.
>
> Firstly: does such a script already exist? I'd love to see such a thing.
>
> Secondly: (and this is my current question) I'm having no luck in piping
> data from one script to another.
>
> For example, I'd like a CGI script to say something like:
>
> open MAIL, "|sendmailsubstitute.pl";
> print MAIL "To: gbuehler\@med.unc.edu\n";
> print MAIL "From: webmaster\@elsitech.com\n";
> print MAIL "Subject: Sample Message\n\n";
> print MAIL "You're a dork!";
> close MAIL;
>
>
> And then have another script catch the output and handle the mailing:
>
> use Net::SMTP;
>
> # Accept message from other program #
>
> read STDIN, $message, 30000;
> @message = split /^/m, $message;
> print "Here's the message:\n";
> foreach $line (@message) {
>  print $line;
> }
> foreach $line (@message) {
>  if ($line =~ /^To:(.*)/i) {
>   $recipient = $1;
>   last;
>  }
> }
> foreach $line (@message) {
>  if ($line =~ /^From:(.*)/i) {
>   $sender = $1;
>   last;
>  }
> }
> # Send the response to Goldmine
> $smtp = Net::SMTP->new('gromit.elsitech.com',
>                            Hello => 'elsitech.com',
>                            Timeout => 30,
>       Debug => 1, ) ;
> $smtp->mail("$sender");
> $smtp->to("$recipient");
>
> $smtp->data();
> foreach $line (@message) {
>  $smtp->datasend("$line");
> }
> $smtp->dataend();
> $smtp->quit;
> exit(1);
>
>
> Should I be using "read" for this, or can I catch the input using a
> while(<STDIN>) ?
>
> I can't seem to get either working. . .
>
> Any help would be much appreciated.
>

Firstly, I havn't managed to get the Net::SMTP module to work under NT -
in the end I had to cobble up something to deal with that.

Second, what I cobbled up perforce requires that you have an SMTP relay to
talk to.

After that, I modified the standard form2mail script to use my smtp module
instead, so theres no need for a command line interface, it just talks
SMTP directly to the nearest server.

If you think this will help, send me a mail and I'll send you the bit of
code I cobbled up to talk SMTP - then you can put the necessary calls in
your form2mail script.

Regards
Neil



------------------------------

Date: Mon, 02 Feb 1998 14:16:43 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Want to determine the subnet networks from a network:subnet combo.
Message-Id: <34D61B9B.DA0@min.net>

Here's short and sweet solution.

sub elaborate_subnet {
    my( $netaddr, $subnetmask ) = @_;
    my( @subnets, $i, $incr, $a );
    my @neta_parts = split( /\./, $netaddr );
    my @mask_parts = split( /\./, $subnetmask );
    for $i ( reverse ( 0 .. $#mask_parts ) ) {
        if ( $mask_parts[$i] > 0 ) {
            # found the modulating position.
            $incr = ( $mask_parts[$i] ^ 0xFF ) + 1;
            for ( $a = $incr; $a <= 0xFF; $a += $incr ) {
                $neta_parts[$i] = $a;
                push( @subnets, join( '.', @neta_parts ) );
            }
            return @subnets;
        }
    }
    # strange: passed a netmask of 0.0.0.0.
    undef;
}

# Try some examples:

@nets = elaborate_subnet( '10.216.0.0', '255.255.224.0' );
print join( "\n", @nets, '', '' );

@nets = elaborate_subnet( '10.216.0.0', '255.255.240.0' );
print join( "\n", @nets, '', '' );

@nets = elaborate_subnet( '10.216.0.0', '255.255.255.0' );
print join( "\n", @nets, '', '' );


------------------------------

Date: Mon, 02 Feb 1998 14:44:14 -0500
From: John Porter <jdporter@min.net>
Subject: Re: When was perl created?
Message-Id: <34D6220E.6E0E@min.net>

Webmaster Of Jonspage wrote:
> 
> I'm doing a project on different programming languages and I
> want to do a time line of the languages...so does anyone know
> when perl was created?

Yes.

You might find these links useful:

http://www.idiom.com/free-compilers/
http://www.first.gmd.de/cogent/catalog/
http://www.byte.com/art/9509/sec7/art19.htm
http://www.csci.csusb.edu/dick/languages.html
http://vesuvius.cs.uiuc.edu:8080/home/pl.html
http://biobio.cs.uiuc.edu/Papers/sc95/main.html
http://www.strangecreations.com/strange/library/links.htm
http://union.ncsa.uiuc.edu/HyperNews/get/computing/lang-list.html
http://www.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/web/language-research.html


------------------------------

Date: 2 Feb 1998 13:40:46 -0500
From: mocha@op.net (broadfield)
Subject: Re: White Hats and Black
Message-Id: <6b53ve$9gg$1@monet.op.net>

re: netscape quitting the browser biz

several people agree that end-users will show little interest in the
release of netscape and the source code, and that such a move only has
appeal to the hackers and coders. 

i agree that the end-users won't widely care one way or the other,
immediately. however the end-user will certainly be affected by this, and
this is due to the changes possible in web-pages. programmers and
web-designers will benefit from the versatility that open-source may
offer. support for more functionality will advance netscape at a greater
speed than bureaucratic MS can offer for their IE.

this then puts the end-user in a position to desire the more-functional
netscape. non?

-jb

but then again... it didn't work for mosaic, did it?



------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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 1790
**************************************

home help back first fref pref prev next nref lref last post