[11100] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4700 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 20 16:17:25 1999

Date: Wed, 20 Jan 99 13:00:18 -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           Wed, 20 Jan 1999     Volume: 8 Number: 4700

Today's topics:
    Re: "Back button" in CGI script (Abigail)
    Re: "Back button" in CGI script <emschwar@mail.uccs.edu>
    Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus droby@copyright.com
        converting to another code page <timu@cityline.ru>
    Re: Counting child processes?  rupert@no.spam.leeds.ac.uk
    Re: Example of Perl Cookie Implementation please (PhelanP806)
    Re: Example of Perl Cookie Implementation please (Abigail)
    Re: Example of Perl Cookie Implementation please <upsetter@ziplink.net>
        Flatline database help <me@me.com>
    Re: Help getting script going dhosek@webley.com
        Help with regular expression (Network Operations)
        HELP: multiple write statements to one output filehandl anna@water.ca.gov
    Re: Is there a way to create self contained perl execut <neilpaku@paradise.net.nz>
    Re: list of hashes (Abigail)
    Re: list of hashes (Abigail)
    Re: New to perl - trying to FTP <abc@abc.com>
    Re: Newbie Perl CGIer needs fast help!  Posting to URL (I R A Aggie)
    Re: Oracle connections. <newsposter@cthulhu.demon.nl>
    Re: Perl problem :(Offline mode... <sternji@mail.northgrum.com>
    Re: problem with: use module; (Bart Lateur)
        script outputting file instead of html page <23_skidoo@geocities.com>
        SOLVED <-- PC Perl system("cvs.exe"): "Fatal server err dejanews@2020consulting.com
    Re: Statistics for comp.lang.perl.misc (Abigail)
        Text::Wrap Problem ken@proexam.org
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 20 Jan 1999 16:41:56 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: "Back button" in CGI script
Message-Id: <78510k$eai$1@client2.news.psi.net>

Katia Hayati (hayati@ocf.Berkeley.EDU) wrote on MCMLXVIII September
MCMXCIII in <URL:news:Pine.SOL.3.96.990119212810.17475A-100000@apocalypse.OCF.Berkeley.EDU>:
{} 
{} Well I am not an expert like Abigail, but it seems to me that if you use
{} the environment variable $ENV{"HTTP_REFERER"} (sic), it will do the trick.


No it doesn't. You haven't bothered to read the URL I gave, did you?


<URL:http://www.foad.org/%7Eabigail/HTML/Misc/back_button.html>



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


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

Date: 20 Jan 1999 12:06:02 -0700
From: "Eric The Read" <emschwar@mail.uccs.edu>
Subject: Re: "Back button" in CGI script
Message-Id: <xkfogntkbmt.fsf@valdemar.col.hp.com>

Katia Hayati <hayati@ocf.Berkeley.EDU> writes:
> On 19 Jan 1999, Abigail wrote:
> > Joel M. Borden (mr.marketing@worldnet.att.net) wrote on MCMLXVII
> > September MCMXCIII in <URL:news:36A4134D.4BD2@worldnet.att.net>:
> > :: Pardon a newbie question...
> > :: 
> > :: I just got my first script working (a simple mail-generating form)... it
> > :: does error-checking, and if required info is missing, I'd like to provde
> > :: a "back" link to the HTML page that had the original form, so that the
> > :: partial info entered by the user will be retained.
> > 
> >    1) That's not a Perl question.
> >    2) Every browser already has that functionality.
> >    3) You can't do that.
> 
> Well I am not an expert like Abigail, but it seems to me that if you use
> the environment variable $ENV{"HTTP_REFERER"} (sic), it will do the trick.

No, because the HTTP_REFERER (sic) environment variable isn't guaranteed
to contain anything at all.  

The one thing I don't understand is why CGI.pm hasn't been mentioned
yet.  It contains facilities to detect whether a form has been submitted
or not, so you can use it to generate the form in the first place, and
then when it's submitted incorrectly, use the same bit of perl to
generate the form with the correct info placed in the appropriate blanks.

Or not.

-=Eric


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

Date: Wed, 20 Jan 1999 18:56:40 GMT
From: droby@copyright.com
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <7858t2$n90$1@nnrp1.dejanews.com>

In article <782nbn$gkb$1@nnrp1.dejanews.com>,
  dturley@pobox.com wrote:
> In article <7824gr$v01$1@nnrp1.dejanews.com>,
>   droby@copyright.com wrote:
> > In article <ebohlmanF5pMvx.7u6@netcom.com>,
> >   Eric Bohlman <ebohlman@netcom.com> wrote:
> > > Jonathan Feinberg <jdf@pobox.com> wrote:
> > > : dturley@pobox.com writes:
>
> <SNIP>
>
> I just think its hilarious that a (bad) joke turned into a thread!
>
 It's only fair.  The other major thread going on has become a bad joke.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 20 Jan 1999 21:32:30 +0300
From: "Tim Ukharev" <timu@cityline.ru>
Subject: converting to another code page
Message-Id: <916856911.358843@mao.cityline.ru>

Hi

How can I covert my variables form win-1251 to dos-866 ??

--

Sincerly yours, Tim.





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

Date: Wed, 20 Jan 1999 19:55:31 +0000 (GMT)
From: rupert@no.spam.leeds.ac.uk
Subject: Re: Counting child processes? 
Message-Id: <36A6A598.3AE@no.spam>

> Hello all, I'm in need of some good ideas. What I want to do is to
> have a forking server count its subprocesses (for load control
> reasons). 

I am needing to do the same thing for the same reason and I cannot
seem to get it right.

Perhaps the problem is one of zombies accumulating because multiple
child processes need reaping when you receive SIGCHLD.
I have found this code by Mr. Schwartz useful for the problem
that you mention:

<http://www.dejanews.com/dnquery.xp?ST=PS&QRY=zombies+multiple+child+reaping+SIGCHLD&defaultOp=AND&DBS=1&format=terse&showsort=score&maxhits=25&LNG=ALL&subjects=&groups=&authors=&fromdate=&todate=>

This should count as an FAQ becuase the documentation and the FAQ
and the Camel are all rather opaque. Also many people post misleading
comments about fork and child processes. Perhaps this sort 
of thing will be easier when we use threads. 

I have not yet solved my problem, which is perhaps not a Perl one. My
perl program tries to open more processes that I would like because
my system wide ulimit is 256 and it ought to be 60 or so. So far as I 
can tell the system wide ulimit is set (in Linux) in initscript which 
is called by init. Sadly, my version of Linux (SuSE 5.2) does not have
an initscript, my guess being that SuSE feel that init can get by
quite happily with inittab alone. So I am looking (so far
unsuccessfully)
for a sample initscript for a humble i386 Linux. Maybe I can change
something in task.h .

