[9882] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3475 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 18 14:07:23 1998

Date: Tue, 18 Aug 98 11:00:36 -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           Tue, 18 Aug 1998     Volume: 8 Number: 3475

Today's topics:
    Re: #!usr/bin/perl is ignored, WHY? (Bryan Miller)
    Re: #!usr/bin/perl is ignored, WHY? (Brian Wheeler)
        can perl be compiled into EXE format? <xuchu@comp.nus.edu.sg>
    Re: can perl be compiled into EXE format? (Abigail)
    Re: Change NT IP Address Using Perl <wkchiu@yahoo.com>
    Re: comp.lang.perl.newbie stevenjm@olywa.net
    Re: Converting to lowecase <grant.griffin@nospam.com>
        Expect.pm on Redhat 5.1 - does it work properly? (Per Steinar Iversen)
        Filehandle associated file name <hansen@sharptech.win-uk.net>
    Re: filehandle in CGI.pm (Bill Mezian)
    Re: has anyone tried embedding perl in win32? <webmaster@fccjmail.fccj.cc.fl.us>
    Re: Have package use another symbol table? (M.J.T. Guy)
    Re: here's an implementation of diff in perl (Abigail)
    Re: here's an implementation of diff in perl (Michael J Gebis)
    Re: here's an implementation of diff in perl (Greg Bacon)
    Re: here's an implementation of diff in perl (Greg Bacon)
    Re: here's an implementation of diff in perl (M.J.T. Guy)
    Re: Inplace Editing <ashley@austin.ibm.com>
        Intro To Perl - Boulder, CO <johnd@xor.com>
    Re: Julian Date (Abigail)
    Re: pangrams in Perl --- randomized Robisonizing (Tomoyuki Tanaka)
    Re: print "Content-type:text/html\n\n"; and redirection (Martin Vorlaender)
        Printing letters with bolding, underline, and italics f <jlaird@nih.gov>
        Problem with $^I in W95 (Louie)
    Re: Problems with file opening <dan@fearsome.net>
    Re: quotemeta <jdporter@min.net>
    Re: Random Number (Tye McQueen)
    Re: regex word boundary question (Abigail)
    Re: Run Perl5 in Win95 (Louie)
    Re: Strange behavior with 'use' (M.J.T. Guy)
    Re: taint checking seems to slow down my code <webmaster@fccjmail.fccj.cc.fl.us>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 18 Aug 1998 15:58:16 GMT
From: millerb@millerb.fc.hp.com (Bryan Miller)
Subject: Re: #!usr/bin/perl is ignored, WHY?
Message-Id: <6rc8ao$7n5@fcnews.fc.hp.com>

bkosch@omnicast.net wrote:
: Try renaming it from first.pl to first.cgi

Yup!  There's always the big hammer approach.  Why not
tell your web server about .pl files instead of making
everything .cgi?

best,
Bryan


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

Date: 18 Aug 1998 16:31:59 GMT
From: bdwheele@educ.indiana.edu (Brian Wheeler)
Subject: Re: #!usr/bin/perl is ignored, WHY?
Message-Id: <6rca9v$oic$2@jetsam.uits.indiana.edu>

Make sure your webserver knows that cgi-bin is an alias for the script
directory.  After that, it doesn't matter what its called:  if its an
executable, it will be run.

Brian Wheeler
bdwheele@Indiana.edu

In article <35CB8E3C.A53F8E65@stud.uni-hannover.de>,
	Raik Lietzow <Raik.Lietzow@stud.uni-hannover.de> writes:
