[19915] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2110 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 11 18:06:02 2001

Date: Sun, 11 Nov 2001 15:05:16 -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: <1005519916-v10-i2110@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 11 Nov 2001     Volume: 10 Number: 2110

Today's topics:
        ANNOUNCE: Graph-ReadWrite 1.04 <neil@bowers.com>
        comp.lang.perl <stuart@otenet.gr>
    Re: comp.lang.perl <andrew@erlenstar.demon.co.uk>
    Re: comp.lang.perl <stuart@otenet.gr>
    Re: comp.lang.perl (Jon Bell)
    Re: comp.lang.perl <flavell@mail.cern.ch>
    Re: comp.lang.perl <stuart@otenet.gr>
    Re: comp.lang.perl <tim@vegeta.ath.cx>
        Exec stops execution of Perl script after having comple <no_spam.yet_another_apprentice@hotmail.com>
    Re: Exec stops execution of Perl script after having co <stuart@otenet.gr>
    Re: Exec stops execution of Perl script after having co <s_grazzini@hotmail.com>
    Re: Exec stops execution of Perl script after having co (Clinton A. Pierce)
    Re: Exec stops execution of Perl script after having co (Logan Shaw)
        GUID generation <mikecook@cigarpool.com>
    Re: How to assign initial value to variable? <spamfree@go-away.net>
    Re: How to assign initial value to variable? <echang@netstorm.net>
        How to initialise EOF (W) <spamfree@go-away.net>
    Re: How to initialise EOF (W) <flavell@mail.cern.ch>
    Re: How to initialise EOF (W) <mbudash@sonic.net>
        How to use Shift and GetOpts (BUCK NAKED1)
    Re: How to use Shift and GetOpts (Garry Williams)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 11 Nov 2001 14:47:40 +0000
From: Neil Bowers <neil@bowers.com>
Subject: ANNOUNCE: Graph-ReadWrite 1.04
Message-Id: <tut9t5699gnc0e@corp.supernews.com>

A new release of the Graph-ReadWrite distribution is making
its way round CPAN:

  file: $CPAN/authors/id/N/NE/NEILB/Graph-ReadWrite-1.04.tar.gz
  size: 21351 bytes
   md5: 7648540f832af93f00b7dff3007e3c98

What is Graph-ReadWrite?

	A collection of modules for reading and writing directed
	graphs in a variety of formats. The graphs are represented
	in Perl using Jarkko's Graph classes.

	The distribution includes a reader and writer for a simple
	XML format designed specifically for the perl Graph classes.
	Formats supported:

		Reading:	Dot, HTK, XML
		Writing:	Dot, HTK, daVinci, VCG, XML

