[10444] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4037 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 21 15:04:51 1998

Date: Wed, 21 Oct 98 12:00:26 -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           Wed, 21 Oct 1998     Volume: 8 Number: 4037

Today's topics:
    Re: Avoid excessive punctuation? <dgris@rand.dimensional.com>
    Re: Camel book: References. <d-edwards@nospam.uchicago.edu>
    Re: Can't do "use lib" <luutran@geocities_.com>
    Re: From scalar to array to output?? (Tad McClellan)
    Re: From scalar to array to output?? <ludlow@us.ibm.com>
    Re: Has anyone experience of using News::NNTPClient? <murrayb@vansel.alcatel.com>
        Novonyx, Apache, Perl & Novell <nbrigham@uainfo.arizona.edu>
    Re: Novonyx, Apache, Perl & Novell <rootbeer@teleport.com>
        OraPERL, Trapping if database is active <robertwp@iafrica.com>
    Re: Pattern Matching: Escaping Period Character (Brand Hilton)
    Re: Pattern Matching: Escaping Period Character <luutran@geocities_.com>
    Re: perl & Mysql (Daniel Beckham)
        Perl and regular expressions - revisited <puyleart@netconcepts.com>
    Re: Perl and regular expressions - revisited <luutran@geocities_.com>
    Re: Perl Cookbook - is this the best perl book? <gnat@frii.com>
    Re: Perl Cookbook - is this the best perl book? <gnat@frii.com>
    Re: Perl Cookbook - is this the best perl book? <uri@fastengines.com>
    Re: Perl on NT (David Cantrell)
        Prevent Export of Names (Joachim Zobel)
    Re: Problem with perl scripts... (Daniel Beckham)
    Re: Resubmit: Kindly help with file locking (Daniel Beckham)
        strange qwirk with READ <smith.will@epa.gov>
    Re: Testing a date (Richard S. Holmes)
        UPDATE: CNET Builder.com Live! New Orleans '98 (CNET Builder.com Live!)
    Re: what is strlen() in perl? <uri@fastengines.com>
    Re: What isn't Perl good for? <eashton@bbnplanet.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 21 Oct 1998 18:42:36 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Avoid excessive punctuation?
Message-Id: <m3vhld3gss.fsf@rand.dimensional.com>

tice@hunch.zk3.dec.com (Walter Tice USG) writes:

> I'm rereading 'Effective Perl Programming', which is just a great
> book.

I agree with you concerning EPP, although some here don't.

>        I do have a style objection to a specific suggestion on pp 34 
> "Item 10: Avoid excessive punctuation."  I'm sure the idiomatic
> crowd thinks it's a good idea to be able to to call functions without
> the explicit ampersand, or even worse use a plus sign (pp 32) ack!

You may have missed that calling with & can change the behavior of
a subroutine.  Consider-

$ perl
use strict;

sub foo {
   my $a = shift;
   die "Oops! Died!\n" if $a;
   print "In foo\n";
}

sub bar {
   &foo;
   print "In bar\n";
}

&foo;
&bar(1);
__END__

In foo
Oops! Died!
$

> My objection is two-fold:
> 
> #1. It's a matter of clarity/definition. If one writes the code, 
>     sure, you know that 'myfunc' is a function, but what about
>     maintenance?

This doesn't seem valid to me.  A person who doesn't recognize
perl keywords shouldn't be maintaining the code.  A person who
does recognize perl's keywords will not have to spend any time
recognizing a function call.

> #2. Since the ampersand is required if one wants to use a keyword for
>     a func name, you could end up with mixed use, which is even less
>     clear.

You should only use & in special circumstances.  Calling user
defined functions with the same name as a perl builtin counts
as one of those special circumstances.

> Naturally, it's a personal choice, but brevity isn't always clear, and
> excessive coolness isn't always wise - or appreciated by those that 
> follow.

Yes, but correctness is always appreciated.  Using & isn't correct
in the vast majority of circumstances.

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Wed, 21 Oct 1998 18:12:05 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: Camel book: References.
Message-Id: <tgk91tss22.fsf@noise.bsd.uchicago.edu>

