[8988] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2606 Volume: 8

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

Date: Fri, 15 May 98 04:00:39 -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: 2606

Today's topics:
    Re: ANNOUNCE: Bit::Vector 5.3 <Stephan.Wilms@CWA.de>
        dbfile.lock (urgent!) <lars-n@hsr.no>
    Re: Does Perl have a IDE?I don't like command line. <ebohlman@netcom.com>
    Re: Does Perl have a IDE?I don't like command line. <ebohlman@netcom.com>
    Re: Does Perl have a IDE?I don't like command line. (Koos Pol)
    Re: Does Perl have a IDE?I don't like command line. (Stefaan A Eeckels)
    Re: Grieving our dying community (Jari Aalto+usenet.nil)
    Re: help with search engine. <info@atig.fr>
    Re: How can you break out of a 'while... ' loop in a fu (Tina Marie Holmboe)
        insert a peace of text in a definite place of a file <info@atig.fr>
    Re: insert a peace of text in a definite place of a fil <ebohlman@netcom.com>
    Re: Learning Perl vs Programming Perl (Books) <Patrick.Hayes.CAP_SESA@renault.fr>
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) (Tina Marie Holmboe)
    Re: Perl not and ! operator differences (Stefaan A Eeckels)
    Re: Perl/Wall lingo question (Dane Jackson)
        prb with GD Module and socket function in perl for win  <luc.petit2@wanadoo.fr>
        Regex problem: substituting 3+ identical characters wit (J|rgen P|nter)
    Re: Removing ^M at the end of each line of a file. (Leonard Miller)
    Re: Removing ^M at the end of each line of a file. (Frank Miedreich)
    Re: Running Perl on Windows (Steven Wayne)
    Re: Running Perl on Windows <quednauf@nortel.co.uk>
    Re: Safe module and %SIG problem (Malcolm Beattie)
        Uploading pictures into a Internet Web Server <liru@ptg.es>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 15 May 1998 09:39:42 +0200
From: Stephan Wilms <Stephan.Wilms@CWA.de>
To: Steffen Beyer <sb@engelschall.com>
Subject: Re: ANNOUNCE: Bit::Vector 5.3
Message-Id: <355BF13E.5429@CWA.de>

[posted & mailed]

Steffen Beyer wrote:
> 
> I am pleased to announce version 5.3 of the "Bit::Vector" module:
> 
> The package is available for download either from my web site at

Please stop that "Announce" SPAM ! It is off topic and of no interest
here in comp.lang.c. I found 4 "Announce" from you today, SPAMMed to
a multitude of newsgroups. *STOP IT*

Stephan


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

Date: Fri, 15 May 1998 11:56:54 +0200
From: "Lars" <lars-n@hsr.no>
Subject: dbfile.lock (urgent!)
Message-Id: <6jh42l$6p5$1@news1.c2i.net>

I'm getting the error message:" Can't open
dbfile.lock:/public/www/stud/drageset/public_html/./dbfiles/users.csv.lock:
No such file or directory"

I get this message when I try to send info from a html-form, and the content
is to be stored in users.csv.
I am pretty sure the path pointing to the various directories  is correct.
I have used chmod 755 on all the files and directories
Any ideas ?




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

Date: Fri, 15 May 1998 07:01:18 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ebohlmanEszKu9.B7p@netcom.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:
:  [courtesy cc of this posting sent to cited author via email]

: In comp.lang.perl.misc, 
:     Lloyd Zusman <ljz@asfast.com> writes:
: :If you don't like so many people getting stuck and asking
: :FAQ's, then do something to help people get the hang of Perl more
: :easily.

: It is ultimately depressing to receive daily reminders of how useless
: and ignored my work and that of others at documenting Perl, in manpages,
: FAQS, webpages, and even books.  It is a rude slap in our faces, and
: I don't understand why we're supposed to make kissy face when it
: happens again and again on the very same day.  I don't know how
: any man can.  You don't see Larry here.  You don't see Dennis in the
: C groups.  And you don't wonder why, now do you?