> Hi there,
> 
> I just started to learn something about CGI's and Perl. I found a
> brilliant URL:
> http://lightsphere.com/dev/class/
> to get an introduction. But my first script doesn't work, unfortunately:
> 
> #!/usr/bin/perl
> 
> print "Content-type:text/html\n\n";
> print <<EndOfHTML;
> <html><head><title>Test Page</title></head>
> <body>
> <h2>Hello, world!</h2>
> </body></html>
> 
> EndOfHTML
> ;
> 
> I save the file and from the Unix shell, I typed: chmod 755 first.pl
> (Now, there's a * behind...)
> 
> When my HTML-File calls the URL:
> http://.../cgi-bin/first.pl
> I get a text-file back showing the commands of first.pl but not "Hello,
> world!"
> 
> Could it be that the first command
> #!usr/bin/perl
> is ignored?
> 
> Being in the cgi-bin directory (Unix shell), I tried to start another
> script using:
> ./test.pl
> It didn't work, as well. But using:
> usr/bin/perl test.pl
> it worked perfectly...
> 
> Can anyone tell me what's wrong with my lovely scripts?
> 
> Thanks, Raik
> Raik.Lietzow@gmx.de
> 


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

Date: Tue, 18 Aug 1998 23:40:57 +0800
From: wings <xuchu@comp.nus.edu.sg>
Subject: can perl be compiled into EXE format?
Message-Id: <Pine.SOL.3.96.980818233755.13446A-100000@sununx.iscs.nus.sg>

sometimes i do feel perl is running slowly.. is there anyway to make an
EXE file out of a .pl? i am using ActiveState Perl5.005 in Windows NT4.0.

thx for any enlightenment.

wings
------
World is a book, those dont travel read only one page.

Email: xwings@usa.net, xuchu@iscs.nus.edu.sg
ICQ UIN: 1440319
http://gump.iscs.nus.edu.sg



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

Date: 18 Aug 1998 17:26:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: can perl be compiled into EXE format?
Message-Id: <6rcdfe$9ae$1@client3.news.psi.net>

wings (xuchu@comp.nus.edu.sg) wrote on MDCCCXIII September MCMXCIII in
<URL: news:Pine.SOL.3.96.980818233755.13446A-100000@sununx.iscs.nus.sg>:
++ sometimes i do feel perl is running slowly.. is there anyway to make an
++ EXE file out of a .pl? i am using ActiveState Perl5.005 in Windows NT4.0.
++ 


Yes there is. But that doesn't solve your problem.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: 18 Aug 1998 16:42:45 GMT
From: "wkchiu" <wkchiu@yahoo.com>
Subject: Re: Change NT IP Address Using Perl
Message-Id: <01bdcac7$f31b57c0$636c8bd0@wkchiu>

Reboot is required in NT4.0 but not NT3.51

- <root.noharvest.\@not_even\here.com> &8<g$J(l%DCD
<35d48707.268535298@news2.cais.com>...
> "wkchiu" <wkchiu@yahoo.com> Said this:
> 
> >Is it possible to change the IP Address and Gateway using Perl ? What
Perl
> >command can I use ?
> >
> 
> Don't you still have to reboot an NT machine to change the IP address
> anyway?  
> 
> Get a linux box, and you can do it "on the fly" any way you like,
> perl, shell script, whatever. ;)
> 
> 
> 


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

Date: Tue, 18 Aug 1998 16:52:42 GMT
From: stevenjm@olywa.net
Subject: Re: comp.lang.perl.newbie
Message-Id: <6rcbgq$hbp$1@nnrp1.dejanews.com>

In article <ExvAoA.4nn@world.std.com>,
  aml@world.std.com (Andrew M. Langmead) wrote:
> "Sabre Taylor" <nonspammers.start.after.this.period.hot_redox@hotmail.com>
writes:
> [on the suggestion comp.lang.perl.newbies]
>
> >I think such a group would be worthwhile. The learning process is such
> >that human interaction is of great help especially during the initial
> >stages.

<SNIP>

> When you have novices answering other novices questions, you are going
> to get a lot of disinformation distributed.

<SNIP>

> many novices who will give responses once they think they know the
> answer, (which may be long before they know enough so that they really
> do.)

<SNIP>

> I can't see how a newsgroup without a regular group of experts can
> function.
> --
> Andrew Langmead
>

Exactly!

Considering this newgroup as the proverbial log, we need experts sitting on
the other end pointing out the error of our ways...

Back when I knew much more about perl than I do now, I sent an answer directly
to a poster on this news group.

The suggestion I sent the hapless recipient was simply wrong.  I (luckily)
caught the mistake a few hours later, and sent the man another e-mail begging
forgiveness and pleading for him NOT to use the code snippet I sent.

Very humbling experience, and I learned my lesson well on that one.

Perl is a perfect model of wisdom, the more you know, the more you realize how
ignorant you are and how much more there is to learn.

Until new users reach the proper level of ignorance, they can not be expected
to provide reliably competent advice to others.

Steve May
$two_cents < $value and next;

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


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

Date: Tue, 18 Aug 1998 12:42:07 -0500
From: Grant Griffin <grant.griffin@nospam.com>
Subject: Re: Converting to lowecase
Message-Id: <35D9BCEF.D9304752@nospam.com>


John Porter wrote:

> Now let me tell you about the park I hang out in.
>
> When I first came to this park, it was thronging -- so much so that one
> could hardly move.  Then I realized that a farmer's market was going on,
> and people were actually bustling about buying great fresh produce for
> dirt cheap.  Everywhere there were signs saying "Please Do Not Litter".
> And occasionally (far too often, it seemed), some slob from Shelbyville
> would be leaning against a post -- right under a No Littering sign --
> and toss his banana peel on the ground.  Out from the crowd would rush
> this Richard Simmons-like dude and slap the guy silly.  Turns out he
> himself had painstakingly painted and erected all the many No Littering
> signs.  Not only that, but most of the time he picked up all the trash.
> Sure, none of the rest of the people enjoyed the sound of cracking
> skulls, but we were glad to see someone taking the trouble to keep
> the place sanitary.  Occasionally we lend the guy a hand with the
> dirty work.

I think most of the good, decent people of the neighborhood probably avoid _your_ park,
too...

Another One Bites the Dust:

To those of you who may have followed my modest attempts at reform over the past few
days, I am about to go away for good.  I'll save you the trouble and write it for you:

    > GOOD RIDDANCE, IDIOT!!!

Basically, all this arguing takes too much time and energy (also for _you_.)  Very little
that I have written in the last few days actually has to do with Perl--but likewise it is
my habbit to pick up litter when I find it in the park--even though I didn't go to the
park to pick up litter.  (I gotta tell you, though, I never dreamed that this park could
be this ugly...)

But if I ever return here, I will endeavor not to pick up litter, and I will ask actual
Perl questions, rather to try make the World of Perl a better place.

I would like to leave you with one final thought: If bashing "idiot" newbies is _truly_ a
kind of "Tough Love" as many rationalize it--rather than simply the blatant egotism its
non-practitioners believe it to be--these "lovers" can apply their "Tough Love" using a
form letter.  (I think Lloyd has made a very good start in that way.)  It is clear to me
that--though unkind--the bashers here are very literate, and are quite capable of coming
up with one or more standard "Tough Love" responses which will advance their "mission of
love" without providing them with the personal ego gratification that comes from
personally tearing down another person.  Since this approach will also save them a great
deal of  time and energy, they can rationalize no reason to avoid it.  If TomC and others
are able to provide "Tough Love" in this way without experiencing any personal ego
gratification, then (and only then) we will know they are doing it because they sincerely
believe it to be "best" for the World of Perl.  Otherwise, our suspicions that they get
their jollies by stepping on somebody else will be reaffirmed.

Even though I am leaving comp.lang.perl.misc, I will continue to use Perl (which is
Practically the best Extraction and Report Language ever invented!)  I do not claim to be
any "master" or "guru" of Perl, but I am living proof that an accomplished computer
programmer can learn Perl entirely on his own, just using the available documentation.
Please kindly remind the next misguided newbie of that.

Thanks, Best Wishes to All, and Goodbye.

=g2






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

Date: 18 Aug 1998 17:12:33 GMT
From: PerSteinar.Iversen@adm.hioslo.no (Per Steinar Iversen)
Subject: Expect.pm on Redhat 5.1 - does it work properly?
Message-Id: <slrn6tjdgi.7ur.PerSteinar.Iversen@elbonia.p52.hioslo.no>

I have problems running Expect.pm consistently
on a Redhat 5.1 machine. A script that illustrates
the problem is like this:

#!/usr/bin/perl -w
use Expect;

$account  = $ARGV[0];
$password = $ARGV[1];

$setpwd = Expect->spawn("/usr/bin/passwd $account");

$setpwd->expect(undef, "New UNIX password:"); 

print $setpwd "$password\n";

$setpwd->expect(undef, "Retype new UNIX password:");

print $setpwd "$password\n";

$setpwd->soft_close();

The machine in question have about 800 accounts.
If the user-record is at the start of /etc/passwd
it succeeds 99% of the time. If it is at the
end of /etc/passwd, the script hardly ever succeeds
but hangs waiting for the confirmation of the
password.

So, there is most likely a timing problem somewhere. Does
anyone have any idea? I have the latest Expect.pm,
IO-Tty-0.02 and IO-Stty-.02. 

The script works nicely all the time on a Redhat 4.2
machine, the problem is thus possibly glibc related (?)
All the latest updates for Redhat 5.1 have been applied.

Any input appreciated!

-psi


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

Date: Tue, 18 Aug 1998 18:55:24 +0100
From: Kare Hansen <hansen@sharptech.win-uk.net>
Subject: Filehandle associated file name
Message-Id: <35D9C00C.2A230C78@sharptech.win-uk.net>

Hi,

I currently having to modify some Perl functions which are being used
extensively by other modules. The functions writes to stdout and stderr
but I need to know if these filehandles have been associated with a
specific file and if they have, the name of the actual files.

I've now been through all the man pages, Nutshell Perl books, the
various online faq's etc. with no luck. Any help will be greatly
appreciated.

Regards,

Kare Hansen



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

Date: Tue, 18 Aug 1998 16:47:07 GMT
From: bill@sky-comm.net (Bill Mezian)
Subject: Re: filehandle in CGI.pm
Message-Id: <35d9af77.16318823@sky2.sky-comm.net>

On 14 Aug 1998 15:25:13 GMT, wings <xuchu@iscs.nus.edu.sg> wrote:

>i'm writing an upload script with CGI. as told in CGI.pm, 
>$q->param('file') returns both the filename as a string and a handle.
>so here is part of my codes:
>
>	$srcfile = $q->param('file');
>	# assuming that $srcfile='d:\test\a.html'
>
>	open (FP, ">d:\\test\\b.html") || die "cant write";
>	while (<$srcfile>) {
>		print FP $_;
>	}
>
>i always get zero bytes in b.html. where am i doing wrong?

You may want to check the routine in CGI.PM itself.  I believe it
initially writes the file to a tempfile.  If it can't write the
tempfile, that may be your problem.  I think the tempfile stuff is
documented in the code.

Bill
>
>thx for any help.
>-- 
>wings
>------
>World is a book, those dont travel read only one page.
>
>Email: xwings@usa.net, xuchu@iscs.nus.edu.sg
>ICQ UIN: 1440319
>http://gump.iscs.nus.edu.sg



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

Date: Tue, 18 Aug 1998 12:07:47 -0400
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: has anyone tried embedding perl in win32?
Message-Id: <35D9A6D3.A0C93AA8@fccjmail.fccj.cc.fl.us>

Brett Calcott wrote:
> 
> becos nobody seems to have answered my question from the 14th.
> here it is again for another try...
> 
> I have version 5.005_02 which I built using MSVC 5.0 sr3.
> I have been playing with embedding perl, and just copied the examples from
> perlembed.html and linked to the perl.lib as directed.
> The first couple of examples seem to work (I can get the mini-perl
> interpreter going) but when I try to pass some parameters I get undefined
> symbols at link time. (See the first example under heading "Evaluating a
> Perl statement from your C program".) Specifically with global PL_na. It
> seems to be having trouble importing other global symbols too.
> Any clues here???
> TIA.
> brett

If you are literally trying to embed perl into the Win32 code, why?

Perl is portable and high usable in the manner is was designed to be
used.  If you are not embedding perl into something, then please restate
the question.

If you are asking an XS question, even though I know zero about XS,
I would still think that a rewording of what you are asking is needed.

HTH,
-Sneex- 
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
http://www.fccj.org/cgi/mail?webmaster | http://webmaster.fccj.org/Webmaster


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

Date: 18 Aug 1998 17:00:52 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Have package use another symbol table?
Message-Id: <6rcc04$hsc$1@pegasus.csx.cam.ac.uk>

Sean McAfee <mcafee@qbert.rs.itd.umich.edu> wrote:
>In article <_7FA1.337$QT4.1366616@newbabylon.rs.itd.umich.edu>, I wrote:
>>sub copy_symbol_table {
>>	no strict refs;  # optional if not using strict refs
>>	my ($package_from, $package_to) = @_;
>>	while (my ($symbol, $glob) = each %{"${package_from}::"}) {
>>		*{"${package_to}::$symbol"} = $glob;
>>	}
>>}
>
>>copy_symbol_table "B" => "A";
>
>It occurred to me after I sent off the above article that this ought to
>work just as well, with much less work:
>
>%A:: = %B::;
>
>However, this doesn't seem to work:
>
>perl -e '$x = 10; %FOO:: = %::; print "$FOO::x\n";'
>
>After the symbol table assignment, inserting 'print $FOO::{"x"}' shows that
>$FOO::{"x"} is *main::x, as it should be, but 'print $FOO::x' doesn't
>display 10.

Consider the following variation of your example, which prints "10":

 perl -e '$x = 10; %FOO:: = %::; $a = "FOO::x"; print "${$a}\n";'

See what's going on now?


If not, consider this one, which also works:

 perl -e '$x = 10; BEGIN {%FOO:: = %::;} print "$FOO::x\n";'

If you still haven't got it, see the end of this message.



Mike Guy
  who guesses that compile time lookup of symbol table entries is the
  most important of Perl's optimisations.


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

Date: 18 Aug 1998 16:00:34 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rc8f2$7sa$1@client3.news.psi.net>

Greg Bacon (gbacon@cs.uah.edu) wrote on MDCCCXIII September MCMXCIII in
<URL: news:6rbuke$rfm$6@info.uah.edu>:
++ In article <6raukg$jep@mozo.cc.purdue.edu>,
++ 	gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
++ : It's possible for an O(N**2) algorithm to always run faster than an
++ : O(N) algorithm regardless of dataset size.
++ 
++ Sure.  People usually use big oh to talk about the worst case for an
++ algorithm, i.e. as an upper bound.

Since that's the correct use for big-Oh, the people who do it "usually"
that way are right. The people who do it otherwise are wrong. Big-Oh
*is* about upper bounds, and nothing else.

++                                     It's possible to choose a dataset
++ for which a certain algorithm runs at its greatest efficiency (i.e.
++ doesn't hit the worst case), whether that dataset be large or small.
++ 
++ : Big-O is an upper bound, so
++ : there's nothing to imply that an algorithm which is O(N**2) is not also
++ : O(n).  For example, "sub f {return 1}" is O(n!), as well as O(n**n)
++ : and O(n**2), O(n), and O(1).  Most people throw out the obviously
++ : ludicrous upper bounds, but we're already being somewhat pedantic
++ : here, so we're obligated to be precise.
++ 
++ How precise is it to label an O(1) algorithm O(n!)? :-)  I agree with
++ you that it is correct, but I would say such a labeling is an abuse
++ of the notation.  If it were the common practice, the notation would
++ stop conveying any information.

Bullshit. The notation doesn't stop conveying any information. If you
want to use big-Oh notation for tight upperbounds, then just simply
say the upperbound is tight.

++ : P.S. Some of my wording would be considered plagarism of Knuth except for
++ : the fact that I'm mentioning it now.  See TAOCP V1E3, page 107-110 to
++ : see what I'm lifting.  It's sure possible that I've added an erroneous
++ : statement myself; this is tricky stuff.  
++ 
++ I always found demonstrating that Quicksort is O(n lg n) tricky. :-)


Since quicksort isn't O (n log n), that's very tricky indeed.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 18 Aug 1998 16:29:22 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rca52$ra3@mozo.cc.purdue.edu>

gbacon@cs.uah.edu (Greg Bacon) writes:

}In article <6raukg$jep@mozo.cc.purdue.edu>,
}	gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
}: It's possible for an O(N**2) algorithm to always run faster than an
}: O(N) algorithm regardless of dataset size.
}Sure.  People usually use big oh to talk about the worst case for an
}algorithm, i.e. as an upper bound.  It's possible to choose a dataset
}for which a certain algorithm runs at its greatest efficiency (i.e.
}doesn't hit the worst case), whether that dataset be large or small.

