[16361] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3773 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 21 21:05:25 2000

Date: Fri, 21 Jul 2000 18:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964227911-v9-i3773@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 21 Jul 2000     Volume: 9 Number: 3773

Today's topics:
    Re: ATTENTION PERL MEATHEADS <godzilla@stomp.stomp.tokyo>
    Re: how to check for integer? <daveb@telus.net>
    Re: How to delete a record in a text data file? aqutiv@my-deja.com
    Re: How to delete a record in a text data file? <care227@attglobal.net>
    Re: How to delete a record in a text data file? <snakeman@kc.rr.com>
        How to detect when an output file is removed timhood@bigfoot.com
    Re: How to detect when an output file is removed <care227@attglobal.net>
    Re: Installation problem with Perl 5.6 in Cygwin <richardwoodwardNOriSPAM@hotmail.com.invalid>
    Re: Matts Script Archive - A critique <joe.kline@sdrc.com>
    Re: Matts Script Archive - A critique <godzilla@stomp.stomp.tokyo>
    Re: Perl program dies through CGI, not from console <digitalj@uswest.net.not>
    Re: Perl program dies through CGI, not from console (Alex Graf)
    Re: Perl program dies through CGI, not from console jcs@superblock.net
    Re: Really Newbie Question, ref: sendmail <digitalj@uswest.net.not>
    Re: Recursive subroutine output to recursive subroutine (Neil Kandalgaonkar)
        Returning a file white_jeremy@my-deja.com
    Re: Returning a file <care227@attglobal.net>
    Re: Returning a file <tony_curtis32@yahoo.com>
    Re: Returning a file white_jeremy@my-deja.com
    Re: Script behaving differently from command line and b <stumo@bigfoot.com>
    Re: Security of CGI General Question <godzilla@stomp.stomp.tokyo>
    Re: Security of CGI General Question <care227@attglobal.net>
    Re: Security of CGI General Question <snakeman@kc.rr.com>
    Re: Security of CGI General Question <care227@attglobal.net>
    Re: Security of CGI General Question <godzilla@stomp.stomp.tokyo>
    Re: Security of CGI General Question <care227@attglobal.net>
    Re: strict (Craig Berry)
        To CGI.pm or not? <snakeman@kc.rr.com>
    Re: To CGI.pm or not? <care227@attglobal.net>
    Re: To CGI.pm or not? <lauren_smith13@hotmail.com>
        Toronto, Canada: Junior-Intermediate Perl/CGI Software  <mpope@ematchcorp.com>
    Re: Understanding Perl Idiom (Please Help) <waltman@netaxs.com>
    Re: Why doesn't ActivePerl 5.6.0 change my PATH? <stumo@bigfoot.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 21 Jul 2000 15:43:14 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ATTENTION PERL MEATHEADS
Message-Id: <3978D202.7ACDB4C3@stomp.stomp.tokyo>

Russ Jones wrote:
 
> And godzilla's already dangerous. Maybe she'll become less dangerous.

I wouldn't hedge any risky bets on this notion.
 
> ps: my spell checker wanted to change "godzilla" to "goodwill." Karma?

Goodwill is where I usually clothes shop. However,
I make a point to drive my classic Corvette Mako Shark
rather than my Mercedes SL. Wouldn't want to raise
any eyebrows when I step out of my car in front of
my favorite Goodwill Industries store.


Godzilla!

-- 
@© = (a .. z); @® = qw (7 15 4 26 9 12 12 1 18 15 3 11 19);
srand(time() ^ ($$ + ($$ << 15))); 
sub G { rand(1000) < 500 ? "\u$1" : "\l$1" ; }
foreach $¿ (@®) { $¢ = $©[$¿-1]; $¢ =~  s/([a-z])/G($1)/gie;
if ($¢ =~ /($©[0])/i) { $¢ = "$¢ "; } print $¢; }
print "!"; exit;


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

Date: Fri, 21 Jul 2000 16:38:39 -0700
From: Dave Bradshaw <daveb@telus.net>
Subject: Re: how to check for integer?
Message-Id: <3978DEFF.338A29E2@telus.net>

Francis Litterio wrote:
> 
> User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6
> 
> elephant@squirrelgroup.com (jason) writes:
> 
> > Mariska writes ..
> > >I don't know how to check if a number is an integer.
> 
> > if you don't know whether it'll be an integer or not then a small change
> > to
> >
> >   $var =~ /^\d*[02468]$/;
> >
> > will make sure it's an integer
> 
> That doesn't detect negative integers (e.g. -3).

perhaps don't use regexp? 

my $i = shift ;

if ( $i != int($i)) {
	print "$i not an int!\n" ;
}


-- 
Dave Bradshaw <daveb@telus.net>


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

Date: Fri, 21 Jul 2000 22:19:13 GMT
From: aqutiv@my-deja.com
Subject: Re: How to delete a record in a text data file?
Message-Id: <8lai8l$3a0$1@nnrp1.deja.com>