Tom has in fact put his finger on the problem: a *lot* of people have
worked *very* hard for *no* pay to create a *very* comprehensive system of
documentation for Perl, a system that is available for *free* and that
compares *very well* to commercial documentation that would cost hundreds
of dollars to purchase.  Those people have worked even harder to make sure
that every distribution of Perl comes with that set of documentation. 
They've worked hard to make sure that people who get Perl distributions
can read that documentation without needing any special tools from
elsewhere (by creating viewers like perldoc and tkpod, and tools to
convert the documentation into HTML, Unix man pages, PDF, Tex, Postscript,
and just about every other format you can imagine).  They've worked hard
to create a *free* Web site where all that information, and more, can be
accessed.  In short, they've done everything they can to enable those who 
want to get the hang of Perl to do so as quickly and conveniently as 
possible.

The problem is that c.l.p.m is getting more and more frequent visits from
people who want to write programs in Perl, but apparently *aren't* very
interested in "getting the hang of" Perl.  They've got a question and they
want it answered *now*; they don't want to take the time to learn how to
answer their own questions.  They don't *care* about all the work that
Perl's developers have put in to making it easy for novice Perl
programmers to learn how to answer their own questions.  They seem to
think it's their right to remain perpetual newbies and still do useful
things with Perl.  They treat c.l.p.m as if it were a store in a mall and
its posters store employees rather than a public square whose denizens
come there to talk about things that interest them. 

I really think the problem here is *not* Unix vs. MS-Windows; the real 
problem, I suspect, is the tremendous proliferation of Web designers who 
have found that simple HTML markup (which, of course, is *not* a form of 
programming) is no longer an adequate set of skills for creating Web 
pages, and who therefore need to transform themselves into programmers, 
but instead have transformed themselves into programmer wannabes.  The 
difference is that a programmer seeks to understand as much of what he's 
doing as he can (realizing that that understanding is always imperfect), 
whereas a programmer wannabe seeks to end up with finished programs while 
learning as little as possible about how to create them.  If the 
programmer needs code to perform a particular task, he can take a look at 
code that implements something similar to, but not the same as, what he 
wants to do, understand what it does and adapt it to his needs.  The 
programmer wannabe, OTOH, can only deal with code that can be directly 
cut-and-pasted into his application because he has no mental model of 
*how* the code accomplishes its task.

Note that "newbie" and "programmer wannabe" are *not*, I repeat *not*, the
same thing.  The newbie who says to himself "I've got a lot to learn, so
I'd better get started looking for the best resources to learn
programming" is a novice programmer, not a wannabe.  Every programmer was
a novice programmer at one time; there's absolutely no shame in it.  Many
very intelligent people have expressed the opinion that the key
characteristic of a very intelligent person is how aware he is of all the
things he *doesn't* know.  The wannabe is the newbie who wants to do
something useful without having to learn how.  The novice programmer seeks
to build a better and better mental model of what he's doing; the
programmer wannabe seeks to memborize a bunch of motions to go through. 

When the novice programmer turns to others for help, he says "I'm looking
at this code and I thought, based on what I've learned so far, that this
construct would do X, but instead it does Y, and I can't seem to find any
references that would explain it."  He's overjoyed if someone gives him a
pointer to a resource that will help him understand the construct.  When
the programmer wannabe turns to others for help, he says "I'm looking at
this code that does Y and I have no idea what it means, but I need it to
do X instead."  He gets all snotty if you give him a pointer to a resource
that will help him understand the code well enough to modify it instead of
telling him what magic incantation to type in order to make it work the
way he wants it. 

Earlier I said that I didn't think that differences between Unix and 
MS-Windows backgrounds were a major part of the problem.  There is, I 
think, one exception.  The first Win32 port of Perl available was the 
ActiveState one, which sadly failed to incorporate all the excellent 
documentation that Perl's developers had created.  It's still the first 
port that a Web designer-type is likely to run across.  There is, I feel, 
a real need to inform its users of the treasure trove of documentation 
available.  Trying to persuade ActiveState to make the documentation 
available on its Web site would be a start.

But I categorically reject assertions like "you have to be a Unix 
programmer to use perldoc."  You have to be comfortable with a command 
line, that's all.  And until you're comfortable with a command line, 
you're not going to be able to do any useful programming, in Perl or any 
other language.  And you can't treat the Perl distribution as a black 
box.  It's full of treasures (*not* hidden ones) if you just look through it.




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

Date: Fri, 15 May 1998 07:10:35 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ebohlmanEszL9n.BJo@netcom.com>

fsg@ultranet.com wrote:
: gbacon@cs.uah.edu (Greg Bacon) writes:

: >If Perl is so great for nonprogrammers, why are so many nonprogrammers
: >inundating our newsgroup with FAQs and other questions that are answered
: >trivially with perhaps ten seconds of investigation on one's own?

