[8157] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1775 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 31 00:07:34 1998

Date: Fri, 30 Jan 98 21:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 30 Jan 1998     Volume: 8 Number: 1775

Today's topics:
    Re: Another "uninitialized variable" problem <rootbeer@teleport.com>
        Beginner needs help... <singah@netutah.com>
    Re: Can PERL test for a process? <zenin@best.com>
    Re: can variables be generated on the fly <puiu@kappa.ro>
    Re: Converting to Leadingcap format? <smiano@mindspring.com>
    Re: Converting to Leadingcap format? <smiano@mindspring.com>
    Re: Don't use signal handlers (was Re: Child processes) (Chip Salzenberg)
    Re: Don't use signal handlers (was Re: Child processes) (Chip Salzenberg)
    Re: easy question about ARGV (David Efflandt)
    Re: Executing app from NT PERL scritp <swarren@eclipse.net>
    Re: I would like for a field to be variable width in a  <rootbeer@teleport.com>
    Re: Internet Community needs cgi scripts like it needs  (Clay Irving)
    Re: Locking files (Chip Salzenberg)
    Re: Locking files (Tad McClellan)
        Parsing Word Docs (newsie)
    Re: Pattern matching poser <rootbeer@teleport.com>
    Re: PERL Win32 getting mail with a pop3 server (Doug Breshears)
    Re: removing a line from a file <rootbeer@teleport.com>
    Re: Some possible bugs <rootbeer@teleport.com>
    Re: Strings to integers HELP please <rootbeer@teleport.com>
    Re: testing perl scripts on my local (David Efflandt)
        Trouble getting to run from web page <georgeh@got.net>
    Re: Trouble getting to run from web page (Tad McClellan)
    Re: Why can't I unzip? (Clay Irving)
    Re: Win32: Any scripts to shut down all services? (Clay Irving)
        Windows NT perl mail command vzanini@xplore.it
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 30 Jan 1998 19:11:28 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Georg Edelmayer <ged@fortec.tuwien.ac.at>
Subject: Re: Another "uninitialized variable" problem
Message-Id: <Pine.GSO.3.96.980130191056.24986H-100000@user1.teleport.com>

On Fri, 30 Jan 1998, Georg Edelmayer wrote:

> i tried the following for quick and dirty testing:
> 
> $fence_bits="00000";
> print $fence_bits."\n";
> $fence_bits = ($fence_bits | "10000");
> print $fence_bits."\n";
> 
> and the output is:
> 
> 00000
> Use of unitialized value at test.pl line 3.
> 10000

This seems to be fixed in 5.004_04, maybe earlier. Hope this helps!

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



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

Date: Thu, 29 Jan 1998 17:17:13 -0700
From: Cathi Miller <singah@netutah.com>
Subject: Beginner needs help...
Message-Id: <34D11C09.7BE8A570@singah.com>

Hi there.
I would like to learn perl, but I'm a bit confused.
If I understand correctly, I need a compiler and stuff.
I downloaded a "kit" from perl.com, but it is in a file format (.gz)
that I can't use. Downloaded a zipped version twice with no better luck.

I could really use some help aquiring the components I need to start
learning and writing perl.
I had intended to get "Perl Cookbook" too. Also having a hard time
finding a newsgroup that posts in english.
Can anyone point me in the right direction?
Sure appreciate any help.




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

Date: 31 Jan 1998 02:39:56 GMT
From: Zenin <zenin@best.com>
Subject: Re: Can PERL test for a process?
Message-Id: <886214691.454318@thrush.omix.com>

Shaun Ledford <shaun@ms.com> wrote:
: Trying to write a script that will test whether a process exists.

	This is vary program dependent, unless you're the one that started
	the process (via fork()/exec()) and know the exact pid.

: Something like this shell command:
: if [ -x MY PROCESS ] ; then
:   p = 1 # I need to start process
: else 
:   p = 0 # Process already running
: fi

	Huh?  This doesn't test of a process exists, only if the file 'MY'
	exists and is executable.

-- 
-Zenin
 zenin@best.com


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

Date: Sat, 31 Jan 1998 03:41:11 +0200
From: Puiu Leontescu <puiu@kappa.ro>
Subject: Re: can variables be generated on the fly
Message-Id: <34D28137.59BDFF11@kappa.ro>

Vjekoslav Balas wrote:

> Hi,
> This may be a silly question, just thought maybe with perl it was possible
> as it is so good with parsing etc:
>
> Can a varibale be generated - this syntax is not correct but shows idea I'm on about:
> $a="var1";
> $"$a"="value of generated variable";
>
>  (supposed to read something like
> $var1="value of generated variable";
>
> Thanks,
> Vjeko

  Well, I use :

${$var}{'key'}='what you want';

and it works...




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

Date: Thu, 29 Jan 1998 16:27:28 -0500
From: Stephen Miano <smiano@mindspring.com>
Subject: Re: Converting to Leadingcap format?
Message-Id: <34D0F440.223F05A3@mindspring.com>

This is a multi-part message in MIME format.
--------------37245A48CE2ED68A745E0522
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Mike Noel wrote:

> Ok.  This is mostly for the amusement of the experienced perl hacks.
> You know how it is when you just want something to work and it doesn't
> have to be pretty? Several times I've had to convert a string from mixed
> case to Leadingcap format (eg, "miKe" -> "Mike").  I am imagining that
> there is a super slick way to do this but here's my solution.
>
> What's the one liner?
>
> sub fixccard
> {
>     # This sub fixes the card name to the Leadingcap format.
>     local($name) = $_[0];
>
>     $name =~ tr/A-Z/a-z/;
>     $name =~ /^(\w)/;
>     $letter = $1;
>     $letter =~ tr/a-z/A-Z/;
>     $name =~ s/^(.)/$letter/;
>     return($name);
> }
>
> Mike Noel
> Integrity Online International
> noel@integrityonline.com

Not one line but shorter.

sub fixccard {
   my($name) = shift;
   $name =~ tr/A-Z/a-z/;
   substr($name,0,1) =~ tr/a-z/A-Z/;
   return $name;
}


--------------37245A48CE2ED68A745E0522
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Stephen Miano
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Stephen Miano
n:              Miano;Stephen
org:            ESM Inc.
adr:            187 Colonial Pkwy North;;;Yonkers;New York;10710;USA
email;internet: smiano@mindspring.com
tel;work:       212-821-6028
tel;fax:        212-821-6634
tel;home:       914-337-0063
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------37245A48CE2ED68A745E0522--



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

Date: Thu, 29 Jan 1998 16:35:52 -0500
From: Stephen Miano <smiano@mindspring.com>
Subject: Re: Converting to Leadingcap format?
Message-Id: <34D0F638.421FB94F@mindspring.com>

This is a multi-part message in MIME format.
--------------160C1AF896A007D07F64F049
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Mike Noel wrote:

> Ok.  This is mostly for the amusement of the experienced perl hacks.
> You know how it is when you just want something to work and it doesn't
> have to be pretty? Several times I've had to convert a string from mixed
> case to Leadingcap format (eg, "miKe" -> "Mike").  I am imagining that
> there is a super slick way to do this but here's my solution.
>
> What's the one liner?
>
> sub fixccard
> {
>     # This sub fixes the card name to the Leadingcap format.
>     local($name) = $_[0];
>
>     $name =~ tr/A-Z/a-z/;
>     $name =~ /^(\w)/;
>     $letter = $1;
>     $letter =~ tr/a-z/A-Z/;
>     $name =~ s/^(.)/$letter/;
>     return($name);
> }
>
> Mike Noel
> Integrity Online International
> noel@integrityonline.com

One line.

sub fixccard {
   ucfirst lc $_[0];
}


--------------160C1AF896A007D07F64F049
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Stephen Miano
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Stephen Miano
n:              Miano;Stephen
org:            ESM Inc.
adr:            187 Colonial Pkwy North;;;Yonkers;New York;10710;USA
email;internet: smiano@mindspring.com
tel;work:       212-821-6028
tel;fax:        212-821-6634
tel;home:       914-337-0063
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------160C1AF896A007D07F64F049--



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

Date: Sat, 31 Jan 1998 02:13:57 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6au1gh$crk$1@cyprus.atlantic.net>

According to ehood@medusa.acs.uci.edu (Earl Hood):
>Is it possible to extract signal handling into a dynamically loaded
>module?

Yes; it was done with dbm, it can be done with signals.  But that
doesn't help us.  Dynamically loaded or not, there's nothing an
extension could do to make Perl signal handlers safe.

>Therefore the performance hit will only occur if the
>programmer chooses to "use Signals".

"Backward compatibility."  You will come to fear those words.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org
           ->  Ask me about Perl training and consulting  <-
             "It's the lemon zester of death!!"   // MST3K


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

Date: Sat, 31 Jan 1998 02:16:01 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6au1ke$cs5$1@cyprus.atlantic.net>

According to Mark Mielke <markm@nortel.ca>:
>If signal handlers can not be implemented safely in perl, should they not
>be a deprecated feature?

Not quite.  Deprecation is for things that are going away.  In
contrast, signal support will be better in 5.005.  If you compile for
threading, for example, signals are delivered in their own thread and
everything works.  Of course, threading costs you heavily -- in
current snapshots, everything running in threaded perl is about 30%
slower than unthreaded perl.

>i don't believe 3% is that much of a sacrifice.

I'm with you.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org
           ->  Ask me about Perl training and consulting  <-
             "It's the lemon zester of death!!"   // MST3K


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

Date: Sat, 31 Jan 1998 02:30:06 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: easy question about ARGV
Message-Id: <34d789b7.6818779@flood.xnet.com>

CS44 Personel <dwu@svcam.amd.com> wrote:

>ok this is a pretty basci question so bear with me.
>I'm reading in a file from one location on my unix system.
>And printing the contents to another location.  Heres my code.
>open (guesthandle2 , "/usr/printtwo.html"):
>open (guesthandle2 , "/var/blah/printfrom.log");
>while (<guesthandle3>) {
>print guesthandle2;
>(location for needed instruction)
>}
>Anyway i want to save the last line printed from the file
>printfrom.log.
>I have tried @a = @ARGV;
>and then print @a at the end of the program.
>If anyone can provide any help it would be greatly appreciated.

You have too many guesthandle2's (typo) and @ARGV has nothing to do
with any of this (it is args from the command line || stdin which is
usually the keyboard || whatever you assign to it).  Maybe you are
looking for something like the following (">" to replace file, ">>" to
append to it), although, it would be more efficient to have whatever
prints to the log also print to the other file:

open (guesthandle2 , ">>/usr/printtwo.html"):	# > or >> ?
open (guesthandle3 , "</var/blah/printfrom.log");
while (<guesthandle3>) {
  $var = $_;
}
print guesthandle2 "$var\n";


David Efflandt/Elgin, IL USA
efflandt@xnet.com    http://www.xnet.com/~efflandt/


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

Date: Fri, 30 Jan 1998 22:58:14 -0500
From: "Stephen Warren" <swarren@eclipse.net>
Subject: Re: Executing app from NT PERL scritp
Message-Id: <6au7o0$pc0$1@news.eclipse.net>

>for ($i=16; $i < 16384; $i+=16)
>{
>   print 'my_app -a -b -c -l$i';
>}

I believe you'll find that the print function prints things. You might
want to try using system() instead.

--
-----------------------------------------------------------------
Stephen Warren, Systems Engineer, Technology House Inc., New York
mailto:swarren@techhouse.com      http://www.techhouse.com/
mailto:swarren@eclipse.net        http://www.eclipse.net/~swarren/
            MIME, S/MIME and HTML mail are acceptable
Anyone can be taught to sculpt: Michelangelo would have to be taught not
to. So it is with great programmers. ACM SigPlan '82 Epigrams in Prog.




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

Date: Fri, 30 Jan 1998 19:26:34 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Terrence Brannon <brannon@surf.usc.edu>
Subject: Re: I would like for a field to be variable width in a format stmt
Message-Id: <Pine.GSO.3.96.980130192118.24986J-100000@user1.teleport.com>

On 30 Jan 1998, Terrence Brannon wrote:

> #!/usr/bin/perl
> 
> 
> $mechname="migna";
> $plotvar="ninf";
> 
> 
>        strdef sc
> 
>        create soma
>        access soma
> 
>        insert $mechname

What version of Perl is this?

>        system("rm @_@")
>        $mechname, $plotvar
> 
>        for (g = -100; g <= 75; g=g+5) {

Is it really Perl?

> 	   rates_@(g)
> 	   $mechname
> 	   sprint (sc, "echo %f %f >> @_@\n", g, @_@)

Or is it a hoax, just close enough to Perl to make us wonder where it came
from?

> 	   $mechname, plotvar, $plotvar, $mechname
> 	   printf ("%s\n", sc)
> 	   system (sc)
> 	   }
> .

You know, this seems like that episode of Star Trek where Kirk and Spock
discover that alternate universe, just like this one except everyone is on
heroin.

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



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

Date: 30 Jan 1998 21:07:54 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Internet Community needs cgi scripts like it needs ...
Message-Id: <6au11q$e5o@panix.com>

In <6at7b5$b9r$1@cyprus.atlantic.net> chip@mail.atlantic.net (Chip Salzenberg) writes:

>According to pudge@pobox.com (Chris Nandor):
>>... a hole in the head ...
>>... AlterNIC ...
>>... spammers ...

>... IRC bots ...  (except purl!)
>... broadcast ICMP replies ...
>... old sendmails ...

 ... Perl 4 questions ...

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Sat, 31 Jan 1998 02:19:25 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Locking files
Message-Id: <6au1qk$csp$1@cyprus.atlantic.net>

According to BENJAMIN BERUBE <berub00@DMI.USherb.CA>:
>My question is about locking file so that when I open a file, nobody
>else can open it.

I'm not aware of any UNIX variants that forbid _opening_ a file that's
locked.  Locking can forbid reading/writing, but even that can be
advisory (i.e. programs don't notice the lock if they're not looking
for it).  You need to read the fcntl() and/or flock() man pages for
your system.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
    Like Perl?  Want to help out?  The Perl Institute: www.perl.org
           ->  Ask me about Perl training and consulting  <-
             "It's the lemon zester of death!!"   // MST3K


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

Date: Fri, 30 Jan 1998 19:50:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Locking files
Message-Id: <c10ua6.9v3.ln@localhost>

BENJAMIN BERUBE (berub00@DMI.USherb.CA) wrote:
: Hello,

: My question is about locking file so that when I open a file, nobody
: else can open it.  


If you are on a Unix system, you just set the file permissions
appropriately.


: For example, I want to update a file called
: "users.dat".  My script open the file, make some modifications in it,
: then re-write it.  But if someone else run the script at the same time,
: everything's lost.


Oh. That's different. Above you said "nobody", which I took to mean
another user account. But you don't want what you said. Instead you
want it so that no other *processes* can modify the file.


: I tried flock, but didn't seem to work.  How can I protect my file ???


You can protect your file by making flock() work ;-)

