[8997] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2614 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 15 20:07:23 1998

Date: Fri, 15 May 98 17:00:52 -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           Fri, 15 May 1998     Volume: 8 Number: 2614

Today's topics:
        Alpha testesrs wanted for Enscript module v0.0 (Joonas Timo Taavetti Kekoni)
    Re: ANNOUNCE: Bit::Vector 5.3 (Steffen Beyer)
    Re: ANNOUNCE: Bit::Vector 5.3 <firewind@metroid.dyn.ml.org>
    Re: Does Perl have a IDE?I don't like command line. (Greg Bacon)
    Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
        Help with bison/lex. (Jacob W Janovetz)
    Re: help with quoting patterns, please (Greg Bacon)
    Re: How do I get the name of each file in a dir? <aturski@fao.ford.com>
        How to determine a perl-reserved word (string) (Yongyan Wang)
    Re: How to determine a perl-reserved word (string) <ajohnson@gpu.srv.ualberta.ca>
    Re: How to determine a perl-reserved word (string) <tchrist@mox.perl.com>
    Re: LWP vs Perl/Tk/Sockets for database interface. (Greg Bacon)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 15 May 1998 22:58:03 GMT
From: jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni)
Subject: Alpha testesrs wanted for Enscript module v0.0
Message-Id: <6jih9r$6fh$1@hiekkalaatikko.cs.hut.fi>

I am looking alpha testers for my Enscripting module.
(text to postscript)

Goals:
a) indemendent of os tools and perl add on modules.(implmented)

b) support custom font heigth(implemented) and width (unimplemented)

c) support custom text formats both in portait/landscape mode

d) support on fixed width font only , becouse this is created for
   format/write and similar text formating modules
e) support 8bit isolatin ascii only(implemented?)
f) support output to file, array and system to shell command (unimplemented)
g) support bold and underline text. (implemented)
h) support a4,a3,letter,legal(implemnted) 
	and custom page size,ledger and other pervert sizes(unimplemented)

This package is mostly written as a part of other project, and
is not supposed to replace any markup languages.

If you program perl yourself and are intrested, please reply via email.

I am also intrested in hearing do find need of such an util like I did.
(well i am gonna program this anyway..;-) )

The module will probably be available under LGPL in CPAN in the near
future.


-- 
	_-  Joonas Kekoni       OH2MTF	    I                           -_
	_-internet:	jkekoni@cc.hut.fi   I       DO NOT EAT.         -_
	_-slowmail:	j{mer{ntaival 7a176 I                           -_
	_-		02150Espoo          I      It is a monitor      -_
	_-		Finland/Europe      I                           -_


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

Date: 15 May 1998 21:38:14 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: ANNOUNCE: Bit::Vector 5.3
Message-Id: <6jick6$6m5$2@en1.engelschall.com>

In comp.lang.perl.misc Stephan Wilms <Stephan.Wilms@CWA.de> wrote:

> John Kugelman wrote:
>> Hm, your usual sig seems to have disappeared. ;-)

> He he, it still amuses me when this happens again :-)
> Sometimes I simply dont append the SIG to make a grumpy reply (where
> one is *absolutely* due) and there's always someone who notices :-)

> Stephan
> (initiator of the campaign against grumpiness in c.l.c)

Actually, Stephan and I have clarified this issue to our both's content in
private correspondence and have settled the matter without the grumpiness
that Stephan's flame initially started with... :-)

Thanks for keeping reading and bearing with us!

Actually, my original two posts were both duplicated due to a technical
problem I had no control of. I'm very sorry for that.

Yours sincerely,
-- 
    Steffen Beyer <sb@engelschall.com>
    Free Perl and C Software for Download: www.engelschall.com/u/sb/download/
    "Perl is like sex: If you never had it, you wonder what the fuss is all
     about. Once you had it, you never want to be without it again." (unknown)


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

Date: Fri, 15 May 1998 15:55:14 -0600
From: firewind <firewind@metroid.dyn.ml.org>
Subject: Re: ANNOUNCE: Bit::Vector 5.3
Message-Id: <Pine.LNX.3.95.980515155434.150J-100000@metroid.dyn.ml.org>

On 12 May 1998, Steffen Beyer wrote:

> I am pleased to announce [a lot of stuff] 