In article <3978A91F.31AFFF8F@attglobal.net>,
  Drew Simonis <care227@attglobal.net> wrote:
> NP wrote:
> >
> > If you are going to use Perl, use it properly.  Don't post
incorrect or
> > sub-optimal answers to comp.lang.perl.misc like you've done on a
couple
> > of occassions as of late.  And goodness gracious, don't go out of
your
> > way to insult someone -- even if they irritate you.  Exercise your
> > right to killfile like I'm doing with you right now.
>
> When?  Recently?  When I post a guess, I always indicate quite
> clearly that it is a guess.  Remember, I'm here to learn too.
> I've found learning from mistakes far more beneficial than imagining
> I am correct and never having my ideas reviewed.
>
> For my own sake, I just looked at every post I've made in the last 3
> weeks.  Not once in that time have you ever corrected any of my
> "incorrect" or "sub-optimal" answers.  Looking back, I also find very
> few occasions where I've posted code.  Most of my posts are RTFM with
> a link to the FM in question.  So some examples would be appreciated.
>
> >
> > *plonk*
> >
>
> Oh well.  There's a first for everything.
>

All I was trying to do is to be a bit helpful... And a whole argument
starts from nowhere and for no reason. Come On, I thought it is a
*perl* forum, not a "I'm better then you" kind of group. And nope,
english isn't my first language, And that doesn't say anything.
btw, I don't mean to resume the argument or something, but "You're
right", is perfectly accaptable english grammar, Thank you very much.

anyhow, that's not the point.



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 21 Jul 2000 19:49:55 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: How to delete a record in a text data file?
Message-Id: <3978E1A3.9376C1D6@attglobal.net>

aqutiv@my-deja.com wrote:

> All I was trying to do is to be a bit helpful... And a whole argument
> starts from nowhere and for no reason. Come On, I thought it is a
> *perl* forum, not a "I'm better then you" kind of group. And nope,
> english isn't my first language, And that doesn't say anything.
> btw, I don't mean to resume the argument or something, but "You're
> right", is perfectly accaptable english grammar, Thank you very much.
> 
> anyhow, that's not the point.

Maybe I should have used a smiley.


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

Date: Sat, 22 Jul 2000 00:04:16 GMT
From: "DS" <snakeman@kc.rr.com>
Subject: Re: How to delete a record in a text data file?
Message-Id: <4y5e5.7289$t%4.79886@typhoon.kc.rr.com>

Anyway, Thanx Drew for all the info on this and all the other replies. You
have been quite helpful. Thanx again

Dirk

"Drew Simonis" <care227@attglobal.net> wrote in message
news:3978E1A3.9376C1D6@attglobal.net...
> aqutiv@my-deja.com wrote:
>
> > All I was trying to do is to be a bit helpful... And a whole argument
> > starts from nowhere and for no reason. Come On, I thought it is a
> > *perl* forum, not a "I'm better then you" kind of group. And nope,
> > english isn't my first language, And that doesn't say anything.
> > btw, I don't mean to resume the argument or something, but "You're
> > right", is perfectly accaptable english grammar, Thank you very much.
> >
> > anyhow, that's not the point.
>
> Maybe I should have used a smiley.




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

Date: Fri, 21 Jul 2000 23:45:47 GMT
From: timhood@bigfoot.com
Subject: How to detect when an output file is removed
Message-Id: <8lanb7$71v$1@nnrp1.deja.com>

I have a process that writes output to a log file. It seems though that
if someone removes the logfile after the program redirects the output
that all future output goes to nowhere-land.

For example:

our $Log = "/tmp/test.log";
my $input;

print "Switching STDOUT/STDERR to $Log\n";
open(TIMOUT, ">> $Log") or die "Can't open log file: $ERRNO\n";

print TIMOUT "Here's some output\n";
print "Delete the file\n";
chomp($input = <STDIN>);
print TIMOUT "This output goes nowhere\n";

print TIMOUT "I can't even trap for an error\n" or die("ack!");


I've checked all the perldoc pages I can stand to read and there doesn't
seem to be any mention of trapping this problem beyond the initial open.
It would seem ridiculous to open, print, close every time I wanted to
output.

Surely somebody has an idea?

Tim


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 21 Jul 2000 20:22:59 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: How to detect when an output file is removed
Message-Id: <3978E963.CE177EF2@attglobal.net>

timhood@bigfoot.com wrote:
> 
> I have a process that writes output to a log file. It seems though that
> if someone removes the logfile after the program redirects the output
> that all future output goes to nowhere-land.
> 

You might find these usefull:

http://www.perl.com/pub/doc/manual/html/lib/Fatal.html
http://www.perl.com/pub/doc/manual/html/pod/perlfunc/print.html
http://www.perl.com/pub/doc/manual/html/pod/perldiag.html


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