"misc.word.corp" <misc.word.corp@pobox.com> writes:

> -A more general question: Would it be easier to write this in C?
> References in Perl seem a bit ornery, at least as presented in Camel.
> I'm sure that they offer many advantages over their complements in C.
> What exactly are those advantages, anyway?

I've got a pointer int * array in C, I wonder how many ints it's
holding?

(code)
printf("%d\n"; array[500]);

(output)
segmentation fault (core dumped)

I've got an array reference ${arrayref} in perl, I wonder how many scalars
it's holding?

if ($#{$arrayref} < 500) {
  print "Ouch!  I'm still running though, care to recover?\n";
} else {
  print $arrayref->[500], "\n";
}


I've got a mystery pointer p in C that was passed to my function;
what type is *p?  Is it int? (*int)? int (*) int?  Yikes.


I've got a mystery scalar $Mystery in perl... it could be a plain
scalar, or a ref to an int or array, or a ref to some huge convoluted
user-defined data structure.  What shall I do?

$Solved_mystery = ref($Mystery);


If you give me, in C, a pointer to one of your precious data
structures -- something nice and OO, with lots of intricate
internal parts you'd rather not have us greasy-fingered users
touch -- guess what, (char *)p points to the first byte, (char *)p+1
to the second, I can stomp right through it byte by byte!

If I give you, in perl, a ref to one of my hacked-up data
structures, yadda yadda -- guess what, perl doesn't allow
pointer arithmetic.


Cool, eh? :)
Darrin

PS I am sure my C here is full of syntax errors, I have honestly
not used it for so long that the details are fading.  My apologies.

PPS Tom Christiansen some time back (this summer?) posted a very cool
article, a "job interviewer's quiz" actually, that described in
great detail a lot of the differences between C pointers and perl
references.  It was very object-oriented, but almost all of it
was applicable to the question at hand I believe.  You might look
for it on dejanews, or someone might have saved it.


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

Date: 21 Oct 1998 18:18:23 GMT
From: "Luu Tran" <luutran@geocities_.com>
Subject: Re: Can't do "use lib"
Message-Id: <8CF9.47E58A8683luutrangeocitiescom@news.mindspring.com>

"Tom Phoenix" rootbeer@teleport.com wrote in 
<Pine.GSO.4.02A.9810201603420.5534-100000@user2.teleport.com>:

>You'll need to use a BEGIN block in that case. Something like this:
>
>    BEGIN { push @INC, '/where/lib/is'; }
>

Thanks I got it.  As it turns out, the package won't work anyway.  

$ ./perl -MSocket -e 1
Can't find 'boot_Socket' symbol in 
/usr/home/mdonline/lib/perl5/5.00502/i386-freebsd/auto/Socket/Socket.so
 at -e line 0

I think putting the binary distribution in my user dir won't cut it.  
Correct me if I'm wrong, but it looks like to install the bindist properly, 
I have to run h2ph and convert some headers, right?  I guess I'll have to 
badger the sysadmin some more :(

>Please remove the underscore _ in your address when you want replies by
>email
>

That's why I never ask for reply by mail.  It's just there in case someone 
wants to flame me :)

-- 
  luu
Please remove the underscore _ in my address when replying by email


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

Date: Wed, 21 Oct 1998 12:43:27 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: From scalar to array to output??
Message-Id: <vf6l07.skf.ln@flash.net>

Kinney Baughman (baughmankr@appstate.edu) wrote:

: I have phone numbers stored in a database in the form: 1234567890

: I want to collect the value of a phone number and output it in the form
: of: (123) 456-7890.

: Surely there is a better solution than this.

   I like the use of substr() as in Daniel's followup.


   You could, in the spirit of TMTOWTDI, use a s///:

      ($pretty = $phone) =~ s/^(\d{3})(\d{3})(\d{4})$/($1) $2-$3/;
      print "$pretty\n";


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 21 Oct 1998 13:22:08 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: From scalar to array to output??
Message-Id: <362E2650.599CDBDF@us.ibm.com>

Kinney Baughman wrote:

> I have phone numbers stored in a database in the form: 1234567890
> 
> I want to collect the value of a phone number and output it in the form
> of: (123) 456-7890.

You can use "substr" to do this.

#!/usr/bin/perl -w

$phone = 1234567890;
$~ = 'PHONE_NUMBER';
write;

format PHONE_NUMBER =
(@<<) @<<-@<<<
substr($phone, 0, 3), substr($phone, 3, 3), substr($phone, 6, 4)   
 .

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: 21 Oct 1998 10:40:21 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Has anyone experience of using News::NNTPClient?
Message-Id: <ud87lx18a.fsf@vansel.alcatel.com>

tmcguiga@my-dejanews.com writes:

> But from the documentatiom to this module I'm told it is an error to attempt
> to select a non-existent news group. Should I be using another method?
> 
> So how do I check for a group's existance? Getting a list of all newsgroups
> whould such an overhead.

You could use Net::NNTP and the list() command to build an array of legal
newsgroups, and use that as your checklist before attempting to select a
group.

-- 
-o- Brad Murray                  "Most programs aren't released;
-o- Alcatel Canada                they are allowed to escape."
-o- Software Analyst                        Jeff DelPapa


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

Date: Wed, 21 Oct 1998 11:11:42 -0700
From: Boxcar Willy <nbrigham@uainfo.arizona.edu>
Subject: Novonyx, Apache, Perl & Novell
Message-Id: <362E23DE.105050E7@uainfo.arizona.edu>

Here goes, pardon any and all idiocy on my part.

We currently have a web site on a Unix box running Apache. We are able
to run cgi scripts and perl w/o any trouble from there. Basically the
user fills out a form and it gets sent to the appropriate person(s)
depending on various inputs.

We now want to port our site to our Novell server where we run Novonyx
Suitespot, Netscapes Enterprise server and Novell 4.11. We are running
an "internal" site off of this setup. The problem is we can't get any of
our perl, cgi scripts to run. We have installed various gateways,
groupwise 5.5, webaccess and load the perl.nlm.

Is there anyone out there currently running this setup successfully?

--

Nick Brigham
'92 FXLR Custom
"I didn't rise to the top of the food chain just to eat vegetables"




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

Date: Wed, 21 Oct 1998 18:37:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Novonyx, Apache, Perl & Novell
Message-Id: <Pine.GSO.4.02A.9810211137400.5534-100000@user2.teleport.com>

On Wed, 21 Oct 1998, Boxcar Willy wrote:

> The problem is we can't get any of
> our perl, cgi scripts to run. 

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 21 Oct 1998 20:01:02 +0200
From: "Rob Pearson" <robertwp@iafrica.com>
Subject: OraPERL, Trapping if database is active
Message-Id: <70l7ho$ls4$1@news01.iafrica.com>

I am very new to PERL. Does anyone have any Oracle PERL script out there
that checks if a specific Oracle database is up. I want this perl script to
run by CRON and if the Oracle database is down, I want to Mail myself a
message. All I need is how to check if Oracle is up or down. PLEASE HELP.

Thanks




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

Date: 21 Oct 1998 18:20:23 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Pattern Matching: Escaping Period Character
Message-Id: <70l8l7$gov3@mercury.adc.com>

In article <362E13A4.7F0E0E09@cybie.com>, Chi Yu  <chi@cybie.com> wrote:
>Greetings,
>
>Can some kind soul please tell me how to match on a period (the
>character period) in a regular expression? A bare period in the regular
>expression is interpreted as a match against any single character except
>the newline character - that's not what I want.
>
>I want to find periods in a string. Must I use an escape character for
>the period? What would that be? I am specifically trying to match data
>in the following format:
>
>   nn.nn where n is a digit
>
>Thanks,
>Chi Yu

First, the short, direct answer to your question.  Yes, to match a
period, you must escape it.  The escape character is the backslash.

However, your question about periods is only the tip of the iceberg.
I think your real question will eventually boil down to, "How do
regular expressions work?"

