[13330] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 740 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 8 12:07:30 1999

Date: Wed, 8 Sep 1999 09:05:14 -0700 (PDT)
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, 8 Sep 1999     Volume: 9 Number: 740

Today's topics:
    Re: "Use <module>" Decide at run-time? (Bart Lateur)
        Array of array. christian.sylvestre@cetelem.fr
    Re: Automating Secure Copy using Perl (Darren Spiteri)
        C padding/Perl unpacking question <vtrinh@octel.com>
    Re: Checking type input <aqumsieh@matrox.com>
    Re: converting a number into a binary? (Greg Bacon)
    Re: converting a number into a binary? <zhuang@ic.sunysb.edu>
    Re: converting a number into a binary? (Anno Siegel)
        coroutines in Perl misha26@my-deja.com
    Re: help,Newbie save a file <aqumsieh@matrox.com>
        How to display milliseconds curtisbeard@my-deja.com
    Re: How to display milliseconds <eyounes@aol.com>
        HTTP::Request:Form rgranson@intlsoft.com
    Re: mod_perl? help! <jpeterson@office.colt.net>
    Re: mysql interview <aqumsieh@matrox.com>
    Re: Old Script Doesn't Like My New Perl? Help! <jeff@vpservices.com>
        Perl - not Purify clean <fworley@dal.asp.ti.com>
        PERL _ Oracle <anspa@spiff.hr.att.com>
        perl question (Divyesh Mistry)
    Re: Programmer's Editor (Greg Bacon)
    Re: Programmer's Editor (Greg Bacon)
    Re: Programmer's Editor (Randal L. Schwartz)
    Re: Programmer's Editor <bivey@teamdev.com>
    Re: Regular Expressions <anderson@unt.edu>
    Re: running perl script on local apache server (Bill Moseley)
    Re: running perl script on local apache server <jpeterson@office.colt.net>
    Re: running perl script on local apache server <c4jgurney@my-deja.com>
    Re: running perl script on local apache server <flavell@mail.cern.ch>
        Tries to download script when running missymanning@my-deja.com
    Re: Tries to download script when running <jpeterson@office.colt.net>
        variable globalisation <tyjang@chico.cstr.ed.ac.uk>
        Where can I find a free website hosting supportting per <1@2.com>
    Re: Where can I find a free website hosting supportting <debot@xs4all.nl>
    Re: Where can I find a free website hosting supportting <nenad.zanko@si.tel.hr>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 08 Sep 1999 13:55:32 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: "Use <module>" Decide at run-time?
Message-Id: <37d95f36.2966718@news.skynet.be>

M.J.T. Guy wrote:

>Close, but not quite right.    "use Module" and "require Module" do some
>extra things.

No shit?

>perlfaq8:"What's the difference between require and use?" says:
>
>    3)  require Module is like require "Module.pm", except the former:
>        3.1: translates each "::" into your system's directory separator.
>        3.2: primes the parser to disambiguate class Module as an indirect
>             object.
>
>The tacking on of '.pm' and translation of '::' are the important bits.
>So in practice this is one of the few places where eval "" is appropriate:

Bzzt! There ARE differences, but this one isn't that relevant!

Try this:

  # file Say/Hello.pm
  sub hello {
      my $name = shift;
      print "Hi, it's $name!\n";
  }
  1;

save as "Say/Hello.pm" somewhere in @INC.

Main:

  require Say::Hello;
  hello('Bart');
-->
  Hi, it's Bart!

Bugger that!

The main difference between "require" and "use", here, is that use()
works at compile time, so it allows a more flexible syntax than
require(); or use() in an eval string, for that matter!

  use Say::Hello;
  hello 'Bart';

Because of the "use", Perl knows about the sub "hello", and so 
"hello 'Bart'" is recognized as a sub call. It won't work with
require(), except maybe if you predeclare the sub:

  sub hello; 		# necessary...
  require Say::Hello;
  hello 'Bart';		# if you want this syntax!


In short: you may need to (slightly) adjust the syntax, if you want to
use require() (plus "import") instead of use()...

-- 
	Bart.


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

Date: Wed, 08 Sep 1999 15:45:31 GMT
From: christian.sylvestre@cetelem.fr
Subject: Array of array.
Message-Id: <7r60am$k81$1@nnrp1.deja.com>