Date: Fri, 21 Jul 2000 17:40:20 -0700
From: wwwprogrammer <richardwoodwardNOriSPAM@hotmail.com.invalid>
Subject: Re: Installation problem with Perl 5.6 in Cygwin
Message-Id: <05191376.f6a66abe@usw-ex0103-024.remarq.com>

Hello, again.  Never mind about this problem.  I have decided to
stick up ActivePerl (binaries), at least for now.

Thanks,
Richard Martin Woodward


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Fri, 21 Jul 2000 19:03:30 -0400
From: Joe Kline <joe.kline@sdrc.com>
Subject: Re: Matts Script Archive - A critique
Message-Id: <3978D6C2.FB1AB41A@sdrc.com>



"Godzilla!" wrote:

> <SNIP>
> Steve Brenner is famous for his cgi-lib libraries and famous
> for being one of the founding fathers of Perl. His work is
> scattered all over the net.

There is only one Father of Perl. Larry Wall.

To assert anything else is implicitly wrong.

There have been many to add to it, but I would be no means call them
founding fathers. Perl is Larry's child that was gracious enough to
share with the rest of us. Period.


--
Joe Kline

It takes a lot of brains to enjoy satire, humor, and wit;
but none to be offended by them.  ---The Midnight Skulker




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

Date: Fri, 21 Jul 2000 16:23:50 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Matts Script Archive - A critique
Message-Id: <3978DB86.5A934B0F@stomp.stomp.tokyo>

Joe Kline wrote:
 
> "Godzilla!" wrote:
 
> > <SNIP>
> > Steve Brenner is famous for his cgi-lib libraries and famous
> > for being one of the founding fathers of Perl. His work is
> > scattered all over the net.
 
> There is only one Father of Perl. Larry Wall.
 
> To assert anything else is implicitly wrong.
 
> There have been many to add to it, but I would be no 
> means call them founding fathers. Perl is Larry's child
> that was gracious enough to share with the rest of us.
> Period.
 

Founding Father: someone who founds or is instrumental in 
founding an institution, nation, etc...

Each participant in our U.S. Constitutional Convention 
of 1787, is considered a Founding Father.

Wall, Schwartz, Brenner and a handful of others,
are the Founding Fathers of Perl. No period.

Amazingly, even myself found a father for my child,
some twenty years back, not too many months before
I enjoyably and gleefully gave birth to her, smiling
and laughing throughout the entire event. He is
quite the Founding Father, even today.

Godzilla!

-- 
@© = (a .. z); @® = qw (7 15 4 26 9 12 12 1 18 15 3 11 19);
srand(time() ^ ($$ + ($$ << 15))); 
sub G { rand(1000) < 500 ? "\u$1" : "\l$1" ; }
foreach $¿ (@®) { $¢ = $©[$¿-1]; $¢ =~  s/([a-z])/G($1)/gie;
if ($¢ =~ /($©[0])/i) { $¢ = "$¢ "; } print $¢; }
print "!"; exit;


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

Date: Fri, 21 Jul 2000 16:37:21 -0700
From: iJohn <digitalj@uswest.net.not>
Subject: Re: Perl program dies through CGI, not from console
Message-Id: <B59E2CC0.13D2%digitalj@uswest.net.not>

in article dV1e5.6131$DH3.139705@news-east.usenetserver.com,
jcs@superblock.net at jcs@superblock.net wrote on 7/21/00 12:55 PM:

> Is anyone aware of anything that might cause the program to die in this
> manner, and only by running it as a CGI program?
> 
> I'm stuck on why it's quitting like this, and even how to figure out
> why, let alone trying to make it stop doing it.  Any clues?


When I get that kind of problem, I issue a regular text/html header right at
the start of the script, and then stick in print diagnostic statements in
the perl code, followed by an exit (print "Got to line 350";exit;).  This
usually narrows things down pretty quickly.   Or sometimes just write lines
to a file to make a trace of the code and then go look at the file to see
where things fell apart.  Not very sophisticated, but it gets the job done.

Most of the time I've had problems like this it's been related to a
subroutine that either doesn't exist or never completes or a file op without
a die on it. 

-- 
 i be iJohn, getting wet in Portland OR
 I support the Freedom to Innovate: that's why I use a Mac.



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

Date: Fri, 21 Jul 2000 23:49:51 GMT
From: alex.graf@.....ec.gc.ca (Alex Graf)
Subject: Re: Perl program dies through CGI, not from console
Message-Id: <3978e11e.202149796@morgoth.sfu.ca>


Could be that the program depends somehow on an environment variable
that is set when using the system interactively (i.e. set in .profile
or whatever) but not set when run by cgi.

a


On Fri, 21 Jul 2000 16:37:21 -0700, iJohn <digitalj@uswest.net.not>
wrote:

>in article dV1e5.6131$DH3.139705@news-east.usenetserver.com,
>jcs@superblock.net at jcs@superblock.net wrote on 7/21/00 12:55 PM:
>
>> Is anyone aware of anything that might cause the program to die in this
>> manner, and only by running it as a CGI program?
>> 
>> I'm stuck on why it's quitting like this, and even how to figure out
>> why, let alone trying to make it stop doing it.  Any clues?
>
>
>When I get that kind of problem, I issue a regular text/html header right at
>the start of the script, and then stick in print diagnostic statements in
>the perl code, followed by an exit (print "Got to line 350";exit;).  This
>usually narrows things down pretty quickly.   Or sometimes just write lines
>to a file to make a trace of the code and then go look at the file to see
>where things fell apart.  Not very sophisticated, but it gets the job done.
>
>Most of the time I've had problems like this it's been related to a
>subroutine that either doesn't exist or never completes or a file op without
>a die on it. 
>
>-- 
> i be iJohn, getting wet in Portland OR
> I support the Freedom to Innovate: that's why I use a Mac.
>



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

Date: Fri, 21 Jul 2000 23:53:36 GMT
From: jcs@superblock.net
Subject: Re: Perl program dies through CGI, not from console
Message-Id: <4o5e5.8118$DH3.214890@news-east.usenetserver.com>

iJohn (digitalj@uswest.net.not) once said:
> When I get that kind of problem, I issue a regular text/html header right at
> the start of the script, and then stick in print diagnostic statements in
> the perl code, followed by an exit (print "Got to line 350";exit;).  This
> usually narrows things down pretty quickly.   Or sometimes just write lines
> to a file to make a trace of the code and then go look at the file to see
> where things fell apart.  Not very sophisticated, but it gets the job done.

> Most of the time I've had problems like this it's been related to a
> subroutine that either doesn't exist or never completes or a file op without
> a die on it. 

Thanks for the response, but I've actually tried this already.  I can
pinpoint the line it dies on, but I can't figure out why it dies, as it
doesn't print any error message.  When I send an initial
"Content-type: ..." line and print my debugging output, it shows up to
the line, and stops.

I probably should have included my code, so here's a slightly modified
snippet of where it dies:

 1  my $handle = IO::Socket::INET->new("myserver:1000");
 2  my $data = <$handle>;
 3  if ($data =~ /^\+OK server ready at .*/) {
 4     print $handle "command\n";
 5     print "sent command\n";
 6     $data = <$handle> or die "uh, problem: $!";
 7     if ($data =~ /^\+OK Enabled .*/) {
 8        print "it worked\n";
 9     } else {
10        print "it didn't work\n";
11     }
12  } else {
13     die "didn't receive banner";
14  }
15  $handle->close;
16  print "finished successfully\n";

Now from the console, this snippet would print everything and the
"finished successfully" line just fine, but through a web browser, all
that is received is "sent command\n".  No 'die' line, no "it worked/it
didn't work", anything.  It just stops at line 6 with no more output.
Looking at the remote server, I see the connection, I see it receive the
command, and then the connection closes.

Any clues?

-- 
joshua stein | superblock information systems | http://superblock.net
jcs@superblock.net | (gnu|p)gp key id: 2048/D8603211 | http://jcs.org


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

Date: Fri, 21 Jul 2000 17:05:13 -0700
From: iJohn <digitalj@uswest.net.not>
Subject: Re: Really Newbie Question, ref: sendmail
Message-Id: <B59E3348.13D4%digitalj@uswest.net.not>

in article 57cfns0th1p483ksm7kc2susm5fap9qv3k@4ax.com, Digitali Binar at
digitali@systemmedics.com wrote on 7/20/00 7:10 PM:

> print sendmail "From: $email_from\n";

The print operator needs to be followed by a file handle to print to (or
else it will print to STDOUT.)

You haven't created a filehandle called "sendmail", and it's not a variable
and its not in quotes so perl thinks is some kind of function.  Then it
tells you that's not a good word to use because its all lower case so it
might conflict with a future perl fucntion (which are always all lowercase).

You send stuff to sendmail by opening a pipe to it with a filehandle:
open (MAIL,"| /usr/bin/sendmail -t");
That creates a file handle that is actually a pipe into the sendmail
program. That is, whatever you print to MAIL is simply sent to the sendmail
program.  The -t switch means that the input is to be parsed by sendmail to
find the headers like To:, Subject:, From: .

Then you can print to the file handle MAIL.

print MAIL "From: The Camel\n";

Don't forget to put a blank line at the end of the headers before the body.

-- 
 i be iJohn, getting wet in Portland OR
 I support the Freedom to Innovate: that's why I use a Mac.



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

Date: Fri, 21 Jul 2000 23:40:59 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: Recursive subroutine output to recursive subroutine problem
Message-Id: <8lamkh$7qo$1@localhost.localdomain>

