[18291] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 459 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 10 03:05:45 2001

Date: Sat, 10 Mar 2001 00:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <984211511-v10-i459@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 10 Mar 2001     Volume: 10 Number: 459

Today's topics:
    Re: binary to decimal conversion: FAQ answer is not goo (Martien Verbruggen)
        Broken Win32 signals!  What to do? <soleary@erols.com>
    Re: Can 2 Form actions be executed with one Submit butt <JukkaKorpela@hotmail.com>
    Re: Can a regex do this? <blah@blah.com>
    Re: Can a regex do this? <blah@blah.com>
    Re: Can a regex do this? <blah@blah.com>
    Re: Can a regex do this? <blah@blah.com>
    Re: Can a regex do this? <uri@sysarch.com>
    Re: Can a regex do this? (nnickee@nnickee.com)
    Re: Can a regex do this? <webmaster@webdragon.munge.net>
    Re: CGI won't work in Netscape browser <cdh@ala.net>
        create a text file in DOS format. <Bing@home.com>
    Re: create a text file in DOS format. <galen.menzel@mail.utexas.edu>
    Re: create a text file in DOS format. <webmaster@webdragon.munge.net>
    Re: Help to Install Perl <godzilla@stomp.stomp.tokyo>
    Re: Help to Install Perl <webmaster@webdragon.munge.net>
    Re: Help to Install Perl <dream1625@aol.com>
    Re: perl code/module to create a dynamic tree TOC menu  <ron@savage.net.au>
    Re: Perl download problem with default link <whataman@home.com>
    Re: Perl download problem with default link (Miguel Cruz)
        PLEASE HELP - Problem with CGI script <dakupoto@americanmaid.ece.utexas.edu>
    Re: PLEASE HELP - Problem with CGI script <ron@savage.net.au>
    Re: PLEASE HELP - Problem with CGI script <webmaster@webdragon.munge.net>
    Re: Tk based alarm clock (Victor Wagner)
    Re: Trying to capture current directory in variable (nnickee@nnickee.com)
    Re: Trying to capture current directory in variable <uri@sysarch.com>
    Re: using Perl for B2B? (Miguel Cruz)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 10 Mar 2001 13:30:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: binary to decimal conversion: FAQ answer is not good
Message-Id: <slrn9aj4e3.uuk.mgjv@martien.heliotrope.home>

On 10 Mar 2001 01:58:50 GMT,
	Abigail <abigail@foad.org> wrote:
> Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMDCCXLVIII
> September MCMXCIII in <URL:news:slrn9aj18t.uoe.mgjv@martien.heliotrope.home>:
> !! On Fri, 09 Mar 2001 23:31:46 GMT,
> !! 	John W. Krahn <krahnj@acm.org> wrote:
> !! > Martien Verbruggen wrote:
> !! >> 
> !! >> The ord and 'c' template indicate that you are working with characters.
> !! >> Normally, characters are 8 bytes long. You need to pick a length and
> !! >             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> !! > Is this a new ISO standard that I missed?  :-)
> !! 
> !! Ack.. 
> !! 
> !! s/bytes/bits/;
> 
> Oh, you didn't mean 8 one-bit bytes?

Nope. Where I come from the 1-bit bytes are sold out.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I used to have a Heisenbergmobile.
Commercial Dynamics Pty. Ltd.   | Every time I looked at the
NSW, Australia                  | speedometer, I got lost.


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

Date: Fri, 09 Mar 2001 23:49:21 -0500
From: Sean O'Leary <soleary@erols.com>
Subject: Broken Win32 signals!  What to do?
Message-Id: <3tajat0bnlp155ctel9ce67nvo21klajcl@4ax.com>

$self->{lurk} = 0;

Hey everybody,

I'm using Perl for Win32 (ActiveState distro build 623) and have been
reading in the Camel and in the perlwin32 about how signal handling is
really broken on Win32.  

I'm working on a program that will be run unattended at 1-2 hour
intervals on a NT 4.0 workstation.  The program queries a database,
writes a file, and decides whether or not it needs to be FTP'd up to
another machine.

When doing the database query, I use a connect call like this:

my $dsn = 'dbi:Oracle:my.remote.db";
my $dbh = DBI->connect( $dsn, 'user', 'pass', { RaiseError => 1 } );

The RaiseError makes the program die if anything goes wrong with the
querying of the remote database.  This is great, except for the "run
unattended" part.  I would like for the program to tell me that
something went wrong, without my having to go to the machine and look
at a log or something.