You've missed my point here.  It's simply invalid to compare Big-O when
talking about efficiency.  If you were given "x <= 1, y <= 10**100",
it would be obvious that "x < y" is an erroneous assumption.  

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


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

Date: 18 Aug 1998 17:17:07 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rccuj$rfm$19@info.uah.edu>

In article <6rca52$ra3@mozo.cc.purdue.edu>,
	gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
: You've missed my point here.  It's simply invalid to compare Big-O when
: talking about efficiency.  If you were given "x <= 1, y <= 10**100",
: it would be obvious that "x < y" is an erroneous assumption.  

That's what I meant when I said it hides constants.

Greg
-- 
Today's agenda: Tug on Superman's cape, spit into wind, pull mask off Lone
Ranger, mess with Jim. 
    -- Ed Dravecky III


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

Date: 18 Aug 1998 17:25:58 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rcdf6$rfm$20@info.uah.edu>

In article <6rc8f2$7sa$1@client3.news.psi.net>,
	abigail@fnx.com (Abigail) writes:
: Greg Bacon (gbacon@cs.uah.edu) wrote on MDCCCXIII September MCMXCIII in
: <URL: news:6rbuke$rfm$6@info.uah.edu>:
: ++ How precise is it to label an O(1) algorithm O(n!)? :-)  I agree with
: ++ you that it is correct, but I would say such a labeling is an abuse
: ++ of the notation.  If it were the common practice, the notation would
: ++ stop conveying any information.
: 
: Bullshit. The notation doesn't stop conveying any information. If you
: want to use big-Oh notation for tight upperbounds, then just simply
: say the upperbound is tight.