: Because they want to use Perl, but don't know the standard forms
: of investigation.

How well does that hypothesis explain the observable evidence?  It 
predicts that someone who asks a FAQ would usually be pleased when given 
a pointer to a reference that would help him/her know the standard forms 
of investigation.  But what we see instead is people bitching about how 
unhelpful and unfriendly the group is because they got instructions on 
how to find out the answers to their questions rather than getting the 
answers directly.  It looks to me like many, if not most, of the FAQers 
are looking for pre-written code, not knowledge of how to write code.



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

Date: 15 May 1998 07:10:35 GMT
From: koos@stag (Koos Pol)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jgppb$8m0@news.nl.compuware.com>

Tom Christiansen (tchrist@mox.perl.com) wrote:
| It's trivial: They flood the group with useless questions...
| ...And the wizards are tired of it.  Damned tired.

You are projecting your anger with the win32 weenies on the possible
benifits for an IDE and online help for the casual programmer (such as
me). But these are related only in *your head*. Don't count me in
with what I'm not part of.

--
Koos Pol
----------------------------------------------------------------------
S.C. Pol                                           tel: +31 20 3116122
Systems Administrator                      email: Koos_Pol@bigfoot.com
Compuware Europe                 PGP public key available upon request

      A little inaccuracy sometimes saves tons of explanation.
                        -- H. H. Munroe


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

Date: 15 May 1998 10:27:38 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jh5aq$ffr$1@justus.ecc.lu>

In article <ebohlmanEsz0rJ.DF4@netcom.com>,
	Eric Bohlman <ebohlman@netcom.com> writes:
> Mark Maurer <mwmaurer@mtu.edu> wrote:
> 
>: I wouldn't worry about distant lose32 brethren.  If perl really catches on,
>: pretty soon someone will create Visual Perl, thereby proving even Perl can be
>                                   ^^^^^^^^^^^
>: made useless by adding the Visual... :)
> 
> YM "Visual P++."  HTH.
ROTFL. Excellent.

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
   Williams and Holland's Law:  If enough data is collected,
          anything may be proven by statistical methods.


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

Date: 15 May 1998 13:00:32 +0300
From: Jari Aalto <<jari.aalto@poboxes.com> (Jari Aalto+usenet.nil) >
Subject: Re: Grieving our dying community
Message-Id: <tbogwzlupr.fsf@blue.sea.net>

|Tue 98-05-12 comdog@computerdog.com (brian d foy) comp.lang.perl.misc
| you're never going to get a Perl course in a university based on
| the merits of Perl.  you have to think like a university committee
| and pander to their concerns - none of which deal with Perl.  show
| them favorable numbers, and you might have your foot in the door.
| otherwise, they'll move on to another crisis.

Interesting. I'm living in a second biggest city of Finland and
I have used perl extensively since 1992 at my work. I'm also attending
university classes which I started at my old age(30!) to get a 
second degree. It's true that it's hard to get a new language in the
schelude, but they do teach much more obscure languages like eiffel
and scheme that don't have much value in a real corporate level
software companies.

But this year I noticed a change: After our company started better
realizing the potential of Perl and tahnks to great features of perl
5.004+(most of all: maturity), the development has been
tremendous. And that voice of industry has been heard in the
University and College level schools too. They are now arranging
first Perl courses, but they have had great difficulties in finding
teachers. One day in a street a frind of mine grasped my sleeve and
asked me to start teaching Perl in the school, because they have got
such indications from the industry.

If you can back up some companies with the language and suggest that 
"it's in the ai that people are wanted", I'm sure the boeard will listen :-)

jari


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

Date: Fri, 15 May 1998 09:08:42 +0200
From: "sg" <info@atig.fr>
Subject: Re: help with search engine.
Message-Id: <6jgpti$ck6$1@minus.oleane.net>