I was hoping I could do something like this:

local $SIG{'__DIE__'} = \$handler;

sub handler {
	use Mail::Mailer;
	# Send me some email
}

at the top of my program and then I would be all good.  It was after
this really didn't work ( the program would die during compilation
complaining of weird things, like modules I'm not even using
(Tie::Registry, specifically) saying that it couldn't find some module
or other. )  I moved this to a BEGIN block, and that was no better.  I
also tried the use sigtrap, and the results were a little bit
different, but still not too good.

It was after all this experimentation that I began to comprehend how
bad the Win32 signal situation was.  But many of the docs said you
could still do some simple things, like set flag or something and
bail.  So I set up a named pipe, and hooked that up to a little mailer
script, and decided that I should be able to write the death message
to the pipe and bail.  ( I opened the pipe at the top of the program,
so all I would have to do is print. )  This worked a little more
reliably than the mailing one, but still not all the time.  

So, to finally ask a question, is there a way that I can (reliably)
call a piece of code whenever the process dies on Win32?  I can see
myself writing a small army of scripts like this, so having a
convenient mechanism to do this would be fantastic.

Thanks everyone!

Sean O'Leary


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

Date: Sat, 10 Mar 2001 07:37:42 +0200
From: Jukka Korpela <JukkaKorpela@hotmail.com>
Subject: Re: Can 2 Form actions be executed with one Submit button?
Message-Id: <1cqiatov2i9dp3o2pgdmmjuo18pl0p4cmi@4ax.com>

Paul <m0rejunkmail@home.com> wrote:

>Thanks for the response, Jon. I was actually making a script. 

I'm afraid that people in comp.lang.perl.misc will be a bit astonished.
You added that group into the Newsgroups line and you don't describe the
previous discussion and your original problem. Since you also seem to
randomly change the From field, never using your full name there, the
discussion isn't getting very productive.

>I just needed the script to perform 2 functions 

Then code it to perform them.

You were given a reference to some help on how to write Perl code that
sends data by E-mail,
http://www.perl.com/pub/doc/FAQs/cgi/perl-cgi-faq.html (#4.1) 
Please read it, and if problems remain, re-read it, and have some other
FAQs needed, and if problems still remain, post a question to the group
where it is most on-topic.

>1) mail the data entries
>2) Print a thank you page.
>
>I've tried each one separately and they both work (separately).

No, they don't. You were using the horrendously unreliable (and
undefined in effect) action="mailto:...". You don't need two submit
buttons or two forms. One form, one button, one script. And that script
then needs to perform the two operations.
-- 
Temporary incomplete copies of my Web site that was
at http://www.hut.fi/u/jkorpela/ (now removed by HUT):
http://mtl.uta.fi/jkorpela/
http://mirror.subotnik.net/jkorpela/


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

Date: Fri, 09 Mar 2001 21:09:19 -0600
From: blahblah <blah@blah.com>
Subject: Re: Can a regex do this?
Message-Id: <6i6jatob9ourn2kig83aaabq3o3gmlslqd@4ax.com>

On 9 Mar 2001 06:18:38 GMT, sholden@pgrad.cs.usyd.edu.au (Sam Holden)
wrote:

>On Thu, 08 Mar 2001 23:58:44 -0600, blahblah <blah@blah.com> wrote:
>>
>>Arrrgh, and it's seems so close too! Unfortunately, .net and
>>jakarta-oro don't like it, the test variable never gets changed. I'm
>>pretty sure now that "pure" regexes can't do it, and the suggestions
>>so far have relied on implementation-specific abilities. Thanks for
>>your effort, though.
>
>Maybe that's because this is a perl group.
>
>If you didn't want it done with perl you should ask in a group 
>that actually cares about the language you want it done in.

Good point, but unfortunately regexes aren't used too much outside of
perl. This will likely change due to .NET, which is why I need to bone
up on it fast.


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

Date: Fri, 09 Mar 2001 21:10:37 -0600
From: blahblah <blah@blah.com>
Subject: Re: Can a regex do this?
Message-Id: <jo6jat4vqdg6j9jkd5ecurlbq6subd65va@4ax.com>

On Fri, 9 Mar 2001 21:39:08 +1100, mgjv@tradingpost.com.au (Martien
Verbruggen) wrote:

>1 - It has to be Wednesday for all values of test.
>2 - The banana has to be peeled
>3 - You can't use Perl
>4 - It has to be done in Perl
>5 - You can't use number 6
>7 - You can't use letters d, g, r, s, w, and y
>8 - It has to be exactly 3.14159265358979 lines long.
>9 - You have to be standing on one leg, singing the national anthem of
>    Macedonia, while drinking a glass of water and balancing an unbrella
>	on your nose.
>10- But most importantly, you can't do it! because I say so!

You got enough to do over there?


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

Date: Fri, 09 Mar 2001 21:12:42 -0600
From: blahblah <blah@blah.com>
Subject: Re: Can a regex do this?
Message-Id: <3s6jat0is85hr5egjoargkgrgf2310lrlk@4ax.com>

On Fri, 09 Mar 2001 08:05:15 GMT, Uri Guttman <uri@sysarch.com> wrote:

>you are just another anonymous troll, so play with moronzilla. here is
>your original post. NOWHERE does it mention anything about .net or
>java. NOWHERE does it say no perl specific code. NOWHERE does it have
>another group but this. so you take your stupid test and get the fuck
>out of here. you are too stupid to even use a real address or name.
>

You incompetent fuck, I said REGEX. I never said PERL. Now go blow
yourself, LOSER.


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

Date: Fri, 09 Mar 2001 21:14:20 -0600
From: blahblah <blah@blah.com>
Subject: Re: Can a regex do this?
Message-Id: <iu6jat0eevv125r411rre04gnkfm4v69m0@4ax.com>

On Fri, 9 Mar 2001 21:43:16 +1100, mgjv@tradingpost.com.au (Martien
Verbruggen) wrote:

>You've been wasting our time with a Java problem, not even understanding
>what you are doing. This is a Perl group. You don't understand what
>regexen are for. They are for MATCHING things. Not replacing things.

Yet another fucking loser who can't read. I said REGEX. I never said
PERL. I guess it's true that only old fucks who can't use current
languages still use perl. Sad.


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

Date: Sat, 10 Mar 2001 04:44:33 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Can a regex do this?
Message-Id: <x7ae6ucjwv.fsf@home.sysarch.com>

>>>>> "b" == blahblah  <blah@blah.com> writes:

  b> On 9 Mar 2001 06:18:38 GMT, sholden@pgrad.cs.usyd.edu.au (Sam Holden)
  b> wrote:

  >> On Thu, 08 Mar 2001 23:58:44 -0600, blahblah <blah@blah.com> wrote:
  >>> 
  >>> Arrrgh, and it's seems so close too! Unfortunately, .net and
  >>> jakarta-oro don't like it, the test variable never gets changed. I'm
  >>> pretty sure now that "pure" regexes can't do it, and the suggestions
  >>> so far have relied on implementation-specific abilities. Thanks for
  >>> your effort, though.
  >> 
  >> Maybe that's because this is a perl group.
  >> 
  >> If you didn't want it done with perl you should ask in a group 
  >> that actually cares about the language you want it done in.

  b> Good point, but unfortunately regexes aren't used too much outside of
  b> perl. This will likely change due to .NET, which is why I need to bone
  b> up on it fast.

i bet this asshole is just another of moronzilla's multiple
personalities. he show the same lack of communication skill, both in
writing unfocused questions and personal attacks the moment things don't
go his way.

as for regexes being used more in other languages, then why don't you
bother them? you will never learn them here, the one group where they
are discussed all the time.

oh, well, he got major plonked. too bad it didn't happen quicker.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sat, 10 Mar 2001 04:56:57 GMT
From: Nnickee (nnickee@nnickee.com)
Subject: Re: Can a regex do this?
Message-Id: <3aacb2e4.22992711@news-server.austin.rr.com>

On Fri, 09 Mar 2001 21:12:42 -0600, blahblah <blah@blah.com> scribbled
upon the bathroom wall in comp.lang.perl.misc:

>You incompetent fuck, I said REGEX. I never said PERL. Now go blow
>yourself, LOSER.

Can you READ?

Test:  What is the name of this newsgroup?  (Hint:  look after the
words "bathroom wall in" above).

Here, I'll make it even easier for you, since it's painfully obvious
that you have reading comprehension problems:

What is the name of this newsgroup?

A.  comp.lang.perl.misc
B.  alt.blah-at-blah-dot-com.has.the.iq.of.a.box.of.hair


