[12796] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 206 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 21 00:25:17 1999

Date: Tue, 20 Jul 1999 20:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 20 Jul 1999     Volume: 9 Number: 206

Today's topics:
        >>>>>>..EXPERIENCED CGI PROGRAMMER NEEDED FOR SHORT TER (Cynthia)
    Re: [Q] In-Browser technology <reason@shadow.net>
    Re: basename regexp? rabm@prodigy.net
    Re: basename regexp? (Randal L. Schwartz)
    Re: basename regexp? <bryan@ets02.jpl.nasa.gov>
    Re: basename regexp? (elephant)
    Re: cant install Thread module <dan@tuatha.sidhe.org>
    Re: flock() replacement in Win32 ? arpith@hotmail.com
    Re: getting the decimal portion of a floating point num (Anno Siegel)
        Help,.,,, money expression.. (Myoungki Kim)
    Re: Help,.,,, money expression.. <cassell@mail.cor.epa.gov>
    Re: Help,.,,, money expression.. (elephant)
    Re: lexical $_ with threads question? <dan@tuatha.sidhe.org>
    Re: lexical $_ with threads question? <dan@tuatha.sidhe.org>
    Re: Listing Files <kmsproule@worldnet.att.net>
    Re: Listing Files <tchrist@mox.perl.com>
    Re: Newbie: Get all directories in a directory: (Joe Smith)
    Re: Perl and Personal Web Server (Win98) <flavell@mail.cern.ch>
    Re: Perl and Personal Web Server (Win98) <cassell@mail.cor.epa.gov>
    Re: Perl CGI Performance (Mike Bristow)
    Re: Perl Database Question (Mike Bristow)
    Re: Perl Programmer Wanted ASAP - Great Rates $$$ <keithmur@mindspring.com>
        Perl(CGI) or JavaScript? <pat4b@hongkong.com>
        Possible to tr/// within s/// ??? <Robert.H.Lowe@X-no.spam-X.lawrence.edu>
    Re: Possible to tr/// within s/// ??? <uri@sysarch.com>
        Program Available--2nd Conference on Domain-Specific La (Moun Chau)
    Re: reading from a file and THEN! (Mike Bristow)
    Re: Unique IP Address Extraction (Anno Siegel)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 21 Jul 1999 00:58:24 GMT
From: webmaster@wkdesign.com (Cynthia)
Subject: >>>>>>..EXPERIENCED CGI PROGRAMMER NEEDED FOR SHORT TERM PROJECT
Message-Id: <379c1b1c.40471107@news.earthlink.net>

Experienced CGI programmer needed for extensive personals
website project.  No dabblers or hobbyist programmers need
reply.  Quick turnaround is essential in this project.  Will be
working under our webmaster to create the framework for a full
featured, interactive dating website.  

I farm out custom CGI work regularly, so there is a an opportunity
for future work for the right person.

Please reply to webmaster@wkdesign.com with the details
of your experience, examples of your work, desired rates and
references.  Please reference "CGI Programmer Position" in
the subject area of your email.  Also indicate if you are willing to
provide a flat rate quote.

If you are sending a resume, please attach it in TEXT or
RICH TEXT FORMAT only.

Cynthia Craig
WKDesign
http://www.wkdesign.com



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

Date: Tue, 20 Jul 1999 17:47:30 -0400
From: "Vladik" <reason@shadow.net>
Subject: Re: [Q] In-Browser technology
Message-Id: <932522335.684.43@news.remarQ.com>

OK, I will try to clarify my question.
With the warning that I may not be speaking
authoritatively about the web technologies yet:
I am just starting this research.


See below.....