What's changed since the last public release?

	* The Dot reader was contributed by Mark Hillebrand
	* Reader and Writer for HTK lattice file format
	* Bugfix in Graph::Reader::XML from Mark Hillebrand
		(didn't handle multiple attributes correctly)
	* Changed my contact email address since I've moved jobs

Neil
-- 
Neil Bowers <neil@bowers.com>




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

Date: Sun, 11 Nov 2001 21:44:48 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: comp.lang.perl
Message-Id: <9smkvs$qrt$1@usenet.otenet.gr>

I have seen many people say this group has been rmgrouped 5 years ago. I
have seen the URLs stating that it is so.
I emailed my news service with the relavent URLs and recieved no reply
whatsoever.
Google has the group!
http://groups.google.com/groups?q=comp.lang.perl&hl=en&lr=lang_en&sa=N&tab=w
g

Newsfeeds.com has the group
http://www.newsfeeds.com/groups/dnewsweb.exe?utag=&wild=comp.lang.perl&cmd_g
rpsearch=Go

I think something needs to be done about this from a higher level.

Or since I have the group maybe I should go on a crucade posting a "this
group is dead please go to comp.lang.perl.misc " message every two weeks.

It is very anoying for new people seeking a perl newsgroup for the first
time
seeing
comp.lang.perl
comp.lang.perl.misc
comp.lang.perl.announce
etc
Most people will chose comp.lang.perl

Something more needs to be done about this.
NB comp.lang.perl has about 10 messages a day compaired to 100 or so here.
IMHO 10% is a significant problem.

--

Stuart Gall
------------------------------------------------
This message is not provable.



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

Date: 11 Nov 2001 20:17:15 +0000
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: comp.lang.perl
Message-Id: <87vgghrrjo.fsf@erlenstar.demon.co.uk>

>>>>> "Stuart" == Stuart Gall <stuart@otenet.gr> writes:

 Stuart> I have seen many people say this group has been rmgrouped 5
 Stuart> years ago. I have seen the URLs stating that it is so.  I
 Stuart> emailed my news service with the relavent URLs and recieved
 Stuart> no reply whatsoever.

 Stuart> Google has the group!

Google is an _archive_, not a news server; removing groups defeats the
purpose of archiving, so they don't do that.

Ideally, of course, they should prevent people from posting to groups
which are no longer valid; I have no idea whether they do so or not.

 Stuart> Newsfeeds.com has the group

Newsfeeds has the dubious distinction of having more bogus groups than
virtually anyone else, including every misspelling, old removed group,
groups created by dictionary floods or active-file graffiti, and so on.
At least at one time they even had more groups than Altopia did.

-- 
Andrew.


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

Date: Sun, 11 Nov 2001 22:55:42 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: Re: comp.lang.perl
Message-Id: <9smoue$sso$1@usenet.otenet.gr>

"Andrew Gierth" <andrew@erlenstar.demon.co.uk> wrote in message
news:87vgghrrjo.fsf@erlenstar.demon.co.uk...
> >>>>> "Stuart" == Stuart Gall <stuart@otenet.gr> writes:

>  Stuart> I have seen many people say this group has been rmgrouped 5
>  Stuart> years ago. I have seen the URLs stating that it is so.  I
>  Stuart> emailed my news service with the relavent URLs and recieved
>  Stuart> no reply whatsoever.
>
>  Stuart> Google has the group!
>
> Google is an _archive_, not a news server; removing groups defeats the
> purpose of archiving, so they don't do that.
>
> Ideally, of course, they should prevent people from posting to groups
> which are no longer valid; I have no idea whether they do so or not.

I know google is an archive. What I mean to say is that it is *still*
archiving comp.lang.perl
it has messages from today. And yes google will allow you to post to
comp.lang.perl

>
>
>  Stuart> Newsfeeds.com has the group
>
> Newsfeeds has the dubious distinction of having more bogus groups than
> virtually anyone else, including every misspelling, old removed group,
> groups created by dictionary floods or active-file graffiti, and so on.
> At least at one time they even had more groups than Altopia did.

Hmm ok I didn't know that. Google got dejanews so Google is now the defactio
standard as far as I am concerned. I just looked at newsfeeds because there
was a link from www.usenet.org




--------------------------------------
This message is not provable.



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

Date: Sun, 11 Nov 2001 21:04:26 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: comp.lang.perl
Message-Id: <GMnMJE.GBL@presby.edu>

In article <9smkvs$qrt$1@usenet.otenet.gr>,
Stuart Gall <stuart@otenet.gr> wrote:
>I have seen many people say this group has been rmgrouped 5 years ago. I
>have seen the URLs stating that it is so.
>I emailed my news service with the relavent URLs and recieved no reply
>whatsoever.
>Google has the group!

>Newsfeeds.com has the group

>I think something needs to be done about this from a higher level.

On Usenet, there is no higher level with real authority to do anything, 
beyond the administrator(s) of each individual news server.  Whatever 
integrity Usenet has depends on the voluntary cooperation of news server 
administrators, and their willingness to follow canonical newsgroup lists, 
FAQs, etc.

>Or since I have the group maybe I should go on a crucade posting a "this
>group is dead please go to comp.lang.perl.misc " message every two weeks.

I think that would be a very useful thing for you to do, if nobody else is
doing it already.  On Usenet, if you really want something to get done, 
you have to be prepared to do it yourself!  :-)

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA


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

Date: Sun, 11 Nov 2001 21:49:57 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: comp.lang.perl
Message-Id: <Pine.LNX.4.30.0111112120050.18797-100000@lxplus023.cern.ch>