Ok, I'm done feeding the troll now =)

Nnickee



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

Date: 10 Mar 2001 06:49:43 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: Can a regex do this?
Message-Id: <98ciq7$5lj$0@216.155.32.55>

In article <iu6jat0eevv125r411rre04gnkfm4v69m0@4ax.com>, blahblah 
<blah@blah.com> wrote:

 | On Fri, 9 Mar 2001 21:43:16 +1100, mgjv@tradingpost.com.au (Martien
 | Verbruggen) wrote:
 | 
 | >You've been wasting our time with a Java problem, not even understanding
 | >what you are doing. This is a Perl group. You don't understand what
 | >regexen are for. They are for MATCHING things. Not replacing things.
 | 
 | Yet another fucking loser who. can't read. 

You obviously can't read either much less comprehend what you DO read, 
or you would have a clear notion that even following up to this post and 
attempting to insult me will never happen despite your best efforts. 

 | I said REGEX. I never said PERL. 

Six hundred million sperm and you were the fastest? =:o Obviously, to 
everyone else here, you couldn't figure your way out of a crumpled paper 
sack with a flame thrower and a truckful of napalm. 


    you post a regex question in a *.perl newsgroup and how 
    the HELL do you expect anyone of the regular participants 
    to parse your question in ANY other context but oh gosh, 
    imagine that, !! --perl--  !!  wow!!! Epiphany!


I've scraped balls of lint out of my jeans pockets that had a better 
concept of their position in reality than you do. To paraphrase myself, 
"The only problem I have with sharks is that they are too large to get 
to such a shallow end of the gene pool as that which you currently 
wallow in."

 | I guess it's true that only old fucks who can't use current languages still 
 | use perl. Sad

I guess it's true that only people too young to have stopped wetting the 
bed in frustration at their complete inability to come up with a 
creative insult, still have to resort to such inane rants[sic] as their 
only outlet for their recriminations at their own barely-self-aware 
stupidity. Oh the pathos. Oh the humanity. Tripe. =:P


FYI: Perl is not only CURRENT but THRIVING. :) 
FYI: regexes are not limited to Perl but are present in numerous other 
contexts. 

chew on that on your way to the bottom of the barrel, and say 'hi' to 
the other people down at the bottom of my bit-bucket while you're down 
there. I hope it hurts when you finally hit bottom. Stupidity[1] should 
be painful. =:P

HANFD

[1](particularly this egregious)

-- 
If you have to flame, flame creatively or not at all. (i.e. everyone else should be grinning but the recipient, who should either wind up off his rocker with fury, or scratching his head wondering if (or how badly) he really got flamed.) Telling someone to fuck off simply isn't nearly as entertaining or educational. (: -- srg


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

Date: Fri, 09 Mar 2001 20:23:48 -0600
From: cdh <cdh@ala.net>
Subject: Re: CGI won't work in Netscape browser
Message-Id: <3AA99034.A85B809@ala.net>

Richard wrote:

> I have quite a few scripts running online and today noticed they are not
> executing when i try and run them from Netscape browser.
>
> When executed, all I get is the HTML code that is processed from the script.
> I have no idea what is going on.
> Everything works great in any other browser. Mainly the reason why I think
> Netscape is a heap of crap. But I must please everyone, and cannot do this
> if Netscape doesnt like my scripts.
>
> Can anyone explain why this is happening.
>
> Thank You,
> Richard

Try putting
print "Content-type: text/html\n\n";
at the beginning of your script.

Yes, Netscape is a piece of crap, so is IE, Mozilla, Opera and every other
browser I've tried. You simply have a choice of your favorite
"piece of crap". Your problem is not one that demonstrates why Netscape is
crap. It's simply adhering to the specs which those other browsers are
not doing.

Cheers,
Chris Hickman




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

Date: Sat, 10 Mar 2001 04:06:05 GMT
From: Renato Santos <Bing@home.com>
Subject: create a text file in DOS format.
Message-Id: <3AA9A73D.296821E6@home.com>

How do I create a text file in UNIX perl that is in DOS format rather
than UNIX?

I tried the system("/bin/UNIX2DOS $file1 $file2"); but it keeps giving
me a server error.  I'm using the perl script to create a text file from
a user input and the file has to be read by an NT machine.

I also tried using the binmode function after I open the filehandle but
that did not work either.

The file looks fine in UNIX but when I open it in WindowsNT it is all
just one long line.  The carriage return for each line is ignored.