Cameron Laird <claird@starbase.neosoft.com> wrote in message
news:BE2245BA1DCDAE31.8804258C1F60F9A7.2EB4BCD57DBA05D1@lp.airnews.net...
>
> In article <932337314.611.103@news.remarQ.com>,
> Vladik <reason@shadow.net> wrote:
> >Hello,
> >Sorry for cross-posting, but
> >my question is really to the people on the news groups
> >who know about Eiffel, Python and Perl.
> >
> >Basically,
> >We are to develop a web client (a program that
> >can be ran witting a web browser) for our otherwise n-tier
> >cross-platform system, our research department gave the
> >recommendation and actually a prototype of the client
> >in MS ASP (active server pages) and, I think but not
> >sure, blended with Visual Basic. Talk about bias...
> >But this means that it can only run in MS IE and not
> >in Netscape, also it limits the number of platforms not only
> >for the client on which web browser runs, but also for
> >the web server (MS platforms only, because web server with
> >active pages can only run there)
> >There is some talk about Java, but our web client
> >will also be ran via Serial links (not T1 connections)
> >on relatively inexpensive systems -- therefore Java is
> >something to look into but it may be slow.
> >So I am set on a quest to find something
> >that
> >a) can be executed within IE or Netscape,
> >b) be faster and overall more resource friendly then JavaScript
technology
> >c) supports OO programming
> >d) does not depend on the platform on which web server is running.( if
the
> >web server is running NT or UNIX (sun, linux)
> >
> >I have found one thing that almost satisfies the requirements:
> >it is based on Oberon-2 programming language and so far sounds
> >VERY promising.
> >  The reason why I am still looking is because
> >there are more books and internet support for Python,Perl and Eiffel
> >then for Oberon (this will be a factor when presenting the proposal
> >to the management).  The other problem is that there is plugin
> >for this technology available for NT and Mac platforms (for both
> >IE and Netscape) and is not available for UNIX platforms (which means
that a
> >web browser can not be ran on UNIX). There is source code,
> >though.
> >If interested: http://caesar.ics.uci.edu/juice/
> >
> >So, finally, my question is is there a technology
> >I am looking for available for either Perl or Eiffel or Python
> .
> .
> .
> No.
>
> That's the short answer.  Slightly longer is this:  I
> don't understand--although I'm sufficiently intrigued
> to answer.
>
> Let's first dispose of the part of my reply where I
> pick nits from your description:
> 1.  "We are to develop a web client (a
>     program that can be ran witting a
>     web browser) ..." evokes to me a
>     plugin.  Is a plugin (supposing a
>     sufficiently potent one exists)
>     exactly what meets your require-
>     ments, or is there a point I'm
>     missing?
I do not know what it is supposed to be
a plugin or not --- but a technology that
allows to develop not-trivial GUI applications
that run withing a browser.

> 2.  "... a prototype of the client
>     in MS ASP (active server pages)
>     and, I think but not sure, blended
>     with Visual Basic ..."  I have no
>     definite idea of what you're say-
>     ing here.  Is it that your
>     customer has a picture of the
>     visual appearance of the desired
>     deliverable?  What is there about
>     the ASP prototype that does *not*
>     meet the requirements?  Is VB
>     blended on the server or client
>     side?  Does it matter?  Is it really
>     VB, or VBScript?

 I meant that VB script was used in the prototype, not VB

> 3.  Are you aware that *lots* of browsers
>     read pages served as ASP?  You can
>     use ASP without requiring IE.
NO I was not aware.  Thanks for pointing out
I will try to find more about netscape (the only
two browser we are to support are Netscape and IE).

> 4.  "... Java ... may be slow."  Lots of
>     things may be slow.  The market-lead-
>     ing browsers are definitely pigs, by
>     my standards, but they've already
>     been mandated, according to your
>     description.
>
>     Technical point:  Java applets work
>     well for me.  Invariably, when I hear
>     people complain about the size of
>     Java applets, they're really com-
>     plaining about ancillary images.
>     Java executable classes themselves
>     are admirably compact, in my experi-
>     ence.
OK, I will take this point into consideration.
I guess what I was looking for is something like
this:
"Here is a technology like Java (or different
but accomplises the same thing), and it is based on this
OO programing language and here is the page where you
can read more about that also includes technical comparasings
between this technology and JavaScript (or other)
"
> 5.  Of what resource is JavaScript not
>     sufficiently conservative?  Do you
>     seriously have performance problems
>     with it?  There are plenty of aspects
>     of JavaScript that deserve scorn,
>     but, unless I have a specific issue,
>     I happily use it to accomplish real
>     work on the client side.
I have never used JavaScript for development, for comparising Juice
applet gets to my computer faster and draws the wireframe
example faster.
The client app we will have to develop will have to
a) maintain a limited set of bussiness rules
b) apply a to relatively large sets of data from the database


> 6.  How much client-side programming are
>     you doing?  Why does object-orienta-
>     tion there matter to you?

Yes it does. Because the app will contain some bussiness
rules, some data access and data presentation layers.

> 7.  What technologies do you want that
>     *do* link client and server platform
>     compatibility?  I can't make this
>     constraint informative in the context
>     of everything else you've written.
Well, I guess what I was asking the ability to have
the server run on any platform and this web client
be executable withing a browser that runs on any platform.

> 8.  What's the part about Juice that you
>     like--is it the promise of superior
>     performance?  Do Franz and Kistler
>     truly make source available?  I
>     hadn't noticed that.  In any case, if
>     I thought it'd help with one of my
>     projects, I'd write them directly.
They make SRC available, I downloaded it,
the license does not seem to be restrictive, but I am
clear on that 100% yet.

