[11526] in Perl-Users-Digest
Perl-Users Digest, Issue: 5126 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 13 10:03:49 1999
Date: Sat, 13 Mar 99 07:00:25 -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 Sat, 13 Mar 1999 Volume: 8 Number: 5126
Today's topics:
2d-array sort Stefan@Stark.net
Re: Active perl (Clay Irving)
Re: ADO, OLE on WinNT <lutz@muc.de>
Re: Appending to the Beginning of an Empty File due@discovernet.net
Array-Sort stefan_0815@my-dejanews.com
Re: Array-Sort (Hans-Georg Rist)
Deleting the rest of the line... <webmaster@guestcities.com>
Re: Deleting the rest of the line... <jdf@pobox.com>
Re: Deletion of a List Array Entry (Tad McClellan)
Re: Deletion of a List Array Entry (M.J.T. Guy)
Re: Exporter question (M.J.T. Guy)
Re: how to output in the desired order? (Larry Rosler)
Newbish Prob - Output to File <timothy.cember@gte.net>
Re: Newbish Prob - Output to File (Hans-Georg Rist)
Output to file - Thanks - but it still don't work! <timothy.cember@gte.net>
Re: Output to file - Thanks - but it still don't work! (Clay Irving)
Re: perl interpreter for windows 95 ? (Larry Rosler)
Perl newbie problem: <fischer@refugees.net>
Re: Perl newbie problem: <ebohlman@netcom.com>
Re: Perl newbie problem: <jacklam@math.uio.no>
Perl segfaulting with Argument "CLIKE" isn't numeric in (Hakan Ardo)
Re: Printing a Copyright character <gellyfish@btinternet.com>
Re: regexp gurus help! Parsing HTML (Bart Lateur)
Re: Shopping cart Problem of configuration of the cgi-s <gellyfish@btinternet.com>
Testing CGI scripts on a standalone <Doc@goforit.demon.co.uk>
Re: use diagnostics problem? <horizon@internetexpress.com.au>
Web Databases <jdoak@MailAndNews.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 13 Mar 1999 13:00:52 GMT
From: Stefan@Stark.net
Subject: 2d-array sort
Message-Id: <7cdni1$f4k$1@nnrp1.dejanews.com>
Hi all,
sorry for this (easy?) question, but Perl is not my main subject so far.
I have an array which looks like this: @Data1 = ( ( "1", "Hans", "Hamburg" ),
( "5", "Maria", "Mainz" ), ("2", "Fred", "Frankfurt" ) );
Now I want to write a piece of source which sorts the array so that the result
looks like this:
@Data1 = ( ( "1", "Hans", "Hamburg" ), ("2", "Fred", "Frankfurt" ), ( "5",
"Maria", "Mainz" ) );
Thanks for any help.
Stefan.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 13 Mar 1999 08:07:13 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Active perl
Message-Id: <slrn7ekoo0.r9.clay@panix.com>
On Fri, 12 Mar 1999 20:55:58 -0800, Bill Garrett <bgarrett@hamilton.net> wrote:
>Finally, I have got a new computer with win 98 instead of win 3.x
>So, if I download active perl is that all I need to start writing,
>editing, and debugging perl scripts. or do I still need some kind of
>shell access?
You have everything you need to get started.
--
Clay Irving <clay@panix.com>
Solutions are not the answer.
- Richard Nixon
------------------------------
Date: Thu, 11 Mar 1999 19:18:42 +0100
From: Lutz Albers <lutz@muc.de>
Subject: Re: ADO, OLE on WinNT
Message-Id: <36E80902.A7699513@muc.de>
Noel Sant wrote:
>
> P.S. Re 3. in my previous message, it's the "or die" wot done it. I followed
> an example in Matt Sergeant's FAQ, but "0" is a GOOD return code.
>
> Now I've changed that to "if ($conn.....) {die...}" it's works OK. But the
> questions remain:
> What is the "Provider"?
This specifies the OLE DB provider ADO uses. There are multiple choices,
ie:
* MSDASQL: uses ODBC
* SQLOLEDB: uses SQL Server
* ...
> What is thee "Initial Catalog"?
This is a SQL-Server specific part of the DSN. It names the default
database used on the SQL-Server, unless you change it later.
Hope This Helps ...
lutz
--
Lutz Albers, lutz@muc.de, pgp key available from <http://www.pgp.net>
Do not take life too seriously, you will never get out of it alive.
------------------------------
Date: Sat, 13 Mar 1999 14:00:49 GMT
From: due@discovernet.net
To: thelma@alpha2.csd.uwm.edu
Subject: Re: Appending to the Beginning of an Empty File
Message-Id: <7cdr2e$hqp$1@nnrp1.dejanews.com>
In article <7ca357$8nu$1@uwm.edu>,
Thelma Lubkin <thelma@alpha2.csd.uwm.edu> wrote:
> This code was adapted from something that Allen Due kindly sent me in
> response to an earlier post to the newsgroup; Allen adapted it from
> code in Christiansen and Torkington's work.
>
> My files will sometimes need to be created during a run: the code
> below just hangs when confronted with the new, empty, files--how
> can I modify it to get around that?
>
> (Someone else posted this very question a few days ago and I've
> been eagerly waiting a response, but since none came I'm trying
> too).
> --thelma
> #####################
> #STORE_DATA
> #####################
> sub store_data
> {
> my %records = %{$_[0]};
> my $linefmt = "%-10s %-15s %-4s %-4s %-4s %-6s %-6s\n";
> local $^I = '.old'; # emulate -i.old
> local @ARGV = (keys %records); # initialize list of files
> while (<>)
> { if ($. == 1 ) {
> foreach (@{$records{$ARGV}}) { printf $linefmt, @{$_}; }
> }
> print;
> } continue {close ARGV if eof}
> }
Oddly, this post does not show up in my newsgroup. I am going to have to
change providers. Anyway, the problem, as near as I can figure, is that for
an empty file the while evaluates as false right from the git go and the
while block is never entered. I can see no easy way around this issue
although I am sure someone else will come up with a more elegent solution. I
think the easiest way around this problem is to ensure that the file has some
conten when it is created, a single space will do, and then run the script in
the original post. Alternatively, before you start the while, check to see
if the file is empty and add a space if it is needed. Something like:
#!/usr/local/bin/perl -w
use strict;
my %ahash = ('myfile.dat' => "hi there",
'myfile2.dat' => "lo there");
local $^I = '.orig'; # emulate -i.orig
local @ARGV = (keys %ahash); # initialize list of files
foreach (@ARGV) {
if (-z){
open (FH,">$_") or warn "$!\n";
print FH " ";
close (FH) or warn "$!\n";
}
}
while (<>) {
print "$ahash{$ARGV}\n" if $. == 1;
print;
} continue {close ARGV if eof}
HTH
AmD
and hey, I am an Allan <g>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 13 Mar 1999 12:50:12 GMT
From: stefan_0815@my-dejanews.com
Subject: Array-Sort
Message-Id: <7cdmu2$ekv$1@nnrp1.dejanews.com>
Hi all,
I can't solve the following problem alone - please help me:
@Data = ( ("1", "Hans", Hamburg), ("5", "Maria", "Mainz"), ("2", "Frank",
"Frankfurt") );
Now I need a new array (@Data2) which is sorted by the first Item of @Data:
@Data2 = ( ("1", "Hans", Hamburg), ("2", "Frank", "Frankfurt"), ("5", "Maria",
"Mainz") );
Thanks,
Stefan.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 13 Mar 1999 14:20:45 GMT
From: hans-georg@rist.net (Hans-Georg Rist)
Subject: Re: Array-Sort
Message-Id: <36ea72ec.14380578@news.uni-ulm.de>
stefan_0815@my-dejanews.com wrote:
>I can't solve the following problem alone - please help me:
>
>@Data = ( ("1", "Hans", Hamburg), ("5", "Maria", "Mainz"), ("2", "Frank",
>"Frankfurt") );
>
>Now I need a new array (@Data2) which is sorted by the first Item of @Data:
>
>@Data2 = ( ("1", "Hans", Hamburg), ("2", "Frank", "Frankfurt"), ("5", "Maria",
>"Mainz") );
# your data:
@Data = ( ("1", "Hans", "Hamburg"), # no barewords!
("5", "Maria", "Mainz"),
("2", "Frank", "Frankfurt") );
print "unsorted: @Data\n"; # array with 9 elements!
# better build an array whose elements
# are references to anonymous arrays:
# my data:
@data = ( [ "1", "Hans", "Hamburg" ],
[ "5", "Maria", "Mainz" ],
[ "2", "Frank", "Frankfurt" ]
);
print "unsorted: ", map( { "@$_ " } @data ), "\n"; # unsorted
# use the Schwartzian Transform for sorting:
@data2 = map { $_->[0] }
sort { $a->[1] <=> $b->[1] } # numerically
map { [ $_, $_->[0] ] }
@data;
print "sorted: ", map( { "@$_ " } @data2 ), "\n";
HTH,
HG
--
Hans-Georg Rist
hans-georg@rist.net
------------------------------
Date: Sat, 13 Mar 1999 18:46:53 +1100
From: "David Falconer" <webmaster@guestcities.com>
Subject: Deleting the rest of the line...
Message-Id: <7cdahm$ukj$1@reader1.reader.news.ozemail.net>
Greetings,
In a text file I have, I want to delete all characters after a certain
occurance of a word.
So each time it comes across the word TRUCK it deletes all characters after
that for the rest of the line.
I checked out the Perl FAQ, but it didnt seem to have quite what I am after.
Thanks in advance for any help.
David Falconer
------------------------------
Date: 13 Mar 1999 09:06:58 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "David Falconer" <webmaster@guestcities.com>
Subject: Re: Deleting the rest of the line...
Message-Id: <m367858ovx.fsf@joshua.panix.com>
"David Falconer" <webmaster@guestcities.com> writes:
> So each time it comes across the word TRUCK it deletes all
> characters after that for the rest of the line.
>
> I checked out the Perl FAQ, but it didnt seem to have quite what I am after.
Did you read _Learning Perl_? How about the perlre and perlop
documents?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 12 Mar 1999 19:03:39 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Deletion of a List Array Entry
Message-Id: <r0acc7.3fa.ln@magna.metronet.com>
James Tolley (jamesht@idt.net) wrote:
: > Is it possible to delete an entry of a list array? I know it is possible to
: > delete an entry in an associative array through the use of its key and its
: > corresponding value, but how about an @list?
: There's no single command to do this,
Yes there is (splice).
: but you can do it this way:
[ snip code too ugly to look upon ]
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Mar 1999 13:36:19 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Deletion of a List Array Entry
Message-Id: <7cdpkj$eq8$1@pegasus.csx.cam.ac.uk>
In article <36E99DAF.8DF462D6@idt.net>, James Tolley <jamesht@idt.net> wrote:
[ Please don't cut attributions of quoted text. ]
>> Is it possible to delete an entry of a list array? I know it is possible to
>> delete an entry in an associative array through the use of its key and its
>> corresponding value, but how about an @list?
>
>There's no single command to do this, but you can do it this way:
Yes there is - see "split".
>@list = ('one','two','three');
># we want to delete the middle entry.
>$index_to_delete = 1;
>@lists[$index_to_delete..$#lists-1] = @lists[$index_to_delete+1..$#lists]
>$lists[$#lists] = undef;
That last line doesn't truncate the array. Instead, you want
$#lists--;
Mike Guy
------------------------------
Date: 13 Mar 1999 13:18:45 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Exporter question
Message-Id: <7cdojl$e22$1@pegasus.csx.cam.ac.uk>
James M. Stern <sternji@mail.northgrum.com> wrote:
>
>You can't export a 'my' variable, only a package variable. Exporter
>works its magic by manipulating the symbol table but a 'my' variable has
>no symbol-table entry.
To be pedantic, you *can* export a 'my' variable. It's just that you
can't use Exporter.pm to do it. By hand, you can do
my $x = 163;
*MyPackage::myvar = \$x;
or even
*MyPackage::myhash = {};
Why you might want to is another question. :-)
Mike Guy
------------------------------
Date: Sat, 13 Mar 1999 00:51:06 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how to output in the desired order?
Message-Id: <MPG.1153c6d34c7c88c3989730@nntp.hpl.hp.com>
In article <7cbj3u$m7k$1@nnrp1.dejanews.com> on Fri, 12 Mar 1999
17:32:47 GMT, du_bing@my-dejanews.com <du_bing@my-dejanews.com >says...
> There is an array:
> %array=(age,20,gender,female,name,guest);
This is not an array; it is a hash. And are those barewords? Ugh...
> I need to output each attribute/value pair in the following order:
>
> name: guest
> age: 20
> gender: female
>
> I tried coercing the order by running the following code:
You cannot coerce the order of elements in a hash directly. You might
want to look into perlfaq4: "How can I make my hash remember the order
I put elements into it?"
Or you might consider simply using an array:
@array = ('guest', 20, 'female');
and one of several ways of defining constants, such as:
sub NAME () { 0 };
sub AGE () { 1 };
sub GENDER () { 2 };
Now $array[NAME] returns 'guest', etc.
(I assume you are going to make arrays of these aggregates, or else why
bother?)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 13 Mar 1999 06:48:15 -0500
From: "Timothy Cember" <timothy.cember@gte.net>
Subject: Newbish Prob - Output to File
Message-Id: <7cdif9$t7b$1@news-1.news.gte.net>
Well, I'm trying to write program to run on a remote NT server that'll
output to html/text files. (I'd be done already if I was using C++)
$save = </demosite/options.txt>;
open(SAVE, ">$save");
print SAVE "Content-type: text/html\n\n";
print SAVE "Yadda yadda \n";
It compiles, no errors pop-up, you'd think everything was fine, but the data
never makes it to the file.
Does it matter that I've got
use Socket;
instead of
use Strict;
at the top of the script? Prog takes input from HTML form.
Thanks...I hope to get good enough to help others in the future
Chris Cember chris.cember@gte.net
------------------------------
Date: Sat, 13 Mar 1999 11:55:48 GMT
From: hans-georg@rist.net (Hans-Georg Rist)
Subject: Re: Newbish Prob - Output to File
Message-Id: <36ea51dc.5914665@news.uni-ulm.de>
"Timothy Cember" <timothy.cember@gte.net> wrote:
>Well, I'm trying to write program to run on a remote NT server that'll
>output to html/text files. (I'd be done already if I was using C++)
>$save = </demosite/options.txt>;
$save = "/demosite/options.txt";
>open(SAVE, ">$save");
>print SAVE "Content-type: text/html\n\n";
>print SAVE "Yadda yadda \n";
> ...
HTH,
HG
--
Hans-Georg Rist
hans-georg@rist.net
------------------------------
Date: Sat, 13 Mar 1999 07:55:18 -0500
From: "Timothy Cember" <timothy.cember@gte.net>
Subject: Output to file - Thanks - but it still don't work!
Message-Id: <7cdm0u$od2$1@news-1.news.gte.net>
$save = "/demosite/options.txt";
open(SAVE, ">$save");
print SAVE "Content-type: text/html\n\n";
print SAVE "Yadda yadda \n";
I made the change you reccomended but it still doesn't work. (?)
Could I be missing something elsewhere?
------------------------------
Date: 13 Mar 1999 08:13:28 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Output to file - Thanks - but it still don't work!
Message-Id: <slrn7ekp3n.r9.clay@panix.com>
On Sat, 13 Mar 1999 07:55:18 -0500, Timothy Cember <timothy.cember@gte.net>
wrote:
>$save = "/demosite/options.txt";
>open(SAVE, ">$save");
>print SAVE "Content-type: text/html\n\n";
>print SAVE "Yadda yadda \n";
>
>I made the change you reccomended but it still doesn't work. (?)
>Could I be missing something elsewhere?
Let me guess -- It works when you run it from the command line, but not
when you try to run it on a Web server. Check:
Idiot's Guide to Solving Perl/CGI Problems
http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
--
Clay Irving <clay@panix.com>
It is a sobering thought, for example, that when Mozart was my age, he had
been dead for two years.
- Tom Lehrer
------------------------------
Date: Sat, 13 Mar 1999 00:21:30 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl interpreter for windows 95 ?
Message-Id: <MPG.1153bfddd6c0ac9898972f@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7cbimb$dt1$1@news.news-service.com> on Fri, 12 Mar 1999
17:36:46 +0100, Marcel de Haan <haantje@multiweb.nl >says...
> does anyone know if a perl excuting engine exists for windows 95/nt ?
> i want to be able to test my perl scripts under this operating system.
Has this question really not been answered all day? Maybe we are
getting tired of it.
Go to <URL:http://www.activestate.com/> and download ActivePerl.
> the scripts will meant to be running when they done under linux/apache
> server.
That should be very easy if the programs are written ab initio with that
goal in mind.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 13 Mar 1999 10:53:34 +0100
From: Martin Fischer <fischer@refugees.net>
Subject: Perl newbie problem:
Message-Id: <36EA359E.2383D584@refugees.net>
Perl newbie problem:
I have to include a second condition for
"last if .." in line No. 7.
My "Perl Cookbook" is some 1.200 km away.
If someone could help:
1: $start=0;
2: foreach $line (@page){
3: print "$line\n" if($start == 1);
4: if($line =~ /Global Appeal/){
5: $start = 1;
6: }
7: last if($line =~ /Stop now/);
8: }
NEED: last if($line =~ /Stop now/ OR /Stop again/);
^^
??
Thank you for your kind understanding.
RGS
Martin
------------------------------
Date: Sat, 13 Mar 1999 10:23:05 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Perl newbie problem:
Message-Id: <ebohlmanF8J3IH.GFJ@netcom.com>
Martin Fischer <fischer@refugees.net> wrote:
: Perl newbie problem:
: I have to include a second condition for
: "last if .." in line No. 7.
: My "Perl Cookbook" is some 1.200 km away.
: If someone could help:
: 7: last if($line =~ /Stop now/);
: NEED: last if($line =~ /Stop now/ OR /Stop again/);
: ^^
: ??
Well, a perusal of perlop will tell you that
last if ($line =~ /Stop now/ or $line =~ /Stop again/);
would work (you were *so* close). Alternatively, a perusal of perlre
would tell you that
last if ($line =~ /Stop (now|again)/);
would also work. Perusing both of them sounds like a good idea.
------------------------------
Date: Sat, 13 Mar 1999 12:14:30 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: Perl newbie problem:
Message-Id: <36EA4896.9125327B@math.uio.no>
Martin Fischer wrote:
>
> NEED: last if($line =~ /Stop now/ OR /Stop again/);
> ^^
> ??
Your test is equivalent to
last if ( $line =~ /Stop now/ or $_ =~ /Stop again/ );
What you probably want is
last if ( $line =~ /Stop (now|again)/ );
Peter
--
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam
------------------------------
Date: 12 Mar 1999 10:22:41 GMT
From: hakan@hobbe.lub.lu.se (Hakan Ardo)
Subject: Perl segfaulting with Argument "CLIKE" isn't numeric in regcomp
Message-Id: <7capth$k6i$1@merkurius.lu.se>
Hi,
I'm having problem with perl. I'm working on a perl library for
viewing and editing msql databases with relations on the web and all
of a suden it started to say:
Argument "CLIKE" isn't numeric in regcomp at
blib/lib/DBIx/HTMLView/Selection.pm line 220.
and then it segfaults. Selection.pm looks like this at rows 219 to 224:
219 foreach ($self->opps) {
220 if ($self->{'str'} =~ s/^$_//) {
221 $self->token("opp",$_);
222 return;
223 }
224 }
$self->opps returns the following array: ['<', '>', '=', '<=', '>=',
'<>', 'LIKE', 'RLIKE', 'CLIKE'], and if I add a "print $self->{'str'}"
between line 219 and 220 to check it the error goes away and
everything works just fine.
I've tried both with perl v 5.005_02 and 5.004_04.
Any sugestions on what might be worng?
--
---------------------------------------------------------------
Name: Hakan Ardo
E-Mail: hakan@debian.org
WWW: http://www.ub2.lu.se/~hakan/sig.html
Public Key: Try "finger hakan@master.debian.org"
Fingerprint: E9 81 FD 90 53 5C E9 3E 3D ED 57 15 1B 7E 29 F3
Interests: WWW, Programming, 3D graphics
Thought for the day: As long as one understands, the
spelling does not matter :-)
---------------------------------------------------------------
------------------------------
Date: 13 Mar 1999 11:14:27 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Printing a Copyright character
Message-Id: <7cdhak$do$1@gellyfish.btinternet.com>
On Fri, 12 Mar 1999 12:11:38 -0500 Dave Abramowitz wrote:
> Is there a way to print the copyright character (the c inside a circle)?
The ISO 8859-1 character code for that character is 169.
The Perl function for printing a character from its value is chr().
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 13 Mar 1999 09:00:17 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regexp gurus help! Parsing HTML
Message-Id: <36ea27da.2607399@news.skynet.be>
Bart Lateur wrote:
>What is far worse is that it will gladly skip any HTML errors, or things
>that are not exactly formed as in this one example.
Here's a patch. It seem to work pretty good. It knows where to stop, and
recognizes (at least some) invalid constructions.
#! perl -w
$_ = qq{<INPUT TYPE="checkbox" NAME="NotListed" VALUE=
'Not Listed' SELECTED>rest...}; # including newline!
if (/<(\w+)/gi) {
print STDERR "Found '$1'\n";
while (/(\w+)\s*(?:=\s*("[^"]*"|'[^']*'|[\w.-]+))?|(>)|(\S)/gc){
last if $3;
die "Unacceptable character '$4' found at column "
. pos() . "\n" if $4;
my($key,$value) = ($1,defined($2)?$2:$1);
for ($value) {
s/^"(.*)"/$1/s or s/^'(.*)'/$1/s;
}
$attribute{uc $key} = $value; # case insensitive key
}
substr ($_, 0, pos) = "";
}
print STDERR "Remainder of main string: $_\n";
foreach (sort keys %attribute) {
print STDERR "$_ => $attribute{$_}\n";
}
__END__
Found 'INPUT'
Remainder of main string: rest...
NAME => NotListed
SELECTED => SELECTED
TYPE => checkbox
VALUE => Not Listed
Bart.
------------------------------
Date: 13 Mar 1999 11:07:17 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Shopping cart Problem of configuration of the cgi-script... Could you help me..
Message-Id: <7cdgt5$bm$1@gellyfish.btinternet.com>
On Fri, 12 Mar 1999 20:52:51 +0100 Julen Ludovic wrote:
<need to edit configuration of some shopping cart program>
> ----
> 500 Server Error
> The server encountered an error and was unable to complete your request.
> Message: CGI output from D:/siteessai/cgi-bin/s-mart.cgi contained no blank
> line separating header and data (most likely a broken CGI program)
> ----
>
Then have you looked at the part of the program that generates the headers ?
Generally this group is not the best place to be asking for help about some
application *whatever Language it might be written in* - in the first
instance you should take it up with the documentation for the application
and if that is no use then you should ask help from the author or vendor
of the program - especially if you have payed for the program. If after
having done these things and you have taken steps to rememdy the problem
and are still having no luck and are having a problem with a piece of
Perl code then you might post that portion of the code that is giving you
trouble here.
What you dont do is post a massive uuencoded configuration file that is
totally meaningless to the majority of people here. We are concerned with
Perl code not configuration of some application we have never heard of.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 13 Mar 1999 12:00:11 +0000
From: Doc <Doc@goforit.demon.co.uk>
Subject: Testing CGI scripts on a standalone
Message-Id: <RSt6zBALNl62EwCc@goforit.demon.co.uk>
Hi
I am new to CGI scripting and am writing a script to produce web pages
from a database - no problem there. But, I would like to be able to
test the programme on my PC rather than have to use my provider's
server! I know that I can run my programme via the command prompt but
obviously that does not include the browser. How can I run it and see
the results? (Yes I have run simple programmes from the browser but as
soon as I include calculations and non-HTML stuff it gets printed on the
screen and no calcs are done - i.e. it is not run as a porper programme)
Thanks in anticipation
doc
--
Doc
------------------------------
Date: Sat, 13 Mar 1999 21:24:54 +1100
From: Mick <horizon@internetexpress.com.au>
To: Ronald J Kimball <rjk@linguist.dartmouth.edu>
Subject: Re: use diagnostics problem?
Message-Id: <36EA3CF6.E233647B@internetexpress.com.au>
I've confused you, Sorry!! :)
My perl script runs fine, I just wanted to add diagnostics to check for warnings
etc (And for future web-based scripts), I only compared Carp and diagnostics for
there formats (To see if there was anything blatantly different in the
diagnostics that may cause the premature end of script errors.)
Why would use diagnostics cause premature end of script header?
Thanks for the reply,
Mick
Ronald J Kimball wrote:
> Mick <horizon@internetexpress.com.au> wrote:
>
> > Ronald J Kimball wrote:
> >
> > > > which in my error log is
> > > > premature end of script headers.
> > >
> > > Are there more errors, or just that? That's not a very helpful error,
> > > all it means is your script exited before it finished printing the
> > > headers. But it doesn't say _why_ your script exited early.
> > >
> >
> > That's why I'm trying to use diagnostics, my error_log only contains
> > premature end of script errors....Is the level of information given in the
> > error_log determined in the httpd.conf (I'm using Apache by the way :) ) ?
>
> I thought you said that your script ran fine when you didn't add use
> diagnostics? So you're using diagnostics to fix a problem that only
> occurs when you use diagnostics... That doesn't make sense. :)
>
> > I also comapared Carp.pm and diagnostics.pm for there format (To see if the
> > diagnostics.pm was different in any way, but, no, they are set out exactly
> > the same.)
>
> Carp.pm and diagnostics.pm are two extremely different modules.
>
> diagnostics.pm outputs extra information with Perl's builtin errors and
> warnings.
>
> Carp.pm allows subroutines to output errors for the file and line where
> the subroutine was called, rather than the file and line containing the
> output command.
>
> I don't think either one would be helpful in the situation you describe.
>
> You say there are no error messages from the Perl script... All I can
> figure is that there is a bug in your script so that it executes
> successfully (i.e. no compile or runtime errors or warnings) but still
> doesn't output a complete set of headers.
>
> What output do you get when you run your script from the command line?
>
> --
> _ / ' _ / - aka - rjk@linguist.dartmouth.edu
> ( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
> / http://www.ziplink.net/~rjk/
> "It's funny 'cause it's true ... and vice versa."
--
----------------------------------------------------------------
HORIZON Software Solutions
Visit Site - http:www.deakin.edu.au/~bellears/horizon/index.html
e-mail - mailto:horizon@internetexpress.com.au
----------------------------------------------------------------
------------------------------
Date: Sat, 13 Mar 1999 08:41:47 -0500
From: Jeff Doak <jdoak@MailAndNews.com>
Subject: Web Databases
Message-Id: <7cdpv1$4vn$1@client2.news.psi.net>
I am creating a web site, and I want to add an interactive database. One
that
users can add/change/delete records. Can I do that using Perl, and is there
a
good book to tell me how it's done?
I've asked a few people, and I can't seem to get any straight answers.
Jeff
------------------------------------------------------------
Get your FREE web-based e-mail and newsgroup access at:
http://MailAndNews.com
Create a new mailbox, or access your existing IMAP4 or
POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------
------------------------------
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 5126
**************************************