Any clue?  I'm really a newbie with PERL so please excuse me if this
question is too trivial.

Bing


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

Date: Sat, 10 Mar 2001 01:21:19 -0600
From: Galen Menzel <galen.menzel@mail.utexas.edu>
Subject: Re: create a text file in DOS format.
Message-Id: <3AA9D5EF.F057C67C@mail.utexas.edu>

Try ending each line with "\r\n" instead of just "\n" when you are printing to
the file.

galen

Renato Santos wrote:
> 
> How do I create a text file in UNIX perl that is in DOS format rather
> than UNIX?
> 
> I tried the system("/bin/UNIX2DOS $file1 $file2"); but it keeps giving
> me a server error.  I'm using the perl script to create a text file from
> a user input and the file has to be read by an NT machine.
> 
> I also tried using the binmode function after I open the filehandle but
> that did not work either.
> 
> The file looks fine in UNIX but when I open it in WindowsNT it is all
> just one long line.  The carriage return for each line is ignored.
> 
> Any clue?  I'm really a newbie with PERL so please excuse me if this
> question is too trivial.
> 
> Bing


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

Date: 10 Mar 2001 07:25:25 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: create a text file in DOS format.
Message-Id: <98ckt5$5lj$2@216.155.32.55>

In article <3AA9A73D.296821E6@home.com>, Renato Santos <Bing@home.com> 
wrote:

 | How do I create a text file in UNIX perl that is in DOS format rather
 | than UNIX?
 | 
 | I tried the system("/bin/UNIX2DOS $file1 $file2"); but it keeps giving
 | me a server error.  I'm using the perl script to create a text file from
 | a user input and the file has to be read by an NT machine.
 | 
 | I also tried using the binmode function after I open the filehandle but
 | that did not work either.
 | 
 | The file looks fine in UNIX but when I open it in WindowsNT it is all
 | just one long line.  The carriage return for each line is ignored.
 | 
 | Any clue?  I'm really a newbie with PERL so please excuse me if this
 | question is too trivial.

You could always try using a more modern text-file reader that's savvy 
about line endings. For example, BBEdit Lite for Macintosh recognizes 
whether a text file is in *nix, DOS, or Mac format, automagically, and 
always displays them properly.

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: Fri, 09 Mar 2001 19:29:59 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Help to Install Perl
Message-Id: <3AA99FB7.4A6CF5F7@stomp.stomp.tokyo>

Suzanne wrote:

(snippage)
 
> ...then it was answered by net nazi who insists
> it is his responsibility to make sure people toe
> the mark in his newsgroups....

You haven't engaged myself in dialog yet.
I have an inherent knack for making these
net nazis appear to be the sissified geeks
they are truly.


> ...getting to know each other is such fun.

You may change your mind on this notion. I find
you to be as annoying as these sissified geeks
populating this newsgroup.

Godzilla!


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

Date: 10 Mar 2001 06:09:07 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: Help to Install Perl
Message-Id: <98cge3$t9$0@216.155.32.55>

In article <ltdq6.165689$B6.36878041@news1.rdc1.md.home.com>, "Suzanne" 
<sbucciarelli1@home.com> wrote:

 | Call me an unabashed noncomformist then .... c'est la vie!

package Useless::Dreck;

[massive snip]

package main;

Don't be surprised[1] if this causes you grief in other newsgroups. This 
business is not limited to Perl, Programming, or computers in general -- 
it's endemic to Usenet.

You've been politely informed of the posting conventions endemic to 
Usenet, and those which we here at c.l.p.m generally request of all 
users and have not even bothered to follow up on the web-links we've 
thoughtfully provided for you that explain why this is (and creates) a 
problem. 

You not only continue to use a practice that bloats the deja archives 
with useless material that is already provided BY usenet via the 
references: mechanism, but do so in a manner that is flagrantly 
offensive. And this, despite the fact that we are not being offensive in 
kind to you, in simply informing you of the facts. 

package Disgust;

Fine. Wallow in your ignorance. Blissfully unaware (on purpose) that 
despite the fact that there's better and more acceptable ways of doing 
things, you're just gonna do your own thing and everyone else can fuck 
off. 

package Flame;

sorry, ma'am, but you are, to put a fine point on it, stupid.  Six 
hundred million sperm and you were the *fastest*? please. YOU come here 
to acquire information and learn, but insist on picking nits with us 
when we tell you the correct way of doing things is not limited to your 
simplistic little world view? 