>     I'm fond of Oberon, and I wish Juice
>     well.  I don't understand your inter-
>     est in it.
>
> It sounds as though you're involved in quite an ambi-
> tious project, of the sort I like.  I wish you well.
> I suspect you'll do well to clarify several of your
> requirements; this will make it much more inviting for
> comp.lang.* readers to help you.
> --
>
> Cameron Laird

Thanks,
Vladislav




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

Date: 20 Jul 1999 20:02:53 -0400
From: rabm@prodigy.net
Subject: Re: basename regexp?
Message-Id: <u673ec1jm.fsf@prodigy.net>

>>>>> ">" == elephant  <e-lephant@b-igpond.com> writes:

    >> Jonathan Stowe writes ..
    >> elephant <e-lephant@b-igpond.com> wrote:
    >>> my Linux perl gives just the script name (the basename) with $0 .. my 
    >>> ActiveState perl on NT gives me the whole filename
    >> 
    >> The differences are almost certainly down to the command interpreter or
    >> shell in question ....  This is a good reason to be using File::Basename.

    >> ooh .. you're right - thanks

    >> -- 
    >>  jason - remove all hyphens for email reply -

# this works on both NT and UNIX
my( $progName );
($progName = $0) =~ s,.*/,,;


-- 
Vinny


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

Date: 20 Jul 1999 17:40:42 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: basename regexp?
Message-Id: <m1u2qyvnqt.fsf@halfdome.holdit.com>

>>>>> "rabm" == rabm  <rabm@prodigy.net> writes:

rabm> # this works on both NT and UNIX
rabm> my( $progName );
rabm> ($progName = $0) =~ s,.*/,,;

No, doesn't work on Unix.  What if a directory has a newline in it?

Add "s" at the end to fix that.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 20 Jul 1999 19:19:41 -0700
From: Bryan D Howard <bryan@ets02.jpl.nasa.gov>
Subject: Re: basename regexp?
Message-Id: <7cso6in3r6.fsf@ets02.jpl.nasa.gov>

> I need to know the name of my script.
> $0 you'd say right? I know, but I just want the name, not the full
> pathname.

Personally, I use:

(my $Prog = $0) =~ s,.*/,,;

Is that what you wanted?

{Bryan}
-- 
Bryan D Howard, EIS FIL Unix Toolbuilder
JPL Section 363, Pasadena, CA, USA            <bryan@solstice.jpl.nasa.gov>


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

Date: Wed, 21 Jul 1999 12:51:36 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: basename regexp?
Message-Id: <MPG.11ffe0c018cb5be1989b57@news-server>

rabm@prodigy.net writes ..
># this works on both NT and UNIX
>my( $progName );
>($progName = $0) =~ s,.*/,,;

does it indeed ? .. define 'works'

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 21 Jul 1999 02:19:26 GMT
From: <dan@tuatha.sidhe.org>
Subject: Re: cant install Thread module
Message-Id: <O6al3.16963$y92.9367@news.rdc1.ct.home.com>

smnayeem7346@my-deja.com wrote:
> Does anyone know why I cannot install the Thread module. I went to the
> threads directory and installed it using perl Makefile.pl, make,
> make test, make install.
> however when i try to use it in the program it says cant find in @INC.

You have enable thread support and build the Thread module when you first
build perl. It can't be done after the fact.

> and one more question is how do i install this module under winNT? it
> gives error when i try perl makefile.pl

I don't know that anyone's actually built it under WinNT.

					Dan


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

Date: Wed, 21 Jul 1999 01:31:09 GMT
From: arpith@hotmail.com
Subject: Re: flock() replacement in Win32 ?
Message-Id: <7n37su$e6c$1@nnrp1.deja.com>


