[10033] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3626 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 3 09:06:48 1998

Date: Thu, 3 Sep 98 06:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 3 Sep 1998     Volume: 8 Number: 3626

Today's topics:
        Accelerated Perl Programming Workshop <dmurray@dgesolutions.com>
        Blowfish crypo with perl (Anders)
        BSDI 3.0 and Compiling Perl5.004_04 (small biz ecommerce)
        Calling PGPSendmail from a perl script <hannum@oak.cats.ohiou.edu>
        Getting default browser dlynch@morrisonscientific.com
    Re: Help on a simple regex <Harald.Joerg@mch.sni.de>
    Re: How do I create a directory only if it doesn't exis (Larry Rosler)
    Re: How do I create a directory only if it doesn't exis <rra@stanford.edu>
    Re: How to DownLoad a file w/o using the browser <jwb79@mail.idt.net>
    Re: how to generate random password <sneaker@sneex.fccj.org>
    Re: How to run my scripts with Perl5 and not Perl 4 whe <r.goeggel@atos-group.de>
    Re: Perl & Java - differences and uses <pats@acm.org>
    Re: Perl & Java - differences and uses (David Cantrell)
    Re: Perl & Java - differences and uses <rra@stanford.edu>
    Re: Perl & Java - differences and uses <rra@stanford.edu>
    Re: Perl compiler (Eric Weiss)
    Re: Perl DBI vs. LiveWire <jwb79@mail.idt.net>
    Re: Perl gurus opinion needed. [THANKS] <butthead@ruxy.org.ru>
    Re: PERL is horrible (David Cantrell)
        PERL script/module to read/check my mailbox file. jteens@my-dejanews.com
    Re: Perl-based INETD Server for NT?? scott@softbase.com
        Polling a socket <mortensi@idt.ntnu.no>
        Question of regex in perl <djhwang@lgtel.co.kr>
    Re: Question <glg@apk.net>
    Re: Sockets communication <mortensi@idt.ntnu.no>
    Re: SWF (Shockwave Flash) file format (Michael Ledwidge)
    Re: Tom Phoenix: ANSWERS WANTED! (Bart Lateur)
    Re: Tom Phoenix: ANSWERS WANTED! (Michael J Gebis)
        Using API's from 3rd party dlls [Newie question] <psouthway@wsatkins.co.uk>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 2 Sep 1998 17:45:30 -0800
From: "Deborah Murray" <dmurray@dgesolutions.com>
Subject: Accelerated Perl Programming Workshop
Message-Id: <01bdd6d6$280cb9f0$ce98c9d0@debhome>

UniForum Technology Training Institute Presents:

Accelerated Perl Programming Workshop
December 16-17, 1998
San Francisco, CA

Space is limited.  For more information, call 1-800-333-8649 or visit the
Web @ www.uniforum.org.



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

Date: 3 Sep 1998 10:06:45 GMT
From: e98_abl@e.kth.se (Anders)
Subject: Blowfish crypo with perl
Message-Id: <6slpnl$cks$1@news.kth.se>

Does anyone know how to crypt a string using Blowfish in Perl?

Appreciate all answers

/Anders


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

Date: Thu, 03 Sep 1998 02:06:33 -0500
From: drifter@delrio.com (small biz ecommerce)
Subject: BSDI 3.0 and Compiling Perl5.004_04
Message-Id: <drifter-ya023080000309980206330001@enews.newsguy.com>

Hello Folks,

I'm opening myself up for a flame or two.

I'm trying to compile Perl5.004_04 on a BSDI 3.0x i386 system. It won't compile!

I heard there is a patch out there. I've searched the BSDI site and found
nothing, looked around perl.com and the like, too. I cannot find anything
about this BSDI 3 patch. Does anyone have a url or something where I can
find this patch and instructions on how to get BSDI compiled on BSDI 3?