Robert A. Mosley a icrit dans le message
<355bb69c.20213063@news.nacs.net>...
>I am developing an algorithm for a search engine for a simple site.
>The pages will be located in a small directory structrue like below
>
>root/
>root/store1
>root/store2
>root/store3
>
>In each directory will be the html files ... i have developed the
>following steps to try to make a search engine ... i would appreciate
>all the input people can provide me.
>
>1. Get a list of all of the html files from all of the sub
> directories.
>2. Place the list of files into an array.
>3. Take the first file from the array and apply the filehandle.
>4. Open the file with no locks ... none needed since they are
> static files.
>5. Search the file for the search string using a basic regex, and
> if found return the position of the instance.
>6. Search for the previos instance of a period, and then hop
> forward to the next charachter.
>7. Place the next 50 charachters and/or spaces into the return
> array.
>8. Continue searching for the next instance of the search string
> in the same file.
>9. Repeat steps 5 to 8 until the file is completed.
>10. Assign the file handle to the next file and continue until
> done. (Obviously close the prior file handle after the file is
> read in)
>11. Print out the file header.
>12. Print out the results with links to the files.
>13. Print out the file footer.
>

I 've done a search engine like that!
(we 've all suffered of the Not Invented Here syndrom :))
but if i were you, i would not try to do a search engine because that
still exists.
for example, swish-e is a very good search engine, speed,
efficiant, reliable, well tested and free!!!!
you're loosing your time to do a thing that stills exits in best.
free search engines can be founded at :
http://searchenginewatch.com/resources/software.html
WAIS, is also a good search engine :)

good luck!!

sg
info@atig.fr




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

Date: 15 May 1998 10:40:22 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: How can you break out of a 'while... ' loop in a function?
Message-Id: <6jh62m$bi4$1@news1.sol.no>

In article <6jf7fa$ffc$1@jelerak.scrye.com>,
	angst <angst@scrye.com> writes:

> No, everything you need is in the two lines.  The first line says nothing
> about what you're doing with the keys.  From a maintenance perspective, if
> you wanted to do something different with each key, you need to know what
> the whole construct does, not just the iteration part.

  This is true, but when encountering a loop I would still claim that being
  able to say:

    foreach $key ( sort ( %hash ) ) ... aha! This iterates over *all* the
                                        elements in the array...

      or

    while ( $key ne 'value' ) ... aha! This iterates as long as key isn't
                                  equal to value.

  has great maintenance and readability value. IMO, yet again. Then, of course,
  one needs to examine the block to see what is done with the elements, or
  similar, but one then has a good grip of what it is supposed to do allready.




>:     ITR: foreach $key ( sort ( keys ( %hash ) ) ) {
>:       if ( $key eq 'lwall' ) { last(ITR) ; }
>:       print "$key\n" ;
>:     }
>:     "Iterate over the sorted keys from the associative array 'hash'" and
>:      "Print the key... unless it is equal to 'lwall', then stop"
> 
> I think you misworded this in a rather important way...more accurately
> it's "iterate over the sorted keys from the hash...if you come to a key
> called 'lwall', stop the iteration.  Otherwise, print the key".
> The difference does a lot to discredit your argument, IMO.

  Here I cannot agree - and I don't really see how your changed wording
  does anything to alter the argument. It still describes a loop with an
  exeption - a break.




> # find the key called "foo" in a very large hash.
> 
> %hash = {
>   # insert 100,000 key-value pairs here
> }
> 
> foreach $key ( sort (keys (%hash))){
>   $val = $key if $key eq 'foo';
> }
> 
> print "foo is $val\n";
> 
> There's a loop with one exit point...very simple to maintain and debug
> by your definition, but horribly inefficient, particularly if 'foo' is
> found very early in the hash.  Consider this loop instead:
> 
> foreach $key (sort keys %hash){
>   if($key eq 'foo'){ $val = $key; last; }
> }
> 
> This is significantly more efficient, because you don't have to iterate over
> every single value in the hash unless the key you want is the last value,
> which is rather unlikely, particularly in a very large hash.

  Actually, you are right - and you are wrong. Let us consider perlsyn for
  a moment:

   "The foreach loop iterates over a normal list value and sets
    the variable VAR to be each element of the list in turn."

  This I cannot interpret in any other way than to say that if one has the
  need to iterate over *all* the elements, one use a _foreach_. It is 
  implemented as a _for_, so using the _foreach_ keyword is, IMO, for reasons
  of ease, and of maintainability.

  Your example, however, clearly does not demand the iteration over *all*
  the elements (unless worst case occurs). This is what perlsyn says about
  _while_:


   "The while statement executes the block as long as the
    expression is true..."


  Now, I might just be naive, but I think I'd choose a _while_ there instead
  of a foreach. A _while_ *needs* to breakout, as it is designed to loop
  until some specific situation occurs. Perfect for the job, and not the
  least less efficient as it also would stop when the element was found.

  So, why would you want to *break* out of a foreach, instead of using what
  seems to be a more correct while-loop ?

  This is what I mean when I say it is worth considering whether one is doing
  the loop in the best way - if one *wants* to end it at one specific time
  why not use a while, and avoid last() ?