Have a nice little world. 

I've been more than patient, more than helpful, more than 'nice' and 
more than 'showing admirable restraint'. til now, anyway :) 

*plonk*[2]

[1] 'act so innocently amazed at the reaction you get'
[2] Any questions? rebuttals? more nonsense? additional Follow-ups? 
you're talking to the hand. 

HAND.

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: Sat, 10 Mar 2001 07:43:54 GMT
From: "Suzanne" <dream1625@aol.com>
Subject: Re: Help to Install Perl
Message-Id: <_Wkq6.167750$B6.37069766@news1.rdc1.md.home.com>

hmmmm .... a classic case of top-posting obsession disorder ... relax Scott,
take a deep breath ... seek a 12-step anti-top-posting support group, and
when all else fails:
Never sweat the petty things and
Never pet the sweaty things!
__________________________________________
Suzanne @CampusTech
http://www.campustech.com   Beta Site: http://campust.iserver.net/
Big Discounts on Software for Students & Teachers




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

Date: Sat, 10 Mar 2001 19:06:40 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: perl code/module to create a dynamic tree TOC menu ??
Message-Id: <aqkq6.739$zW2.33483@ozemail.com.au>

See below

--
Cheers
Ron  Savage
ron@savage.net.au
http://savage.net.au/index.html

Chile <abcd@ntlworld.com> wrote in message news:Y7bq6.8198$t1.572554@news6-win.server.ntlworld.com...
> Hi,
>
> You know those cool tree toc menu's like the ones used in windows explorer.
>
> Does anyone know if there is perl module or perl code that you can store the
> folder options in a txt file and then run the script that will create the
> tree and display it on the web page??

Perhaps the closest to what you want would be CGI::Explorer. Get it from a CPAN near you.
I expect to upload V 1.01 in a couple of days :-).





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

Date: Sat, 10 Mar 2001 03:07:10 GMT
From: "What A Man !" <whataman@home.com>
Subject: Re: Perl download problem with default link
Message-Id: <3AA99AD5.8707A34D@home.com>

Micah Cowan wrote:
> 
> "What A Man !" <whataman@home.com> writes:
> 
> > Why can WinZip grab this file...
> > http://members.tripod.com/~Mystiqal/Fonts.zip ...
> > but my browser or LWP can't?
> >
> [ S N I P ]
> 
> It could be that the URL checks your "Browser" HTTP Header field.
> This doesn't seem likely, though.  Are you /sure/ that WinZip gets
> what it's supposed to from that URL?
> 
> I thought it might be a virtual server, requiring the use of the
> "Host" field, but a quick check disproved that.
> 
> Micah


Yes, using IE, when I click on the link from Tripod's default page, it
downloads the correct file, and then I take it to WinZip and it unzips
it. I mispoke... I should've said that my IE browser, not WinZip, gets
the correct file; but IE only gets it after you go to the default page
and click on it. (There's got to be a way to do this with a Perl
script.) Of course, WinZip has nothing to do with downloading a file...
it only unzips it. I checked the unzipped files, and they were all
there.

--Regards,
Dennis

--Dennis


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

Date: Sat, 10 Mar 2001 06:28:41 GMT
From: mnc@admin.u.nu (Miguel Cruz)
Subject: Re: Perl download problem with default link
Message-Id: <tQjq6.1797$8I5.1237278@typhoon2.ba-dsg.net>

What A Man ! <whataman@home.com> wrote:
> Why can WinZip grab this file...
> http://members.tripod.com/~Mystiqal/Fonts.zip ...
> but my browser or LWP can't?

The tripod server is looking at the Referer header. I was able to get it
this way:

  curl -H 'Referer: http://members.tripod.com/~Mystiqal/Fonts.zip' \
    http://members.tripod.com/~Mystiqal/Fonts.zip

(don't type this, or at least redirect it somewhere, unless you want to
watch an awful lot of binary data fly by)

miguel


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