On Nov 11, Stuart Gall inscribed on the eternal scroll:

> I think something needs to be done about this from a higher level.

There is no "higher level" than an rmgroup message.

If you want to learn how the big-8 groups are organised, this is the
wrong place to do it: you need to be looking somewhere in the
news.admin.* hierarchy, or at the news.* FAQs. But briefly, there is a
regular posting called a "checkgroups message"  which is also archived
to the Usenet archives in
ftp://rtfm.mit.edu/pub/usenet-by-hierarchy/news/groups/
where you will also find some news FAQs that may help to understand
the (dis)organisation that is Usenet.

There _is_ no higher authority than this on whether a big-8 group
officially exists.

> Or since I have the group maybe I should go on a crucade posting a "this
> group is dead please go to comp.lang.perl.misc " message every two weeks.

There's no reason they would listen to J. Random Usenaut if they won't
pay attention to the authoritative checkgroups message.

> It is very anoying for new people seeking a perl newsgroup for the first
> time seeing
> comp.lang.perl

Indeed it is, but if you check the archives you'll find no shortage of
reminders that the group is officially dead.  Often, the response
seems to be that the hon Usenaut prefers the company that they find
there (as you'll also find people saying for alt.perl).

> Something more needs to be done about this.

It's easily said, but people have been speaking about it for years
now.

> This message is not provable.

I wasn't about to try.  The fact that I find my news client quoting
this is indicative that your sig separator must be defective, I think.

Cue A.Prilop's apposite sig:

| Outlook Express is a fine news_reader_.
| Its only problem: It allows you to post.

all the best



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

Date: Sun, 11 Nov 2001 23:56:58 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: Re: comp.lang.perl
Message-Id: <9sms7o$14o$1@usenet.otenet.gr>

"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message
news:Pine.LNX.4.30.0111112120050.18797-100000@lxplus023.cern.ch...
> On Nov 11, Stuart Gall inscribed on the eternal scroll:
>
> > I think something needs to be done about this from a higher level.
>
> There is no "higher level" than an rmgroup message.
>
> If you want to learn how the big-8 groups are organised, this is the
> wrong place to do it: you need to be looking somewhere in the
> news.admin.* hierarchy, or at the news.* FAQs. But briefly, there is a
Well not realy, maybe I should. My concern was that other people like me
would spend a few months in the wrong group.

>
> There's no reason they would listen to J. Random Usenaut if they won't
> pay attention to the authoritative checkgroups message.
TPTB will not care, but at least new recruits will be directed to the
correct place.

>
> > It is very anoying for new people seeking a perl newsgroup for the first
> > time seeing
> > comp.lang.perl
>
> Indeed it is, but if you check the archives you'll find no shortage of
> reminders that the group is officially dead.  Often, the response
> seems to be that the hon Usenaut prefers the company that they find
> there (as you'll also find people saying for alt.perl).
The reminders tend to be mostly reminders in clpm not to crosspost. The
person doing the reminding does not crosspost the reminder (obviously)

>
> > This message is not provable.
>
> I wasn't about to try.  The fact that I find my news client quoting
> this is indicative that your sig separator must be defective, I think.
>
There were two dashes and a space when it left me, and they are there when I
downloaded the message. Perhaps it is the line of dashes which is taken as a
sig-end. If it is perhaps I should change it?

Anyway I get the picture dada, let the crusade begin :-)

--

Stuart Gall
------------------------------------------------
This message is not provable.



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

Date: Sun, 11 Nov 2001 22:47:14 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: comp.lang.perl
Message-Id: <slrn9uu0et.5i7.tim@vegeta.ath.cx>

Jon Bell <jtbell@presby.edu> graced us by uttering:
> Stuart Gall <stuart@otenet.gr> wrote:
[ snip ]
>>Or since I have the group maybe I should go on a crucade posting a "this
>>group is dead please go to comp.lang.perl.misc " message every two weeks.
> 
> I think that would be a very useful thing for you to do, if nobody else is
> doing it already.  On Usenet, if you really want something to get done, 
> you have to be prepared to do it yourself!  :-)