That's what it is for.

Your extremely unhelpful "didn't seem to work" diagnostic pretty
much precludes anyone from being able to help you though. Sorry.


You have, of course, already read the man pages and FAQs that
pertain to file locking, right?


: Take note that if someone else try to use the file while it's already
: open, it should be waiting for the file to close (so it re-try opening
: the file as long as it can't).

That is the default behavior for flock()  (blocks until it gets the lock)


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


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

Date: Sat, 31 Jan 1998 04:04:13 GMT
From: newsspam@weptop.com (newsie)
Subject: Parsing Word Docs
Message-Id: <34d2a1e3.1654622311@news.paranet.com>

I have been able to extractt he text from Word Docs with the following
bit of code:
#!/usr/bin/perl
# Parse word docs fed in at the command line
$file = $ARGV[0];
$startFlag = 0;
open(FILE,"<$file")||die $!;
while(<FILE>){
	chomp;
    if(s/^.*cgrid {//){
    	$startFlag = 1;
        s/\\[a-z]+\d\d//g;
    }
    if($startFlag == 1){
        s/\\par //;
        s/[}{][}{]$//;
        s/\\[rl]quote /'/g;
    	$h .= "$_\n";
    }
}
close(FILE);
open(FILE,'>c:\temp\word_conversion.txt')||die $!;
print FILE $h;
close(FILE);
exit;

This only works on word 6/95. Has anyone been able to parse a word 97
doc?

Paul Coogan
coogan@webtop.com


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

Date: Fri, 30 Jan 1998 19:19:49 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Terry von Gease <twv@cup.hp.com>
Subject: Re: Pattern matching poser
Message-Id: <Pine.GSO.3.96.980130191318.24986I-100000@user1.teleport.com>

On 29 Jan 1998, Terry von Gease wrote:

> Given two regular expressions, is there any way to determine that there
> exists any string that will match both patterns? In other words, is
> there an intersection? 

There's not guaranteed to be a string that matches even one of them, of
course! But my hunch is that a program could determine such a string
analytically, or prove that no such string exists. Writing the program (or
proving that no such program exists) is left as an exercise. :-) 

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



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

Date: Sat, 31 Jan 1998 04:35:25 GMT
From: breshear@eonet.com (Doug Breshears)
Subject: Re: PERL Win32 getting mail with a pop3 server
Message-Id: <34d2a946.177964327@news.eoni.com>

Try the POP3Client and NNTPClient I have tested both of these
just playing around with my POP3 account from Win95 machine
and they appear to work just fine, except getting them formated
will require some extra effort.

I found these on CPAN

Doug Breshears

Jeffrey Schrab <jschrab@REMOVETHISroyle.com> wrote:

>
>
>Sebastian Probst wrote:
>
>> Hello all,
>>
>> I am looking for a POP3 modul for PERL for WIN32. I only could find this
>> modul for UNIX. Contacting the author of this modul failed, because the
>> mail address in the modul description is not valid.
>>



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

Date: Fri, 30 Jan 1998 19:40:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chad R Cordero <ccordero@wiley.csusb.edu>
Subject: Re: removing a line from a file
Message-Id: <Pine.GSO.3.96.980130193152.24986K-100000@user1.teleport.com>

On Thu, 29 Jan 1998, Chad R Cordero wrote:

> 	open(FILE, "+>file");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

Also, see what section five of the FAQ has to say about "How come when I
open the file read-write it wipes it out?"

>                 @list = split(/\n*/, <FILE>);

It would be better to use this:

    chomp(@list = <FILE>);

 ...and then, if needed, grep out any empty lines. (But see below.)

>                 $i = 0;
>                 while(defined($list[$i]))
>                 {
>                         if($list[$i] eq "$name")
>                         {
>                                 splice(@list, $i, 1);
>                         }
>                         else
>                         {
>                                 $i++;
>                         }
>                 }

That's another task for grep; you could do both together:

    @list = grep { length and $_ ne $name } @list;

>                 $line = join("\n", @list);
>                 print FILE ("$line\n");
>         close(FILE);

Hope this helps!

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



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

Date: Fri, 30 Jan 1998 19:08:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: shaker@netusa1.net
Subject: Re: Some possible bugs
Message-Id: <Pine.GSO.3.96.980130190735.24986G-100000@user1.teleport.com>

On Fri, 30 Jan 1998 shaker@netusa1.net wrote:

> I will gladly upgrade. However, it is going to take some time. We have
> perl and several other 'tools' in a central (so-called) software bank. I
> have to persuade the maintainers of this to perform the upgrade for me.

Maybe it will help to show them that it's a way to fix some bugs. :-) 
Good luck! 

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



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

Date: Fri, 30 Jan 1998 19:06:02 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Richard Wilde <rippo@kc3ltd.co.uk>
Subject: Re: Strings to integers HELP please
Message-Id: <Pine.GSO.3.96.980130185751.24986F-100000@user1.teleport.com>

On Fri, 30 Jan 1998, Richard Wilde wrote:

> The perl script must ignore the form{'quanity'} variable if there are
> any non-numerical characters in it.

Test for whatever you consider non-numerical with tr/// . For example, if
you think that numbers might look like +3.14159e-17 or $12,345,678.90, you
could use code like this.

    if ($quantity =~ tr/0-9+,eE.\-$//c) {
	$quantity = '';
    }

Hope this helps!

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



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

Date: Sat, 31 Jan 1998 02:15:07 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: testing perl scripts on my local
Message-Id: <34d6855a.5701577@flood.xnet.com>

eer6517@nospamgarnet.acns.fsu.edu (Eric Smith) wrote:

>Is it possible to put perl on a windows 95 or mac os8 machine so I can
>test my scripts without having load them to the server everytime I make a
>change. Dialing in is a real hassle on a university server, it's always
>busy. 
>
>If this is possible is there anything important I should know before I do this.
>
>Thanks,
>
>Eric Smith

You don't say what OS your university runs, but if it is some flavor
of UNIX you cannot beat Linux for running perl, apache and CGI on your
PC so you can test thoroughly and not have to change anything when
uploading (same paths, file permissions, etc.).

If for some reason your university runs Windows, there are Win servers
available including a personal webserver from MS or a version of
apache (www.apache.org).

Testing on a totally different OS is too much of a hassle.  Been
there, done that.


David Efflandt/Elgin, IL USA
efflandt@xnet.com    http://www.xnet.com/~efflandt/


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

Date: Fri, 30 Jan 1998 17:56:16 +0000
From: george <georgeh@got.net>
Subject: Trouble getting to run from web page
Message-Id: <34D21428.17B@got.net>

To anyone who would be kind enough to help,

I am a Perl rookie to say the least.  I am writing a CGI that simply
takes some data from the user of a web page and adds it to a list.  I am
using Perl5 for this program.  I can run everything perfectly from the
command line ... it does exactly what I want.  But when I try to run it
from the web page where the data is taken, I get this error...

**********
Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your
request.

Please contact the server administrator, root@asia.got.net and inform
them of the time the
error occurred, and anything you might have done that may have caused
the error.
**********

1. I checked my permissions and groups and owners ... they are all
fine.  It has the same permissions as other CGI's running from the same
directory.
2.  I CAN run the following script from the web page :

#!/usr/local/bin/perl5
print "Content-type: text/html\n\n";
print "hello";

3. BUT I cannot run the following program from the web page (but from
the command line it works OK):

#!/usr/local/bin/perl5
use CGI;
print "Content-type: text/html\n\n";
my $in = new CGI;
print $in;
print "hello";

4.  I am running version 5.00307 on my machine ... but I noticed before
I started running programs that the CGI.pm was missing ... so I ftp'd it
from another machine to my machine.  Why will it run from the command
line but not from the web site if the permissions and everything are OK?
 ... I am really stumped.

Any ideas?  Thanks in advance


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

Date: Fri, 30 Jan 1998 21:07:17 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Trouble getting to run from web page
Message-Id: <5h4ua6.el4.ln@localhost>

george (georgeh@got.net) wrote:
: To anyone who would be kind enough to help,


Your error message obviously comes from the server. It says "server"
right in it. You should ask server questions in a newsgroup with
some connection to servers.

Perl does not have a server.

This is the Perl newsgroup.


: I am a Perl rookie to say the least.  I am writing a CGI that simply
: takes some data from the user of a web page and adds it to a list.  I am
: using Perl5 for this program.  I can run everything perfectly from the
: command line ... it does exactly what I want.  But when I try to run it
: from the web page where the data is taken, I get this error...

: **********
: Server Error
: **********

[snip]

: 4.  I am running version 5.00307 on my machine ... but I noticed before
: I started running programs that the CGI.pm was missing ... so I ftp'd it
: from another machine to my machine.  Why will it run from the command
: line but not from the web site if the permissions and everything are OK?
: .... I am really stumped.

: Any ideas?  Thanks in advance


Yes. 

In the future please post your question to an on-topic newsgroup.


Anyway, CGI scripts often run as a different user that what you use
at the command line. This includes a different "home" directory.

You probably had CGI.pm in your homedir, so command line programs
find it in the current directory. The HTTP server likely runs your
script with a different current directory.

See if your server log says something about not finding CGI.pm
in @INC. Then (what you should have done in the first place) go
have a look at the _correct_ way to install your own modules in
the Perl FAQ, part 8:

   "How do I keep my own module/library directory?"


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


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

Date: 30 Jan 1998 21:10:37 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Why can't I unzip?
Message-Id: <6au16t$e97@panix.com>

In <slrn6d49i2.1ah.sitaram@ltusitaram.diac.com> sitaram@diac.com (Sitaram Chamarty) writes:
>On 29 Jan 1998 05:28:27 GMT, PaulJCase <pauljcase@aol.com> wrote:
>>I just downloaded latest.tar and I can't for the life of me get it open? why?
>>Thank you

>You cannot unzip a tar file.  Only a zip file (and some kinds of clothing :-)

>Try
>    tar -xvf latest.tar

WinZip unzips and extracts files from a tar file, though...

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: 30 Jan 1998 21:17:34 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Win32: Any scripts to shut down all services?
Message-Id: <6au1ju$efp@panix.com>

In <6atgqn$659$2@nz12.rz.uni-karlsruhe.de> Marc.Haber-usenet@gmx.de (Marc Haber) writes:

>Did anyone write a script that shuts down all services on a Windows NT
>machine? Any hints will be appreciated.

unlink should do the job. :)

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Fri, 30 Jan 1998 20:36:06 -0600
From: vzanini@xplore.it
Subject: Windows NT perl mail command
Message-Id: <886205905.1274019843@dejanews.com>

I'm quite new in Windows NT CGI programming using Perl. An obstacle I've
found hard to pass is the following: how can I send some data (for
example the one coming from an HTML form) via E-Mail? I know I can do
that in UNIX calling the SENDMAIL shell command. But, there is such a
command also in Windows NT, or does exist an utility which permit to
execute this function? If someone has some experience in this field,
please write me!!! Thank you,  Valerio

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 1775
**************************************

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