Thanks to you all (but only if you help (-)

Joe Hyde

==========================
Your Home Office Toll Free Number
and Corporate Image...
< http://www.universalnumber.com/ >


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

Date: Thu, 3 Sep 1998 12:03:44 GMT
From: "Dave Hannum" <hannum@oak.cats.ohiou.edu>
Subject: Calling PGPSendmail from a perl script
Message-Id: <EypIpG.K12@boss.cs.ohiou.edu>

Hello,

Is anyone familiar with either calling PGP or PGPSendmail from a perl CGI?
I'd like to use this method in a shopping cart applications.  The owner has
a PGP key, the server has PGPSendmail.  I have the shopping cart on a secure
channel and want to transmit the credit card info via PGP.  How do I call
either the PGP sendmail or as the ISP suggested, it might be just as
practical to call the owners PGP key right from the script?  I'm not
familiar with how to do this.  Does anybody know?

Thanks,
Dave Hannum




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

Date: Wed, 02 Sep 1998 22:24:45 GMT
From: dlynch@morrisonscientific.com
Subject: Getting default browser
Message-Id: <35edc53e.517099299@news.canuck.com>

Hi,

How do you in Perl for Win32 get the default browser from the
registry?  Any help would be appreciated.

David.


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

Date: Thu, 03 Sep 1998 11:35:30 +0200
From: Harald Joerg <Harald.Joerg@mch.sni.de>
To: Andreas Vierengel <avierengel@citynet.de>
Subject: Re: Help on a simple regex
Message-Id: <35EE62E2.6EA1D6D4@mch.sni.de>

[mailed and posted]

Andreas Vierengel wrote:
> I am reading lines from a file and do a regex on each line.
> I want to match a line if it contains a certain string only ONE time.
> Example:
> string to match: 'ab'
> 
> possible lines:
> 
> "abdfgab1234abhj"             <-- should not be matched because of three
> occurences of 'ab'!
> "kjhdsbabakkioi"                  <-- should be matched!
> 
> Is ist possible to do this in one regex?

While the solutions presented so far may be more readable,
you can still do in one regexp without /g counting:
       /^([^a]|a(?!b))*ab([^a]|a(?!b))*$/
-- 
Oook,
--haj--


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

Date: Thu, 3 Sep 1998 00:45:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I create a directory only if it doesn't exists
Message-Id: <MPG.1057e8d2c7e38fd8989820@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <oee90k1ae0v.fsf@alpha.hut.fi> on 03 Sep 1998 09:47:28 +0300, 
Jarkko Hietaniemi <jhi@alpha.hut.fi> says...
> lr@hpl.hp.com (Larry Rosler) writes:
> > The problem is knowing what's available in what module.  It's like 
> 
> Have you considered this newfangled, outlandish, sissyish,
> nay, disgusting, idea called "reading the documentation"? :-)

Thanks for the smiley.  It depends.  It is an individual choice with 
tradeoffs.

In this case, I might have suspected there would be a module to do the 
job (mkpath or 'mkdir -p' for those who might not recall); found it (in 
File::Path) by searching the module list (for 'Path' or 'director', but 
not 'directory' as it happens, because it is 'directories' sigh...); 
looked up its calling sequence; and used it.  I would have practiced a 
bit using the documentation and, by osmosis, become more aware of some of 
the other modules.  There are benefits in that, and costs.

My choice was to figure out how to solve the problem, which involved 
writing a recursive 'one-liner' subroutine.  I practiced a bit of Perl 
that I don't do very often.  There are benefits in that, and costs.

I am reminded of the old debate about whether to use a C library function 
such as strcpy -- which requires knowing or looking up the order of its 
parameters -- or just writing 'while (*s++ = *t++);' as God intended.  
The answer in that case is that the library function might be implemented 
in assembly language using hardware primitives and run *much* faster.  In 
this case, the module is implemented in Perl, certainly loads slower and 
might even run slower (because of its generality).

TMTOWTDI.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 03 Sep 1998 04:31:20 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: How do I create a directory only if it doesn't exists
Message-Id: <m3g1e98mbb.fsf@windlord.Stanford.EDU>

Michael J Gebis <gebis@fee.ecn.purdue.edu> writes:
> lr@hpl.hp.com (Larry Rosler) writes:

>> Why not just test for its existence before trying to make it?

>> mkdir $dir, 0777 or die "Couldn't mkdir $dir. $!" unless -d $dir;