Thank you for that wonderful series of off-topic spammage, Steffen.

-- 
(initiator of the campaign for grumpiness where grumpiness is due in c.l.c)

Attempting to write in a hybrid which can be compiled by either a C compiler
or a C++ compiler produces a compromise language which combines the drawbacks
of both with the advantages of neither.
    -- John Winters <john@polo.demon.co.uk> in comp.lang.c 



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

Date: 15 May 1998 22:28:43 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jifir$3k9$7@info.uah.edu>

In article <6jic74$nk5$1@client3.news.psi.net>,
	abigail@fnx.com (Abigail) writes:
: Does that hide the programmer from what exactly is going on? Yes, it
: certainly does. Is that bad? Nope, not in my opinion. It's a frigging
: button. There's no point in wasting time to build a button; let the
: programmer spend time on programming the call back function, that's
: what counts.

FWIW, I think visual development of GUIs is a Good Thing.  How it looks
is very important, and it's nice to be able to shuffle the ``frigging
buttons'' around and have that code generated for manual tweaking if
needed.  In fact, it would probably be better for someone trained in
human factors GUI design to worry about how the interface looks and let
the programmers spend their time doing what they do best.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: 15 May 1998 19:16:37 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jiicl$d0$1@ultranet.com>

Greg writes:
>fsg@ultranet.com writes:
>: IDEs do more than flip windows; for instance, in Borland's C++Builder 3
>: product, which has a great IDE, I can put my cursor over a variable
>: in the source of a running program and see what the value of the variable
>: is.  Sounds odd, but it's an immense timesaver.
>
>Perhaps I'm a child of the free software generation or maybe I'm just a
>pessimist.  When I see a glitzy shrinkwrapped box with the latest
>greatest Buck-Bang-Pow compiler/debugger/IDE/whatever, I usually wonder
>whether the cutesy bells and whistles are really worth the money when I
>can have software with equivalent if not better (and probably more
>reliable) software for an infinitely cheaper amount?  If such glamour
>were really so vital to programming, wouldn't it appear in free
>development environments too?

One of the things you learn quite quickly in the free software generation
is that the idealistic theory that the best possible software (or even
software at all, in some areas: see word processing and spreadsheets)
will be written over time.  This is a great idea, but is a crock.  For
instance, Perl does not have a usable graphical user interface library.
It does not (but will soon) have threads.  The Perl compiler does not
produce optimized C code.  CPAN is a haphazardly organized, curiously
formatted collection of non-orthogonal, varying-quality patchwork
modules.  GCC is extremely slow.  Unix does not have a way to drag and
drop.  The most common interface to Unix is a character terminal type
that they don't even make any more.

Why not?  Because there's nobody who gets paid to do this, or who
cares enough to solve it (where it needs getting solved; opinions may
vary, wildly).

It turns out a lot of stuff that's useful but not vital is left on the
cutting room floor in the free software world.  Collected all together,
the useful stuff can be _extremely_ useful.

>I find that having to go to the mouse too frequently really limits my
>productivity.  IDEs seem to want you to click, click, click your way to
>happiness.

IDEs do nothing of the kind.  Again, I invite you to try my free offer
to check out Delphi or C++Builder.

>: The IDE also makes
>: the annoying and tedious part of writing win32 programs (designing the
>: interface) trivial, which is good, because I've got better things to worry
>: about than implementing a button.
>
>What of Tk?  Tk code will run on many, many, many more platforms than
>the hoarde fodder will.

Tk is a grotesque and broken hideous mess that, where portable, and
where it works, takes up more memory than emacs for even the most
trivial and understated task.  I once said that Osterhout doesn't need
a human factors engineer, he needs a gun.  This remains true.

>: And of course, all of the tools (editor,
>: debugger, compiler, libraries) work together in harmony so I don't have to
>: worry about tool-to-tool communication conflicts.
>
>I've never heard of vi and perl -d exchanging even one cross word.

Now try to get vi, ddd, gcc, gdb, ar, tar, as, cpp, make (any flavor
you like) and cvs not to exchange any cross words.  You can do it,
but the effort is non zero.