In article <DB58F47B6CFE4CBC.86221CBC936CCEEE.E42946E775907BA8@lp.airnews.net>,
 <firstname.lastname@nokia.com> wrote:

>Neil,
>
>First I'd like to thank you for your help with this and yes you are
>right we are using version 4.

It was Bart who noticed.

>Sorry about the length, but would the use of my() in place of the
>local() correct the problem of the second subroutine keeping the
>information from the pervious calls to it?

On first glance I don't see why. You seem to be initializing all your
local variables. I tried a recursive sub in a perl4 idiom and it worked
fine for me. Although you do local($x,$y,$z) = ""; which works, but for
the wrong reason. You probably want () instead of "" there.

But like I said before your code, and problem, is just too complicated
for quick analysis on a newsgroup. Maybe other people are willing to take
up the challenge as is, but if you could show the behaviour in a *small* 
section of code it would be easier to help you.

-- 
Neil Kandalgaonkar <neil@brevity.org>


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

Date: Fri, 21 Jul 2000 23:41:30 GMT
From: white_jeremy@my-deja.com
Subject: Returning a file
Message-Id: <8lan3b$7nt$1@nnrp2.deja.com>

Hello,

Is it possible to return a file after sending
info to a Perl script?

Let's say I had a bit of HTML like:

onClick="document.scr='script.cgi?info'"

I would ideally want to return a GIF or JPEG from
the server while passing info to the Perl script.

Can his be done?  Inquiring minds want to know.

Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 21 Jul 2000 20:02:02 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Returning a file
Message-Id: <3978E47A.41192B74@attglobal.net>

white_jeremy@my-deja.com wrote:
> 
> Hello,
> 
> Is it possible to return a file after sending
> info to a Perl script?

Yes, or a pointer to that file, which would be more HTMLish.

> 
> Let's say I had a bit of HTML like:
> 
> onClick="document.scr='script.cgi?info'"
> 
> I would ideally want to return a GIF or JPEG from
> the server while passing info to the Perl script.
> 

Any script or application can do this.  Just have script.cgi print
the HTML that would cause the browser to load the image.  Don't forget
to output a valid header first, thou.


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

Date: 21 Jul 2000 19:26:15 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Returning a file
Message-Id: <878zuv80yg.fsf@limey.hpcc.uh.edu>

>> On Fri, 21 Jul 2000 23:41:30 GMT,
>> white_jeremy@my-deja.com said:

> Hello, Is it possible to return a file after sending
> info to a Perl script?

> Let's say I had a bit of HTML like:
> onClick="document.scr='script.cgi?info'"

That isn't HTML.

> I would ideally want to return a GIF or JPEG from the
> server while passing info to the Perl script.

Can a CGI program return an image type?  Yes.

> Can his be done?  Inquiring minds want to know.

Yes, it can.  You'll get better help in
comp.infosystems.www.authoring.cgi as your question has
nothing to do with perl per se.

-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


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

Date: Sat, 22 Jul 2000 00:41:58 GMT
From: white_jeremy@my-deja.com
Subject: Re: Returning a file
Message-Id: <8laqkl$9ah$1@nnrp1.deja.com>

Good advice, but I don't want to write an html file to return a value.
I want the script to look and act like an image file when it is called
so that I could use it as an onMouseOut file for example.

Is that possible?



In article <3978E47A.41192B74@attglobal.net>,
  care227@attglobal.net wrote:
> white_jeremy@my-deja.com wrote:
> >
> > Hello,
> >
> > Is it possible to return a file after sending
> > info to a Perl script?
>
> Yes, or a pointer to that file, which would be more HTMLish.
>
> >
> > Let's say I had a bit of HTML like:
> >
> > onClick="document.scr='script.cgi?info'"
> >
> > I would ideally want to return a GIF or JPEG from
> > the server while passing info to the Perl script.
> >
>
> Any script or application can do this.  Just have script.cgi print
> the HTML that would cause the browser to load the image.  Don't forget
> to output a valid header first, thou.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sat, 22 Jul 2000 00:04:31 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Script behaving differently from command line and by CGI
Message-Id: <8lal3t$l1j$1@supernews.com>

I've had problems a bit like that where the directories don't have the right
permissions - try chmod on the directories that contain the exe file.