>> That will cause a problem if $dir exists but is a file, so you might
>> want to elaborate the test to meet your needs.

> There's actually a (probably minor) race condition where two separate
> processes could detect that the directory doesn't exist before either
> gets a chance to create it.  Be sure to check the result of mkdir if
> this is an issue.

To fully answer the question in that case:

use Errno qw/EEXIST/;
my $status = mkdir ($directory, 0777);
if (!$status && $! != EEXIST) { die "can't create $directory: $!\n" }

if that's really an issue.  :)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 3 Sep 1998 06:54:18 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: How to DownLoad a file w/o using the browser
Message-Id: <01bdd707$cf0bec90$6488fdc7@dixon>



Vasant Kumar <vasant@bellatlantic.net> wrote in article <35EDED90.4487@bellatlantic.net>...
: Hi -
: 
: Can someone refer me to some program, script, or code that will let me
: download a file from the given URL site without using the browser. I do
: have access to Unix and Windows 95 machine, and can use Perl, C, or
: Java.
: 
: Example -
: 
: When I go to the following location using Netscape browser, I am
: prompted if quotes.csv (the file name in this case) should be downloaded
: or saved:
: 
: http://quote.yahoo.com/d/quotes.csv?s=dell&f=sl1d1t1c1ohgv&e=.csv
: 
: If I select 'save', the file quotes.csv is saved. IS THERE A SIMPLE WAY 
: I can still download quotes.csv, in this example, without explicitly
: going to the browser?
: 

Try the LWP module. For what your doing, the "simple" get method should do just the trick.
--
HTH,


Jim



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

Date: Thu, 03 Sep 1998 07:08:30 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: how to generate random password
Message-Id: <35EE78AE.BF94099@sneex.fccj.org>