>: It's much the same reason why people buy Macs.  Macs are truly excellent
>: machines.  I love Macs.  I would never be caught dead using a Mac, but
>: like win32, like Unix, like Perl, like C++, like COBOL, everything really
>: does have a time and a place.  You should accept that.
>
>I don't know why you'd believe that I don't.

Because you keep speaking in absolutes about IDEs being bad and win32
being the devil's work that could not possibly be programmed for by a
sane person, for starters.

>  There are serious systems
>for serious users and then there's everything else for everyone else.

Like that sentence, for instance.  The implication that everything
else is 'nonserious' is silly.  You should accept that every kind of
system exists for a purpose, and depending on how good you are, you
can make a great thing out of any one of them.

>Concept based visual interfaces are best suited for people who have
>little need or desire for what actually happens so long as they can
>express to the machine the task they want it to perform.  Such novice
>friendly systems are necessarily expert unfriendly.

This is irrelevant, but wrong; see, for instance, nextstep, beos, rhapsody.

>: It seems that you and Tom are both bothered more by nomenclature and
>: what the people call themselves than anything else.  If they called
>: themselves 'access forms designers', and yet kept doing the exact same
>: thing, would you be as vocal in your abuse?  If not, why not?
>
>No, I wouldn't.  How thrilled would you be if I called myself an
>Anglophile but went around bashing England and everything related to it.

I would be utterly, 100% disinterested, because, get this, I don't
particularly _care_ what you think.  It doesn't affect me in the
slightest.  No amount of you standing in Trafalgar Square hooting and
mooning the statue is going to stop me from digesting my breakfast
cereal or traipsing carefree down the pier with my loved one.  Even
if you were to send me mail every day proclaiming the superiority of
the French, I would quickly adapt to the situation (through the use
of Perl, I might add).

>I see no value in lying about one's qualifications.

I see no value in getting pissed off just because someone else uses
a word differently than me or doesn't understand it as well as I do.
In fact, I see negative value; when you scream at a helpless and
unknowing newbie, _especially_ if they're just stupid, you descend
past their level.  At least they're asking a question, rather than
spewing careless vitriol.

>: Perhaps the problem is that you're inexperienced with IDEs.  Tell you
>: what -- why don't you go down to the university store and get Delphi 3,
>: or C++Builder 3, at a student discount.  Play with it for a few days;
>: if you don't like it, I'll send you a check for the full amount of the
>: purchase.
>
>Could you please drop the fixation on the fact that I'm still in school?
>It adds nothing to your argument and weakens your credibility.

I'm sorry it pains you that you are, but the deal is, you get a good
deal at the university store.

>  Second,
>why should I pay to replace software that already works the way God and
>Dennis intended? 

You might learn something, maybe even acquire an open mind.  Maybe
you might even grow to appreciate that Dennis didn't solve all the world's
problems two decades ago.

Or, at the very least, you would be able to become an _informed_
member of this discussion, able to comment using facts rather than
unsubstantiated opinions and guesswork.

> Thirdly, I don't possess the tool-challenged systems
>on which to run such software.

Alas.

>Software libraries and IDEs are apples and oranges.  Software libraries
>still require a programmer's knowledge and skill to assemble them
>properly.  If the boxes are too big and too opaque, the end result will
>be slovenly software, despite the lies IDEs would have you believe.

I'm starting to be skeptical that you know much about IDEs, especially
given that your apparently most recent example experience was Borland C
3.5.  Certainly, as an experienced programmer who has used both IDEs
and non-IDE environments, I can't make sense of what you're saying here.
IDEs use software libraries.  Did you know this?

>: As for the idea of choosing less challenged systems -- that's one reason
>: why I suggested that you'll learn a lot when you leave school.  Not because
>: I think you're stupid, but because you really haven't seen a lot of the
>: world yet.
>
>Would you work in a place that subjected small children to sixteen hour
>workdays?  Would you work for someone for whom you couldn't find even an
>ounce of respect in your entire person?  I realize that hard times do
>visit, but this is not the state of our industry.  There are too many
>Dev^H^H^HBill worshippers in this world for me to waste even one
>keystroke in an environment that will always fight against those used to
>programmer friendly systems.