> It won't work reliably.  There are icky, non-atomic kludges to try
> to get around this [like creating a lock file when you want the file
> to be locked, and deleting it when your process is finished writing -
> note
> that this is generally considered A Bad Idea (tm) and can cause
> annoying failures when the lock file doesn't get deleted].  But if
> your website is going to be fairly low-traffic, you should be able to
> get away with this for the most part.
>

I'm really only learning it on win95. So i guess, finally it will be on
a Unix system. But till then I am using all the scripts as CGIs on a
win95 platform.. on my computer using a Free server. But I may get a few
people to test it, and they may be on simultaneously.. so...

I guess, I will try the lock file.. how does it work ? Just create a
lock file OR create a lock file and keep changing a value inside:
1/0/1/0 etc.. ??

Also shouldn't windows in general already have some file protecting
mechanism like share.exe or something ???


> I know it's not your fault, but I'm really getting tired of that
slogan.
> "Share what you don't know.  Learn what you don't evaluate."
>
> David

___________Snip, cut...Chomp...Ahhh...that slogan's gone now!__________

<peep>

________Oh damn! It's still here! Ah well, quick! close ur eyes! :)____


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 21 Jul 1999 00:32:41 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: getting the decimal portion of a floating point number
Message-Id: <7n34f9$r5t$1@lublin.zrz.tu-berlin.de>

William <bivey@teamdev.com> wrote in comp.lang.perl.misc:
>anna@water.ca.gov wrote in article <7n2n1s$7t0$1@nnrp1.deja.com>...
>> Hi,
>> 
>> Is there a way in Perl or in a module of getting the decimal portion of
>> a floating point number?  I have already tried using the format_picture
>> method of Number::Format, but that doesn't work.
>> 
>> For example, if I have a number, 12345.6789 and I want to be able to
>> return the portion .6789, how do I go about that?
>> 
>> Thanks in advance for your reply,
>> Anna
>
>Try
>	$YerNumber =~ m/(\.\d+)/;
>	return $1;

What's wrong with $YerNumber - int $YerNumber?  It doesn't depend on
the locale.

Anno


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

Date: Wed, 21 Jul 1999 01:32:24 GMT
From: hanwool@miraeventure.venb.co.kr (Myoungki Kim)
Subject: Help,.,,, money expression..
Message-Id: <slrn7pa8l0.iqo.hanwool@miraeventure.venb.co.kr>

hi, 

I need your help ^_^;

i want to convert int string to money expression. 
in example, 4000 -> 4,000   5000000 -> 5,000,000

do you have a good code?


-- 
---------------------------------
Myoungki, Kim
hanwool@gomvp.com  (Mirae Venture)


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

Date: Tue, 20 Jul 1999 19:52:18 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Help,.,,, money expression..
Message-Id: <379535E2.F3AEE30E@mail.cor.epa.gov>

Myoungki Kim wrote:
> 
> hi,
> 
> I need your help ^_^;
> 
> i want to convert int string to money expression.
> in example, 4000 -> 4,000   5000000 -> 5,000,000
> 
> do you have a good code?

Yes.  There is some excellent code for this in the Perl
FAQ.  Since you're using Perl, you ought to have the Perl
FAQ and the Perl docs on your hard disk (or your network,
at the very least).  They come with Perl, so someone had to
muck up the installation to keep you from getting them.
If you don't have the FAQ, you can go to www.cpan.org and
get a copy [among many other neat things there].

And you'll probably want to read about the 'use locale;' 
pragma too.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 21 Jul 1999 13:01:46 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Help,.,,, money expression..
Message-Id: <MPG.11ffe322d2905bc8989b58@news-server>

Myoungki Kim writes ..
>i want to convert int string to money expression. 
>in example, 4000 -> 4,000   5000000 -> 5,000,000
>
>do you have a good code?

perlfaq5 does .. under the question "How can I output my numbers with 
commas added?"

  perldoc perlfaq5

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 21 Jul 1999 02:14:46 GMT
From: <dan@tuatha.sidhe.org>
Subject: Re: lexical $_ with threads question?
Message-Id: <q2al3.16961$y92.9367@news.rdc1.ct.home.com>

Derek Sherlock <derek_sherlock@hp.com> wrote:
> Hi again,

> dan@tuatha.sidhe.org wrote:
>> 
>> Derek Sherlock <derek_sherlock@hp.com> wrote:
>> > Hi,
>> 
>> > Thanks.  That explains it.  Sort of.
>> 
>> > But, despite the paragraph you quoted, experimentation shows that
>> > you CAN local() $_.  The effect on visibility and lifetime seems
>> > to be identical to that of local()'ing a true global, except that
>> > it does not use the global namespace (i.e. it remains separate &
>> > distinct from $main::_).  But the local()'d value is still visible
>> > to subroutines you call, so the localization is temporal (like
>> > local()), and not lexical (like my()).
>> 
>> What's happening is that you've got a lexical $_ (the default one) and a
>> package $_, which you've local()'d. Your second example here:
>> 
>> > use Thread;
>> > local $a;
>> > $a = 'hey';
>> 
>> should really have a my before the $a to match the $_ example.

> If I used "my" before $a in my second example, I would then get
> an error because you can't localize a lexical.  Well, except a 
> "magic" one, aparently. :)

Well, the current implementation does have a few rough spots. That's one
of 'em...