For the answer to that question, you need to read -- carefully, and at
least two or three times -- the perlre man page, and the entries in
the perlop man page for "m/PATTERN/gimosx" and
"s/PATTERN/REPLACEMENT/egimosx".  If you're on a Win32 system, you can
see these documents via "perldoc perlre" and "perldoc perlop".

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: 21 Oct 1998 18:26:31 GMT
From: "Luu Tran" <luutran@geocities_.com>
Subject: Re: Pattern Matching: Escaping Period Character
Message-Id: <8CF9.48C274AB58luutrangeocitiescom@news.mindspring.com>

"Chi Yu" chi@cybie.com wrote in <362E13A4.7F0E0E09@cybie.com>:

> Can some kind soul please tell me how to match on a period (the
> character period) in a regular expression?

escape it with \ i.e., \.

To get a literal \ you of course do \\

see man page perlre

-- 
  luu
Please remove the underscore _ in my address when replying by email


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

Date: Wed, 21 Oct 1998 14:53:22 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: perl & Mysql
Message-Id: <MPG.1097f7b0fdc2f19198969a@news.supernews.com>

Your post made no sense.  After translating the English, I'm assuming you 
wish to access a MySQL server on a remote machine.  MySQL allows you to 
access a remote MySQL server via TCP sockets.  If you are using the MySQL 
Perl module, check out the connect function, or its equivalent.  This 
function allows you to specify a host name when connecting to a database 
and should do the trick nicely.

Regards,

Daniel Beckham

In article <362E0CF8.8E347E88@orangenet.co.uk>, iqbal@orangenet.co.uk 
says...
> Hi
> 
> I have perl with Mysql working fine on one machine. I now want to be
> able to send, receive data from this machine, to/from another machine
> using perl scripts.
> 
> However i do not want to install mysql on the second machine, is there a
> way round this, or do I need to install mysql on all my machne, before I
> can get them to talk to the database on one of them.
> 
> Thanks
> 
> Iqbal
> 


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

Date: Wed, 21 Oct 1998 13:06:00 -0500
From: "Jason Puyleart" <puyleart@netconcepts.com>
Subject: Perl and regular expressions - revisited
Message-Id: <70l7fs$bo$1@news3.alpha.net>

I think my first posting wasn't very clear so, I will try again with a more
specific example.

    I need to evaluate a variable in a regular expression:

$foo = 'Hello (World'

if ($bar =~ /$foo/)

    The problem is that the interpreter thinks that 'Hello (World' is
missing a left parenthese (indeed it is if I wanted to evaluate it that
way), but I want to evaluate the string in the variable.

Is there anything I can do to prevent this from happening?




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

Date: 21 Oct 1998 18:40:05 GMT
From: "Luu Tran" <luutran@geocities_.com>
Subject: Re: Perl and regular expressions - revisited
Message-Id: <8CF9.4A31FF3204luutrangeocitiescom@news.mindspring.com>

"Jason Puyleart" puyleart@netconcepts.com wrote in 
<70l7fs$bo$1@news3.alpha.net>:

> I think my first posting wasn't very clear so, I will try again with a 
more
> specific example.
> 
>     I need to evaluate a variable in a regular expression:
> 
> $foo = 'Hello (World'
> 
> if ($bar =~ /$foo/)
> 
>     The problem is that the interpreter thinks that 'Hello (World' is
> missing a left parenthese (indeed it is if I wanted to evaluate it that
> way), but I want to evaluate the string in the variable.
> 
> Is there anything I can do to prevent this from happening?
> 
> 

If that's a literal (, maybe you should escape it? 

$foo = 'hello \(there';

Otherwise that is an illegal regex and perl will rightly complain.

By the way, don't do this

$foo = "hello \(there";

because perl will eval $foo and it becomes 'hello (there' and you're back 
where you started.

-- 
  luu
Please remove the underscore _ in my address when replying by email


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

Date: 21 Oct 1998 11:56:22 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <5qems1dcjd.fsf@prometheus.frii.com>

pmj@hotmail.com (PM Jenkins) writes:
> I suggest that people buy this book when the next
> release comes out.