Uh, good luck getting a decent job.  One of the truths of this
particular industry (I've found) is that hacking houses want people
who understand that the religious nature of the platform is not the
issue; the issue is satisfying the customer.  I hate to sound like
The Man, but there it is.

>: I've been a professional hacker for a number of years now, and only through
>: the grace of God have I been able to choose my platform.  Most of the people
>: I work with are told what platform to work with.  Sometimes the end customer
>: even specifies the platform explicitly as part of the requirements document.
>: The idea that 1/5th, if that many, of the programmers out there can 'choose
>: less challenged systems' is quite seriously a riot.
>
>One's freedom to provide one's own direction is directly proportional to
>the skills and knowledge one has mastered.  Every employer will always
>need good hackers.  The fact that you've been able to choose your
>platform suggests to me that you've been able to select from the most
>appealing jobs.

I appreciate and enjoy your idealism.  However, as an active member of
the job market you're telling me about, allow me to suggest that you
(or anyone else, including me) will be quite lucky to live in a single-
platform world.  Especially a single-platform world not involving
Microsoft.  The idea makes me smile.

>: >xterm &
>: 
>: And how do you type that in?  Do you use a mouse pointer or a window
>: manager on that X server?
>
>One of the Windows platform's hugest mistakes is that, as a design goal,
>it seeks to minimize use of one of the highest bandwidth computer input
>devices, the keyboard.  Having to go to the mouse more frequently than
>to tell my window manager, ``hey, I'm interested in this window now'' is
>irritating and inefficient.

So the answer to the question was "windows is poorly designed", eh?
I dunno, Greg, seems a little evasive.  But the answer's irrelevant
(I know you use a mouse pointer and a window manager on that X server);
I was just making fun of your dogged insistence that you're not doing
the exact same thing that a windows user is doing.

>: The point is, you're talking personal preference (a little hypocritically,
>: but that's of no matter), not objective reality.  When I was a CS college
>: student, I often spoke about computers in terms of objective reality.  I've
>: moved on to speaking about everything else in terms of objective reality,
>: but computers, no sir.  So I know where you're coming from, but from
>: personal experience, I know that it doesn't work.
>
>The difference in subjectivity usually amounts to the granularity of
>control sought.  Do you believe differently?

The sentence is incoherent, so I can't answer that one way or another.

>: >I never said that a Win32 user is necessarily clueless.  In fact, I've
>: >openly stated that there are Win32 users of clue.
>: 
>: Again, I suggest you go back and read your posts.  You strain credulity.
>
>Please provide specific examples.

Oh bother, do I have to?

"The very act of exposing Perl's pristine beauty to the unappreciative,
unthinking, and, hence, unworthy clueless droves of lose32 users is
dumbing down the language."

(http://x11.dejanews.com/getdoc.xp?AN=352926949&CONTEXT=895272910.560988168&hitnum=3)

You go on to grudgingly admit that a few may be clueful, but the great
mass is not.

>: >By their actions, they detract from the usefulness of a great resource.
>: 
>: So set up another resource.
>
>We all wait like hungry predators for clp.moderated.

Where 'wait like hungry predators' in { scream at newbies, piss, moan }.
>
>: Or figure out a way to solve the problem.
>: Use Perl.  Use killfiles.
>
>Again, ignoring the problem doesn't make it go away.  What happens to
>the new Perl user who comes to clpm to see 250+ messages, most of which
>is junk?  He'll likely think, ``what a load of shit'' and move on.

so he'll go to clpM.  And?

>  I
>feel an obligation to limit the requests for FAQtime stories and other
>noisy junk to make this newsgroup as valuable a resource as it was when
>I first came.

Your method of 'limiting the requests' is both more embarrassing to the
Perl community than the requests and ultimately useless.  That guy who
wanders into clpm will also see your and Tom's wild rantings and wonder
what the heck is wrong with the language that simple-looking requests
get so hideously brutalized by these apparent expert champions.

>: >Why do you suppose Larry has left comp.lang.perl.misc?  If you kill
>: >clpm, you kill one of Perl's biggest selling points and much of its
>: >usefulness.
>: 
>: Nonsense.  clpm is cool and all, but Perl is Perl, and clpm does not
>: contribute significantly to the 'usefulness' of the language.
>
>False.  What other language can claim such a useful resource with highly
>knowledgable developers who are very eagar to help people free of
>charge?

C, C++, Java, TCL, Python.

>: I suppose Larry left clpm because he didn't have the time.
>
>I hear he saw this coming.

Consider asking him?

>: You will
>: notice that he didn't start responding to every post with a scathing
>: diatribe about how their platform sucks.
>
>I am told by many that Larry despises conflict.  In fact, I've never
>seen him get involved in any of the p5p skirmishes except to put an
>end to them.  Different people handle problems in very different ways.

I submit that Larry's method is better than yours.  Certainly, it
gets a hell of a lot more done.

>: In fact, he's even actively
>: attempted to bring the win32 people into the fold, and has helped out
>: trying to get more win32 cooperation and involvement going in the core.
>
>If someone stinks, view it as a reason to help them, not a reason to
>avoid them.
>             -- Larry Wall in <199702111730.JAA28598@wall.org>
>
>Even Larry isn't able to tolerate the stench around here.

You're misguided.  Larry is doing a great deal to help the exact
same people you're uselessly and violently attacking.  He's not doing
it via comp.lang.perl.misc, but nobody ever said he had to.  There's
a reason win32 is being integrated into the Perl5 core.  Whose side
is that quote on now?

>: How is your way of blasting everyone more successful than his way of
>: working within the system?
>
>I challenge you to show how I blast everyone.  I'd like to see an
>example how I've blasted someone who presented a non-FAQ, non-homework
>problem and actually attempted to solve their problem on their own
>first.

'Everyone' was too strong.  Let's even say 'anyone'.  I challenge you
to show me how blasting anyone will ever help them learn anything.

>: 1.  Don't take it personally.  You're likely to notice the outliers on the
>: curve -- the people who want spoonfeeding and who rant and scream that you
>: suck if they don't get it.  You probably don't notice the hundreds of people
>: that you help, because by definition they're off busily using the great info
>: to do their job.
>
>I'm not taking it personally.  When someone defecates near the food at
>the picnic, it tends to spoil everyone's appetite and kind of ruin the
>outing.  I hate to see people shit all over our newsgroup.

It's clear from your charged language and colorful metaphors that you're
taking it extremely personally, Greg.  And the metaphors cleanly miss;
nobody forces you to read stupid posts.  You do it yourself because you're
either too lazy, too masochistic, or too incompetent to avoid them.

>: 2.  If you find yourself taking it personally, do something else.  clpm
>: doesn't need you, or Tom, or Tom, or Chip, or Randal, or me.  Nothing
>: in the Perl distribution you received mandates that you spend your time
>: getting aggravated.
>
>If we all took this defeatist attitude, I could not imagine the slum
>clpm would be now.  You criticize me for not seeing things through the
>eyes of others, yet you don't understand that I'd rather take the
>problem on instead of ignoring it.

Your 'taking the problem on' only magnifies the problem.  It solves nothing.
I for one would much rather that you and Tom just ignored it, since you
both appear to be incapable of realizing that beating up newbies hurts and
shames one newbie, and has the side effect of making 10 million people
think the people at the helm of Perl are raving assholes.

>: Keep trying, or get out of the way and stop embarrassing the rest of us.
>
>How am I embarrassing anyone?

Reread your posts.

>: >Ignoring the problem won't make it go away. 
>: 
>: Yes, it will.  It will make it go away _for_ _you_.
>
>That would be a very selfish attitude to take.  It gives some people
>great joy to see and participate in a successful potluck dinner.

Greg, you're a smart guy, but I'm getting impatient with you.  I've
proposed multiple systems in which you would be able to read clpm
without getting personally antagonized by every third posting.  I've
even offered to help implement one particularly good solution.  But
you insist on ignoring the fact that the problem is solvable, and
instead tilt at the windmill and imply that the only way to solve
the problem is through public torrents of abuse.  Frankly, that
disturbs me a _lot_ more than the newbie questions.

>: Maybe that'll be a good thing, if you must attack the newbies.
>
>You paint with quite a broad brush.  Please outline what lead you to
>believe that I attack all newbies as a matter of personal policy.

I don't believe that.  I believe you (but more importantly, perhaps,
Tom) attack many newbies flagrantly, viciously, and loudly.  I also
believe that in no circumstances is that ever the right thing to do,
no matter how egregious the homework problem.  I further believe that
you and Tom are both smart enough to be able to "get" this, and that
you and Tom are both capable enough to implement solutions that are
either great for you, or great for the whole newsgroup.  With my help,
if asked for.

Felix


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

Date: 15 May 1998 23:38:22 GMT
From: janovetz@ews.uiuc.edu (Jacob W Janovetz)
Subject: Help with bison/lex.
Message-Id: <6jijle$8v1$1@vixen.cso.uiuc.edu>

Hello,

   I'm quite sure this isn't the place to post; I was hoping that
someone with knowledge in BISON (YACC) could refer me to a proper 
place.

   I'm having trouble with the 'bison.simple' source code in a 
reentrant parser.  The trouble is that I want to redefine yyparse()
to take on arguments, but 'bison.simple' declares a prototype if
yyparse with no arguments.  I can alter bison.simple, but I'd
prefer to know if it is an error in that code, or in my understanding.
If the former, I'd like to report it.


    Cheers,
    Jake

--
   janovetz@uiuc.edu    | Once you have flown, you will walk the earth with
 University of Illinois | your eyes turned skyward, for there you have been,
                        | there you long to return.     -- da Vinci
        PP-ASEL         | http://www.ews.uiuc.edu/~janovetz/index.html


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

Date: 15 May 1998 22:08:36 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: help with quoting patterns, please
Message-Id: <6jied4$3k9$3@info.uah.edu>

In article <355C9BCA.1631@bell-labs.com>,
	Dave Kristol <dmk@bell-labs.com> writes:
: [Please respond by email -- I don't peruse the news group.]

Private consulting will run you $150/hour.  For your sake, I hope you
catch this on Deja News or a friend will point you to this followup.

: This question pertains to Perl 5.003 on Solaris.

All versions of perl less than 5.004 have genuine security problems
(with the CERT warnings to back them up).  I strongly urge you to
upgrade to 5.004.

: 1) $alldir_p = '^\\\\S+$'; 
: 	Does same thing as above

Consider what ends up in the regular expression:

  DB<1> $alldir_p = '^\\\\S+$'

  DB<2> p $alldir_p
^\\S+$

That regular expression specifies a string that begins with a single
backslash followed by at least one 'S' character.

: 2) $alldir_p = '^\\\(\S+)$';
: 	All three tests match(!).