> Aaargh.  My brain is about to explode!  Let's see...  So the $_ 
> I localized is in fact a thread specific global, but when I use an 
> explicit package in the name, I get a non-thread-specific global, 
> and without explicit (or implicit by foreach) localization, I 
> am still looking at a lexical.

No, not quite. $_ *is* a lexical in threaded perl. It does not reside in
any symbol table anywhere. Perl does go to great lengths to disguise that
fact, which is probably the big cause of your confusion.

> Sidetrack question:

> What happens to lexical variables that already exist when a thread
> is created.  The thread gets it's own stack, of course.  Does this
> implicitly give it its own inherited copy of all the lexical 
> variables?

Nope. The scratchpads that the lexicals are allocated on are at a higher
scoping level and therefore visible. Lexicals are *not* inherently
thread-specific. 

> I assume it must, otherwise, making $_ and @_ lexical
> would have been a pointless excercise?

Okay, maybe a quick history lesson's in order. (Most of the threading
implementation was done by Malcolm Beattie, BTW, with a good chunk of the
more recent stuff courtesy of Gurusamy Sarathy and Ilya. My
contribution's been mainly docs and rabble rousing :)

When threaded perl first came out it was supposed to have very few changes
and be really low impact, so basically no changes were made to how core
perl handles variables. $_ and @_ had to be dealt with, of course, given
how many places they're used, so the logical thing to do was to make them
lexical and allocate them from the same scratchpads that lexicals are
allocated on. After all, whenever a thread starts you're guaranteed to
enter a new lexical scope, so allocating $_ and @_ wasn't a problem.

Unfortunately, threads turned out to be a bigger problem than that, since
many of the special globals need to be thread-specific. For these it
seemed pretty obvious that lexicals weren't really the way to go, so
thread-specific globals were implemented. $_ and @_ were left alone,
though, since they were already implemented with heaps of magic attached
to them. (Well, bigger heaps than they already had)