jerry <honglan00NOhoSPAM@yahoo.com.invalid> wrote in message
news:03bb78f8.84679565@usw-ex0104-025.remarq.com...
> Hi,there,
> I have a similar problem. I need to invoke a shellscript through
> my website. However when I tested the cgi script from the unix
> prompt, it worked fine. But when I run it from the webpage, the
> program ran throught its initial phase only. There was not error
> message. When I monitored the system process, the actual exe file
> was not even invoked. In my shell script, it does some data
> preprocessing and then calls other binary program to execute.
>
> Any hint?
>
> my script is like this
>
> use CGI;
>
> ..
> if (param()){
>   ...
>   #call the shell script
>   open3(WTR, RDR, ERR, "genReport.ksh") || die ("cannot open
> script");
>   ...
>   #print the system output to the webpage
>   while (<RDR>){
>     print p("$_") ;
>   }
> }
>
>
>
> -----------------------------------------------------------
>
> Got questions?  Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>




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

Date: Fri, 21 Jul 2000 15:37:45 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Security of CGI General Question
Message-Id: <3978D0B9.70974DD@stomp.stomp.tokyo>

DS wrote:
 
> Excuse me if this is a stupid question but is it safe to 
> list a password in the the same cgi thats being executed?
> For example I am making a script to post news updates and
> I need to password protect the posting ability on it.
> So in my script I just  made a simple comparison like this :

(snipped, alt.perl deleted so as not to tempt them here)

Perfectly safe if your script is not WWW readable
via directory indexing, group permissions are off,
other users on your server are not hacking your 
own server from within and, if you do not have a
one-in-a-million person visit, like me, who knows
how to pull a %xx trick and read your script.

Use a healthy password, like "admin" or "guest"
or maybe even "password" and, no problem.

You are actually very safe if you practice just
a little bit of security regarding directory
indexing and permissions.

Godzilla!

-- 
@© = (a .. z); @® = qw (7 15 4 26 9 12 12 1 18 15 3 11 19);
srand(time() ^ ($$ + ($$ << 15))); 
sub G { rand(1000) < 500 ? "\u$1" : "\l$1" ; }
foreach $¿ (@®) { $¢ = $©[$¿-1]; $¢ =~ s/([a-z])/G($1)/gie;
if ($¢ =~ /($©[0])/i) { $¢ = "$¢ "; } print $¢; }
print "!"; exit;


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

Date: Fri, 21 Jul 2000 19:55:03 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Security of CGI General Question
Message-Id: <3978E2D7.919041B8@attglobal.net>

"Godzilla!" wrote:
> 
> Perfectly safe if your script is not WWW readable
> via directory indexing, group permissions are off,
> other users on your server are not hacking your
> own server from within and, 

The majority of attacks are from within.  Lets not forget that.

> if you do not have a
> one-in-a-million person visit, like me, who knows
> how to pull a %xx trick and read your script.

1 in a million?  

> 
> Use a healthy password, like "admin" or "guest"
> or maybe even "password" and, no problem.

I hope this is sarcasm.  

> 
> You are actually very safe if you practice just
> a little bit of security regarding directory
> indexing and permissions.

That is complete and total crap, and you know it.


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

Date: Sat, 22 Jul 2000 00:07:24 GMT
From: "DS" <snakeman@kc.rr.com>
Subject: Re: Security of CGI General Question
Message-Id: <0B5e5.7290$t%4.79689@typhoon.kc.rr.com>

What is total crap? His entire statement?

Dirk

"Drew Simonis" <care227@attglobal.net> wrote in message
news:3978E2D7.919041B8@attglobal.net...
> "Godzilla!" wrote:
> >
> > Perfectly safe if your script is not WWW readable
> > via directory indexing, group permissions are off,
> > other users on your server are not hacking your
> > own server from within and,
>
> The majority of attacks are from within.  Lets not forget that.
>
> > if you do not have a
> > one-in-a-million person visit, like me, who knows
> > how to pull a %xx trick and read your script.
>
> 1 in a million?
>
> >
> > Use a healthy password, like "admin" or "guest"
> > or maybe even "password" and, no problem.
>
> I hope this is sarcasm.
>
> >
> > You are actually very safe if you practice just
> > a little bit of security regarding directory
> > indexing and permissions.
>
> That is complete and total crap, and you know it.




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

Date: Fri, 21 Jul 2000 20:09:48 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Security of CGI General Question
Message-Id: <3978E64C.76666CD@attglobal.net>

> DS wrote:
> 
> What is total crap? His entire statement?
> 
> Dirk
> 

Yes.  It is purposefull mis-information.  It can't be anything else.
This statment is a giveaway:

:Use a healthy password, like "admin" or "guest"
:or maybe even "password" and, no problem.

To call those generic, oft tried passwords "healthy" is beyond 
dangerous to those who might be new to the digital world.  Those
would be prime examples of _very_dangerous_ passwords.  

Also, this is mis-leading:

:You are actually very safe if you practice just
:a little bit of security regarding directory
:indexing and permissions.

A "little bit" and "very safe" do not travel well together in the 
busy world of security.


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

Date: Fri, 21 Jul 2000 17:11:16 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Security of CGI General Question
Message-Id: <3978E6A4.BBADDBBE@stomp.stomp.tokyo>

Drew Simonis wrote:
 
> "Godzilla!" wrote:

> That is complete and total crap, and you know it.


Having a bad hair day, Ms. Mueller?

Godzilla!

-- 
print "file:///%43|%2f";


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

Date: Fri, 21 Jul 2000 20:40:35 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Security of CGI General Question
Message-Id: <3978ED83.660F156C@attglobal.net>

"Godzilla!" wrote:
> 
> Drew Simonis wrote:
> 
> > "Godzilla!" wrote:
> 
> > That is complete and total crap, and you know it.
> 
> Having a bad hair day, Ms. Mueller?

No. I shave my bean, so I have no hair.  Your flippant attitude is
what is bad here.  I can understand if people make an honest mistake,
I do it myself all the time.  What I can't stand is when someone 
purposefully does something that may cause harm, which is what you
did.  Its wrong, its dangerous, and you know it.

> print "file:///%43|%2f";

Im impressed.


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

Date: Fri, 21 Jul 2000 21:47:51 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: strict
Message-Id: <snhh87ec6tt147@corp.supernews.com>

Brendon Caligari (bcaligari@shipreg.com) wrote:
: look at it as a dogma

Perhaps we need a set of 'dogmas' paralleling the pragmas, with 'impose'
and 'ban' keywords in the 'use' and 'no' roles.

  impose Transubstantiation qw(:monophysite);
  #...
  {
    ban Transubstantiation;
    print $heresy->{creed};
  }

Perhaps in Perl 6?


-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Turning and turning in the widening gyre
   |   The falcon cannot hear the falconer." - Yeats, "The Second Coming"


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

Date: Sat, 22 Jul 2000 00:12:07 GMT
From: "DS" <snakeman@kc.rr.com>
Subject: To CGI.pm or not?
Message-Id: <rF5e5.7291$t%4.79909@typhoon.kc.rr.com>

Hello I am a newbie at CGI scripting and I have read alot about CGI.pm but I
am still a newbie so I am not sure whether to install it or just stick with
writing my own scripts. What would you advise? Is CGI.pm really  a good
addition?

Thanx alot
Dirk




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

Date: Fri, 21 Jul 2000 20:27:26 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: To CGI.pm or not?
Message-Id: <3978EA6E.40CE5F69@attglobal.net>

DS wrote:
> 
> Hello I am a newbie at CGI scripting and I have read alot about CGI.pm but I
> am still a newbie so I am not sure whether to install it or just stick with
> writing my own scripts. What would you advise? Is CGI.pm really  a good
> addition?

CGI.pm is part of the standard perl distribution, so the answer is...
You already have it!

Alot of folks complain about the overhead of CGI.pm, which can be large
if you are just using it for simple things like getting data from a
form.
Luckily, there are smaller modules that do the same thing.

Have a look at:

http://search.cpan.org/search?mode=module&query=CGI

Quite a bounty.  

The goodies are near the bottom of that list.


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

Date: Fri, 21 Jul 2000 17:35:39 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: To CGI.pm or not?
Message-Id: <8laq71$3b$1@brokaw.wa.com>


DS <snakeman@kc.rr.com> wrote in message
news:rF5e5.7291$t%4.79909@typhoon.kc.rr.com...
> Hello I am a newbie at CGI scripting and I have read alot about CGI.pm but
I
> am still a newbie so I am not sure whether to install it or just stick
with
> writing my own scripts. What would you advise? Is CGI.pm really  a good
> addition?

1) It's already installed if you have a proper Perl installation.
2) It's an excellent way to program CGI.  Most of the icky things are taken
care of, allowing you to concentrate on the problem at hand.