Consider what ends up in the regular expression:

  DB<8> $alldir_p = '^\\\(\S+)$'

  DB<9> p $alldir_p
^\\(\S+)$

That regular expression specifies a string that begins with a single
backslash followed by a sequence of at least one non-space character,
with that sequence being saved in $1.

: 3) $alldir_p = '^\\(\S+)$'; 
: 	Fails:  /^\(\S+)$/: unmatched () in regexp at y.pl line 8.

Consider twhat ends up in the regular expression:

  DB<11> $alldir_p = '^\\(\S+)$'

  DB<12> p $alldir_p
^\(\S+)$

That regular expression contains a syntax error.  The backslash before
the open parenthesis makes it match an open parenthesis instead of being
a metacharacter.  The close parenthesis at the end doesn't have a soul
mate, and the regular expression compiler, being the compassionate deity
that it is, objects to such a universe.

: Evidently there's something I don't understand, either about quoting or
: about pattern matching, or about the combination.

Backwhacking a non-alphanumeric in a regular expression is guaranteed to
yield an ordinary character, i.e. it matches itself instead of being a
metacharacter.  You can use code like

    $pattern =~ s/(\W)/\\$1/g;

to say that $pattern contains all ordinary characters.  You can also say

    $pattern = quotemeta $pattern;