Jim Woodgate wrote:
> 
> "Dan Bassett" <dan@bns.com> writes:
> > A random password which can contain a combination of uppercase
> > letters, lowercase letters and numbers with a length of between
> > 8 and 10 digits...
> 
> Weird, someone posted the exact same question on clp.modules... :)
> 
> Here's the same code I posted as an answer to that post...
> 
> @validchars = ( A..Z, a..z, 0..9 );
> 
> $rpass = "";
> for ( 0..(rand(3)+7) ) {
>   substr($rpass,$_,1) = $validchars[rand($#validchars+1)];
> }
> print "$rpass\n";
> 
> --
> Jim Woodgate
> Tivoli Systems
> E-Mail: jdw@dev.tivoli.com


Draw back to above is that you can't use it in the passwd file.

Try:
#!/usr/bin/perl -w

use strict;
use diagnostics;

# Digit Place...
my $first;
my $second;

# General Counters...
my $x;
my $y;

# Test Password
my $pw =  shift || "Password"; # Or user supplied...

# Program control...
while(1) {
  $first  = (((rand(time)) >> (11 + 1 - 8)) & ~(~0 << 7));
  $second = (((rand(time)) >> (11 + 1 - 8)) & ~(~0 << 7));

  last if ($x++ > (16*((2**31)-1))); # Loop millions...
  # print "$first $second\n";

  next unless chr($first)  =~ /[a-zA-Z0-9]/;
  next unless chr($second) =~ /[a-zA-Z0-9]/;

  # crypt w/two letter seed...
  print "Trying: ", crypt($pw, ("".chr($first).chr($second)."")), "\n";
}

HTH,
-Sneex- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Murphy's Law of Research:
           Enough research will tend to support your theory.


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

Date: Thu, 3 Sep 1998 11:29:20 +0200
From: "Ronald Gvggel" <r.goeggel@atos-group.de>
Subject: Re: How to run my scripts with Perl5 and not Perl 4 when both are installed in the same place
Message-Id: <6slnlp$70j$1@news.pop-stuttgart.de>


Fernando schrieb in Nachricht <6skacp$16c0$1@news.doit.wisc.edu>...
>Both versions are installed in /usr/bin/
>.. so if i run a script it automatically tries to run perl4 and not
perl5 even
>if I have " #!/usr/bin/perl5 " at the top of the script.
>How do i know is running perl4 and not perl5?


>
>but if i do "perl5 name.pl" the script runs nicely.

check your $PATH.

maybe perl5 in $PATH is not /usr/bin/perl5?

HTH
Ronald




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

Date: 03 Sep 1998 02:14:58 PDT
From: Patricia Shanahan <pats@acm.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35EE5D83.41B6DD9D@acm.org>

This treatment of programming language selection as a dirty topic is
very unfortunate. It is a critical aspect of software design, and
worthy of being discussed and thought about seriously. There is a lot
more to picking the right language for a project than "I like language
X, X is always better than all the others, anyone who doesn't use X is
dumb or evil.". How are people going to get it right if nobody will
discuss the strengths and weaknesses of languages relative to
different types of work?

Patricia



Jon Bell wrote:
> 
> In article <35ed93c2.0@news.netcom.co.uk>, Jim <-> wrote:
> >I was originally only going to ask clpm but didn't want a biased opinion,
> >thats also why I asked for references to info. We're all big boys, I'm sure
> >we can discuss these things maturely, isn't that what usenet is all about?
> 
> Unfortunately, choice of programming language, for many people, is like
> choice of religion.  And how many people can discuss religion in a mature
> fashion?  :-)
> 
> --
> Jon Bell <jtbell@presby.edu>


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

Date: Thu, 03 Sep 1998 09:22:36 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl & Java - differences and uses
Message-Id: <35f15ef4.58881727@thunder>

On Wed, 02 Sep 1998 12:40:44 +0000,
  Austin Schutz <spamsux-tex@habit.com> enlightened us thusly:

>> [perl and java] inhabit different environmental niches - although there
>> is some overlap.
>
>	If you are looking for a language with greater overlap you
>might consider trying python (http://www.python.org/). One of the latest
>and coolest things you can do with python is compile it in to java
>bytecode.

Yay!  Back to the perl/python war!

Compiling python to java bytecode _is_ cool.  I wonder, could a perl
'compiler' do the same?

-- 
David Cantrell, part-time NT/java/SQL techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: 03 Sep 1998 04:15:46 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl & Java - differences and uses
Message-Id: <m3n28h8n19.fsf@windlord.Stanford.EDU>

In comp.lang.perl.misc, David Cantrell <NukeEmUp@ThePentagon.com> writes:

> Clearer than

> local @mths=split(/ /,
>   'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec');
> $when=~s/(\d+)-0*(\d+)-0*(\d+)/$3 $mths[$2-1] $1/;

> :-)

my @months = qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/;

may be rather clearer.  :)  And you don't need the first 0* in that regex
since you're using the number for arithmetic anyway.

Date parsing is annoying.  Something like:

        $when =~ s/(\d+)-(\d+)-0*(\d+)/$3 $months[$2 - 1] $1/;

probably really is the best way to do it if you need the full power of the
above expression (finding dates anywhere in the string $when, strimming
the leading 0 from the day of the month, etc.).  If you don't, if $when is
just a date for example, then clearer might be:

        use Date::Parse;
        use POSIX qw(strftime);
        $when = strftime ('%Y %b %d', localtime str2time ($when));

which is somewhat shorter and more readable at the cost of loading two not
particularly small modules.  But that may be an acceptable cost,
particularly if you're doing a lot of this.

I tend to use strftime() for pretty much any non-trivial time formatting,
just because it means I can avoid hard-coding lots of arrays of month
names and the like, as well as doing odd arithmetic with 0-based months
and the like.  It also localizes automatically for me, in case someone's
running my script in Germany.

And Date::Parse rocks.  I love being able to do something like:

    require Date::Parse;
    my $date = join (' ', @ARGV);
    $end = Date::Parse::str2time ($date) or die "Can't parse $date\n";

and be able to call scripts with a syntax like:

        weekly aug 8
        weekly 8/4/97
        weekly january 1st

etc. and have it just cope.

Anyway, that's all a digression and mostly off-topic for the Java group,
except to note that there do tend to be clean ways of doing things.  But
then, that's what everyone says, and I agree that some of the
dereferencing syntax is pretty ugly.  @{$hash{value}} is the one I dislike
the most.