Can somebody give me a bit of explanation for these couple of lines of
code....

@d = ();
@test = ("1","2","3");

for (my $i = 0; $i <= 2; $i++){
   push @{$d[$i]},$test[i];
}

I am trying to understand this line : push @{$d[$i]},$test[i];

Thanks,

Christian Sylvestre


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 8 Sep 1999 23:57:25 +1000
From: Spit@spam-free.UUCP (Darren Spiteri)
Subject: Re: Automating Secure Copy using Perl
Message-Id: <50q5r7.mj2.ln@lobo>

In comp.security.ssh Brian Landers <blanders@gandalf.bluecoat93.net> wrote:
>> Would rsync (Andrew Tridgell's software) work over ssh?
> Yes

It works very well. I use rsync/smrsh/ssh and it's a very secure and reliable
combo.
-- 
+-\___  ___  ______   __ __/=\=/=\=/=\=/=\=/=\=/=\=/=\=/=\=/=\=/=\=/=\-+
: / __)| _ \||_   _| /__/_/  NOTE: Above email address is fictitious.  :
|:__  \:  _:: :: :   @# '') "Bunch of savages in this town..." - Dante |
`(____/|_|><|_||_|><><\__3- - -*(at)hempseed(dot)com><><><><><><><><><>'


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

Date: 08 Sep 1999 07:23:20 -0700
From: Van Trinh <vtrinh@octel.com>
Subject: C padding/Perl unpacking question
Message-Id: <wkwvu1jxd3.fsf@octel.com>


I have to write some CGI scripts to interface with a legacy C program
with a bunch of C data structures. 

One of the issues that i'm facing is how to recognize the C
padding pattern and  adjust for it accordingly in my unpack template.

Currently, my way of dealing with this is by eyeballing the hex dump
of my C structure and visually determine the amount of padding that the
C compiler does to the data structure, i'd then compose the Perl's "unpack"
template accordingly.

My question is does anybody have a tool that will help me with this
job?

Thanks in advance.



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

Date: Wed, 8 Sep 1999 09:49:40 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Checking type input
Message-Id: <x3yn1uxh5sc.fsf@tigre.matrox.com>


Mike <info@counter.w-dt.com> writes:

> How do you check to make sure a variable only has numbers in it.

Reading the FAQs should have been your first resort. From perlfaq4:

	How do I determine whether a scalar
	is a number/whole/integer/float?

--Ala



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

Date: 8 Sep 1999 14:11:52 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: converting a number into a binary?
Message-Id: <7r5qr8$kje$4@info2.uah.edu>

In article <37D661F5.1293E218@ic.sunysb.edu>,
	"Z. Huang" <zhuang@ic.sunysb.edu> writes:

:    can anyone tell me how to convert a number (integer or float) into a
: binary? For, example:
:               8 ---> 100
:              0.125--->  0.001

That's a FAQ.  Please read Section 4 of the Perl FAQ.

Greg
-- 
It has been discovered that C++ provides a remarkable facility for concealing
the trival details of a program--such as where its bugs are. 
    -- David Keppel


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

Date: Wed, 08 Sep 1999 10:55:16 -0400
From: "Z. Huang" <zhuang@ic.sunysb.edu>
Subject: Re: converting a number into a binary?
Message-Id: <37D678D3.65A02807@ic.sunysb.edu>

     Not exactly. FAQ does not answer how to convert a decimal into a binary.

Greg Bacon wrote:

> In article <37D661F5.1293E218@ic.sunysb.edu>,
>         "Z. Huang" <zhuang@ic.sunysb.edu> writes:
>
> :    can anyone tell me how to convert a number (integer or float) into a
> : binary? For, example:
> :               8 ---> 100
> :              0.125--->  0.001
>
> That's a FAQ.  Please read Section 4 of the Perl FAQ.
>
> Greg
> --
> It has been discovered that C++ provides a remarkable facility for concealing
> the trival details of a program--such as where its bugs are.
>     -- David Keppel



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

Date: 8 Sep 1999 15:04:43 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: converting a number into a binary?
Message-Id: <7r5tub$85m$1@lublin.zrz.tu-berlin.de>

Z. Huang <zhuang@ic.sunysb.edu> wrote in comp.lang.perl.misc:
>Greg Bacon wrote:
>
>> In article <37D661F5.1293E218@ic.sunysb.edu>,
>>         "Z. Huang" <zhuang@ic.sunysb.edu> writes:
>>
>> :    can anyone tell me how to convert a number (integer or float) into a
>> : binary? For, example:
>> :               8 ---> 100
>> :              0.125--->  0.001
>>
>> That's a FAQ.  Please read Section 4 of the Perl FAQ.
>
>     Not exactly. FAQ does not answer how to convert a decimal into a binary.

I moved your reply to where it belongs: *below* the text you replied to.

See perldoc -q 'convert bits'.

Anno


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

Date: Wed, 08 Sep 1999 15:24:20 GMT
From: misha26@my-deja.com
Subject: coroutines in Perl
Message-Id: <7r5v2j$j7l$1@nnrp1.deja.com>

Hello,

This should be easy but I just can't figure it
out.  I am trying to run a background process,
write to its input, read from its output, maybe
write to input again, etc.

My first thouhg was

open (F, "| command |");

but that doesn't work.  I spent a couple of hours
reading manuals but the second thouhgt has not
come yet.

Does anyone have any idea how to do this?

Thanks in advance,

Misha


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 8 Sep 1999 09:19:43 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: help,Newbie save a file
Message-Id: <x3ypuzth768.fsf@tigre.matrox.com>


randys@dowco.com (Randy) writes:

> All I need to know is there an extention I have to put on the end of a
> script file ?

If you're on a unix machine, then you don't need any specific
extension. In fact, you don't even need an extension at all. Despite
that, all of my Perl scripts have a .pl extension, so that I would
know that this is a Perl file without more()ing it.

If you're on a winblows machine, then you probably need the .pl
extension since this associates files with the Perl interpreter. Of
course, you can associate the Perl interpreter with another extension
(like .cgi for example), but then you are just confusing yourself.

HTH,
--Ala



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

Date: Wed, 08 Sep 1999 14:12:07 GMT
From: curtisbeard@my-deja.com
Subject: How to display milliseconds
Message-Id: <7r5qrb$fpj$1@nnrp1.deja.com>

Can anyone help me?

I need to display the time in a program I am making.
I can display everything except for the milliseconds.
e.g. the hours, minutes, and seconds

I want to add the milliseconds.

Thanks in advance,
Curtis


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 8 Sep 1999 18:04:29 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: How to display milliseconds
Message-Id: <7r6191$i48@news.vtcom.fr>

the module Time:HiRes is what you're looking for.

Eric - FRANCE




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

Date: Wed, 08 Sep 1999 15:43:46 GMT
From: rgranson@intlsoft.com
Subject: HTTP::Request:Form
Message-Id: <7r607e$k5g$1@nnrp1.deja.com>

I'm using the HTTP::Request::Form module, and when I try
running anything, including the sample script for querying
Altavista that is in the docs, I get the following error:

Can't use an undefined value as an ARRAY reference at
/usr/lib/perl5/site_perl/5.005/HTTP/Request/Form.pm line 169.

(Yes, I'm aware that the sample script is missing a semicolon at
the end of the 'my @forms' line, and I have made the correction.)

Anyone have any ideas, or know if this is a bug in this
module?

Thanks,
Rich


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 08 Sep 1999 14:41:13 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: mod_perl? help!
Message-Id: <dAuB3.90$xa4.1190@news.colt.net>

clavikal <clavikal@voicenet.com> wrote:
> What should I build first? Apache or mod_perl?
> Do I just have to perl Makefile.PL && make && make install like other perl
> modules?
> Do I have to rebuild Apache after mod_perl?

Build mod_perl - it will build apache for you if you ask it to. All this is
in the readme and install files for the mod_perl distribution. Check those
out first - there's no way you'll do anything with mod_perl unless you read 
the docs that are supplied.



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

Date: Wed, 8 Sep 1999 09:25:34 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: mysql interview
Message-Id: <x3yogfdh6wh.fsf@tigre.matrox.com>


George Reese <borg@imaginary.com> writes:

> Greg Bacon <gbacon@itsc.uah.edu> wrote:
> : In article <eA%A3.376$96.26431@ptah.visi.com>,
> : 	George Reese <borg@imaginary.com> writes:
> 
> : : Actually, no, it was not. It was a "for anything you might want to do
> : : in perl, python works and it is easier to maintain". I do not think
> : : perl sucks as such, even though I will say it out of hand. I simply
> : : think perl serves no purpose any more.
> 
> : Are you going to justify any of this, or are you foaming at the mouth?
> 
> Somehow, I doubt anyone really wants a rehash of the thread from last
> year. I think it is best to leave it at that being my feelings and
> that a vast majority of this particular newsgroup believes otherwise.

You are of course entitled to your own points of view, but statistics
speak louder than words. Read lwall's 3rd state of the onion.

It is funny that you think Perl doesn't serve any purpose any
more. The way I see it is that Perl was made to fill an empty gap, and
it did so beautifully. Other languages, on the other hand (like
Python, for example), was written for the sake of writing yet another
language (IMO of course). So, when I started to read about Python I
thought "Hmm .. this language serves no purpose at all!"

:-)

--Ala



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

Date: 8 Sep 1999 14:28:35 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Old Script Doesn't Like My New Perl? Help!
Message-Id: <37D67196.F1A79190@vpservices.com>

Dan Poynor wrote:
> 
> Use of uninitialized value at /home/httpd/cgi-bin/rotate.pl line 7.
> 
> ---------here's the script rotate.pl-------------
> #! /usr/bin/perl
> 


Hmm, a -w error with no -w on the shebang line!  That means your script
was not -w safe and your new perl must be run through a server or a
batch file or something that automatically adds -w.  This means you will
have to check all your scripts to make sure all variables are
initialized, not a bad thing in the long run.


-- 
Jeff


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

Date: Wed, 08 Sep 1999 09:09:13 -0500
From: Frazer Worley <fworley@dal.asp.ti.com>
Subject: Perl - not Purify clean
Message-Id: <37D66E09.F507A350@dal.asp.ti.com>


From the Perl Embed documentation:

#include <EXTERN.h>
#include <perl.h>

static PerlInterpreter *my_perl ;
 ...
 ...
  my_perl = perl_alloc() ;
  perl_construct(my_perl) ;
  perl_parse( my_perl, NULL, argc, argv, (char **)NULL ) ;
  perl_destruct(my_perl) ;
  perl_free(my_perl) ;
 ...
 ...

This generates 119 Purify errors:

  array bounds read, 
  array bouhds write, 
  uninitialised memory read, 
  free memory read
  444 leaked bytes

these errors all stem from the perl_parse() function.

I'm using Perl headers:

  from perl5.005_02/lib/5.00502/sun4-solaris/CORE

Any suggestions ?

Perl is in a pretty sorry state of affairs if it contains these
type of errors - and in large quantities. And - note I only called
perl_parse with NULL arguments .... heaven knows how much junk I'd
be exposed to if I called the function with real arguments.

I believe TCL is clean.

-F



-- 
---------------------------------------------------------------
Phone:    +01-972-480-2845   Email:    fworley@dal.asp.ti.com
Fax:      +01-972-480-3020   TI_MSGID: FJ

Address:  M/S 8635, Texas Instruments, 
          8505 Forest Lane, 
          Dallas, Tx, 75243
---------------------------------------------------------------


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

Date: Wed, 08 Sep 1999 11:34:32 -0400
From: "G.P. Singh" <anspa@spiff.hr.att.com>
Subject: PERL _ Oracle
Message-Id: <37D68207.A16E1E2A@spiff.hr.att.com>

Hi,

I compile perl 5 on Hp/ux 10.20 with dynamic loader, compiled DBI , no
errors, but while doing make test
on ORACLE::DBD , i recvd. few errors, anyway i continued , now when i
try to use it i get the following errors:

/usr/lib/dld.sl: Unresolved symbol: pthread_mutexattr_default (data)
from
/opt/perl5/lib/site_perl/5.005/PA-RISC2.0/auto/DBD/Oracle/Oracle.none
/usr/lib/dld.sl: Unresolved symbol: pthread_attr_default (data)  from
/opt/perl5/lib/site_perl/5.005/PA-RISC2.0/auto/DBD/Oracle/Oracle.none
/usr/lib/dld.sl: Unresolved module for symbol: sltsrsa (code)  from
/opt/perl5/lib/site_perl/5.005/PA-RISC2.0/auto/DBD/Oracle/Oracle.none
Abort(coredump)

The file db.pl has just this:

catbert>cat db.pl
#!/opt/perl5/bin/perl -w
use DBI;
              # Create new database handle. If we can't connect, die()
$dbh = DBI->connect('dbi:Oracle:sddb','scott,'tiger');
              if ( !defined $dbh ) {
                  die "Cannot connect to sddb server: $DBI::errstr\n";
                }


Please advice.
Can i get a compiled binary for DBD:ORA.
TIA
GP
psingh@spiff.att.com



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

Date: 8 Sep 1999 10:51:50 -0400
From: divyesh@intac.com (Divyesh Mistry)
Subject: perl question
Message-Id: <7r5t66$8h3@nile.intac.com>

Hi,

Can anyone supply me with a script that make database calls.

Thanks.


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

Date: 8 Sep 1999 14:07:56 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Programmer's Editor
Message-Id: <7r5qjs$kje$2@info2.uah.edu>

In article <MPG.12405b3989eaf327989cb6@news-server>,
	elephant@squirrelgroup.com (elephant) writes:

: Randal L. Schwartz writes ..

: >Syntax highlighting for Perl.  I'll believe it when I see it.
: 
: thing is that with syntax highlighting (as with a lot of things) 
: "useful" is a subset of "complete"

Perhaps, but "incomplete" is a subset of the union of "will bite you in
the ass at the most inopportune time" and "will cause great confusion".

Greg
-- 
If you view your problem closely enough you will recognize yourself as part of
the problem.


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

Date: 8 Sep 1999 14:09:03 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Programmer's Editor
Message-Id: <7r5qlv$kje$3@info2.uah.edu>

In article <sig10pln5m.fsf@cre.canon.co.uk>,
	Gareth Rees <garethr@cre.canon.co.uk> writes:

: Randal L. Schwartz <merlyn@stonehenge.com> wrote:
:
: > Does it get both of these right:
: > 
: >   time /3 ;#/; print "hello";
: >   sin /3 ;#/; print "goodbye";
: > 
: > As in, does it highlight the "print" in print "hello" as a comment,
: > and the "print" in print "goodbye" as a keyword and string?
: 
: I've just tried this with Ilya's cperl-mode for Emacs.  It doesn't
: understand prototypes, so it gets the second line wrong.  But re-writing
: the second line as
: 
:     sin m/3 ;#/; print "goodbye";
: 
: gives cperl-mode enough information to get it right.

I don't understand the point of mollycoddling broken software.

Greg
-- 
Men never do evil so completely and cheefully as when they do it from
religious conviction. 
    -- Blaise Pascal


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

Date: 08 Sep 1999 08:02:48 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Programmer's Editor
Message-Id: <m1iu5lwinb.fsf@halfdome.holdit.com>

>>>>> "Greg" == Greg Bacon <gbacon@itsc.uah.edu> writes:

Greg> Perhaps, but "incomplete" is a subset of the union of "will bite you in
Greg> the ass at the most inopportune time" and "will cause great confusion".

Yes, and that's my point.

I use the fairly complete syntax highlighting of Ilya's "cperl-mode"
in GNU Emacs.

On rare occasion, I must change the code I write so that it doesn't
confuse cperl-mode, so that cperl-mode doesn't continue to confuse me.

This does not seem right, and I know Ilya's pretty familiar with Perl
syntax, and with GNU Emacs, so I don't give much hope for other tools
out there.  It might work on trivial stuff, but I don't write any
trivial Perl code anymore. :)

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 8 Sep 1999 14:59:29 GMT
From: "William" <bivey@teamdev.com>
Subject: Re: Programmer's Editor
Message-Id: <01befa0a$5b8348a0$583c08cf@bill.jump.net>

Greg Bacon <gbacon@itsc.uah.edu> wrote in article
<7r5qjs$kje$2@info2.uah.edu>...
> In article <MPG.12405b3989eaf327989cb6@news-server>,
> 	elephant@squirrelgroup.com (elephant) writes:
> 
> : Randal L. Schwartz writes ..
> 
> : >Syntax highlighting for Perl.  I'll believe it when I see it.
> : 
> : thing is that with syntax highlighting (as with a lot of things) 
> : "useful" is a subset of "complete"
> 
> Perhaps, but "incomplete" is a subset of the union of "will bite you in
> the ass at the most inopportune time" and "will cause great confusion".

If the Perl syntax highlighting in UltraEdit-32 isn't complete,
it's easy to make it so (and your fault if you don't). It's
controlled by a simple-to-edit text file. (There were a couple
of shortcomings in the stock file, but fixing that only took a
few minutes.)-Wm


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

Date: Wed, 08 Sep 1999 10:39:23 -0500
From: "Richard L. Anderson" <anderson@unt.edu>
Subject: Re: Regular Expressions
Message-Id: <080919991039236250%anderson@unt.edu>

In article <x3y1zcaipq9.fsf@tigre.matrox.com>, Ala Qumsieh
<aqumsieh@matrox.com> wrote:

> > #!perl -w
> > 
> > use strict;
> > 
> > my $testString = "<caddaar<test<hello";
> > 
> > if ($testString =~ /<.*?<(.*)/){
> >    print $1;
> > }
>

Output -> test<hello
 
> Well, that hardly does what the original poster wanted (which is not
> quite clear). But he/she wants something cut out, and you don't cut
> anything. I suspect the original poster wanted to cut everything up to
> and including the second "<". Then your regexp should be:
> 
>         $testString =~ s/^[^<]*<[^<]*<//;
> 
> A (better?) option might be:
> 
>         my $t = "<caddaar<test<hello";
>         substr($t, 0, (index($t, '<', index($t, '<')+1)+1)) = '';
> 
> HTH,
> --Ala


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

Date: Wed, 8 Sep 1999 07:04:11 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: running perl script on local apache server
Message-Id: <MPG.12400cbb18e8db4b98971b@nntp1.ba.best.com>

Maureen Dunlap (maureen@islandwebdesign.com) seems to say...
> I'm not a programmer, but I have been using perl scripts for years

I'm not a perl programmer, but I play one on TV

> Now I'm setting up a script on my local C: drive on my apache server and
> am getting an Internal Server Error with the following showing up in the
> error log:
> 
> "Premature end of script headers"
> Is this something really obvious and simple?

Sure.

Go to www.apache.org and look at, you guessed it, the FAQ!

http://www.apache.org/docs/misc/FAQ-F.html#premature-script-headers

BTW -- there's a usenet group that deals with CGI issues -- and that 
topic is currently being discussed (and it's always being discussed 
there).



-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Wed, 08 Sep 1999 14:46:16 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: running perl script on local apache server
Message-Id: <YEuB3.91$xa4.1190@news.colt.net>

Maureen Dunlap <maureen@islandwebdesign.com> wrote:
> Hi,

> I'm not a programmer, but I have been using perl scripts for years on
> remote servers with only the normal annoying configuration errors to
> deal with.

> "Premature end of script headers"

This indicates that your program is either terminating, or producing output 
that is not a valid header, before it produces some output that _is_ a valid
header.

This may or (more likely) may not be to do with Perl. If your script runs 
without errors from the command line it almost certainly isn't a Perl problem.

I would suggest this is a CGI or HTTP problem, or a problem with NT recognising
perl scripts and executing them properly.



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

Date: Wed, 08 Sep 1999 15:09:41 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: running perl script on local apache server
Message-Id: <7r5u79$idf$1@nnrp1.deja.com>

In article <37D65FFC.737E72F1@islandwebdesign.com>,
  Maureen Dunlap <maureen@islandwebdesign.com> wrote:

<snip>

> Now I'm setting up a script on my local C: drive on my apache server
and
> am getting an Internal Server Error with the following showing up in
the
> error log:
>
> "Premature end of script headers"

This isn't the best group to ask this sort of question,
comp.infosystems.www.authoring.cgi covers CGI issues and
comp.infosystems.www.servers.ms-windows covers server configuration.

This could be caused by a number of problems, without seeing the script
I can only offer two suggestions;

1) Firstly can you run the script from the command line? Does it work?

2) Add the line;

use CGI::Carp qw(fatalsToBrowser);

to your script, if the script is failing it will hopefully give you the
line no. and more of an idea what the problem is.

HTH,

Jeremy Gurney
SAS Programmer  |  Proteus Molecular Design Ltd.
"Sometimes I think the so-called experts
 actually are experts."


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 8 Sep 1999 17:26:57 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: running perl script on local apache server
Message-Id: <Pine.HPP.3.95a.990908172445.14340J-100000@hpplus03.cern.ch>

On Wed, 8 Sep 1999, Bill Moseley wrote:

> http://www.apache.org/docs/misc/FAQ-F.html#premature-script-headers
> 
> BTW -- there's a usenet group that deals with CGI issues --

indeed

> and that topic is currently being discussed (and it's always being
> discussed there). 

That is, sadly, only too true.  Some months are more September than
others.



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

Date: Wed, 08 Sep 1999 15:12:26 GMT
From: missymanning@my-deja.com
Subject: Tries to download script when running
Message-Id: <7r5uce$ing$1@nnrp1.deja.com>

I have a problem...I have a perl script that I am trying to switch from
unix to nt.  It works fine on the unix but on nt it tries to
download...any suggestions.  I am new to nt so please be specific.  I
set the permissions and associations but still tries to download when I
run it.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 08 Sep 1999 15:53:33 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Tries to download script when running
Message-Id: <1EvB3.92$xa4.1244@news.colt.net>

missymanning@my-deja.com wrote:
> I have a problem...I have a perl script that I am trying to switch from
> unix to nt.  It works fine on the unix but on nt it tries to
> download...any suggestions.  I am new to nt so please be specific.  I
                                 ^^^^^^^^^^^^^^^^
> set the permissions and associations but still tries to download when I
> run it.

This is not a problem with Perl, and is unlikely to be a problem with your
perl script. It is likely to be a problem with NT, your web server, and the 
way either or both of those are configured. Please ask your question in groups 
that deal with NT web servers.



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

Date: 08 Sep 1999 16:13:29 +0100
From: Tae-Yeoub Jang <tyjang@chico.cstr.ed.ac.uk>
Subject: variable globalisation
Message-Id: <qg01zc9bfmu.fsf@chico.cstr.ed.ac.uk>

I would like to use several modules "Mod_a.pm", "Mod_b.pm",
"Mod_c.pm" by using one generalising module "All.pm" which looks
like:

                package All;
                use strict;
                use vars qw(@ISA @EXPORT);
                use Exporter;
                @ISA = qw(Exporter)
                use     Mod_a;
                use Mod_b;
                use Mod_c;

But when I specify only "use All;" in a perl script, that script does
not recognise global variables specified in each embedded module.  For
example, "Mod_a.pm" could be like:

                package Mod_a;
                use strict;
                use vars qw(@ISA @EXPORT $var);
                use Exporter;
                @ISA = qw(Exporter);
                @EXPORT = qw($var);
                $var = "something";  ## $var is globalised, isn't it?

In a script I can retrieve the value of $var if I specify the line
"use Mod_one;" but I can't, if I specify only "use All;" instead.  Why
not?  How are the global variables made inherited across other
modules?

Thanks,
Tae



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

Date: 8 Sep 1999 14:59:29 GMT
From: "Ben" <1@2.com>
Subject: Where can I find a free website hosting supportting perl?
Message-Id: <01befa0a$a20f9620$7467ae80@steven>

I need the website supports .pl file.
Please don't tell me that I can find it at "yahoo" and so on.
Thanks.



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

Date: Wed, 08 Sep 1999 17:06:59 +0200
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: Where can I find a free website hosting supportting perl?
Message-Id: <37D67B93.3F208DA1@xs4all.nl>

You can find it at "yahoo", but I just give them right here ;-)

http://www.hypermart.net/
http://www.virtualave.net/

Ben wrote:

> I need the website supports .pl file.
> Please don't tell me that I can find it at "yahoo" and so on.
> Thanks.

--
Penpal International
http://www.debot.nl/ppi/
ppi@debot.nl or debot@xs4all.nl




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

Date: Wed, 08 Sep 1999 17:52:58 +0200
From: Nenad Zanko <nenad.zanko@si.tel.hr>
Subject: Re: Where can I find a free website hosting supportting perl?
Message-Id: <37D6865A.233@si.tel.hr>

Ben wrote:
> 
> I need the website supports .pl file.
> Please don't tell me that I can find it at "yahoo" and so on.
> Thanks.

www.virtualave.net
-- 

Nenad
_____________________________________________
MyHempPage-> http://myhemppage.virtualave.net
Buta-> http://surf.to/Buta


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 740
*************************************


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