Ben.
(A Mac person who doesn't really understand unix).


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

Date: 20 Jan 1999 18:54:32 GMT
From: phelanp806@aol.com (PhelanP806)
Subject: Re: Example of Perl Cookie Implementation please
Message-Id: <19990120135432.04802.00000185@ng-ch1.aol.com>

>-- Next time they come in, I want to be able to check for that cookie,
>-- and if it exists, redirect elsewhere.  I know how to do the redirect,
>-- but was hoping to see some real examples of using cookies in a perl
>-- script.  Thanks.
>
>You would do it the same as in a fortran program using cookies.
>

I've never seen a FORTAN compiler that would accept Perl syntax, or a Perl
interpreter that would accept FORTRAN syntax.  I'm not sure I'd want either of
them, but I'd like to know where Abigail found one.

On a slightly more serious note, I think Steve can find what he's looking for
in CPAN.  I don't do cookies from within Perl, but I'm pretty sure there is
some code in one of the modules in CPAN that does.

-P

--------------------
I detest SPAM and boycott the SPAMMers, email me ads for your competitors!


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

Date: 20 Jan 1999 17:31:52 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Example of Perl Cookie Implementation please
Message-Id: <7853u8$ejs$4@client2.news.psi.net>

Steve . (syarbrou@nospam.enteract.com) wrote on MCMLXVIII September
MCMXCIII in <URL:news:36a60631.1769028@news.enteract.com>:
-- I want to have a script on my unix box that when someone fills out a
-- form and submits it, the perl script will place a cookie on their
-- system to let me know next time they come in that they filled out the
-- form.

Can I have an almond cookie please?

-- Next time they come in, I want to be able to check for that cookie,
-- and if it exists, redirect elsewhere.  I know how to do the redirect,
-- but was hoping to see some real examples of using cookies in a perl
-- script.  Thanks.

You would do it the same as in a fortran program using cookies.

Your question has nothing to do with perl. Since you are using a keyboard,
I suggest asking your question in alt.comp.periphs.keyboard.



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


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

Date: Wed, 20 Jan 1999 19:54:49 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Example of Perl Cookie Implementation please
Message-Id: <dwqp2.125$QD2.11261@news.shore.net>


PhelanP806 <phelanp806@aol.com> wrote:

: On a slightly more serious note, I think Steve can find what he's looking for
: in CPAN.  I don't do cookies from within Perl, but I'm pretty sure there is
: some code in one of the modules in CPAN that does.

There's probably something on www.cgi-resources.com that uses cookies.

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Wed, 20 Jan 1999 18:34:47 -0000
From: "Steve" <me@me.com>
Subject: Flatline database help
Message-Id: <7857k9$6g9$1@news5.svr.pol.co.uk>

Hi,

I am trying to customise a CGI shopping cart script which uses a flatline
ASCII database file as its backend to store product information. The script
is S-Mart, which is very good and despite being an absolute newbie to CGI
programming I have learnt a lot from modifying the code and have been able
to make it do other things I want.

I am having problems with having multiple values for one field. For example,
I might want a CD I'm selling to be classed under 3 different genres. S-Mart
can write all three values to the database fine, but it cannot display them
on searches etc., but if there is only one value it displays it fine. Below
is an example of a database entry with multiple values created by S-Mart:

itemid|itemprice|genre1,genre2,genre3|

The values are split by commas. S-Mart has a .CFG configuration file, where
the genre values are defined, for example:

%groups = (
genre1, 'Pop',
genre2, 'Rock',
genre3, 'Classic'
);

So if the field is "genre1" in the database it will be returned as "Pop" on
any HTML page. This is how the CGI script searches the database and returns
the field values (edited to remove unnecesary stuff):

# The search subroutine

my(%ITEM);
($ITEM{'itemid'}, $ITEM{'price'}, $ITEM{'group'}) = split(/\|/,$LINES[$i]);

&print_item(\%ITEM);


# The print_item subroutine

local(*ITEM) = shift;

print "$ITEM{'itemid'}, $ITEM{'price'},\n

($groups{$ITEM{'group'}})";


This works fine if there is only one value for the item group. But if
multiple values are added, it tries to look for "genre1,genre2,genre3" in
the configuration file instead of "genre1", then "genre 2" and finally
"genre3". I want it to do the latter and return 3 genres, so the script
needs to be told that "," is a character which seperates the values, then do
the ($groups{$ITEM{'group'}}) for each of the groups.

I tried my best as a novice to do this but it simply wouldn't work, even
though it seems quite straight forward. If anyone could help out by
modifying that little bit of code above, I would really appreciate it. Just
e-mail me if you need the code for the full script to do it.

Thanks in advance.

Steve
steve@baldyman.demon.co.uk






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

Date: Wed, 20 Jan 1999 19:34:11 GMT
From: dhosek@webley.com
Subject: Re: Help getting script going
Message-Id: <785b3j$p64$1@nnrp1.dejanews.com>

In article <784rgd$agn$1@nnrp1.dejanews.com>,
  chall5@hotmail.com wrote:
> After finally getting myself a CGI-BIN on a UNIX box I am having trouble
> getting a Perl script to work and wondered if anyone could help me.

> The script I am trying to make work is the simple database application
> detailed at http://webreview.com/wr/pub/98/10/23/perl/database.html.  I have
> set the path to the perl interpreter correctly for my server
> (#!/usr/local/bin/perl) at the beginning of the script, uploaded the .pl file
> in ASCII, set the permissions, put the database.txt file in a separate dir
> and have the config.txt file pointing at the database.txt file correctly (I
> hope) so it can be written to. However I keep getting Internal Server Error
> mesages.  I have Telnetted in but I do not know how to run the .pl file from
> the command line to get more feedback on the problem.

If you look at your server error log, that might shed some light on the
problem.

As for running it from the command line, you should be able to go to the
cgi-bin directory and run the script by just typing its name.

-dh


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 20 Jan 1999 19:11:45 GMT
From: root@coredcs.com (Network Operations)
Subject: Help with regular expression
Message-Id: <36a6299d.16184023@news.coredcs.com>

Hello,

I have the following regexp that I'm attempting to decipher.  The
input variable is text(a paragraph of regular words).

$text =~ s/([^\012]{1,90})\s/$1\012/sg;

I believe that it's trying to do something with FF characters.
However what happens is that it seems to drop the last word of the
last sentence down a line(looks like maybe a newline or carriage
return gets put in before the last word of the last line).

Any help you can give would be appreciated.  I'm going to poke through
Mastering Reg Exp from ora.

Steve


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

Date: Wed, 20 Jan 1999 19:23:15 GMT
From: anna@water.ca.gov
Subject: HELP: multiple write statements to one output filehandle
Message-Id: <785aek$ok9$1@nnrp1.dejanews.com>

Hi,

I have several write statements that worked with several formats.  But when I
tried to open a filehandle to write to a file, the write statements no longer
worked.  Do you have the answer to why this no longer works?

What worked:
-----------

$~='BASINS'; $^='topBASINS';
 ...
write;
 ...
$~='AREAS';  $^='topAREAS';
write;


(Then I would redirect STDOUT of program to a file.  Ex.  program_name >
file_name )


What doesn't work:
------------------
open(NEWR, ">$reportOut") || die "\nCan't open file: $!\n";
 ...
$~='BASINS'; $^='topBASINS';
 ...
select NEWR;
write BASINS;
 ...
$~='AREAS';  $^='topAREAS';
select NEWR;
write AREAS;
 ...
close(NEWR) || die "\nCan't close file: $!\n";


(The file gets created but none of the content makes it to the file.)

Thanks for your reply in advance,
Anna



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 21 Jan 1999 08:09:11 -0800
From: neilpaku <neilpaku@paradise.net.nz>
Subject: Re: Is there a way to create self contained perl executable? Thanks all...
Message-Id: <36A75127.7F6A@paradise.net.nz>

for all of your comments and suggestions, especially Clint for your
insight. My situation is that there is a one time only job to be
performed by the users at their discretion - installing perl was
considered but since for the majority, it will only be used once, the
install option was not seen to be the best use of resources (mainly
time).
Anyway, thanks all for the help. It was very much appreciated and
confirms my opinion about freeware communities and perl in particular.

Cheers,
	Neil.


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

Date: 20 Jan 1999 17:12:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: list of hashes
Message-Id: <7852p8$ejs$1@client2.news.psi.net>

Alex Farber (alex@kawo2.rwth-aachen.de) wrote on MCMLXVIII September
MCMXCIII in <URL:news:36A5CB36.1F3A426C@kawo2.rwth-aachen.de>:
() 
() I have a question. Why doesn't it work to push() 
() a reference to a hash into a list, like this:
() 
()     push @loh, $href;


Explain "doesn't work", as it works for my definition of work.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


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

Date: 20 Jan 1999 17:37:26 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: list of hashes
Message-Id: <78548m$ejs$5@client2.news.psi.net>

Alex Farber (alex@kawo2.rwth-aachen.de) wrote on MCMLXVIII September
MCMXCIII in <URL:news:36A61CBA.E95076A7@kawo2.rwth-aachen.de>:
[] 
[] could you please explain it little bit more? Because you seem
[] to be correct - it looked like I was always pushing the same 
[] (it printed HASH(0x80c5c9c) for all occurences) empty hash with 
[] my SybPerl-script:
[] 
[]    use strict;
[]    my $href;
[] ...
[]    while($href = $dbh->ct_fetch(1, 1)) {
[]           push(@loh, $href);
[]        }


RTFM. It's documented.



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: Wed, 20 Jan 1999 17:41:48 -0000
From: "Richard Gordon" <abc@abc.com>
Subject: Re: New to perl - trying to FTP
Message-Id: <7854g3$1ga$1@plutonium.btinternet.com>


I just given up with the ftp.pl package and had a go at reinstalling the
libnet package again (following the instructions properly this time) and it
all seems to work OK now.

Thanks for the advice,

Richard Gordon




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

Date: Wed, 20 Jan 1999 14:24:04 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Newbie Perl CGIer needs fast help!  Posting to URL
Message-Id: <fl_aggie-2001991424040001@aggie.coaps.fsu.edu>

In article
<AA368C7E8B2EF9A1.72EF6A6D9BADAC56.0F8C2271CC0C7122@library-proxy.airnews.net>,
ttxyxexr@airxmail.net ((//trxby)) wrote:

+ I am a programmer Abigail...
+ The client has had four months to get this ready...Now they want it up 
+ in three days 

This indicates to me that you do this for money...

+ Does anyone have any expertise in this area who could help me out?

Now, why should we help you earn money without some recompense? Should
someone send you a rate card? Further, what's wrong with Abigail's suggestion?

Abigail: Use LWP::UserAgent if you really want to do this.

Take a look at the LWP documentation set. It is fairly straight forward
to use, and comes with a cookbook document.

If that isn't adequate, someone can send you a rate card.

James


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

Date: Tue, 19 Jan 1999 13:35:39 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Oracle connections.
Message-Id: <36A4D078.8E77D7A4@cthulhu.demon.nl>

om7@cyberdude.com wrote:
> 
> I need to connect to an Oracle database using Perl, can someone tell me how I
> can go about doing this?  Are there any special modules/libraries available
> for this purpose?

perl -MCPAN -e shell
i /Oracle/

Install those DBI/DBD modules, read the documentation, and write your scripts.

Erik
-- 
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely.  And everyone who owns a car intends that it be used as a
portable dumpster.  Any unwanted garbage in their vehicle they can
simply throw away, after all.



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

Date: Wed, 20 Jan 1999 18:55:50 GMT
From: "James M. Stern" <sternji@mail.northgrum.com>
Subject: Re: Perl problem :(Offline mode...
Message-Id: <36A626B6.948C9E72@mail.northgrum.com>

Herein, a gentle reply to a point of view that usually draws harsh ones.

Andrew Fry wrote:

> [... What module was prompting for "offline mode" values?] 
> I am well aware of manuals, on-line docs, etc ... but I dont have
> time to plough through lots of manuals/docs (do you ???), and I
> know by experience that one doesnt always find what one is looking for
> in documentation.

How much does one find by not looking?  How long does it take to look? 
Much less time than it takes to receive a reply from clpm.

> The fact is that I run a small comms/networking consultancy & software
> house ... and we work to very tight deadlines. Having the time to read
> and learn is something of a luxury.

No, a necessity.

First, it saves time.  Learning by trial and error involves many errors
and great trials.  Had you read the CGI documentation (under 40 pages,
unformatted), you would have been in a good position to guess the cause
right away.  Had you read about the Perl debugger, you could have found
the cause without even the CGI documentation.  (Also, since Perl comes
with complete source code, you could have searched the installed Perl
files for the word "offline".)  In any case you would have had the
answer within minutes.

Second, the trial-and-error "solution" may have hidden bugs that won't
show up until your code goes into production.  Your deadlines will only
get tighter when the customer demands immediate fixes for those.

By the way, I'll bet the regulars in this group are busier than you. 
People who read manuals usually are in demand to clean up after people
who don't.  :-)

> I appreciate the helpful replies, but frankly, I dont see the point in
> these discussion groups if the reply is just going to be 'read the
> manual'!

I'm saying:  Read the manual.  You owe it to your customer and yourself.

-- 
James M. Stern                Northrop Grumman Corp.  Hawthorne, CA
Opinions expressed above are not necessarily my employer's.


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

Date: Wed, 20 Jan 1999 17:49:07 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: problem with: use module;
Message-Id: <36a6149b.531179@news.skynet.be>

M.J.T. Guy wrote:

>But 'meow' does have the minor disadvantage that if you check your
>module with perl -wc, you'll get an error
>
>Useless use of a constant in void context at ...

It doesn't happen in an eval "'meow'", so I don't expect it in a normal
require or use either.

Actually, I've tested it. 

#! perl
# file meow.pm
package meow;
"meow";
__END__

#! perl -w
# file test.pl
use meow;
print "Okido!";
__END__

perl -w test.pl 
> Okido!
perl -wc meow.pm
>Useless use of a constant in void context at meow.pm line 4.
>meow.pm syntax OK
perl -w meow.pm
>Useless use of a constant in void context at meow.pm line 4.

	Bart.


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

Date: Wed, 20 Jan 1999 18:13:35 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: script outputting file instead of html page
Message-Id: <36A61CC1.5375@geocities.com>

can anyone offer any explanations as to why a cgi script on an apache
server would output as a file (which netscape doesn't recognise and
saves as a text file) rather than as a page of html?

i have checked the content header, it seems fine. i have also put 

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

and the text file that is output starts 'test?' so i know that the print
command is being executed. it just seems to be ignored somewhere along
the line.

i put up a "hello world" script which worked fine, checked all the
permissions, they were all the same... can anyone suggest directions i
could check next? 

thanks very much for any suggestions.

-23


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

Date: Wed, 20 Jan 1999 18:56:54 GMT
From: dejanews@2020consulting.com
Subject: SOLVED <-- PC Perl system("cvs.exe"): "Fatal server error. Virtual memory exhausted."
Message-Id: <7858tg$n9i$1@nnrp1.dejanews.com>

SOLUTION:
The CVS server daemon, installed on Unix in /etc/inetd.conf,
appears the culprit, not the PC, not Perl.

I was mislead by the different behavior I saw in the differing PC shell
environments.

I increased the Unix swap space and the problem went away.

In article <77p8g4$nnf$1@nnrp1.dejanews.com>,
  gregpf@my-dejanews.com wrote:
> Hi,
>
> I am attempting the most basic Perl wrapper script around CVS using system().
>
> It is failing with what appears to be a Perl system() problem where memory
> is being exhausted.
>
> Can anyone think of a fix or a workaround ?
> (Code and Output shown below).
>
> I am on a PC, and have tried 2 versions of PC Perl including a very recent:
>     Binary build 509 provided by www.ActiveState.com
>     Built 13:37:15 Jan  5 1999
>
> I am using CVS  "server" protocol on a PC to a Sun Unix host.
> $CVSROOT=:pserver:my_name@cvsserver:/repository
>
> My simple goal is to wrap the command "cvs.exe  co all" and retrieve
> our codebase.
>
> This command works *fine* on our codebase both directly, as well as running
> under  BASH,  MKS sh.exe, and CMD.exe .
>
> It just fails when run from system().
>
> #############################
> OUTPUT
> ##############################
>
> ----------------  FIRST RUN:   -----------------------
> (/bin/sh.exe  BASH shell being picked up by system() )
>
> @args= ("cvs.exe  co  all" );
> $gExitCode= 0xffff & system(@args);
>
> 391 files gotten before aborting with:
>     U corp/develop/src/data/techlibs/cg21_exc.lst
>
>     cvs [server aborted]: can not reallocate 2097152 bytes
>     system(cvs.exe co all) returned 0x100
>
> ----------------  SECOND RUN:   -----------------------
> (NT shell  C:\WINNT\system32\cmd.exe picked up by system() )
>
> @args= ("cmd.exe /c  cvs.exe  co  all" );
> $gExitCode= 0xffff & system(@args);
>
> 4,228 files before aborting with:
>     U corp/vendor/src/Oe/lib/libOed.a.HP-UX10
>     U corp/vendor/src/Oe/lib/libOed.a.SunOS4
>
>     Fatal server error
>     Virtual memory exhausted.
>
> Note: FIRST run performed on C: drive
> Initial disk freespace=     517 meg.
> Disk Freespace upon abend=  300 meg.
>
> Note: SECOND run performed on E: drive
> Initial disk freespace=     6.9 GIG
> Disk Freespace upon abend=  6.9 GIG.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 20 Jan 1999 16:45:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <78517g$eai$2@client2.news.psi.net>

Bart Lateur (bart.lateur@skynet.be) wrote on MCMLXVIII September MCMXCIII
in <URL:news:36a5a6c7.7715369@news.skynet.be>:
][  
][ Anyway, I suggest replacing the original regexp with (tested):
][  
][  
][ /^\s{0,3}(?:>|:|\S+>|([!"#\$%&'*+,\-.\/:;=?\@\\^_`\|~])\1|\[\]|\(\)|\{\}|<>)/
][  


Wouldn't work.




Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


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

Date: Wed, 20 Jan 1999 20:23:44 GMT
From: ken@proexam.org
Subject: Text::Wrap Problem
Message-Id: <785e04$rsk$1@nnrp1.dejanews.com>

Hello,
I know that Text::Wrap acts on reformatting text into paragraphs.  I'm trying
to reformat blocks of variable-width sentences into 70 column output.  I'm
going through a text file, gluing adjacent lines together (Some lines may
end in periods followed by two spaces).  I am then passing the built up
string to the wrap function.  What happens is that the function in some
cases (I think when a period is at the $Columns position), will change
the two spaces after the period into a tab.  I looked at the source to the
module and it appears the problem is at the following spot:

push @rw, unexpand($lead . $1), "\n";

Does the whole string, $1, need to be put through the unexpand function?
I'm not sending my output to a printer or a terminal so I don't really
need any space optimizations. Can this line be written as:

push @rw, unexpand($lead), $1, "\n";

Here's an example of a short scipt that is causing the behavior:

#!/usr/bin/perl5
use Text::Wrap;
$Text::Wrap::Columns=70;

$test = "This is a test of the emergency broadcasting system It is only a
test.  In case of a real emergency, you will be notified.  Thank you for your
time";

print wrap("","", $test), "\n";

The variable $test is one long string with no newlines.  To workaround this
behavior, I substitute the tab(s) back into two spaces and then print out
the variable.  It works, but I would like to hear from the community to
see what they think about this.  Thanks in advance.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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