People do this all the time.  I did it myself when I was lurking in
c.l.p making sure the newbies who chose it out of ignorance don't get
bad advice from the other newbies.

It was pointed out by several more experienced hackers every person who
posts to a dead group is used by the remaining posters to defend the
groups existence (and subsequent un-death).  Thus, I was adding to the
problem.

On top of everything else, many c.l.p'ers _know_ clpm exists and
deliberately do _not_ use it because of it's "reputation" for being
harsh and try to make the dead c.l.p a "kinder, gentler" dead group.

And because a group's death is unenforceable, we really can't do much
except remove it from cross-post headers and treat as if it were
officially _and_ effectively dead.

Am I missing something?

Tim Hammerquist
-- 
Boss:   You forgot to assign the result of your map!
Hacker: Dang, I'm always forgetting my assignations...
Boss:   And what's that "goto" doing there?!?
Hacker: Er, I guess my finger slipped when I was typing "getservbyport"...
Boss:   Ah well, accidents will happen.  Maybe we should have picked APL.
             -- Larry Wall in <199710311732.JAA19169@wall.org>


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

Date: Sun, 11 Nov 2001 21:44:14 +0100
From: "Bob Rock" <no_spam.yet_another_apprentice@hotmail.com>
Subject: Exec stops execution of Perl script after having completed?????
Message-Id: <9smocl$148as7$1@ID-98646.news.dfncis.de>

Hello,
I recently noticed that the system and exec calls are not equivalent. I
noticed that the exec call after having completed stops the execution (or
maybe just the output) of my Perl script. I thought it was due to the return
value of the called command but I verified that this is not so. Can someone
explain why both exec and system work in calling my command but when done
with the exec the Perl script stops execution immediately after having
completed the exec call? Thank you.


Regards,
Bob Rock






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

Date: Sun, 11 Nov 2001 23:04:20 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: Re: Exec stops execution of Perl script after having completed?????
Message-Id: <9smp4q$sv6$1@usenet.otenet.gr>

"Bob Rock" <no_spam.yet_another_apprentice@hotmail.com> wrote in message
news:9smocl$148as7$1@ID-98646.news.dfncis.de...
> Hello,
> I recently noticed that the system and exec calls are not equivalent. I
> noticed that the exec call after having completed stops the execution (or
> maybe just the output) of my Perl script. I thought it was due to the
return
> value of the called command but I verified that this is not so. Can
someone
> explain why both exec and system work in calling my command but when done
> with the exec the Perl script stops execution immediately after having
> completed the exec call? Thank you.
>

did you lookup exec or system in the manual perlfunc?
If you had looked up exec here is what you would have found (not my
emphasis!)

exec LIST
exec PROGRAM LIST
The exec() function executes a system command AND NEVER RETURNS - use
system() instead of exec() if you want it to return. It fails and returns
FALSE only if the command does not exist and it is executed directly instead
of via your system's command shell (see below).

Since it's a common mistake to use exec() instead of system(), Perl warns
you if there is a following statement which isn't die(), warn(), or exit()
(if -w is set - but you always do that). If you really want to follow an
exec() with some other statement, you can use one of these styles to avoid
the warning:



--

Stuart Gall
------------------------------------------------
This message is not provable.





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

Date: Sun, 11 Nov 2001 21:06:44 GMT
From: "Steve Grazzini" <s_grazzini@hotmail.com>
Subject: Re: Exec stops execution of Perl script after having completed?????
Message-Id: <ELBH7.98784$n5.12169975@typhoon.nyc.rr.com>

"Bob Rock" <no_spam.yet_another_apprentice@hotmail.com> wrote in message
news:9smocl$148as7$1@ID-98646.news.dfncis.de...
[..]
> value of the called command but I verified that this is not so. Can
someone
> explain why both exec and system work in calling my command but when done
> with the exec the Perl script stops execution immediately after having
> completed the exec call? Thank you.
[..]

You probably can't beat the explanation in perldoc -f exec. ;)

-Steve





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

Date: Sun, 11 Nov 2001 21:09:20 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Exec stops execution of Perl script after having completed?????
Message-Id: <4OBH7.11660$RI2.5944135@news2>