Hello, Peter.  Nathan Torkington here.  I cowrote the book with Tom.

> There are SO MANY typos/bugs/... in this book (757 of them).

Really?  Where did you get this figure from?  Even counting every page
number mentioned in the errata, I only get 343.  Most of those are
silly typos ("pager" for "paper" in the body of the text), not serious
show-stoppers.  The number of technical errors is around 30 or 40.

> My guess is that after authors typed in, they never looked it back
> until the book printed out.

Wrong on a number of accounts, I'm afraid.  It took us eighteen months
to write the Cookbook, during which time we read and reread each
section far too many times.  Other people read it, too--did you see
the number of people in the Acknowledgements?  We even checked the
code in the book with 'perl -c' to ensure there were no typos.

Some of the typos and bugs were introduced in production (those that
prevent code from compiling, for instance).  Some were there all
through the drafts that we circulated for others to read.  It's hard
to know what else we could have done to catch those bugs, though.  If
you have any ideas, we'd love to know how to prevent the bugs that
over a hundred people failed to pick up.

> Authors argue that 757 bugs are very small  comparing the size (less
> than 1 bugs / page !).

There you go with that figure again.  On the errata list on the
O'Reilly web site, it says less than 1 technical bug every 20 pages.

> Gees what an attitude !!

Which attitude are you referring to?  The attitude that we had over a
hundred people read the cookbook before it went to press?  The
attitude that we compile and make available the errata instead of
keeping them secret and forcing people to buy a later printing?  The
attitude that we're fixing as many of the errata as we can with each
printing that goes out?  The attitude that we respond to email and
newsgroup messages from our readers?  The attitude that we're rolling
Cookbook solutions back into the FAQ?

We have a lot of attitude, but I don't think any of it is the attitude
you're accusing us of.

> I think that they owe an apology to the
> buyers for publishing such a screwed-up error-ridden version.

Alternatively, one might say that you owe us an apology for posting
such an error-ridden, misinformed, and potentially sales-damaging
message.

>  One question that I had was, how come authors ended up typing
> variables in all CAPS ?  Are they MS-DOS or VMS users ?

That was a hang-over from the original Camel.  The Great Missing
Chapter used allcaps and a font change for metasyntactic elements, and
we initially tried to mimic this.  We later decided it didn't work,
and began turning them back to lower-case real variables.  We failed
to get them all.

I ache sympathy for your poor tired eyes and long-suffering brain,
that they are so strained by the tragedy of allcaps.  Rest assured
that we are aiming to have them all eradicated and replaced by
tranquil soothing lower-case variables by the fourth printing.  I know
your prayers are with us for this noble endeavour.

So, in conclusion, I'm terribly sorry we didn't meet your exacting
standards.  Please accept my apologies.

However, I expect your level of criticism to be informed, and
therefore from a peer.  I look forward to buying a perfect first
printing of your forthcoming book.  Please supply publisher and title
information so that I may preorder it from Amazon.

Have a perfectly blissful day,

Nat


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

Date: 21 Oct 1998 12:05:42 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <5qd87ldc3t.fsf@prometheus.frii.com>

Daniel Grisinger <dgris@rand.dimensional.com> writes:
> pmj@hotmail.com (PM Jenkins) writes:
> <snip troll>
> The troll is dead.  Long live the troll!!

Whoops, I guess I fell for an IDG troll!  D'oh! :-)

Nat
("Usenet For Dummies" is a book title wrong in so many ways ...)


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

Date: 21 Oct 1998 14:28:57 -0400
From: Uri Guttman <uri@fastengines.com>
To: Nathan Torkington <gnat@frii.com>
Subject: Re: Perl Cookbook - is this the best perl book?
Message-Id: <sariuhdn506.fsf@camel.fastserv.com>

>>>>> "NT" == Nathan Torkington <gnat@frii.com> writes:

  NT> Daniel Grisinger <dgris@rand.dimensional.com> writes:
  >> pmj@hotmail.com (PM Jenkins) writes: <snip troll> The troll is
  >> dead.  Long live the troll!!

  NT> Whoops, I guess I fell for an IDG troll!  D'oh! :-)

  NT> Nat ("Usenet For Dummies" is a book title wrong in so many ways
  NT> ...)