or even

    if (/\Q$pattern\E/) {
        ...;
    }

Hope this helps,
Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: Fri, 15 May 1998 17:53:20 -0400
From: Alan Turski <aturski@fao.ford.com>
Subject: Re: How do I get the name of each file in a dir?
Message-Id: <355CB94F.DB1E4D3E@fao.ford.com>

Ala,
   The function you are looking for is called 'glob'.  Not all perl books list
it.  It is mentioned in "Using Perl 5 for Web Programming", Special edition,
on page 472.  In fact the example they give is exactly the printing you want
to do, viz.,

@files = glob("/tmp/*.txt");



Ala Qumsieh wrote:

> Aaron wrote:
>
> > Mike Williams wrote:
> > >
> > > On Sun, 19 Apr 1998 12:38:42 -0500, Chocolate <poohba@io.com> wrote:
> > > >How do I get the name of each file in a dir and print it?
> > >
> > > How about
> > >
> > > print `ls`;
> > >
> > I too have wondered about this.  I have had to resort to the above or
> > also I have used $foo=`echo /some_dir/*`;
> > But what if I'm on a different platform, win32?  Do we always have to
> > resort to the shell to get a file list?  Hell we can chmod, chdir, mkdir
> > and the like, but I can't find a "perl" command to list the files.
> >
> > Aaron
>
>  Haaaa???
> You're telling me that you haven't heard of opendir() ???
>
> --
> Ala Qumsieh             | "How much wood would a woodchuck
> ASIC Design Engineer    |  chuck if a woodchuck could
> Matrox Graphics Inc.    |  chuck wood?"
> Montreal, Quebec        |             - Trivial ... 5!