[Posted and mailed]

In article <9smocl$148as7$1@id-98646.news.dfncis.de>,
	"Bob Rock" <no_spam.yet_another_apprentice@hotmail.com> writes:
> Hello,
> I recently noticed that the system and exec calls are not equivalent. I
> noticed that the exec call after having completed stops the execution (or
> maybe just the output) of my Perl script. I thought it was due to the return
> value of the called command but I verified that this is not so. Can someone
> explain why both exec and system work in calling my command but when done
> with the exec the Perl script stops execution immediately after having
> completed the exec call? Thank you.

Oversimplifying greatly:

system is a function which stops (pauses) your perl program and starts
an external program running using the shell and whatever other tools
are necessary.  When the external program ceases, control is returned to
your perl program.

Think of exec not as a function but a "goto" (they don't return).  Instead 
of calling an external program, it overlays your current program (Perl) 
with the command specified.   The body's the same, but the guts have 
changed.  It doesn't return because...well, there's nowhere to return to.

I've got a fun little tutorial on fork written a while ago at:

	http://geeksalad.org/fork/all.html

But along the way it touches on exec.  Enjoy.

-- 
    Clinton A. Pierce            Teach Yourself Perl in 24 Hours  *and*
  clintp@geeksalad.org                Perl Developer's Dictionary
"If you rush a Miracle Man,     for details, see http://geeksalad.org     
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: 11 Nov 2001 16:12:08 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Exec stops execution of Perl script after having completed?????
Message-Id: <9smt3o$kqi$1@charity.cs.utexas.edu>

In article <9smocl$148as7$1@ID-98646.news.dfncis.de>,
Bob Rock <no_spam.yet_another_apprentice@hotmail.com> wrote:
>I recently noticed that the system and exec calls are not equivalent. I
>noticed that the exec call after having completed stops the execution (or
>maybe just the output) of my Perl script. I thought it was due to the return
>value of the called command but I verified that this is not so. Can someone
>explain why both exec and system work in calling my command but when done
>with the exec the Perl script stops execution immediately after having
>completed the exec call?

Because that's what they do!

Sometimes you want to replace the current process with an instance of
another program.  Sometimes you want to just call another program and
then return.  Since you want different things at different times, there
are different calls to do it.

Actually, system() is generally implemented in terms of exec().

What exec() does is it loads another program into the current process,
replacing the current program.  system() creates a new process (using
fork()), then has that new process call exec() to load a new program
into the new process, and then waits for that process to exit.

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


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

Date: Sun, 11 Nov 2001 15:07:44 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: GUID generation
Message-Id: <YECH7.226$wB3.322015@news.uswest.net>

Hi folks,
    Does anyone have any ideas on generating a GUID (global unique
identifier)? I see a module for win32 GUID generation, but not having
platform independence.
        Thanks!!!
            Michael
--
== CigarPool ==
http://www.cigarpool.com




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

Date: Sun, 11 Nov 2001 19:46:08 GMT
From: "spamfree" <spamfree@go-away.net>
Subject: Re: How to assign initial value to variable?
Message-Id: <4AAH7.28072$mh1.3448798@news1.cableinet.net>

> >>    use strict;
> >I get software server error with strict.
>
>
> Yes that is supposed to happen, violations of strict are fatal errors.
>
> The next step would be to go fix them.
Ged-away!
>
> If you had shown us the actual code, we could have provided actual
> help in resolving the strict issues...
>
Not certain which of my code is causing it...
'The server encountered an internal error or misconfiguration and was unable
to complete your request. '
Which is slightly better than useless.
>
> >I have heard you advise others to use strict and suggest it should be
used
> >as the default  (mandatory) :-)
>
>
> You are perceptive  :-)
Your on record at Google.
>
>
> >I get server error
>
>
> Server? What server? We're talking Perl here, Perl does not need a server.
>
> >even with $var initialized with 'my'
>
> strict requires[1] _declarations_ (as with my()). You are not
> required to also initialize (ie. set them to a value).
>
>    my $foo;  # no value set, yet strict is happy