Oh, and I'll freely admit that my sig is ugly and cryptic, but that was
intentional.  :)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 03 Sep 1998 04:26:52 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl & Java - differences and uses
Message-Id: <m3iuj58mir.fsf@windlord.Stanford.EDU>

In comp.lang.perl.misc, Patricia Shanahan <pats@acm.org> writes:

> This treatment of programming language selection as a dirty topic is
> very unfortunate. It is a critical aspect of software design, and worthy
> of being discussed and thought about seriously. There is a lot more to
> picking the right language for a project than "I like language X, X is
> always better than all the others, anyone who doesn't use X is dumb or
> evil.". How are people going to get it right if nobody will discuss the
> strengths and weaknesses of languages relative to different types of
> work?

I sometimes wonder if a lot of the problem isn't that most of the people
who tend to post flames to these sorts of threads only know one language.

Once you've been in this game for a while and have had to write packages
and integrate code that was written by dozens of other programmers in a
wide variety of different languages, write code for widely differing
runtime environments, write code under widely differing requirements, and
have had a chance to play around a bit and try stuff out just 'cause it
looks interesting, I don't think you'd ever go back to being monolingual.

I still think Bourne shell is far and away the best programming
language... for init scripts.  :)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Tue, 1 Sep 1998 21:47:19 -0400
From: eweiss@winchendon.com (Eric Weiss)
Subject: Re: Perl compiler
Message-Id: <MPG.10566db1c1dd858d9896f4@news.dgsys.com>

A lot of good point have been made in this discussion without
recognizing that different situations call for different solutions.
Sometimes I write Perl programs that are run on Windows laptops.  I
prefer not to distribute Perl5.004 et al.  A bit of compiled code 
means the laptop user gets a nice relatively little package and 
cannot change the code.  Yes, there are times when I don't want
the user to be able to change the code...such as when the client
is not in a position to maintain Perl code.  I'll be glad to give
the client a copy of the code, but fixing their modifications may
be beyond my contract with the company.

Other times, giving the client a Perl file is the most logical way
to go.

Afterall...

There's more than one way to do it in Perl!

Eric


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

Date: 3 Sep 1998 07:15:18 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: Perl DBI vs. LiveWire
Message-Id: <01bdd70a$bdb9d800$6488fdc7@dixon>