hey gnat,

why not rewrite the cookbook for dummies. just remove all the code and
text and leave the recipe titles! no errata, no content, just what IDG
ordered!

other titles could be:

	"cooking perl for dummies who burn boiling water"
	"perl for low grade morons who won't understand this book anyway"
	"perl in 50 microseconds for complete idiots"
	"how to make money fast by publishing and selling this book on
	perl to morons who don't know what a good technical book looks like"
	"perl: RTFM"

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Wed, 21 Oct 1998 16:38:34 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl on NT
Message-Id: <362f0df6.84923763@thunder>

On Tue, 20 Oct 1998 21:53:11 -0500, "Matt Johnson"
<mjohnson@getonthe.net> enlightened us thusly:

>Does anyone know why my perl scripts are looking for files that are in my
>servers root, instead of the directory that my scripts are in.
>
>I am using IIS 3.0.

That'd be the reason then.

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Wed, 21 Oct 1998 18:50:56 GMT
From: jzobel@my-dejanews.com (Joachim Zobel)
Subject: Prevent Export of Names
Message-Id: <362e7e5a.4573511@dilbert.crrrwg.de>


Hi.

Heres another one from the C++ programmers road to perl. 

I have modules where I only want to export a limmited set of
functions. I have noticed that functions are exported even if I don't
list them as EXPORT_OK. Is there a way to stop this?

I am importing them into main by using require and calling them by
their module::function names.

Yes, im trying to mimick private functions. And I know the quote with
the gun at the head:-). Just want to have the gun around.

Thanx,
Joachim

"I read the news today oh boy"             - The Beatles - A Day In The Life

Althoug this message has a valid From header, replies 
to user@kud.com where user = jzobel are preferred.


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

Date: Wed, 21 Oct 1998 14:17:36 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: Problem with perl scripts...
Message-Id: <MPG.1097ef4aaa32b142989699@news.supernews.com>

You really should read the cgi spec, the perl faq's and other docs.  You 
need to send a content header first.

print "Content-type: text/html\n\n";

then send your hello statment.

print "Hello!\n";


In article <70kq0i$p52$1@nnrp1.dejanews.com>, hyytiainen@edu.h4thol.fi 
says...
> So I decided to ask for help...
> 
> I4ve had a problem with my cgi scripts...
> Every time I try to execute any script, attempt results with this kind of
> message...
> -------------------------------------------------------------------------
> Internal Server Error
> 
> The server encountered an internal error or misconfiguration and was unable to
> complete your request.
> 
> Please contact the server administrator,  and inform them of the time the
> error occurred, and anything you might have done that may have caused the
> error.
> _________________________________________________________________________
> 
> Or when I tried to call a script from html page, it didn4t write anything.
> Okay! So I seeked a problem without finding it and decice to try with a script
> as simple as possible.
> _________________________________________________________________________
> #!/usr/local/bin/perl
>  #
>  # hello world
>  #
>  print 'Hello world./n/n';
> _________________________________________________________________________
> And I tried to call it like this:
> _________________________________________________________________________
> Content-type: text/html
> 
> <html>
> <head><title>testing</title></head>
> <body>
> <center>
> <!--VirtualAvenueBanner-->
> <!--#exec cgi=/cgi-bin/simple.pl-->
> </center>
> </body>
> </html>
> _________________________________________________________________________
> And nothing....
> I can4t figure out what is wrong...  Can you?
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
> 


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

Date: Wed, 21 Oct 1998 14:55:22 -0400
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: Re: Resubmit: Kindly help with file locking
Message-Id: <MPG.1097f8223cbeec1798969b@news.supernews.com>

I've heard that lockf and flock both have trouble locking across the 
network.  Anyone know something for sure about this?