At some point, possibly before 5.006 (though I wouldn't count on it), $_
and @_ will get turned into thread-specific globals and we'll all chuckle
at the first try at implementation. It's really not a *bad*
implementation, it's jsut turned out to be sub-optimal in the long run.

> For that matter, if there are already global thread-specific 
> $_ and @_ implimented, why bother with lexical ones.  Doesn't the 
> existance of the global thread-specific one already solve the 
> thread-safety problem?

There aren't global thread-specific $_ and @_, though. Yet. ;-)

					Dan


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

Date: Wed, 21 Jul 1999 02:16:38 GMT
From: <dan@tuatha.sidhe.org>
Subject: Re: lexical $_ with threads question?
Message-Id: <a4al3.16962$y92.9367@news.rdc1.ct.home.com>

Derek Sherlock <derek_sherlock@hp.com> wrote:

> Hi,

> If lexicals don't do anything special when a new thread is created,
> what was the reason for turning $_ and @_ into lexicals when 
> making perl thread-capable.  A lexical $_ belonging to the outer
> lexical scope of the program is still shared between threads, just
> as if it is a non-thread-specific global.  How does this help 
> thread-safety?

Whenever you start a new thread you're guaranteed a new level of lexical
scope, since you're always entering a new block. There's basically an
implied "my ($_, @_);" (though I know you can't actually my $_ or @_ yet)
done whenever a thread's started.

					Dan


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

Date: Tue, 20 Jul 1999 17:08:38 -0700
From: "Kevin M. Sproule" <kmsproule@worldnet.att.net>
Subject: Re: Listing Files
Message-Id: <7n330a$3ei$1@bgtnsc02.worldnet.att.net>


Jonathan Stowe wrote in message <7n2mtk$1nh$1@gellyfish.btinternet.com>...
>On Mon, 19 Jul 1999 21:04:14 -0700 Kevin M. Sproule wrote:
>>
>> Ashish Kadakia wrote in message <932424514.5244@www.remarq.com>...
>>>Hi, I would like to list all the files starting with the
>>>root directory..
>>>Can anyone point me how to do that?
>>>
>>
>> What the previous examples lack in functionality they make up for in
>> brevity. ;)  The request was to list "all" the files starting with the
root
>> directory.  Here a a working WIN32 solution.
>>
>
><snip over blown example>
>
>> To iterate is human, to recurse devine.
>>
>
>Quite so, quite so ...
>
>Of course as others have pointed out File::Find is by far the best way
>to go but if you must do it yourself - you neednt waste so many keystrokes:
>
>SNIP<


Sir,

Your example may work well on UNIX but the object here was to write
something for WIN32.   The File::Find routine will walk the WIN32 file
structure, but it returns "/"s instead of "\"s.  Sure, my code is too long
and not too perlish, but it works.  I thought the whole idea of perl is that
there is more than one way to do it! (timtowdi)  Most responders to posts
seem to think that there is only one way to do it.

Yours truly,
Kevin Sproule




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

Date: 20 Jul 1999 18:13:48 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Listing Files
Message-Id: <379510bc@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Kevin M. Sproule" <kmsproule@worldnet.att.net> writes:
:Your example may work well on UNIX but the object here was to write
:something for WIN32.   

That this should matter seems like a bug in and of itself.  

:The File::Find routine will walk the WIN32 file
:structure, but it returns "/"s instead of "\"s.  

And this you call a problem?

:I thought the whole idea of perl is that
:there is more than one way to do it! (timtowdi)  

Some thoughts: 

 *  Some of you know what the Perl slogan on Windows is, and you can say
    it with me: "It's a good thing there's more than one way to do it,
    because most of them don't work."  --Larry Wall

 *  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

Use tools.  Avoid the wheel.

--tom
-- 
     This is Unix; if you can't get the sources, it isn't freeware.
     --Peter Salus


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

Date: 20 Jul 1999 19:56:12 -0700
From: inwap@best.com (Joe Smith)
Subject: Re: Newbie: Get all directories in a directory:
Message-Id: <7n3csc$okh$1@shell3.ba.best.com>

In article <campbell-lange-0707991528120001@campbell-lange.easynet.co.uk>,
Rory C-L <campbell-lange@easynet.co.uk> wrote:
>CODE:    
>   1:  sub lookin
>   2:  {
>   3:    my $dir = shift;
>   4:    opendir DIR, $dir or die "Can't open $dir $^E";
>   5:    chdir $dir;
>   6:    my @files = readdir DIR;
>   7:    foreach $f (@files)
>   8:    {  
>   9:       ++$count;
>  10:       if (-d $f)
>  11:       {
>  12:          lookin($f);
>  13:       } else {
>  14:          #carry on#;
>  15:       }
>  16:    }
>  17:  }

The problem is in line 5.  It goes down into subdirectories, but never back
up to process the sibling directories.  Right after line 16, you need
chdir("..") (or the Mac equivalent) to get out of the directory you are
currently looking in.  Or eliminate the chdir() as others have suggested.

Better yet, use File::Find.
	-Joe
-- 
INWAP.COM is Joe Smith, Sally Smith and our cat Murdock.
  (The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.)
See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"


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

Date: Wed, 21 Jul 1999 01:45:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <Pine.HPP.3.95a.990721013921.25705B-100000@hpplus03.cern.ch>

On Tue, 20 Jul 1999, David Cassell wrote:

> > Thank you. I have done numerous searches and never saw that group. I
> > wish more people were as helpful as you.
> 
> Uh-oh.  A *helpful* response.  I guess we'll have to send Kent back
> to the Abigail School For Abrupt And Obfuscated Replies.

;-)

But this leaves open the question: what the heck are newbies doing wrong
that they can't find their way around usenet groups???

PINE isn't exactly the world's most accomplished newsreader (that's
meant as an understatement), but I only have to go into the "add group"
dialog and type "browsers" to get a list of the relevant newsgroups that
are carried on this server.  Or indeed I could type "www" and get a list
of all the WWW-related groups that it carries.  Is it really so hard?





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

Date: Tue, 20 Jul 1999 19:20:29 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <37952E6D.F44D113D@mail.cor.epa.gov>

Alan J. Flavell wrote:
> [snip of utter drivel by yours truly]
> But this leaves open the question: what the heck are newbies doing wrong
> that they can't find their way around usenet groups???
> 
> PINE isn't exactly the world's most accomplished newsreader (that's
> meant as an understatement), but I only have to go into the "add group"
> dialog and type "browsers" to get a list of the relevant newsgroups that
> are carried on this server.  Or indeed I could type "www" and get a list
> of all the WWW-related groups that it carries.  Is it really so hard?

My guess is that the problem is how the newbies get here.  Nyetscape and
Internet Exploder aren't good newsreaders, and a newbie could easily get
lost on his/her way through the menus and collapsed newsgroup trees.
Using hotmail or deja(news)? is probably even worse.. and God only
knows what it's like from an AOL account.  I doubt any of these make
any attempt to steer a new Usenet user to anything approaching a Usenet
guide, much less some group with newusers in the title.  There may be
some competent people in there, but they may be completely lost in the
Clue Vacuum.

IMHO, anyway, 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 21 Jul 1999 00:17:48 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: Perl CGI Performance
Message-Id: <slrn7pa4dc.sf.mike@lindt.fat.dotat.at>