--
Alan Turski
Visteon - CAE Systems




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

Date: 15 May 1998 21:08:11 GMT
From: ywang@emma.plaza.ds.adp.com (Yongyan Wang)
Subject: How to determine a perl-reserved word (string)
Message-Id: <6jiars$k01@myst.plaza.ds.adp.com>

I want to determine if a string contain a perl reserved word.

E.g.  $a = "log"         log is a perl reserved word 
      $a = "tr"          tr is a perl reserved word 
      $a = "John"        John is not a perl reserved word 

Thanks,

Yongyan




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

Date: Fri, 15 May 1998 18:02:08 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: How to determine a perl-reserved word (string)
Message-Id: <355CC970.58CFDE3A@gpu.srv.ualberta.ca>

Yongyan Wang wrote:
> 
> I want to determine if a string contain a perl reserved word.
> 
> E.g.  $a = "log"         log is a perl reserved word
>       $a = "tr"          tr is a perl reserved word
>       $a = "John"        John is not a perl reserved word
> 

in the 5.004_04 distribution source is the file:
keywords.pl
it has the keywords one-per-line following
the __END__ token.

hope it helps
regards
andrew


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

Date: 15 May 1998 23:15:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to determine a perl-reserved word (string)
Message-Id: <6jiiad$q5l$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    ywang@emma.plaza.ds.adp.com (Yongyan Wang) writes:
:I want to determine if a string contain a perl reserved word.
:
:E.g.  $a = "log"         log is a perl reserved word 
:      $a = "tr"          tr is a perl reserved word 
:      $a = "John"        John is not a perl reserved word 

Sure, just call the following is_keyword() function.  It return 0 if
it isn't a keyword, and non-zero if it is.  In fact, positive negative
words are real keywords, once that can't be overridden.  Negative
ones, on the other hand, can be.

    % perl -MDevel::Keyword -e \
	'for $word (@ARGV) { printf "$word: %d\n", is_keyword($word) }' \
	    if that can delete each word unlink
    if: 104
    that: 0
    can: 0
    delete: 43
    each: 47
    word: 0
    unlink: -229

I enclose Devel/Keyword/Keyword.xs for your enjoyment.

--tom

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

MODULE = Devel::Keyword         PACKAGE = Devel::Keyword

int
is_keyword(perlstr)
    SV *perlstr

    CODE:
    {
        STRLEN slen;
        char *str = SvPV(perlstr,slen);
        RETVAL = keyword(str, slen);
    }
    OUTPUT:
        RETVAL

-- 
:       I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it.  Any ideas?  (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-) Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>


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

Date: 15 May 1998 22:10:09 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: LWP vs Perl/Tk/Sockets for database interface.
Message-Id: <6jieg1$3k9$4@info.uah.edu>

In article <6ji9ul$fsv@fcnews.fc.hp.com>,
	millerb@millerb.fc.hp.com (Bryan Miller) writes:
: I am interested in input from Perl hackers as two which is
: simpler/cleaner: using LWP and POSTing to a CGI script or
: simply writing a small Perl/Tk form that submits/retrieves
: data directly to/from the SQL database?

You haven't given us specifics from your requirements.  Are you
interested in being able to talk to this database from the web?

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

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

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