IMHO,
Yup livewire is faster (I'm using informix) and queries are easier - but....

- LiveWire is not portable.
- If you excell at coding JS, your good at JS and nothing else. Perl offers much broader horizons.
- NSES 3.0 will only allow you 120 applications (May seam like a lot, but you could run out real quick).
- I've seen pictures of the Perl porters, and they seam very healthy, and will probably be around for a long time.

Later,

Jim
--



Jay Bartelt <bartelt@enteract.com> wrote in article <35ed48d8.1881485@news.enteract.com>...
: We are beginning additional development on a Enterprise Server driven
: website in which a majority of the code is LiveWire javascript.  Is it
: worth attempting a performance comparison between the current LiveWire
: setup and perl using DBI to access a rather huge Oracle database?
: 
: I read in a FAQ that LiveWire javascript runs 60 times faster on
: complex queries than Perl.  Is the fact that this is on a Netscape
: Enterprise FAQ show that they are complete liars or are they whistling
: the right tune here?
: 
: I would prefer to use Perl as I am tired of dealing with these moronic
: .web files compiled by LiveWire.  Has anybody out there done a
: comparison or have an opinion?  Thanks!



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

Date: Thu, 03 Sep 1998 12:03:29 +0400
From: Dmitry Dorofeev <butthead@ruxy.org.ru>
Subject: Re: Perl gurus opinion needed. [THANKS]
Message-Id: <35EE4D51.333A3D2F@ruxy.org.ru>

Thanks to all, who made a response !!!

It's clearly that term 'Perlacker' sucks, at least 
while written on paper.

I will stop using it here within my friends.
Going to switch to something other...
You provide so many possibilities, thanks many more for your
HUMOR. Today is a dark time for Russia, and humor is a real help
at least for me.

FYI, russian people usually says 'hacker' like it was written 'huckerr'
and 'er' in the end sounds like in the 'ERRor'.


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

Date: Thu, 03 Sep 1998 09:15:40 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: PERL is horrible
Message-Id: <35f05d10.58397561@thunder>

On Wed, 02 Sep 1998 17:59:14 -0500,
  John Warner <support@acuity.com> enlightened us thusly:

>Learning Perl is certainly a good start.  Many of my customers have found _Perl 5 for Dummies_ published
>by IDG extremely helpful.  As for learning regular expressions, I found_Mastering Regular Expressions_ by
>Jeffrey Freidl (published by O'Reilly) the most helpful resource.

Mastering Regular Expressions is certainly a Good Book, but I wouldn't
recommend it to a perl newbie.  They're better off with the Llama and
the Camel, then moving on to Friedl's book when they've got to grips
with the regex coverage in the Perl-specific books.

Friedl's book goes into a LOT of gory details which aren't
particularly relevant to a beginning perl user.  They do come in
useful for more advanced users though.

My take on it is that it is more of a text-book than a tutorial or a
reference.  Which is good, cos we've already got an excellent tutorial
and reference in the Llama and Camel.

-- 
David Cantrell, part-time NT/java/SQL techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Thu, 03 Sep 1998 10:46:38 GMT
From: jteens@my-dejanews.com
Subject: PERL script/module to read/check my mailbox file.
Message-Id: <6sls2e$io$1@nnrp1.dejanews.com>

Hello there,
I'm looking for perl script/module for handle my mailbox file directly
(/var/spool/mail/mymailbox). Any help would be mostly appreciated.
Thanks,
Paul

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 3 Sep 1998 12:40:09 GMT
From: scott@softbase.com
Subject: Re: Perl-based INETD Server for NT??
Message-Id: <35ee8e29.0@news.new-era.net>

George Kuetemeyer (george.kuetemeyer@mail.tju.edu) wrote:
> I'm looking for a perl-based INETD server for NT

Since you can't fork() on NT, this would be hard to write.
Perl 5.005's new threading features might be a way to go.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 3 Sep 1998 11:03:51 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Polling a socket
Message-Id: <6slt2n$l9n$2@due.unit.no>

Hi

I have a socket communication between a Server (S) and a Client (C). I
want S and C exchange data as long as C wants to. Then I can have S
going in an loop forever, receiving data and take approriate actions,
like this:

while (<CLIENT>) {..}

C must be able to read data from S, whenever there is any, and at the
same time be able to receive data from a user to send to S until a
QUIT. The code:

while (1) {

  if (<SOCK>) {print;} # ERROR: If no data, then execution pause right here.
  $input = <STDIN>;
  chop $input;
  last if ($input eq 'QUIT');

}

The question is:

How can I find out if a socket contains data without halting the
execution?

Thanks for any help

Morten Simonsen


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

Date: Wed, 02 Sep 1998 20:12:25 +0900
From: duke <djhwang@lgtel.co.kr>
Subject: Question of regex in perl
Message-Id: <35ED2819.8F5C4F5F@lgtel.co.kr>

The following is part of my perl script to match a string.

$line =~ m/^From: (\S+).*\(([^()]*)\)/

I like to match a string like
"From: yasha@harari.org (the king)" or
"From: yasha@harari.org " with the regex.

And I print the $line variable with

$reply_address = $1;
$from_name = $2;
print "To: $reply_address ($from_name) \n";

but it did not work.

please help me out.

God bless you.






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

Date: Thu, 03 Sep 1998 06:33:38 -0400
From: Gary Gapinski <glg@apk.net>
To: sh_ori@netvision.net.il
Subject: Re: Question
Message-Id: <35EE7082.E8299002@apk.net>

The libwww-perl collection of modules provide this as well as other
related functions.

Regards,

Gary

Ori Shmolovsky wrote:
> 
> Is it possible using perl to create a socket to a server lets say
> members.xoom.com and read a file from that server lets say
> /aladdin1/index.html? If yes can you tell me how?


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

Date: 3 Sep 1998 10:52:25 GMT
From: Morten Simonsen <mortensi@idt.ntnu.no>
Subject: Re: Sockets communication
Message-Id: <6slsd9$l9n$1@due.unit.no>

Morten Simonsen <mortensi@idt.ntnu.no> wrote:
> What I want to do: A server communicating with a client, both back
> and forth, as long as the client wants to.

After some struggeling hours, I managed to send data both back and
forth. Because someone might be interested, I post my "solution", even
though I'm answering my own question!

On the client side:

print SOCK "whatever"

On the server side:

open(FILE); # || die "..."
while (<STDIN>) {print FILE;}
close(FILE);

What was wrong about my previous attempts:

I tried to write to STDOUT at the server, to see what kind of input I
got from the client. However the STDOUT was redirected to the client,
which did not take into account that anything could come from the
server.

What is lacking from this solution:

It not good enough, because this allows only one communication
transcation from the client. It should be possible to prompt a user to
send more information to the server, until the user says QUIT.

Morten Simonsen

P.S. Many thanks:)


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

Date: 3 Sep 1998 08:25:17 GMT
From: leddo@drjones.next.com.au (Michael Ledwidge)
Subject: Re: SWF (Shockwave Flash) file format
Message-Id: <6sljpd$qqq@inferno.mpx.com.au>

Larry Rosler (lr@hpl.hp.com) wrote:
: > what its speed is like. i then thought, bit vectors, someone had to have
: > done this and i searched cpan and found bit::vector. by this time i was
: strings) isn't as grotesque as I thought when I posted the code.