On Tue, 20 Jul 1999 23:04:31 GMT, Dave Ortman <dortman@my-deja.com> wrote:
>Question,
>
>I've typically worked with server side Java to generate web pages; and
>have found them to be satisfactory with regards to speed and
>resources.  However, I've now working on a web site that was written in
>Perl, which I have had no previous experience with.
[snip]
>Can somebody offer me some information regarding these items?  If it's
>quicker to point me to a URL, please do so.

Your question is /not/ about perl as such, but about webservers.

Try comp.infosystems.www.servers.{mac,misc,ms-windows,unix}.

Actually, take a look through deja.com first; this topic is likely
to have been discussed a lot there.

-- 
Mike Bristow, Geek-At-Large.                GK/RM0501
one tequila - two tequila - three tequila - FLOOR !!!


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

Date: Wed, 21 Jul 1999 00:19:03 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: Perl Database Question
Message-Id: <slrn7pa4fn.sf.mike@lindt.fat.dotat.at>

On Tue, 20 Jul 1999 22:53:02 GMT, Dave Ortman <dortman@my-deja.com> wrote:
>Pardon my seemingly ignorant question,
>
>I've been given the task of connecting a web site written in Perl to an
>Oracle 8 Database.  I've been looking at various documentation; and
>have found the Oraperl, DBD, and DBI modules.  

DBD is to DBI as a specific JDBC driver is to JDBC.

-- 
Mike Bristow, Geek-At-Large.                GK/RM0501
one tequila - two tequila - three tequila - FLOOR !!!



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

Date: Tue, 20 Jul 1999 17:31:23 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Perl Programmer Wanted ASAP - Great Rates $$$
Message-Id: <3794F8BB.A80EE4BC@mindspring.com>

The Main Man wrote:
> 
> We are in need for a Perl Programmer to work on a variery of exciting
> new projects in the adult entertainment biz.
> 
> Candidate must have own equipment and be ok to work on his/her own and
> to strict deadlines.
> 
> Good Fun Company and good rates of pay + bonuses.
  ^^^^^^^^^^^^^^^^

Now yer talkin'.  I could use some Good Fun Company...
-- 
 ... if the problem persists ... get  a  3.5  ft ... length of sucker rod
and have a chat with the user in question.
                -- Linux System Administration,
                   SYSLOGD (8), page 7
                   (Dealing with DOS attacks exploiting SYSLOGD)


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

Date: Wed, 21 Jul 1999 10:17:30 +0800
From: "Patrick" <pat4b@hongkong.com>
Subject: Perl(CGI) or JavaScript?
Message-Id: <7n3aks$vtf$1@imsp009a.netvigator.com>

Dear All,
    I have a problem, don't know whether I should use Perl(CGI) or
JavaScript to achieve the following, can anyone tell me?

Situation
  I want to have several multiple choice questions in each of my web page.
User first enter their name in one page , then go on to every page of my web
to answer the question. there is one variable to hold the name and one
variable to hold number of questions they answered correctly until they
leave our homepage. Then it will automatically store in a page which show a
list of player who answered the most number of questions correctly. It shows
in descending order. But each time the page will randomly choose questions
so that each time it shows different questions for different players.

Can any suggest which language I should use? and the routines for writing
this programs? Thanks a lot.

Patrick
dbs2pat@netvigator.com
ICQ: 8882328




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

Date: Tue, 20 Jul 1999 20:47:51 -0500
From: Robert Lowe <Robert.H.Lowe@X-no.spam-X.lawrence.edu>
Subject: Possible to tr/// within s/// ???
Message-Id: <379526C7.237CF14F@X-no.spam-X.lawrence.edu>

Just curious...

How can one use s/FOO/foo/, when FOO is determined in the context of
a regular expression?  In this case, I was interested in replacing
USERNAME@domain.com with username@domain.com, when found at the
beginning of a line.  Is this possible with one line?

TIA,
Robert


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

Date: 20 Jul 1999 23:01:44 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Possible to tr/// within s/// ???
Message-Id: <x7btd6g0yv.fsf@home.sysarch.com>

>>>>> "RL" == Robert Lowe <Robert.H.Lowe@X-no.spam-X.lawrence.edu> writes:

  RL> How can one use s/FOO/foo/, when FOO is determined in the context of
  RL> a regular expression?  In this case, I was interested in replacing
  RL> USERNAME@domain.com with username@domain.com, when found at the
  RL> beginning of a line.  Is this possible with one line?

	s/(whatever)/\L$1/ ;

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Wed, 21 Jul 1999 00:38:31 GMT
From: moun@usenix.org (Moun Chau)
Subject: Program Available--2nd Conference on Domain-Specific Languages, October 3-5, 1999
Message-Id: <FF7347.CAD@usenix.org>
Keywords: USENIX, Domain-Specific languages, ACM, SIGPLAN, SIGSOFT, DSL, languages, design, implementation, software engineering, declarative languages, tools, design principles, object-oriented languages, visual environments, architecture, infrastructure, program analysis, formal methods, type theory, testing/prototyping, unix, research, conference, refereed papers, invited talks, tutorials