Do you disagree that it's misleading to say comparing strings by
comparing corresponding characters takes O(n!) time?

: ++ I always found demonstrating that Quicksort is O(n lg n) tricky. :-)
: 
: Since quicksort isn't O (n log n), that's very tricky indeed.

O(n + n lg n) is the same as O(n lg n).

Greg
-- 
Ah, women. They make the highs higher and the lows more frequent.
    -- Nietzsche


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

Date: 18 Aug 1998 17:52:43 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rcf1b$jug$1@pegasus.csx.cam.ac.uk>

In article <6rcdf6$rfm$20@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <6rc8f2$7sa$1@client3.news.psi.net>,
>	abigail@fnx.com (Abigail) writes:
>: Greg Bacon (gbacon@cs.uah.edu) wrote on MDCCCXIII September MCMXCIII in
>: <URL: news:6rbuke$rfm$6@info.uah.edu>:
>
>: ++ I always found demonstrating that Quicksort is O(n lg n) tricky. :-)
>: 
>: Since quicksort isn't O (n log n), that's very tricky indeed.
>
>O(n + n lg n) is the same as O(n lg n).

What's that got to do with Abigail's (correct) statement?


Mike Guy


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

Date: Tue, 18 Aug 1998 10:37:44 -0500
From: Ashley Rosilier <ashley@austin.ibm.com>
Subject: Re: Inplace Editing
Message-Id: <35D99FC8.7B37FB14@austin.ibm.com>