: This is what I meant by your having really made a contribution to the 
: Perl community with your code and benchmarks.  I wonder will anyone else 
: weigh into the discussion.  I certainly owe you the next beer.

No comment to make on either coding technique but hey SWF and Perl were mean't to be together. As a film-maker(perler), I can't wait till you guys get the two working together. I've been waiting for news of this! Keep it up.

Cheers,
	.M.

--
---------------------------------------------------------------------
				          Michela Ledwidge
	TLWM-A-TQC	               michela@thequality.com	
				http://thequality.com/people/michela 
---------------------------------------------------------------------



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

Date: Thu, 03 Sep 1998 10:27:29 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <35f46b35.10271634@news.tornado.be>

John Porter wrote:

>But Tom P utterly failed to grasp the deeper context.
>Ian A. Lowe's regex was /\<in.routed>\>/, and he explained that he
>wanted to match "in.routed" or "/usr/sbin/in.routed".
>He was expecting -- as any vi user might -- to match word boundaries
>with \< and \>.  Such things are matched by \b in perl, of course;
>Tom coulda mentioned that.  He also coulda suggested a regex that
>actually did Ian was trying to do.  Hope this helps!

Note that there is NO word boundary between "<" and "/". Therefore, "\b"
won't always work, 4ex. in "</usr/sbin/in.routed>".

Hmmm... Maybe the regex syntax would benefit if the user could easily
redefine the class of "word characters", so that "\b" or something
similar would work on the user defined class.

	Bart.


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

Date: 3 Sep 1998 04:59:04 GMT
From: gebis@welsh.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <6sl7mo$bnc@mozo.cc.purdue.edu>

news@russo.org (Chris Russo) writes:
}In article <cAgH1.126$kE2.1100174@news.shore.net>, nvp@shore.net (Nathan
}V. Patwardhan) wrote:

}>Maybe or maybe not!  But it won't be possible to give you the correct
}>answer until we measure this newsgroup and it weighs less than a
}>phonebook for the burrough of Queens.  Hope this helps!

}"Nathan V. Patwardhan" == "Mee"

}Even if it's not true, their equally plonkable.

How many times do we have to say it?  TEST before posting!

The corrected example should read:

'Nathan V. Patwardhan' eq 'Mee';

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Wed, 2 Sep 1998 18:19:50 +0100
From: "Paul Southway" <psouthway@wsatkins.co.uk>
Subject: Using API's from 3rd party dlls [Newie question]
Message-Id: <35ed7e0b.0@nnrp1.news.uk.psi.net>

Under Delphi, Wordbasic, C etc it is possible to call a function in a
vendor's dll (if you know the details).  Is this possible in Perl ?




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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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