Lauren





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

Date: Fri, 21 Jul 2000 22:28:24 GMT
From: Matthew Pope <mpope@ematchcorp.com>
Subject: Toronto, Canada: Junior-Intermediate Perl/CGI Software Developer (up to  $55K) Perl, HTML/CGI, JavaScript
Message-Id: <3900D61B.39461CC6@ematchcorp.com>


--------------73A2FA3BE8194D8B95C691E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This position involves writing commercial eTailing Internet shopping
software (and components) for resale (ecommerce) for a new dot com
software company, which will soon apply to be traded on NASDAQ. Several
clients are already using our innovative, high technology ETailing
Enterprise software.  OO Tools are included to rapidly build ETailing
web sites to 'humanize the internet shopping experience'.

Developers/students with some but not all of the total experience and
skill requirements mentioned below are still encouraged to apply since,
we may decide to change this position to a junior software developer.
The ideal candidate (for junior intermediate) will have:

   *  1.0+ years experience with Perl, HTML/CGI and JavaScript
   *  0.5+ years experience with Java
   *  2.0+ years systems development experience, preferably with a
     software/hardware vendor or a consulting company using OOA/OOD
   *  methodology.
   *  MS SQL Server experience an asset
   *  bachelor degree in Computing or equivalent

The candidate will have the opportunity to learn:

   * Java Servlets
   * Java Server Pages
   * EJB, RMI/CORBA
   * Java Swing
   * OO Analysis and Design