> less efficient, and the program would take longer to run.  If you
> can't figure out how to use control structures properly, perhaps you
> should work on increasing your understanding of the language rather than
> trying to write code with as few actual unique commands (gasp) in it as
> possible.

  Now this turned nasty. Is there any specific reason you have for this
  rather unpleasant comment ? Or just a bad day ?




> I can only hope I'm still misunderstanding you, because if not, what you're
> advocating is extraordinarily bad programming practice.

  You are still not getting it, that much I can confirm.

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: Fri, 15 May 1998 09:15:20 +0200
From: "sg" <info@atig.fr>
Subject: insert a peace of text in a definite place of a file
Message-Id: <6jgqb4$cq2$1@minus.oleane.net>

hello everybody!!

I know that it is possible to insert a peace of text a the end of a file
with the open command.
like that :
open(FILEHANDLE,">>file.htm");
print FILEHANDLE "blablalblalal";
close FILEHANDLE;

but I would wanted to insert a peace of text in a definite place of a file,
for example just
before the word called "toto", or the html tag <!.. blabla..!>.

Is it possible?
if yes, how?

thanks you very very much for your help!!!
sg
info@atig.fr




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

Date: Fri, 15 May 1998 07:48:11 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: insert a peace of text in a definite place of a file
Message-Id: <ebohlmanEszn0B.CtF@netcom.com>

sg <info@atig.fr> wrote:
: but I would wanted to insert a peace of text in a definite place of a file,
: for example just
: before the word called "toto", or the html tag <!.. blabla..!>.

: Is it possible?

Yes.

: if yes, how?

Described in pretty good detail in perlfaq5 (perldoc perlfaq5 will show 
it to you).  The techniques described will work even if you want to 
insert a whole war of text :)



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

Date: 15 May 1998 09:16:36 +0200
From: Patrick Hayes <Patrick.Hayes.CAP_SESA@renault.fr>
Subject: Re: Learning Perl vs Programming Perl (Books)
Message-Id: <vxjyaw4qa0b.fsf@goblin.pdj.renault.fr>

Randal Schwartz <merlyn@stonehenge.com> writes:
> If they buy *both* books, they can spell my name whatever way
> they *want*!

In that case, when's your next book coming out Wandall?

> :-)

:-) :-)

Pat


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

Date: 15 May 1998 09:42:36 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <6jh2mc$5eu$1@news1.sol.no>

In article <6jfhsq$1hv$1@cyprus.atlantic.net>,
	chip@mail.atlantic.net (Chip Salzenberg) writes:

>>   "I want to learn how to drive!"
>>   "Well, there's nothing like experience! Go out and look at how its done,
>>    kid, then come back when you've learned."
> 
> Straw man.  I didn't say "_only_ by example".

  Exactly. And I never said "Only by the book". *Both* approaches are good,
but the fall-on-your-nose-a-few-times one is perhaps not the best for those
*starting out* with a language.




> Every great engineer learned a great deal as a youth by taking things
> apart and seeing how they worked.  Denying that this kind of learning
> is good and important for programmers is a serious error, IMO.

  IMnsHO - I agree. But denying that _perhaps_ one should lay a fundamental
theoretical foundation prior to experience is, IMO, as serious.

-- 
  Tina Marie Holmboe                
  Application Developer (Geeks'R'Us)         [tina@tech.scandinaviaonline.se]
  Scandinavia Online AB Development Dept.    (+46) 08 587 81000 (switchboard)
                                             (+46) 08 587 81189 (direct)


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

Date: 14 May 1998 22:29:41 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: Perl not and ! operator differences
Message-Id: <6jfr8l$c0r$1@justus.ecc.lu>

In article <355b4688.606859765@news.spacelab.net>,
	raul@homeontheweb.net (Raul Nohea Goodness) writes:
> 
> Tom, I agree that we shouldn't convert all punctuation to words, but
> it's a gray area. I don't think 
>   $a ? $b : $c;
> is more maintainable than
> if( $a ) {
>    $b;
> }
> else {
>    $c;
> }
(1) is more maintainable *as written*, using simple statements.
if $b and $c become more complex, (2) might be a better option.
APL goes too far in using symbols for everything. COBOL
goes too far in using words. 
There is however *no* doubt that the conditional operator
makes certain constructs a lot clearer (and hence more
maintainable) than an if-then-else construct.

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
   Williams and Holland's Law:  If enough data is collected,
          anything may be proven by statistical methods.


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