> can anyone point me to some doucmentation (other than the
> $^I predefined variable!) or better yet, an example?
> 


Tad's post led me to the right place in the FAQ. My apologizes
for the list clutter.

Thanks,
Ashley
(who did try the FAQ first, I swear! :)

-- 

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Ashley Rosilier				IBM Microelectronics
ashley@austin.ibm.com			World Wide Design Center
(512) 838-8391
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>


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

Date: Tue, 18 Aug 1998 10:38:40 -0700
From: John Donnelly <johnd@xor.com>
Subject: Intro To Perl - Boulder, CO
Message-Id: <35D9BC20.26CF@xor.com>

The 9/1-3/98 Intro To Perl For Programmers is sold out.
        We have added a second September session, 9/22-24/98, to
        accommodate demand.  There are 4 openings left in the
        9/22-24 session (max 10 people).  Please contact me for
        registration information.
        --John Donnelly, Training Coordinator
          XOR Network Engineering, Inc.
          http://www.xor.com/; johnd@xor.com; 303-448-4816
                                *****
               Introduction to Perl for Programmers
                 (Three Day Hands-on Lecture/Lab)
                             Boulder, CO
                   Tom Christiansen Perl Consultancy
                Tuesday-Thursday, September 22-24, 1998
                          Tuition: $995


   Designed to  be  programmer-friendly  and  platform-neutral,
   Perl  is  a high-level, general-purpose programming language
   that makes easy and medium-hard  tasks  easy  and  seriously
   non-trivial  tasks  possible.   Now  moving  into its second
   decade, Perl has become the language of  choice  across  all
   platforms for programmers engaged in rapid prototyping, sys-
   tem utilities, software tools, system management tasks, data
   base  access, graphical programming, and world wide Web pro-
   gramming.
   NOTE: While this course is based on the current  release  of
   Perl  (version  5.004),  it is not intended to be a detailed
   discourse  on  all  advanced  programming   constructs   now
   afforded  by  that release.  It is a jump-start introduction
   to Perl for experienced programmers, not an advanced  course
   for Perl programmers.

   Who should attend:
   This three-day course is an intensive introduction  designed
   with  programmers in mind, preferably those with backgrounds
   in C programming, shell scripting, or both.

   Prerequisites:
   Ability to edit files with a UNIX text editor.   While  some
   previous exposure to Perl is beneficial, it's not essential.
   Because Perl incorporates  aspects  of  more  than  a  dozen
   well-known  UNIX  tools,  experienced  UNIX  programmers and
   administrators will come up to speed on Perl  very  rapidly,
   but  programmers  on  other platforms can also learn and use
   Perl.

   Topics Include:
   + Detailed Descriptions and Numerous Examples of:
       Syntax and semantics of the language, its data types, and