This Internet startup is well positioned to take a dent out of the
predicted 2.5 order of magnitude growth in eCommerce Small Business
revenues between 1998 and 2003 (IDC).
Get in on the ground floor of this Internet startup and join a team of
very experienced software professionals.  Our corporate culture is
centered on providing a fun workplace where engineers can grow both
technically and financially. Good salary and excellent participation
(once we apply and go public) will enable us to offer total compensation
at least on par if not better than the upper reaches of Toronto software
and hardware vendors.

Principals only submit resumes to engjobs@ematchcorp.com (We are a
software company, not a recruiter.)  [Netizens please excuse this brief
commercial interruption...]

--------------73A2FA3BE8194D8B95C691E0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
This position involves writing commercial eTailing Internet shopping software
(and components) for resale (ecommerce) for a new dot com software company,
which will soon apply to be traded on NASDAQ. Several clients are already
using our innovative, high technology ETailing Enterprise software.&nbsp;
OO Tools are included to rapidly build ETailing web sites to 'humanize
the internet shopping experience'.
<p>Developers/students with some but not all of the total experience and
skill requirements mentioned below are still encouraged to apply since,
we may decide to change this position to a junior software developer. The
ideal candidate (for junior intermediate) will have:
<ul>
<li>
&nbsp;1.0+ years experience with Perl, HTML/CGI and JavaScript</li>

<li>
&nbsp;0.5+ years experience with Java</li>

<li>
&nbsp;2.0+ years systems development experience, preferably with a software/hardware
vendor or a consulting company using OOA/OOD</li>

<li>
&nbsp;methodology.</li>

<li>
&nbsp;MS SQL Server experience an asset</li>

<li>
&nbsp;bachelor degree in Computing or equivalent</li>
</ul>
The candidate will have the opportunity to learn:
<ul>
<li>
Java Servlets</li>

<li>
Java Server Pages</li>

<li>
EJB, RMI/CORBA</li>

<li>
Java Swing</li>

<li>
OO Analysis and Design</li>
</ul>
This Internet startup is well positioned to take a dent out of the predicted
2.5 order of magnitude growth in eCommerce Small Business revenues between
1998 and 2003 (IDC).
<br>Get in on the ground floor of this Internet startup and join a team
of very experienced software professionals.&nbsp; Our corporate culture
is centered on providing a fun workplace where engineers can grow both
technically and financially. Good salary and excellent participation (once
we apply and go public) will enable us to offer total compensation at least
on par if not better than the upper reaches of Toronto software and hardware
vendors.
<p>Principals only submit resumes to <a href="mailto:engjobs@ematchcorp.com">engjobs@ematchcorp.com</a>
(We are a software company, <i>not</i> a recruiter.)&nbsp; [Netizens <i>please</i>
excuse this brief commercial interruption...]</html>

--------------73A2FA3BE8194D8B95C691E0--



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

Date: 21 Jul 2000 19:58:24 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Understanding Perl Idiom (Please Help)
Message-Id: <m3og3rghnj.fsf@netaxs.com>

kenlaird@my-deja.com writes:

> Yes, I mean I'm trying to understand the use of () in the examle above.
> Because the first time I wrote this more "naturally" without "()"
> 
> #!/usr/bin/perl -w
> @a=`ps -edf`;
> foreach @a {
> if /ftp/ {
> print ;
> }
> }
> 
> and it didn't work.It happens to me frequently when I try to write
> some Perl code to forget these "parens" unless I know where to put them
> right.

The only time you don't need need the parens is when an if, unless,
while, until, or foreach is being tacked onto the end of another
statement, as in

print "foo" if $a == 0;

In all other case you need to use the parens.  You're never wrong to
include the parens, so if you're having trouble remembering when to
use them you might as well always use parens.

Again, this is all described in great detail in perlsyn.

Walt


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

Date: Sat, 22 Jul 2000 00:07:58 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: Why doesn't ActivePerl 5.6.0 change my PATH?
Message-Id: <8lal45$l1j$2@supernews.com>

David Ness <DNess@Home.Com> wrote in message
news:39788723.7C1BD22F@Home.Com...
>
> I might only add that a slightly deceptive thing that you may encounter is
> that the SET may not get executed on opening a new DOS window until you
have
> rebooted your machine once. IIRC, there was a time when I believed that
> AutoExec.BAT didn't really `work' because I would change it and then open
a new
> window and not see effect of the change. However, when I changed it,
rebooted
> the machine and then opened a DOS window, the change had the proper
effect.

True, but that's mainly because autoexec.bat is only processed on startup,
so it ignores it after that; what's equally annoying is setting environment
variables in one DOS box have no effect on the others, so even if you've set
the path correctly and got it working in one it doesn't go to all the rest
by default. I expect this is by design, but it still can be annoying.

Stuart




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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3773
**************************************


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