Date: Fri, 9 Mar 2001 21:41:37 -0600
From: Amal Banerjee <dakupoto@americanmaid.ece.utexas.edu>
Subject: PLEASE HELP - Problem with CGI script
Message-Id: <Pine.SOL.3.93.1010309213551.23675A-100000@americanmaid.ece.utexas.edu>


   Could some Perl/CGI guru please help me? I have a html file containing
   a form, from inside of which I invoke a CGI script. Now what I am
   trying to do is open a simple text file from inside the CGI script, 
   and write some text into it. However, this file is never getting
   created. The following code block shows this:

   open(FILEHAN, ">dat.txt") || die "File could not be opened!\n";
   print FILEHAN "This is a test.";
   close(FILEHAN);

   I am not getting any error message either. Could someone please 
   point out what I might be doing wrong? Thanks in advance for your
   help!
  



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

Date: Sat, 10 Mar 2001 19:02:04 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: PLEASE HELP - Problem with CGI script
Message-Id: <Slkq6.738$zW2.33528@ozemail.com.au>

See below

--
Cheers
Ron  Savage
ron@savage.net.au
http://savage.net.au/index.html

Amal Banerjee <dakupoto@americanmaid.ece.utexas.edu> wrote in message
news:Pine.SOL.3.93.1010309213551.23675A-100000@americanmaid.ece.utexas.edu...
>
>    Could some Perl/CGI guru please help me? I have a html file containing
>    a form, from inside of which I invoke a CGI script. Now what I am
>    trying to do is open a simple text file from inside the CGI script,
>    and write some text into it. However, this file is never getting
>    created. The following code block shows this:
>
>    open(FILEHAN, ">dat.txt") || die "File could not be opened!\n";
>    print FILEHAN "This is a test.";
>    close(FILEHAN);

Questions:
1) What is the current directory when the open statement is executed? That's where you are trying to write 'dat.txt'.
2) What makes you think you're CGI script has permission to write to this current directory, whatever it may be.
3) Web servers usually run as specific users. What user is your web server running as?






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

Date: 10 Mar 2001 07:22:20 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: PLEASE HELP - Problem with CGI script
Message-Id: <98cknc$5lj$1@216.155.32.55>

In article 
<Pine.SOL.3.93.1010309213551.23675A-100000@americanmaid.ece.utexas.edu>,
 Amal Banerjee <dakupoto@americanmaid.ece.utexas.edu> wrote:

 |    Could some Perl/CGI guru please help me? I have a html file containing
 |    a form, from inside of which I invoke a CGI script. Now what I am
 |    trying to do is open a simple text file from inside the CGI script, 
 |    and write some text into it. However, this file is never getting
 |    created. The following code block shows this:
 | 
 |    open(FILEHAN, ">dat.txt") || die "File could not be opened!\n";
 |    print FILEHAN "This is a test.";
 |    close(FILEHAN);
 | 
 |    I am not getting any error message either. Could someone please 
 |    point out what I might be doing wrong? Thanks in advance for your
 |    help!

use the -w switch on the shebang line: 

    #!perl -w

    use strict; # speaks for itself

    use CGI qw/:standard/; 

and last but not least

    use CGI::Carp qw/fatalsToBrowser/;

which will in most cases indicate error codes to you in the browser 
window.

in a worst case you can always telnet to your shell and run the unix 
'tail' command on the web error log files therein to see if the errors 
were logged there. 

I generally go on to add something even more complex to my 
    use CGI::Carp; 
statements, though. 

based on the docs at Lincoln Stein's CGI.pm website: 

 use CGI::Carp qw(fatalsToBrowser set_message);
   BEGIN {
     sub handle_errors {
        my $msg = join( br(), @_);
        print 
          header, 
          start_html( "CGI/Perl Script Error" ),
          h2( "aCk!"),
          p( "I'm currently beta-testing some changes, so E-mail me, ", 
              a({-href=>'mailto:yourname@yourdomain.com'}, "yourname"), 
              ", about this if it persists.",
           ), 
          hr,
          p( "Got an error: $msg" ), 
          end_html;
       }
     set_message(\&handle_errors);
   };


HTH

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: 9 Mar 2001 13:03:24 +0300
From: vitus@wagner.rinet.ru (Victor Wagner)
Subject: Re: Tk based alarm clock
Message-Id: <98a9pc$kvu$1@wagner.wagner.home>

In comp.os.linux.misc * Tong * <sun_tong_001@yahoo.com> wrote:
: Hi,

: I'm planing to write a Tk based alarm clock, and make it open source
: tool for the public. So the first thing I have to make sure is that
: there's not such a thing out there. My research is enclosed at the
: end of this email. 

It seems too simple task to make it standalone program.
I estimate size of script about 200 lines with good GUI interface
for setting alarms.