Date: 13 May 1998 14:41:03 GMT
From: dpj@ddt.occ.uc.edu (Dane Jackson)
Subject: Re: Perl/Wall lingo question
Message-Id: <6jcbdv$3vp$1@malgudi.oar.net>

Greg Bacon (gbacon@cs.uah.edu) wrote:
: Ugh.  CS is as much of an art as it is a science.  I don't think you'll
: find many engineers who'd admit that art is part of what they do.
	Engineering is as much an art as a science IMHO, many times in
engineering you have to go by what 'feels' right.  Not everything is
black & white, you have to just do what seems to 'work' for you sometimes.

: Engineers make poor computer science teachers (at least in my
: experience).
: 
: Greg
	I've had some very good & some average teachers (for CS) that were
EE's & ECE's, I haven't had any fabulous teachers that were CS.  I think
this is very much a function of the instution/person you're learning from.

-- 
Dane Jackson - zuvembi@mindless.com
Murphy's Laws of Computing #7
"He who laughs last probably made a back-up"


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

Date: Fri, 15 May 1998 12:31:36 +0200
From: "PETIT Philippe" <luc.petit2@wanadoo.fr>
Subject: prb with GD Module and socket function in perl for win 32
Message-Id: <6jh4ub$bvn$1@platane.wanadoo.fr>

Hello,

Excuse me for my english, I'm French.

I have Perl for win32 (activeware) build 5.003-07 and PERLIS 315 NT4 SERVER
and IIS3 SP3 in my internet server and in local server Omnicron httpd and
W95 or NT4 WORKSTATION SP3 Perl for win32 (activeware) build 5.003-07 and
PERLIS 315.

$im->gif; don't work on my Internet server (no data) but work fine in my
local server.

but in my internet server if I use $im->gif($FileN); I create a good gif
file.

do you have an idea ?

I have create this function :

sub reversedns {
    local($adr) = @_;

    if ($adr =~ /^[0-9.]+$/) {
 ($a,$b,$c,$d) = split(/\./,$adr);
 $tmp = pack('C4',$a,$b,$c,$d);
 ($adresse) = gethostbyaddr($tmp,2);
 if ($adresse eq '') {
  $adresse = $adr;
 }
    } else {
    $adresse = $adr;
    }
    return($adresse);
}

this function work fine in local but in IIS don't work (timeout) and socket
function work fine in local server but don't work on internet server

Thank in avance

regard,