In article <362E0F39.BA6C6B45@creative.net>, ff@creative.net says...
> Hello,
> 
> I'm trying to use the lockf module to lock files across the network but
> have not had much luck.  Would really appreciate a hint or a clue.  Here's
> a simple script that shows the problem:
> 
> #!/bin/perl -w
> 
> use strict;
> use File::lockf;
> 
> open F, "<foo" or die "Unable to open foo\n";
> my $err = File::lockf::lock(\*F);
> print "Error = $err\n";
> 
> which prints
> 
> Error = 9.
> 
> Thanks in advance for any help.  Would also appreciate direct e-mail because
> this newsgroup grows so fast and if I don't check for a couple of days I
> lose the messages off our server.
> 
> 


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

Date: Wed, 21 Oct 1998 14:46:21 -0400
From: "William Smith" <smith.will@epa.gov>
Subject: strange qwirk with READ
Message-Id: <70la60$prn2@valley.rtpnc.epa.gov>

I am using perl to read dbase files --see code below. When run on NT I find
that one particular dbase file will not read properly, i.e., the read
statement

read(DB,$buf,12);

returns 5 meaning it read only 5 of the 12 requested bytes.

I checked the file for damage, but it is okay.  On unix no problem.

What's going on here? Any ideas.



open(DB,$dbname) || die "Unable to open $dbname: $!";

#db header
# stuff As String * 4
# recs As Long
# hdrlen As Integer
# reclen As Integer

 # read dbase header using "little-endians"
 read(DB,$buf,12);
 ($a,$nrecs,$hdrlen,$reclen) = unpack("A4 V v v",$buf);






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

Date: 21 Oct 1998 14:21:05 -0400
From: rsholmes@rodan.syr.edu (Richard S. Holmes)
Subject: Re: Testing a date
Message-Id: <xzck91t4vzi.fsf@rodan.syr.edu>

In article <MPG.1097bc7018b620d7989830@nntp.hpl.hp.com> lr@hpl.hp.com (Larry Rosler) writes:

>I call that the year 2.1K problem, which most of us won't have to deal 
>with. :-(  In any case, your suggested formula fails for most Western 
>European countries before 1752 (do `cal 1752` and look at September), 
>and for Russia before 1918 or so, and ...
>
>Fortunately for most of us, the Unix epoch doesn't include 1900 or 2100.
>
>As a confirmed pedant, I believe there really should be a limit to 
>pedantry.
>
>    unless ($year % 4) {                    # leapyear?
>
>will do just fine for me.

Yes, it will -- or it won't.  It depends.

The problem is with the problem, which was ill-defined.  In what
context are we checking a date?  Is this for an accounting system,
which must deal only with dates beginning now and for the next (say)
twenty years in a particular locality?  Or a genealogy system, which
must deal with dates in all countries for all times up through (say)
twenty years from now?  Or a system to help develop science fiction
writers' timelines, which has to be good through the next (say) ten
thousand years?

Does it need to understand the Jewish calendar?  The Chinese calendar?

Does it have to cope with the fact that Sweden (I think) once --
literally, *once* -- had a February 30?

Never solve a problem until the problem is clearly understood.

-- 
- Rich Holmes
  Syracuse, NY /             We have more important things to do...
  Newport News, VA           Censure and move on!  Sign the petition at
  rsholmes@mailbox.syr.edu   <http://www.moveon.org>


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

Date: 21 Oct 1998 18:39:35 GMT
From: builderlive@cnet.com (CNET Builder.com Live!)
Subject: UPDATE: CNET Builder.com Live! New Orleans '98
Message-Id: <builderlive-2110981141460001@10.10.64.203>


CNET Builder.com Live! New Orleans '98
the technical conference for site builders
December 7-9
http://www.builder.com/live


LAST CHANCE TO SAVE $200!!
This Friday, October 23 is the last day to save $200 off on-site
registration for CNET Builder.com Live! New Orleans '98.  Register now at
http://www.builder.com/live

Don't miss out on the only good conference for Web builders. We are
looking forward to a spectacular conference in December and based on early
registrations we expect to sell out.  

For complete information and to register, visit http://www.builder.com/live


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

Date: 21 Oct 1998 14:04:28 -0400
From: Uri Guttman <uri@fastengines.com>
To: Michal Rutka <erhmiru@erh.ericsson.se>
Subject: Re: what is strlen() in perl?
Message-Id: <sarlnm9n64z.fsf@camel.fastserv.com>


>>>>> "MR" == Michal Rutka <erhmiru@erh.ericsson.se> writes:

  >> >> Perl is wonderful!
  MR> What so wonderful about it?
  >>  why do you make comments like that after helping someone out?

  MR> It is not a comment. It is a question. I know why I love Perl, and
  MR> all I want to know is why, a begginer (I guss), like Mehdi is
  MR> finding Perl wonderfull.

i understand your intent now, but i did interpret it in a negative
way. as some have asked me to be clearer, i will ask you to do the
same. i think others who i have emailed with agree that that comment
reads as negative. other ways to write it might be:

which part of perl do you most feel wonderful about?
tell us more about why you feel wonderful about perl.

these convey a more positive view from the writer as well and asking the
original poster about their views. the question you asked could be read
as "WHY do you think perl is wonderful (since i don't think so)?"

  MR> My personal software experince is 14 years. I work in a lab where
  MR> I have ten other programmers. Only I am using Perl :-(, moreover I
  MR> am not a programmer but a system engineer. Especcialy, young
  MR> programmers, are not attracted by Perl. All I want is to gather
  MR> some arguments form others.

that is great.
  >> if you don't like perl, than why do you use it?

  MR> I LOVE PERL. You are too fast with your conclusions.

  >> and why do you follow this group?

  MR> I've already explained this.

well, as we have butted heads (and others would agree with me) your
public attitude could be perceived as anti-perl. this posting will help
clear that view. previously you jumped on me without knowing the entire
thread (and you did apologize), and you jumped on john porter regarding
the ST before you understood what he meant (and his little syntax
error). so you can understand why we would read negative views in your
other posts.

  >> we know plenty of people who dislike perl for various reasons and
  >> that is fine. but to denigrate it while actually answering a query
  >> in the group can get a little irritating to the rest of us. we like
  >> the language and like helping out others with it.

  MR> Me too. Didn't you notice that I am helping others too. A nice
  MR> thing about it is that in the morning I have a lot of credidts in
  MR> mail mail box, from all over the world, from guys which I helped
  MR> :-)

i have noticed your helping, which is why i was confused about your
attitude. i welcome your assistance for others. i just wanted (and
probably will see) a more positive take on perl from you.

  >> there have been plenty of flame wars about perl as you have seen so
  >> please keep comments about you perl love/hate to those threads. and
  >> keep the language answers focused on just the problem. i know the
  >> poster said "perl is wonderful" but they probably didn't expect
  >> your retort.

  MR> God and heaven, please keep me out from flame wars. I never took
  MR> part in any, and I do not want. Neither I want to start one.

well, the ST thread with john porter had some sparks and smoke but it
didn't erupt into an all out flame war.

  MR> Hope this explains my point of view, and hope this will decrease
  MR> my missunderstanding ratio with you.

it is a fine step along that path. i will give you more understanding
and leeway especially regarding your english. it can be tricky saying
what you really mean when the language can be read so many ways.

  MR> Oh, I have a signature too: -- Dr. Ir. Michal Rutka Ericsson Radio
  MR> Systems BV Senior System Engineer P.O. Box 2015 Wide Area Pagers
  MR> 7801 CA Emmen Bluetooth The Netherlands

so put it in your .signature file and have your news reader use it.

uri


-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Wed, 21 Oct 1998 18:00:49 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: What isn't Perl good for?
Message-Id: <362E1EC8.79B06F1@bbnplanet.com>

Uri Guttman wrote:

> hey we should do this. if all pm members were to invest, we could create
> a geek pub. i am tired of all the irish pubs here. we have had pm
> meetings in most of the brewpubs and nothing works out well for us (some
> combination of good food, beer, service and privacy (less outside noise
> so we can make our own).

Actually, I've already hired someone to do a business plan over the
weekend. It will be here in Boston, of course. Now to find the perfect
location. :) Good food, folks and fun and Perl. I've always wanted to do
this. 

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

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

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