I have predeclared and validated all variables.
Maybe it's because I've actually set values for each variable and it don't
like it? ...
my $database = "record.txt";
my $this = param("this");
my $that = param("that");
my $and = param("and");
my $everybloodyother = param("everybloodyother");
etc.
>
>
> >and find it
> >difficult to debug
>
>
> They should be brain-dead easy to repair as the message usually
> points right to the line that needs fixing.
>
>
> >as I don't have access to server logs.
>
>
> You should do all of your initial testing from the command line. Even
> better if it is on your own computer rather than an ISP's 'puter.
Hmm, I don't know how to enter name=value pairs standard input (keyboard) in
offline mode using active perl for windows, and I get "Too late for T option
line one but.. I'll read the docs some more :-)
>
> The ISP business is pretty cut-throat. If your's is silly enough
> to withhold from you the output from your very own programs, then
> you should really be shopping around for an ISP with a measurable
> clue quotient.
My host says it recognises the problem and will do so in the near future.
>
> You seem to be using Perl for CGI applications (only one of
> its MANY uses), so you should already know how to see the
> error messages even without access to the "server logs".
>
> Because you have surely looked for Perl FAQs that mention CGI:
>
>    perldoc -q CGI
>
>       "How can I get better error messages from a CGI program?"
Yup.The very first thing I did.
>
>
> >What other factors
> >come into play?
>
>
> I dunno what that might mean. Sorry.
I mean anything other than the obvious predeclaration.
Anything else I need to think about as to why I get errors with strict?
>
>
> >        if ( $surname =~ tr/a-zA-Z\n\t //c) {
>
> Golly, even the inventor of the World Wide Web (Tim Berners-Lee)
> won't be allowed to use your system!
>
> And neither will "Joe Foreman 3rd", "Joe Foreman 4th" ...
Cruel to those particular people I know but- at least they are warned about
it for having a fancy name :-)
>
> Why allow newlines and tabs in a proper name?
That's a... "I'll tidy it up later sort of thing".  honestly ;-)
like this perhaps..
if ( $surname =~ tr/a-zA-Z' //c)
>
> [1] strict does not really _require_ declarations. You can have
>     a strict-clean program with lots of variables and zero
>     variable declarations. How to do this is indicated in the
>     message that you get when you use an undeclared variable.
>
Thats the problem, the only message I'm getting is: 'The server encountered
an internal error or misconfiguration and was unable to complete your
request. '
and it's certainly not the shebang line either: #!/usr/bin/perl -Tw

--
millside
_____________






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

Date: Sun, 11 Nov 2001 20:40:09 GMT
From: "E.Chang" <echang@netstorm.net>
Subject: Re: How to assign initial value to variable?
Message-Id: <Xns9156A06C34EB4echangnetstormnet@207.106.92.86>

"spamfree" <spamfree@go-away.net> wrote in
news:4AAH7.28072$mh1.3448798@news1.cableinet.net: 

>> >>    use strict;
>> >I get software server error with strict.

[snip]

> Not certain which of my code is causing it...
> 'The server encountered an internal error or misconfiguration and
> was unable to complete your request. '
> Which is slightly better than useless.

[snip]
 
>> You should do all of your initial testing from the command line.
>> Even better if it is on your own computer rather than an ISP's
>> 'puter. 
> Hmm, I don't know how to enter name=value pairs standard input
> (keyboard) in offline mode using active perl for windows, and I get

When you get the CGI.pm the prompt for name=value pairs, type in the  
name and value pairs you want to initialize in the form name=value, one 
pair per line.  End with control-D (Unix) or control-Z (DOS).

> "Too late for T option line one but.. I'll read the docs some more
> :-) 

To avoid the "Too late..." error, invoke your program with the -T 
switch on the command line.  "perl -T scriptname"

[snip]

>> Because you have surely looked for Perl FAQs that mention CGI:
>>
>>    perldoc -q CGI
>>
>>       "How can I get better error messages from a CGI program?"
>>       Yup.The very first thing I did. 

And did you follow the advice?  Did you add

use CGI::Carp qw(fatalsToBrowser);

as the first statement after the shebang line?

[snip]