Bien ` vous
Philippe
Luc PETIT inginieur Conseil
Developer's Paradise
http://www.devparadise.com/






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

Date: 15 May 1998 05:41:47 GMT
From: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: Regex problem: substituting 3+ identical characters with just one
Message-Id: <6jgkir$e0k$1@penthesilea.Materna.DE>

Hello,

here's my problem: printing out man-pages, I get rubbish like 
'_lll_oooo_kkk' instead of just 'look'. So far, no one can tell me why
or how to prevent this. Being no UNIX-Guru myself, I thought about using Perl
for a temporary solution. In a first step, I print the man-pages to a file and
then stript out all _ and  to get e.g. 'lllooookkk'.

Now enter Perl. I use a regex to subtitute each occurence of 3 or more 
identical characters with just one character. Being a learner, the regex is
very simple:
   s/([a-zA-Z0-9])\1\1+/\1/g
After that I re-use that regex to change all the special chars like !"'$% etc.
I don't use \w in the above because _ is used in tables in the man-pages.

Now the obvious problem is that my regex goes wrong if e.g. 'Page 22' turns
into 'Page 22222' and will thus read 'Page 2' after substitution. 

Another problem is tat right now I don't have time to immerse myself in regex
and/or UNIX. I'm just looking for a temporary fix until I can go after the 
real problem (why does the printout look the way it does?).

So, any ideas are very welcome.


TIA
	Juergen Puenter



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

Date: Thu, 14 May 1998 23:27:53 -0700
From: millers3@sonic.net (Leonard Miller)
Subject: Re: Removing ^M at the end of each line of a file.
Message-Id: <millers3-1405982327540001@d58.pm8.sonic.net>

In article <6j9jhi$plt$1@inn.imcn.com>, "N6006024"
<pernande@dev.amadeus.net> wrote:

> After having saved a perl script with Homesite 3.0, when I open the script
> using vi I can see that each line is ended by a  ^M. Consequently, I made a
> perl script to remove ^M.
> My code looks like this :
> 
> open (FILE, ">$ARGV[0]") || die "Cannot open $ARGV[0] : $!";
> while (<FILE>) {
> s/\^M//g;
>  print <FILE> $_;
>  }
> close(FILE) || die $!;
> 
> Thanks in advance for your help,
> 
> Philippe.

When you print to a FILEHANDLE the angle operator is not used.
Should be:

   print FILE $_;
   
-Leonard


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

Date: Fri, 15 May 1998 11:13:03 +0200
From: miedreich@acm.org (Frank Miedreich)
Subject: Re: Removing ^M at the end of each line of a file.
Message-Id: <miedreich-1505981113030001@mac206.mpipf-muenchen.mpg.de>

In article <6j9jhi$plt$1@inn.imcn.com>, "N6006024"
<pernande@dev.amadeus.net> wrote:

>After having saved a perl script with Homesite 3.0, when I open the script
>using vi I can see that each line is ended by a  ^M. Consequently, I made a
>perl script to remove ^M.
>My code looks like this :
>
>open (FILE, ">$ARGV[0]") || die "Cannot open $ARGV[0] : $!";
>while (<FILE>) {
>s/\^M//g;
> print <FILE> $_;
> }
>close(FILE) || die $!;
>
>Thanks in advance for your help,
>
>Philippe.

While I agree that perl is a great help when trying to correct the output
of certain OSs, you might want to set the default line breaks of Homesite
to Unix. Don't ask me where this option is, but it is available.

Frank

-- 
Frank Miedreich
Max-Planck-Institut fuer psychologische Forschung


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

Date: Fri, 15 May 1998 08:51:55 GMT
From: steven@amber.co.uk (Steven Wayne)
Subject: Re: Running Perl on Windows
Message-Id: <355effb3.2339754@news.demon.co.uk>

genfil@my-dejanews.com wrote:

>Thank you Steven,
>
>I know how to associate file in Win95. Is it the same with NT?

Yes indeed.

Steven.

-- 
We pray for one last landing, on the globe that gave us birth,
To rest our eyes on fleecy skies, and the cool green hills of Earth.
                                                  -- R.A. Heinlein
http://www.ambercomputing.demon.co.uk/


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

Date: Fri, 15 May 1998 09:45:51 +0100
From: "Frank L. Quednau" <quednauf@nortel.co.uk>
Subject: Re: Running Perl on Windows
Message-Id: <355C00BE.98D351D4@nortel.co.uk>

genfil@my-dejanews.com wrote:

> Thank you Steven,
>
> I know how to associate file in Win95. Is it the same with NT?
>

 Yes


--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





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

Date: 15 May 1998 09:38:51 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: Safe module and %SIG problem
Message-Id: <6jh2fb$o4m$1@news.ox.ac.uk>

In article <6jf08i$ra2$1@ncar.ucar.edu>,
Craig Ruff <cruff@ncar.ucar.edu> wrote:
>From my reading of the Safe module documentation, as shipped with 5.004_04,
>it shouldn't be possible for code inside the compartment to access the
>global %SIG hash.  However, my tests show that it is possible to hijack
>a signal handler with code inside the compartment.  The code in the
>compartment does not see the other global arrays like ARGV, ENV and INC.
>
>Is this a known problem?  Thanks.

The Safe/Opcode documentation talks somewhat about signals but doesn't
explicitly mention that. If I knew about it once, I'd forgotten it.
%ENV and %SIG are handled in pretty similar ways in the core (they're
forced to be global and they have "uppercase magic" which propagates
to their elements). I can't work out right now why they behave
differently but I'll work on it. It may be that we just have to
document the current behaviour and accept it but that would be
disappointing.

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"I permitted that as a demonstration of futility" --Grey Roger


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

Date: Wed, 13 May 1998 14:47:15 +0000
From: liru <liru@ptg.es>
Subject: Uploading pictures into a Internet Web Server
Message-Id: <3559B273.71180A52@ptg.es>

I need to upload images from a pc to an internet server. The user will
go into a web page and in it he will find a form where he must insert
the name of the picture and the path in his pc.
After that when he picks a bottom the image must be uploaded into a web
server.
Where can I find a perl script that can do this work? Thanks.




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

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

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