By the way, it would require perl or Tcl interpreter to stay in memory
during all your login session, and this seems to much for just an alarm
clock. 

I now use much more complicated tool, which have clock, calendar,
startup menu and much more (but not alarm. I've planned to include it,
but never found time). Really it is something like graphical desktop
shell. For this task flexibility, provided by tcl outweights memory
footprint.


: xalarm clock: C based.
: alarm clock in tkgoodstuff: too simple and not stand alone. 

Add rclock which comes with rxvt. C-based too.


-- 
"You can't have filenames longer than 14 chars.
You can't even think about them!"
             -- Larry Wall in Configure from the perl distribution


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

Date: Sat, 10 Mar 2001 04:46:46 GMT
From: Nnickee (nnickee@nnickee.com)
Subject: Re: Trying to capture current directory in variable
Message-Id: <3aabaef7.21986825@news-server.austin.rr.com>

On 09 Mar 2001 08:41:25 -0800, merlyn@stonehenge.com (Randal L.
Schwartz) scribbled upon the bathroom wall in comp.lang.perl.misc:

>Michael> I am a Perl newbie writing a program that does a tree-walk;

>Please don't, unless you are basing it on File::Find, already included
>in your distribution.

Randal,

Have you written a post (that the new google-deja archive will
actually have) or an article that addresses the why behind that
"please don't"?   Reason I ask is because I learned a lot by doing
things the hard way (like "tree-walking" without using File::Find and
writing irc bots without using Net::IRC) the first time around... 

And yes, I know I created a heckuva lot of square wheels and a whole
lot of ugly code along the way =)

Nnickee



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

Date: Sat, 10 Mar 2001 05:28:05 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Trying to capture current directory in variable
Message-Id: <x77l1ychwa.fsf@home.sysarch.com>

>>>>> "nc" == nnickee@nnickee com <Nnickee> writes:

  nc> On 09 Mar 2001 08:41:25 -0800, merlyn@stonehenge.com (Randal L.
  nc> Schwartz) scribbled upon the bathroom wall in comp.lang.perl.misc:

  >> Please don't, unless you are basing it on File::Find, already included
  >> in your distribution.

  nc> Have you written a post (that the new google-deja archive will
  nc> actually have) or an article that addresses the why behind that
  nc> "please don't"?   Reason I ask is because I learned a lot by doing
  nc> things the hard way (like "tree-walking" without using File::Find and
  nc> writing irc bots without using Net::IRC) the first time around... 

  nc> And yes, I know I created a heckuva lot of square wheels and a
  nc> whole lot of ugly code along the way =)

you just answered your own question. if you want to do those things for
educational purposes, fine. but for a real program, why (poorly)
reinvent the wheel.

i recall a digital lab class where we built a UART (the hardware logic
of a serial line) from TTL logic. in then next lab assigment we were
given a UART chip to use. so the same thing applies there, we reinvented
a wheel to learn about it. but when making a car, we were given wheels.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sat, 10 Mar 2001 06:12:20 GMT
From: mnc@admin.u.nu (Miguel Cruz)
Subject: Re: using Perl for B2B?
Message-Id: <8Bjq6.1796$8I5.1231081@typhoon2.ba-dsg.net>

Hermel Michaud  <hermel_michaud@hotmail.com> wrote:
> Thanks Jon for giving your 2cents.
> Here's more details to what i mean.
> I am a programmer(im not a newbie, but i am a Junior Programmer(1 year
> exp.)
> What i want to do is the connect ONE big company with all of its vendors
> for online transactions. I've been learning Java(servlets, JSP,EJB) for a
> few weeks now, but someone told me Perl would be better for me since our
> developement team is 2 or 3 persons max.

What language is your one year's experience with? That's likely to be a good
starting point, unless maybe it was Logo or PostScript. I wouldn't recommend
switching development languages too many times, because it's just a waste of
time. Wait until you're good at something - anything - and then it'll be
easier and more effective to explore. Otherwise you'll just keep blaming the
language-of-the-day for whatever problem you run across.

You can do what you're doing in any language. The main issue for your
application is going to be the database programming; Perl, Java, whatever
will just be used for glue, user interface, and stringing together SQL.

All that said, it is true that you can get started in Perl with much less
heartache than with Java. There's a lot fewer hoops to jump through in
creating a Perl program. On the other hand, that means you have more
responsibility as a programmer.

miguel


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V10 Issue 459
**************************************


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