data            structures
       Regular expressions
       I/O facilities
       User-defined functions
       Writing and using library modules
   + An easy introduction to Perl's object-oriented
programming                    mechanisms


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

Date: 18 Aug 1998 17:32:22 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Julian Date
Message-Id: <6rcdr6$9ae$2@client3.news.psi.net>

ywang@maingate.net (ywang@maingate.net) wrote on MDCCCXIII September
MCMXCIII in <URL: news:6rc3en$633$1@nnrp1.dejanews.com>:
++ Hi,
++ 
++ Could anyone please tell me how to generate the Julian Date in Perl?


use Time::JulianDay;



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: 18 Aug 1998 17:19:52 GMT
From: ez074520@dilbert.ucdavis.edu (Tomoyuki Tanaka)
Subject: Re: pangrams in Perl --- randomized Robisonizing
Message-Id: <6rcd3o$i7q$1@mark.ucdavis.edu>


In article <6rbklp$l0f$1@nnrp1.dejanews.com>,  <b_redeker@hotmail.com> wrote:
>[snip]
>>  i wrote this mainly in the hope that others will modify it to
>[snip]
>> 		   2, 1, 7, 25, 22, 4, 4, 9, 2, 4, 1) ;  }
>>     else {
>>     	$seed="tt found this sentence which contains exactly  and  ";
>> 	$seed="this pangram tallies  and  ";
>> 	$seed="this sentence contains exactly  and  ";
>> 	for( @AtoZsplit ) { $c1{$_} = 1 } }
>did my news-reader make something disappear or is the above a little
>obsolete?


 if you are talking about how there are 3 consecutive lines
	$seed=...
 then that's because of laziness and for convenicence.

 more convenient not to comment out.  -- i can switch between
 different seeds (sentence templates) more quickly.

 (thanks, Alejandros, again for the comments.
 i'll make the changes soon.)



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

Date: Tue, 18 Aug 1998 19:35:25 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: print "Content-type:text/html\n\n"; and redirection...
Message-Id: <35d9bb5d.524144494f47414741@radiogaga.harz.de>

Simon Wistow (simon@new-mediacom.com) wrote:
: IIS is very picky, try putting this in instead

: print "HTTP/1,0 200 OK\n";
               ^ That, of course, should be a dot '.'
: print "Content-type: text/html\n\n";

It's probably easier to do

use CGI;
print CGI::header();

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 OpenVMS: Where do you    | work: mv@pdv-systeme.de
 want to BE today?        |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Tue, 18 Aug 1998 11:56:34 -0400
From: jbl <jlaird@nih.gov>
Subject: Printing letters with bolding, underline, and italics from perl script?
Message-Id: <35D9A432.65960F8E@nih.gov>

How does one print characters with bolding, underline, and italics from
perl script?

JBL



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

Date: Tue, 18 Aug 1998 17:36:30 GMT
From: louie@visca.com (Louie)
Subject: Problem with $^I in W95
Message-Id: <35d9bb0f.2806215@news.uni-stuttgart.de>

Greetings:

I'm trying to use the $^I in-place edit variable in Win95 (running the
GSAR version 5.004_02). The following works as expected:

#!/usr/local/bin/perl -w
use strict;
@ARGV = 'c:/texts/numbers.txt';
$^I = '.bak';
while (<>) {
  print
}

However, when I try $^I = 'old/*.bak'; (the c:/texts/old/ directory
exists), the original file is erased and no backup is made. In fact,
this happens whenever a * is used. Finally, if I try $^I = 'bak'; the
original file is erased and a 0 byte copy (numbers.txtbak) is created.

Is this just MS-DOS weirdness? Thanks.



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

Date: Tue, 18 Aug 1998 18:16:59 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: Re: Problems with file opening
Message-Id: <903461757.28574.0.nnrp-05.c2deb1c5@news.demon.co.uk>

Thanks Sean and everyone else who sent help. The problem was purely
self-generated. i.e. I screwed up by not thinking everything through
thoroughly. Basically, although the directory I was trying to write the file
to had the correct permissions set, the SUB-directory that I was creating
using $foo (created on-the-fly by the script) of course had not been
chmoded. An extra line of

chmod 0777, "$foo";

and the problem was of course speedily resolved. This may or may not serve
as a useful reminder to others too for future reference (Although 90% of the
people will be thinking "Duh, obviously")   ;-)

Many thanks again to all those who gave assistance.

Dan Adams
dan@fearsome.net


>> In my (Perl) CGI script I use $foo to describe a directory path - call it
>> 'a/b/c'
>>
>> After a great deal of other stuff (which all works fine) I ask the script
to
>> simply create a file 'a/b/c/bar.htm' and then close it without writing
any
>> data to the file. Simple, right? So I thought. I am using:
>>
>> open(FILE, ">/$foo/bar.htm") || die "I can't create that file\n";
>> close(FILE);
>>
>> and the script returns the dreaded "Internal Script Error" when I try
>> running it.


(huge snippage)

>Remember that depending on how your webserver is set up, you will almost
>certainly not have write access to the whole directory tree of the
>webserver(this would be very unsafe).  Try removing your path variable
($foo)
>and the preceding /and see where the file shows up.  While the permissions
on
>a file are not set until it is created, the permissions on the directory
>where you are trying to create the file will already be set.  Try running
>your script outside of the webserver to just check it's syntax.


(more snippage)




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

Date: Tue, 18 Aug 1998 12:38:34 -0400
From: John Porter <jdporter@min.net>
Subject: Re: quotemeta
Message-Id: <35D9AE0A.897@min.net>