BTW, it is impossible to tell whose good advice you are responding to 
above.  When you follow-up to an article, don't delete the attribution 
line.

-- 
EBC


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

Date: Sun, 11 Nov 2001 19:46:09 GMT
From: "spamfree" <spamfree@go-away.net>
Subject: How to initialise EOF (W)
Message-Id: <5AAH7.28073$mh1.3449816@news1.cableinet.net>

Warning (W)
Use of uninitialized value at
/home/sites/site13/web/cgi-bin/pre-register/pre-register.pl line 166.
print <<EOF; # line 166

How to initialie EOF line?

--
millside
_____________




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

Date: Sun, 11 Nov 2001 21:19:41 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to initialise EOF (W)
Message-Id: <Pine.LNX.4.30.0111112114450.18797-100000@lxplus023.cern.ch>

On Nov 11, spamfree inscribed on the eternal scroll:

> Warning (W)
> Use of uninitialized value at
> /home/sites/site13/web/cgi-bin/pre-register/pre-register.pl line 166.
> print <<EOF; # line 166

Bet you omitted to terminate the previous program statement.
Perl would then think this was a continuation of it, and various
kinds of misleading errors could be reported.

Please get into the habit of showing a bit more context when you ask
about this kind of problem.  Just a few lines before and after the
point at which the incident occurred would normally suffice.  (Don't
go too far the other way and try posting an entire script that's
hundreds of lines long, of course!).



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

Date: Sun, 11 Nov 2001 20:50:20 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: How to initialise EOF (W)
Message-Id: <mbudash-3BF5B8.12502111112001@news.sonic.net>

In article <5AAH7.28073$mh1.3449816@news1.cableinet.net>, "spamfree" 
<spamfree@go-away.net> wrote:

> Warning (W)
> Use of uninitialized value at
> /home/sites/site13/web/cgi-bin/pre-register/pre-register.pl line 166.
> print <<EOF; # line 166
> 
> How to initialize EOF line?

often the line specified in an error message is confusing... as in this 
case... there's nothing wrong with this line... can we see the 5 lines 
before and after?

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Sun, 11 Nov 2001 12:58:38 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: How to use Shift and GetOpts
Message-Id: <2661-3BEECA5E-424@storefull-247.iap.bryant.webtv.net>

After reviewing the docs on "Getopt" and "shift", I still don't
understand how to use them. What does the below "shift" and "opts" codes
do, and how would you enter a directory name while using "shift"?

use Getopt::Std; 
use Net::FTP; 
use Cwd; 
getopts("dD"); 
defined($opt_d) or $opt_d = 0; 
defined($opt_D) or $opt_D = 0; 
my $dir  = shift;
my $dir = "temp_dir";


Thanks,
--Dennis



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

Date: Sun, 11 Nov 2001 22:29:21 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: How to use Shift and GetOpts
Message-Id: <slrn9utuu2.2dq.garry@zfw.zvolve.net>

On Sun, 11 Nov 2001 12:58:38 -0600 (CST), BUCK NAKED1
<dennis100@webtv.net> wrote:

> After reviewing the docs on "Getopt" and "shift", I still don't
> understand how to use them. What does the below "shift" and "opts"
> codes do, and how would you enter a directory name while using
> "shift"?
> 
> use Getopt::Std; 
> use Net::FTP; 
> use Cwd; 
> getopts("dD"); 

Now the @ARGV array has been shifted to remove all of the options that
were on the command line leaving only the words after the last option
or after the `--'.  

The return value of getopts() should be checked to see if it
encountered any errors.  It's often as easy as 

  getopts("dD") or die $usage;

> defined($opt_d) or $opt_d = 0; 
> defined($opt_D) or $opt_D = 0; 

Not sure why you do this.  Either way the _boolian_ value will be
false, if the option wasn't specified.  

> my $dir  = shift;

The variable $dir will now contain whatever word was left on the
command line after getopts() consumed the options.  

> my $dir = "temp_dir";

This declaration masks the first one, thus the first one is no longer
accessible.  You are enabling warnings, aren't you?  That would have
told you about the problem.  

-- 
Garry Williams


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 2110
***************************************


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