*Take part in the community dedicated to promoting the promise
  and practice of domain-specific languages
*Learn of current advances of DSLs and examine the spectrum of
  benefits which DSLs can provide
*Concentrate on the unique aspects of DSL design, DSL
  implementation, and of DSLs as software engineering tools

DSL '99
2ND CONFERENCE ON DOMAIN SPECIFIC LANGUAGES
October 3-5, 1999
Omni Hotel, Austin, Texas, USA
-----------------------------------------------------
Save.  Register by September 13, 1999.
Register on line:  www.usenix.org/events/dsl99
-----------------------------------------------------
Sponsored by USENIX, The Advanced Computing Systems Association
In cooperation with ACM SIGPLAN and ACM SIGSOFT

Refereed Papers Examing the Unique Positive Aspects of DSLs in areas
such as:
* Different Approaches To DSL Construction
* New DSLs For Problem Domains such as Specifying Hardware Circuits
and Robot Control Protocols
* Creating Data-Intensive Web Sites and Collaborative Applications

Keynote:  Towards More Natural Domain-Specific Languages
by Brad A. Myers
Human Computer Interaction Institute, Carnegie Mellon University

Hot Research Reviews
* Domain-Specific Languages for Programming and Security in Active
Networks, by Carl A. Gunter, University of Pennsylvania
* A Methodology for Designing Domain-Specific Languages Using Program
Specialization, by Charles Consel, IRISA/University of Rennes

Insight and Perspective from Invited Talks
* Language Technology for Performance and Security
* The Next 700 Markup Languages

Interactive Sessions, Hosted Luncheon, and Conference Reception

"(Regarding the 1997 DSL Conference) Papers presented were of such
uniformly high quality that the program committee was unable to
single out one for special commendation. Interest in the BOFs was
so great that initial plans to run them concurrently were shelved
in favor of a consecutive schedule.  Overall, I believe the 
conference was a great success!"
Andrew J. Forrest, AT&T Labs





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

Date: Wed, 21 Jul 1999 00:09:28 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: reading from a file and THEN!
Message-Id: <slrn7pa3to.sf.mike@lindt.fat.dotat.at>

On 20 Jul 1999 18:36:59 GMT, K. Posern <posern@informatik.uni-marburg.de> wrote:
>There is a logfile. The logfile grows and grows and then from time to
>time (automatically) it happens that the logfile will be zipped and
>moved to an archive.
>Furthermore there is a tool (= little perl program) which opens the
>logfile and always waits for and then reads the new input (in/to the
>logfile).
>
>And at this point I wondered if it is SOMEHOW possible (in perl) to
>NOTICE that the "old" logfile was zipped and moved away and to close and
>reopen the filehandle, so that is now attached to the "new" logfile
>(with the same name in the same directory, but starting at size 0).

Assuming that you're using code simlar to that which answers the
question ``How do I do a tail -f in perl?'' in perlfaq5 you might 
consider something a bit like:

open file
stat filehandle and remember the inode
do:
	read from the file 'till EOF
	stat filename & remember the inode
	sleep a bit
	reset error on filehandle
while inode from first stat ain't the same as the inode from the second

lather, rinse, repeat.

This does assume ``normal unix semantics'' for filesystems,
which may or may not be the case.

Mike, refusing to post perl code 'cos he's too tired to test it proper.

-- 
Mike Bristow, Geek-At-Large.                GK/RM0501
one tequila - two tequila - three tequila - FLOOR !!!


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

Date: 21 Jul 1999 00:42:19 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Unique IP Address Extraction
Message-Id: <7n351b$r6q$1@lublin.zrz.tu-berlin.de>

John Stanley <stanley@skyking.OCE.ORST.EDU> wrote in comp.lang.perl.misc:
>In article <7n2o2k$8cc$1@nnrp1.deja.com>,  <wired2000@my-deja.com> wrote:
>>If anyone knows a better way to do this with grep/egrep/any other linux
>>command, your input is definitely appreciated.
>
>cat file | cut -f7 -d\; | sort | uniq

cut -f7 -d\; <file | sort -u

Anno


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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 V9 Issue 206
*************************************


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