Patrick Clauberg wrote:
> 
> I have mp3 files like artist # song.mp3 and want to get artist
> and song into my database
> 
> if ($file =~ /^(\w+\s+.*)+\s*#\s*(\w+\s*.*).mp3/) {

Um, what's wrong with

	( $artist, $song ) = split /\s*#\s*/, $file;

-- 
John Porter


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

Date: 18 Aug 1998 11:55:30 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: Random Number
Message-Id: <6rcbm2$l3l@fumnix.metronet.com>

) > In article <35d8473c.2260737@news.demon.co.uk>,
) >         Darren@introdesign.com (Darren Ferguson) writes:
) > : Is there a random number command for Perl or in fact a routine.

) Greg Bacon wrote:
) > Did you even bother to read the FAQ or the docs or some book on Perl?
) > I found 38 occurrences of `random' grepping through the FAQ and docs.

Grant Griffin <grant.griffin@nospam.com> writes:
) I know that "Windows People" (if that's what Darren is) supposedly deserve
) automatic scorn around here,

Who said anything about Windows???  I think you are reading
things into the reply that weren't there.  Greg _might_ have felt
some scorn but reading emotion from postings is particularly
problematic.

) but to my knowledge, Windows comes
) with nothing like "grep".

This is comp.lang.PERL.misc.  Go look up "grep" in the Perl
documentation.

To quote Greg:  Did you even bother to read the FAQ or the docs or
some book on Perl?  (:

) I'm sure many grep or grep-like
) programs are available on the net, but unless you have heard of
) a grep program somewhere, you may not have even thought
) of the concept.

By the way, my copy of WinNt came with find.exe as well as
"Start => Find => Files => Advanced => Containing Text".  My
copy of Perl came with HTML documents and my copy of WinNt
came with Internet Explorer which came with "Edit => Find".

) but I didn't psychically know about it before I discovered it
) there.

Maybe you didn't read enough of the documentation that came
with Pascal?  (:

) along with your helpful advice.

Helpful advice to all:  Read the documentation.  When you get new
software, take a minute to find the documentation.  There are
probably pointers to it in lots of places.  Just take the time
and make the effort.
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 18 Aug 1998 16:07:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: regex word boundary question
Message-Id: <6rc8sn$7sa$2@client3.news.psi.net>

Paul Phillips (paul@partitura.com) wrote on MDCCCXIII September MCMXCIII
in <URL: news:35D8DBE2.8BED869B@partitura.com>:
++ Hello,
++ 
++ I am reading and studying the "llama" book. (best way to learn, right?)
++ On page 83, when discussing word boundaries in regular expressions, I
++ read this:
++ 
++ /\bFred\b/;     #  matches Fred but not Frederick or alFred
++ 
++ Yes, I understand that, it makes perfect sense.  However, the next line
++ reads:
++ 
++ /\b\+\b/;      #matches "x+y" but not "++" or " + "
++ 
++ That does not make sense. As I read it, the first "\b" is a word
++ boundary, the next "\" escapes the "+" so it is a real plus and not a
++ multiplier (so there is one "+"), then the final "\b" is again a word
++ boundary.  So to me it matches " + " (space on either side of the plus)
++ and not the other two choices.  Am I dense and missing something here,
++ or is this a typo in the book?


How many words are there in this sentence? One? It only has letters and
spaces.....

A word boundary occurs when a non-word character (\W) is followed by a 
word character (\w), a word character is followed by a non-word character,
or at the beginning of the string if the first character is a word
character, or at the end of the string if the last character is a
word character.

There are no word characters in " + ", so how can there be a word boundary?




Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Tue, 18 Aug 1998 17:36:31 GMT
From: louie@visca.com (Louie)
Subject: Re: Run Perl5 in Win95
Message-Id: <35d9baf5.2780395@news.uni-stuttgart.de>

"Fernando Nemec" <fnemec@sti.com.br> wrote:

>Hi All!
>Can I run Perl Scripts under Windows95?
>If yes, how I can do it?

See: http://www.visca.com/clueless/cgi-win95.html
or, for Apache (strongly recommended):
http://www.visca.com/clueless/gs_perl_apache_win95.html or, for 



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

Date: 18 Aug 1998 17:29:25 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Strange behavior with 'use'
Message-Id: <6rcdll$iuk$1@pegasus.csx.cam.ac.uk>

In article <35D99F0C.1FD2@min.net>, John Porter  <jdporter@min.net> wrote:
>Martien Verbruggen wrote:
>> 
>> [use Module] is exactly equivalent to
>> 
>>     BEGIN { require Module; import Module LIST; }
>> ...
>> Otherwise, demands that a library file be included if it
>> hasn't already been included.
>> 
>> 'if it hasn't already been included.'
>
>My understanding is that only applies to the require, not to the
>import.  And evem when I tried adding an explicit call to import,
>it made no difference: package b still didn't get the exports 
>from package a.

The key to all this is the exact order in which things happen.   In
particular, that phrase 'if it hasn't already been included' conceals
a nasty wrinkle.    When does Perl consider a module to have been
included?    At the start of the require, or when the require has
completed?     Perl chooses the first, so as to avoid looping.    So
if you try to do a second require of a module nested inside the first,
it will be a no-op, and then Module->import will be called possibly
before Module has been compiled, leading to undefined subroutines and
other chaos as you observe.

The obvious fix:  don't do that, then.   Avoid looping module structures.

Or forgo the benefits of the import() function.   Write the inner use as

   use Module ();

Of course, then you'll have to explicitly qualify all uses of subroutines
from Module:

  Module::some_sub($arg1, $arg2);

All rather tedious.

There may also be mileage in pre-declaring subroutines.   I'll leave
you to work out the details and possibilities.


Mike Guy


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

Date: Tue, 18 Aug 1998 11:55:18 -0400
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: taint checking seems to slow down my code
Message-Id: <35D9A3E6.76CD60E6@fccjmail.fccj.cc.fl.us>

John Porter wrote:
> 
> Bill 'Sneex' Jones wrote:
> > I'm a complete failure.
> 
> Easy on the self-deprecation, hey.
> 

:]

Thx, but I wasn't serious anywas :]

:]
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
http://www.fccj.org/cgi/mail?webmaster | http://webmaster.fccj.org/Webmaster


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

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


Administrivia:

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

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


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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3475
**************************************

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