[10547] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4139 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 3 09:08:09 1998

Date: Tue, 3 Nov 98 06: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           Tue, 3 Nov 1998     Volume: 8 Number: 4139

Today's topics:
    Re: A perl Question <emills@harris.com>
    Re: ActiveX and Perl (David Cantrell)
    Re: ANNOUNCE: Bit::Vector 5.6 (Steffen Beyer)
    Re: Can CGI run without anyone "browsing it"? (David Jacoby)
        CGI vs LWP modules <kjetil@balder.no>
    Re: CGI vs LWP modules <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: CGI vs LWP modules <kjetil@balder.no>
    Re: CGI vs LWP modules (David Jacoby)
    Re: CGI vs LWP modules <Tony.Curtis+usenet@vcpc.univie.ac.at>
        CGI, common text question <kjetil@balder.no>
    Re: CGI, common text question <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Fix Width... slok00@yahoo.com
    Re: Fix Width... (Tad McClellan)
        getting another cgiscript to output within a perl scrip (pickup)
        Help on installing perl on AIX (Oliver Szrama)
    Re: HELP! I need a perl enviroment for Win 95 <perlguy@technologist.com>
    Re: How do i remove Carriage Returns og Newlines from a <maxm@normik.dk>
    Re: Inserting into Access with win32:odbc <e.christensen@netjob.dk>
        Large File Support in Perl (>2GB) perrella@yahoo.com
        Newbie: files in different directories. <mk@control.auc.dk>
        Newbie: files in different directories. <mk@control.auc.dk>
    Re: Not to start a language war but.. <rra@stanford.edu>
    Re: Not to start a language war but.. (David Formosa)
    Re: OLE Publication <msergeant@ndirect.co.uk_NOSPAM>
        Pass by Reference (was: Not to start a language war but <tchrist@mox.perl.com>
        Perl  5.003_07 build 316+ GD Library + NT Alpha nobody@nowhere
        PERL is TOO flexible <emills@harris.com>
    Re: Perl Upload Script Needed Badly <perlguy@technologist.com>
    Re: perl&cgi question <kjetil@balder.no>
    Re: Problem with Win32 reg exp <monty@primenet.com>
    Re: Problem with writing to a log file ()
    Re: Question regarding CGI.pm <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Question regarding CGI.pm dave@mag-sol.com
        using perl on HUGE (>2GB) files perrella@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 30 Oct 1998 07:43:24 -0500
From: "PERL ROCKS!" <emills@harris.com>
Subject: Re: A perl Question
Message-Id: <3639B46C.1FA95482@harris.com>

Document contains no data usually implies that it didn't receive the
required streams to stdout, for example:

print "Content-type:text/html\n\n";
print "<HTML><HEAD>...</HEAD><BODY>...</BODY>";

so either you don't have proper HTML in your program, or the browser isn't
getting it properly.

E


Martin Vorlaender wrote:

> shienh gurpreet (gss2@roogna.eng.wayne.edu) wrote:
> : [...]
> : The problem that I'm having is that when I enter the password on my
> : webpage,it says "Document Contains No Data".
> : [...]
> :
>



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

Date: Tue, 03 Nov 1998 10:37:45 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: ActiveX and Perl
Message-Id: <363edc81.318956955@thunder>

On Mon, 2 Nov 1998 15:25:12 -0500, "Roger Kenneth Trussell"
<rtrussell@hps-inc.com> enlightened us thusly:

>    Does anyone know whether there exist a version of Perl for Windows
>95/95/NT that can access ActiveX objects?  I've already heard about ActiveX
>scripting engines, but I don't think that is what I want.  I want to write a
>CGI-BIN script that can access ActiveX objects located on the server.

You should look at the Activestate version of perl for Win32.  They
supply extensions such as perl/ISAPI and perlscript which can be used
as an ASP language.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: 3 Nov 1998 06:56:45 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: ANNOUNCE: Bit::Vector 5.6
Message-Id: <71m9fd$3aj$1@en1.engelschall.com>

In comp.lang.perl.modules I (Steffen Beyer <sb@sdm.de>) wrote:

> What's new in version 5.6:
> --------------------------

> The leading zeros in the output of "to_Hex()" have been suppressed.

Note that this only refers to the unused bits in the bit vector, the
output of "to_Hex()" continues to be fixed length, i.e.

    length = ceil( bits / 4 )

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    Free Perl and C Software for Download: www.engelschall.com/u/sb/download/


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

Date: 3 Nov 1998 04:20:09 GMT
From: jacoby@harbor.ecn.purdue.edu (David Jacoby)
Subject: Re: Can CGI run without anyone "browsing it"?
Message-Id: <71m09p$5dp@mozo.cc.purdue.edu>

In article <71ii45$cj9$1@merkurius.lu.se>,
Magnus Nilsson <kla95mgn@student1.lu.se> wrote:
>Is it possible for a CGI program to, for example, read email from one
>account and send it to another - without constantly being activated by
>someone browsing by?

Web Browsers, and the CGI scripts that run them, should run as user WWW or
the like, not as you. So it is 1) not germain and 2) not wise. But, you 
should be able to set up a mail filter, like slocal or procmail, that
should do what you ask w/o web involvement. And the specific scripts you
send stuff through can easily be perl.

>I'm really curious... thanks in advance!
>/Magnus Nilsson

-- 
Dave Jacoby		   I wish I could give brother Bill his big thrill
jacoby at ecn.purdue.edu   I would set him in chains at the top of the hill
http://purdue.org/~jacoby/ Then send out for some pillars and Cecil B. Demille
Father. Guitarist. Geek.   He could die happily ever after - Bob Dylan


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

Date: Tue, 03 Nov 1998 11:23:13 +0100
From: Kjetil Svendsberget <kjetil@balder.no>
Subject: CGI vs LWP modules
Message-Id: <363ED991.A25452F6@balder.no>

Whats the main difference between theese 2, and what are the benefits
for using one of them versus the other?






-- 
Kjetil Svendsberget, systemengineer
Balder Dialog AS
Olaf Helsetsvei 6
N-0694 Oslo, Norway


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

Date: 03 Nov 1998 11:27:47 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: CGI vs LWP modules
Message-Id: <83vhkxt6jg.fsf@vcpc.univie.ac.at>

Re: CGI vs LWP modules, Kjetil <kjetil@balder.no> said:

Kjetil> Whats the main difference between theese 2, and what
Kjetil> are the benefits for using one of them versus the
Kjetil> other?

CGI is primarily for server-side applications run at the
behest of HTTP servers (usually).

LWP is for client-side programming, writing tools that
connect to HTTP servers (and other similar information
services too).

(So a client using LWP could connect to an HTTP server and
cause a server-side program using CGI to be run).

"perldoc" is the way to start...

For more info about the WWW and related protocols:

    http://www.w3.org/

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Tue, 03 Nov 1998 11:42:19 +0100
From: Kjetil Svendsberget <kjetil@balder.no>
Subject: Re: CGI vs LWP modules
Message-Id: <363EDE0B.69A6D5@balder.no>

Thanks Tony. Ive chosen right then becuase im programming server-side
application.


Tony Curtis wrote:
[snip Tony's help]


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

Date: 3 Nov 1998 10:35:45 GMT
From: jacoby@harbor.ecn.purdue.edu (David Jacoby)
Subject: Re: CGI vs LWP modules
Message-Id: <71mma1$k6f@mozo.cc.purdue.edu>

Kjetil Svendsberget  <kjetil@balder.no> wrote:
>Whats the main difference between theese 2, and what are the benefits
>for using one of them versus the other?

Well, they aren't comparable things. Everyone will say 'perldoc cgi' 
and 'perldoc lwp' (wait a minute -- reverse the single quotes ), and
that's a good idea, but I'll tell you a bit more.

LWP is the Library for the Web in Perl, and it allows you to, among
other things, create your own web clients. The CGI module simplifies
the creation of CGI programs. I never use it, as I really get annoyed
by the way it formats stuff. The browser still takes it, but when I 
look at the output, it goes longer than 80 characters. It's an annoyance
for me, but I like dealing with CGI straight anyway.

They are, as I said before, unrelated. 

-- 
Dave Jacoby		   I wish I could give brother Bill his big thrill
jacoby at ecn.purdue.edu   I would set him in chains at the top of the hill
http://purdue.org/~jacoby/ Then send out for some pillars and Cecil B. Demille
Father. Guitarist. Geek.   He could die happily ever after - Bob Dylan


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

Date: 03 Nov 1998 14:21:24 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: CGI vs LWP modules
Message-Id: <83k91c3oa3.fsf@vcpc.univie.ac.at>

Re: CGI vs LWP modules, David
<jacoby@harbor.ecn.purdue.edu> said:

David> clients. The CGI module simplifies the creation of
David> CGI programs. I never use it, as I really get annoyed
David> by the way it formats stuff. The browser still takes
David> it, but when I look at the output, it goes longer
David> than 80 characters.

You'd throw away all that CGI.pm gives you just because of
that?

You can always do a

    print "\n";

to coerce the output stream into something more readable.

The browserware doesn't care either way.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Tue, 03 Nov 1998 11:47:55 +0100
From: Kjetil Svendsberget <kjetil@balder.no>
Subject: CGI, common text question
Message-Id: <363EDF5B.C86ED7BF@balder.no>

i have now several cgi scripts (perl files) who all do

print $cgi->start_html(-title=>"$title",
	-author=>'Kjetil Svendsberget, kjetil\@balder.no, Balder Dialog AS',
	-BGCOLOR=>'#FFFF80',-TEXT=>'#000000',-LINK=>'#0000FF',
	-ALINK=>'#FF0000',-VLINK=>'#400040');

What i would like to do is to have this text in one place rather than
copy/paste it for every script that needs it.

I have a TMlib.pm module (who every script do a 'use Tmlib' on), and ive
tried writing this subroutine there:

sub print_standard_start_html{
	my ($title) = @_;
	
	my ($start_html) = <<EOHTML;
\$cgi->start_html(-title=>$title,
	-author=>'Kjetil Svendsberget, kjetil\@balder.no, Balder Dialog AS',
	-BGCOLOR=>$bg_color,
	-TEXT=>'#000000',
	-LINK=>'#0000FF',
	-ALINK=>'#FF0000',
	-VLINK=>'#400040');	
EOHTML

return $start_html;
}


and from the scripts i try to call it with:

my ($start) = &print_standard_start_html('Title for this web cite');
print $start;


Which does not work. Browser displays this as:

$cgi->start_html(-title=>Title for this web cite, -author=>'Kjetil
Svendsberget, kjetil@balder.no, Balder
Dialog AS', -BGCOLOR=>'#FFFF80', -TEXT=>'#000000', -LINK=>'#0000FF',
-ALINK=>'#FF0000', -VLINK=>'#400040'); 


at which point do i do wrong? browser thisplays what perl should have
executed. Am i wrong in assuming i can do this?



-- 
Kjetil Svendsberget, systemengineer
Balder Dialog AS
Olaf Helsetsvei 6
N-0694 Oslo, Norway


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

Date: 03 Nov 1998 11:54:53 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: CGI, common text question
Message-Id: <83lnlt2ghu.fsf@vcpc.univie.ac.at>

Re: CGI, common text question, Kjetil <kjetil@balder.no>
said:

Kjetil> i have now several cgi scripts (perl files) who all
Kjetil> do print $cgi->start_html(-title=>"$title",
Kjetil> -author=>'Kjetil Svendsberget, kjetil\@balder.no,
Kjetil> Balder Dialog AS',
Kjetil> -BGCOLOR=>'#FFFF80',-TEXT=>'#000000',-LINK=>'#0000FF',
Kjetil> -ALINK=>'#FF0000',-VLINK=>'#400040');

Kjetil> What i would like to do is to have this text in one
Kjetil> place rather than copy/paste it for every script
Kjetil> that needs it.

Use style sheets.  CGI.pm lets you put (CSS) <style> markup
into the HTML <head>.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Tue, 03 Nov 1998 08:42:25 GMT
From: slok00@yahoo.com
Subject: Fix Width...
Message-Id: <71mflh$dp5$1@nnrp1.dejanews.com>

I got an input file that I read in and need to output to another file.
The input file conforms to a certain format.

Eg.
1000000000000
2000000000000
3JohnSmithSiliconValley
400000000000
5000000000

What I want to achieve is to extract when it read that the line start
with 3, it will extract say first 9 character and assign to $name, 10-20 char
to $address adn output name and address to output file with the fields
being seperated by "|".

I am now able to detect the 3 and output the entire line to OUTPUT file.
I would like to find out how I can use some kind of format template and
do extraction and outputing.

Some sample codes will be appreciated.
Thanks.

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


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

Date: Tue, 3 Nov 1998 07:21:35 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Fix Width...
Message-Id: <v00n17.6u7.ln@flash.net>

slok00@yahoo.com wrote:
: I got an input file that I read in and need to output to another file.
: The input file conforms to a certain format.

: Eg.
: 1000000000000
: 2000000000000
: 3JohnSmithSiliconValley
: 400000000000
: 5000000000

: What I want to achieve is to extract when it read that the line start
: with 3, 


   if (/^3/) {
      print "line starts with three\n";
   }

: it will extract say first 9 character and assign to $name, 


   $name = substr $_, 0, 9;


: 10-20 char
: to $address 


   $address = substr $_, 9, 11;


: adn output name and address to output file with the fields
: being seperated by "|".

: I am now able to detect the 3 and output the entire line to OUTPUT file.
: I would like to find out how I can use some kind of format template and
                                                      ^^^^^^^^^^^^^^^

   perldoc -f unpack


: do extraction and outputing.


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


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

Date: Mon, 26 Oct 1998 15:35:52 GMT
From: tim@interactive1.easynet.co.uk (pickup)
Subject: getting another cgiscript to output within a perl script?
Message-Id: <363492bb.443939@news.demon.co.uk>

I'm writing a perl script which returns a page of html, building the
page on the fly. Halfway down the page I need to get the output from
another script embedded into the page, and then finish off writing the
page in perl.

I don't have access to the other CGI script and don't even know what
it is written in.

Calling it from a browser like so

http://mymachine:8001/CgiScript/qmethod=show&docid=1

returns a flat text file to the browser ...for example

"This is the return from the other script"


my perl code stripped down looks like this





#!/usr/bin/perl

print "Content-type:text/html\n\n";
print "<html>\n";
print "<body>\n";
print "<h2>cgi script returns</h2>\n";

$cgi_output ="http://mymachine:8001/CgiScript/qmethod=show&docid=1"

//now I want to print the output from the cgiscript
//i have tried
//open(SHOW, $cgi_output);
//@lines = <SHOW>;
//close(SHOW);
//foreach $line (@lines){
//   print $line;
//}
//but nothing was returned

print "</body>\n</html>\n";
exit;




What i want this example to return is the page

<html>
<body>
<h2>cgi script returns</h2>
"This is the return from the other script"
</body>
</html>



I am using perl5.00... downloaded from perl.com on a windows nt4
machine. Browser is ie4.
I have tried to look up this process in the perl help manuals, but
don't know what this process is called so am having difficulty finding
appropriate information.

tia

tim 








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

Date: Tue, 3 Nov 1998 12:40:02 +0100
From: oszrama1@mmm.com (Oliver Szrama)
Subject: Help on installing perl on AIX
Message-Id: <71mq3t$p4a$1@magnum.mmm.com>

I'd like to install perl on an IBM RS6000 with AIX Version 4.2. If I follow
the installation instruction from the INSTALL file I cannot find the
Configure script.

/#sh Configure
sh: Configure:  not found.

Where can I find this script?

Oliver Szrama
Germany
oszrama1@mmm.com




Opinions expressed herein are my own and may not represent those of my employer.



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

Date: Tue, 3 Nov 1998 13:09:33 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: HELP! I need a perl enviroment for Win 95
Message-Id: <363F008D.F8B8C98@technologist.com>

Cornuts wrote:
> 
> Does anyone know where I can download software to program in perl
> besides CPAN and Active state. I have searched around and found those
> two sites as the only ones who actually distribute perl software
> (enviroments) I have downloaded from both of those sites and found
> "uncleanable" viruses in each. I would download the source code and
> compile it myself, but all I have is Turbo C++ 3.0  which is not a
> supported "C" compiler to compile the perl enviroment (Borland C++ 5.0
> and beyond). Can someone help me? I would love to get started
> programming in perl, and it would be nice to check my code locally
> instead of doing guess work and uploading cgi's to my ISP server to find
> that they don't work. Any help would be appreciated. Please respond to
> cornuts@mrfoda.com if you have the chance. Thanks.
>                                                         CORNUTS.

You seem to know something that thousands of others do not.

Please elaborate on '"uncleanable" viruses'.  

Brent
-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Tue, 3 Nov 1998 11:08:28 +0100
From: "maxm" <maxm@normik.dk>
Subject: Re: How do i remove Carriage Returns og Newlines from a string via regexp's ?
Message-Id: <71mkjt$gsd$1@miri.tele.dk>


Uri Guttman wrote in message ...
>>>>>> "BJFW" == Bill Jones, FCCJ Webmaster <webmaster@fccj.org> writes:

>if you are doing that, uset tile mode for reading:


Ill try that

>tr/\r\n / /s ;
>
>which will convert all \r\n to spaces and squeeze extra spaces into
>one. the squeeze is for the \r\n which would get converted to '  ' (2
>spaces) otherwise.


Thanks ... my problems are solved

Hilsen/regards

Max M Rasmussen
New Media Director
Denmark

Work:
mailto:maxm@normik.dk
http://www.normik.dk

Private:
mailto:maxm@maxmcorp.dk
http://www.maxmcorp.dk

Download my latest album in
high quality MP3 format for free at:
http://www.maxmcorp.dk/html/musical.htm#MaxMCorporation





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

Date: Tue, 03 Nov 1998 15:24:28 +0100
From: EC <e.christensen@netjob.dk>
To: John Lee <jglee@us.ibm.com>
Subject: Re: Inserting into Access with win32:odbc
Message-Id: <363F121C.7D6CECD2@netjob.dk>

Hi
You could try
$Data->sql("INSERT INTO Table1 (A,b) VALUES ('please', 'work')");

Note the aphostrop's as I asume your fields are defined as text.
Ernst
John Lee wrote:

> I have been trying to insert into an MS Access database with the
> following test program...
>
> use Win32::ODBC;
>
> $Data = new Win32::ODBC("foobar");
>
> $Data->Run ("INSERT INTO Table1 (A,b) VALUES (please, work)");
>
> $Data->Close();
>
> The Run command spits out the following...
>
> Excecuting connection 1
> sql statement: "INSERT INTO Table1 (A,b) VALUES (please, work)"
> Error: "-3010[Microsoft][ODBC Microsoft Access 97 Driver] Too few
> parameters. Expected 2.10"
> --------------------
>
> Does anyone know how to make inserts work with Access??



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

Date: Tue, 03 Nov 1998 12:29:40 GMT
From: perrella@yahoo.com
Subject: Large File Support in Perl (>2GB)
Message-Id: <71msvk$svs$1@nnrp1.dejanews.com>

Hi,
Does anyone have a version of Perl5 that has "Large File Support" (i.e.
supports files large than 2 gigabytes) for IBM AIX V4.

-Ron Perrella

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


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

Date: Tue, 03 Nov 1998 12:02:16 GMT
From: Morten Knudsen <mk@control.auc.dk>
Subject: Newbie: files in different directories.
Message-Id: <363EF167.397A3A59@control.auc.dk>

Here's my problem...

I'm trying to build a virtual shopping cart for use in a small on-line
store. Each user is assigned a
file with a filename equal to the users ip address. This file will then
contain information about the
user's purchases. But, I can't seem to get the script to find the file
($ip). When I place the file in
the same directory as the script, there's no problems at all, but I just
can't find the file in another
directory! Help!

Here's the script (or at least a part of it):

---SCRIPT---

#!/usr/bin/perl

$ip = $ENV{'REMOTE_ADDR'};
$cart = "data1/hypermart.net/bluegalaxy/thestore/carts/$ip";

print "Content-Type: text/html\n\n";

### GET THE PRODUCTS IN THE CURRENT USER'S CART ###

if (-e "$cart") {
  open (CARTFILE, "<$cart");
  @incart = <CARTFILE>;
  close (CARTFILE);
}

foreach $product(@incart) {
  print "$product\n";
}

---END SCRIPT---

Any help would be really appreciated!

Please e-mail me at: chrknudsen@hotmail.com

Thanks!

/Christian H. Knudsen



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

Date: Tue, 03 Nov 1998 12:02:42 GMT
From: Morten Knudsen <mk@control.auc.dk>
Subject: Newbie: files in different directories.
Message-Id: <363EF181.70A747E9@control.auc.dk>

Here's my problem...

I'm trying to build a virtual shopping cart for use in a small on-line
store. Each user is assigned a
file with a filename equal to the users ip address. This file will then
contain information about the
user's purchases. But, I can't seem to get the script to find the file
($ip). When I place the file in
the same directory as the script, there's no problems at all, but I just
can't find the file in another
directory! Help!

Here's the script (or at least a part of it):

---SCRIPT---

#!/usr/bin/perl

$ip = $ENV{'REMOTE_ADDR'};
$cart = "data1/hypermart.net/bluegalaxy/thestore/carts/$ip";

print "Content-Type: text/html\n\n";

### GET THE PRODUCTS IN THE CURRENT USER'S CART ###

if (-e "$cart") {
  open (CARTFILE, "<$cart");
  @incart = <CARTFILE>;
  close (CARTFILE);
}

foreach $product(@incart) {
  print "$product\n";
}

---END SCRIPT---

Any help would be really appreciated!

Please e-mail me at: chrknudsen@hotmail.com

Thanks!

/Christian H. Knudsen



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

Date: 03 Nov 1998 00:00:03 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Not to start a language war but..
Message-Id: <ylww5dcikc.fsf@windlord.stanford.edu>

In comp.lang.perl.misc, ZigroN <zigron@jps.net> writes:

> What precisely is stopping you from doing _Any_ of this in Python?

People really should listen to this point, particularly on the Perl side.
There seems to be a lot of language advocacy of the form "you can't do
this in language X" going around right now; that's generally just not
true.  Pretty much all of the languages that we're talking about are
Turing-complete, so unless you're talking about deep voodoo with external
interfaces like writing OS kernels or something, you're going to be *able*
to do anything in pretty much any language.

There are considerably more interesting things to argue about.

To me, Python vs. Perl has always struck me as just the latest incarnation
of the standard fight between "clean" and "dirty" languages.  Python, at
least as it's been described to me, has a clean and consistent core
language, and proceeds consistently from a set of basic axioms.  In other
words, it's likely nearly all programming languages.

Perl isn't.  Perl is dirty and ugly and proud of it.  And the fact that
that's the primary objection to Perl emphasizes that this really isn't a
case of one language or the other being better, but rather a case of how
the programmer wants to think.

Perl is rife with intentional inconsistencies and default behaviors.
split 'a' splits a string at each a, but split ' ' doesn't split a string
at each space; rather, it performs a magic split on whitespace which is
almost but not quite the same as split /\s+/.  use strict makes you
predeclare all of your variables, except for $a and $b in sorting subs
since those are special.  And so forth.

In other words, Perl is like English, where one always spells words by
putting "i" before "e" except when one doesn't.

See, the one thing that I'll never argue is that Perl is for everyone.
Because I don't believe that it is.  Perl is for people who think like
Perl thinks.  Now Perl knows a lot of different ways of thinking, and a
lot of people from very different backgrounds can be happy thinking in
Perl, unless they expect Perl to *only* think they way they think.  And
provided they don't mind the weird corners where Perl's thinking like
someone else.  In order to really love Perl, you have to happily embrace a
language that has lots of odd little corners and is proud of it.

See, the reason why I love Perl isn't that it can do more, or that it has
more available code, or that I learned it first (because I didn't).  Those
are good reasons to choose Perl in a project, and there are similar good
reasons to choose Python in a project.

I love Perl because it's fun.

And fun is a very subjective thing, and the fact that I find it fun
certainly doesn't ensure that you're going to find it fun.  :)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 3 Nov 1998 12:19:27 GMT
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Not to start a language war but..
Message-Id: <slrn73tt6f.8eg.dformosa@godzilla.zeta.org.au>

In article <ylww5dcikc.fsf@windlord.stanford.edu>, Russ Allbery wrote:
[...]Now Perl knows a lot of different ways of thinking, and a
>lot of people from very different backgrounds can be happy thinking in
>Perl, unless they expect Perl to *only* think they way they think.

I think perl rewards peaple who know how to think in a number of ways.
And peaple who are able to understand peaple who think in ways other
then them.  In a way perl is a multicultural langage, a pollyglot if
you will.

[...]

>I love Perl because it's fun.

Yep, thats my reson to.



-- 
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.



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

Date: Tue, 03 Nov 1998 13:05:14 +0000
From: Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
Subject: Re: OLE Publication
Message-Id: <363EFF89.FE0D5DA8@ndirect.co.uk_NOSPAM>

Chad Moston wrote:
> 
> Anybody know of some good documents that contain
> definitions of OLE objects?

Yep. Usually the documentation that comes with those objects is the best
source. This applies to Word, Excel, and anything else I can think of. 

Further than that, install MSVC4 (or 5 or 6) and use OLEVIEW to look at
the typelibs.

-- 
<Matt/>

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: 3 Nov 1998 12:41:44 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Pass by Reference (was: Not to start a language war but..)
Message-Id: <71mtm8$f2b$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    wtanksle@cx930311-b.ocnsd1.sdca.home.com (William Tanksley) writes:
:Perhaps all those Perl book I've been reading ARE just that mendacious.
:They're trying to make me stop learning Perl.  :-)

Reading the wrong books, eh? :-)

:>Therefore, I can only surmise that you don't understand pass-by-reference
:>semantics.   Please consult perlsub.
:
:I understand them quite well.  I use 'em, too.  I wish that I didn't have to
:understand them and type them every time in order to use them.  The same
:goes for so many of the little things.  Yeah, I can learn to ignore them,
:since the big things Perl does well are cool.  Is that the correct solution,
:though?  Or are the things that look like minor, repeated irritations
:actually the source of Perl's coolness?

I don't quite understand what your problem with pass by reference is, but
looking down below at your suggested code, I begin to get a glimmer.

In Perl, as it is in C, one must be forever mindful of the distinction
between a reference and its referent.

If you have in C an `int *', you can't do `int' things to it without
a proper dereference.

    f(i,j)
	int *i, j);
    {
	j = *i;         /* note the star */
    }

Or with structures, 

	f(buff, pbuf)
	    struct stat buff, *pbuf;
	{
	    count += buff.st_nlink;
	    count += pbuf->st_nlink; 	/* arrow, not dot */
	}

The source of the confusion is having to support both thingies and
pointers thereto.  One can cure this by killing references (like tcl or
awk) or by killing referents (like python or scheme).

:>I dunno.  I write things like 
:>    $tv_show{"Flintstones"}{"kids"}[0]{"age"}++
:
:You quite likely don't pass them to functions, though.  What would the
:recipient function look like?
:
:sub whatever { my %tv_show = %{[$@_[0]]};
: # yadda.
:}
:I sure am illiterate.  Let me try that again.
:my %tv_show = %{[shift]};

You certainly have a knack for obfuscation!

    my $tv = shift;
    $tv->{"Flintstones"}{"kids"}[0]{"age"}++

suffices and is in fact preferable, since your copy of the top
level of the hash is unnecessarily slow and of little real effect
considering the multilevel nature of data structure.

One could also hack the symbol table:

    local *tv = shift;
    $tv{"Flintstones"}{"kids"}[0]{"age"}++

But that's getting a tad iffy.

:>Or even the classic linked-list traversal:
:>    for ($node = $head; $node; $node = $node->{LINK}) {
:>	printf "I am %d.\n", $node->{VALUE};
:>    } 
:>without having to "work with it" all that much.  What's your gripe?
:
:Linked lists are so cool that Perl provides them as a primitive type.  Cool.

Um, no -- it does not.  I just demo'd using them.

:And then it doesn't let you pass them to functions unless you pass only that
:one list.  If you want to pass more than one list, you have to actually pass
:references or some other trick.  Why?  There is some balancing benefit, right?

First off, it is silly to call pass-by-reference a trick.  It's a
standard idiom.  The `balancing benefit' is that this makes it easy
to write functions like print() or sort() or reverse(), which expect a
flattened list.  As for "have to", I really don't understand what your
confusion or gripe is here.

    $listA = Ring->new();
    $listB = Ring->new();
    merge($listA, $listB);

seems entirely clear to me.

As for the base types, @array and %hash, those you would generally
pass by explicit reference.  You don't do this with built-ins
like push() because they're prototyped to take an implicit reference.
You could do this with your own stuff this way:

    sub hpush(\%@) {
        my $href = shift;
        while ( my ($k, $v) = splice(@_, 0, 2) ) {
            $href->{$k} = $v;
        } 
    } 
    hpush(%pieces, "queen" => 9, "rook" => 5);

I still don't know the exact region where your particular brain-damage
resides, but I suspect it may be in embracing the dereferencing arrow.

--tom
-- 
    I don't believe it's written in Perl, though it probably
    ought to have been.  :-)
	--Larry Wall in <1995Feb21.180249.25507@netlabs.com>


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

Date: Tue, 03 Nov 1998 09:38:43 GMT
From: nobody@nowhere
Subject: Perl  5.003_07 build 316+ GD Library + NT Alpha
Message-Id: <71miqh$icj8@eui1nw.euskaltel.es>


Hello,

we have been looking into the news, for some solutions we have with the
library GD.pm running on an Alpha NT server. We have already tried
different versions of both gd.pm and gd.pll, but every time we get the
same error: "Can't load ..\perl\lib\auto\gd\gd.pll for module GD:: 193 at
 ....\perl\lib\dynaloader.pm line 450."

The version we are runnig is perl 5.003_07 build 316.
Thanks in advance but any suggestion will be welcome.


Greetings


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

Date: Thu, 29 Oct 1998 08:02:38 -0500
From: "PERL ROCKS!" <emills@harris.com>
Subject: PERL is TOO flexible
Message-Id: <3638676E.F980FC4A@harris.com>

Its nice to be flexible sometimes- having several means to accomplish
something can be helpful. But when not necessary, it makes learning a
language and interpreting syntax more difficult than it needs to be.
Don't get me wrong- PERL ROCKS! I use it almost exclusively now. This is
a philosophical question from a PERL user- so don't flame!

But for example, why should I be able to call a subroutine with

  mysub();
  &mysub;
  &mysub();

In fact, why have "&" at all, when mysub() does just fine? It seems to
me, Computer Scientist that I am, that a language developer would have
as an objective, a minimal grammar. Additional complexity adds nothing
to the language's capabilities or power; conversely it diminishes its
practicality by making it harder to write and apply a  parser-generator,
and even more significant- it makes it harder for programmers to learn
and apply the language.

This is but one example I've found that seems redundant. Another:

  print "stuff\n";
  print ("stuff\n");

What does this add? Maybe Mr. Wall wanted to allow many possible
syntaxes (syntaces?) so in the event that a programmer "forgot" one, he
was more likely to "stumble on" to one that worked? I've read many
quotes from Mr. Wall and generally find him insightful and intuitive,
but I'm not sure about his thoughts along these lines. One quote I
found:

"Although the Perl Slogan is There's More Than One Way to Do It, I
hesitate to make 10 ways to do something. :-) "
     --Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>

is along these lines- why make more than ONE? What did it add, Larry?

Just a thought..

E



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

Date: Tue, 3 Nov 1998 13:00:50 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Perl Upload Script Needed Badly
Message-Id: <363EFE82.E2193B00@technologist.com>

Tim Schaab wrote:
> 
> Hi
>     I'm in need of a perl script to ulpoad binary files via the web.
> I'm running the Pi3 Web server and am using Perl on windows. Any and
> all help anyone can give me would be greatly appreciated. Please email
> me at schaab@cs.wisc.edu if you have any information that can help me
> out. Thank you very much.
> 
> Tim Schaab

Tim, 

Use CGI.pm, I have an example at:
http://webreview.com/wr/pub/98/08/14/perl/index.html

Also, the CGI.pm home page has some information on it.  There is a link
to that page on the www.perl.com page under "CGI".

Good luck,
Brent
-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Tue, 03 Nov 1998 09:58:23 +0100
From: Kjetil Svendsberget <kjetil@balder.no>
Subject: Re: perl&cgi question
Message-Id: <363EC5AF.14E81D60@balder.no>



brian d foy wrote:
> 
> In article <363DDAE2.A18140AE@corp.home.net>, Justin Harvey <jbharvey@corp.home.net> posted:
> 
> > You need to change the mime association for .pl extension inside your
> > browsers so that it will use it as a CGI, and not try to download it.
> 
> sorry, but it's the server that does what you are thinking about.


Sorry for asking this in the wrong newsgroup, but as i said this is NOT
a web server problem, since both machines acess the same web-server
(www.balder.no), they even have the same browser. IE 4.0 (v.4.72). But i
get different results looking at the same page.
I really thought there was something wrong with my perl script because
whenever the perl script is uncompilable it sometimes happened that the
browser wants to download the script instead of executing it. 
So if this is not perl related in what newsgroup should i ask this
question then?


Kjetil


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

Date: 3 Nov 1998 05:37:47 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: Problem with Win32 reg exp
Message-Id: <71m4rb$ef8$1@nnrp02.primenet.com>

Tye McQueen <tye@fohnix.metronet.com> wrote:
> The FAQ surely told you to use "-w" when you can't figure
> out why it isn't working:
>
>     C:\> perl -w -e 's/foo/bar/gi' -p -i.bak *.txt
>     Useless use of a constant in a void context at -e line 1.
>
> Notice that the single quotes are being passed to Perl so
> that the Perl code is:
>
>     's/foo/bar/gi'
>
> not
>
>     s/foo/bar/gi
>
> Just what "-w" warned me about.

This is sarcasm, right? I mean, you don't really think that a
self-confessed Perl neophyte would read this

     Useless use of a constant in a void context at -e line 1

and immediately think, "Oh, yeah! Clearly my command interpreter
is passing the whole string

     's/foo/bar/gi'

to the Perl interpreter, including the single quotes that I see
delimiting nearly every command-line script in every resource I've
ever read about the Perl programming language, and this, of course,
is a 'constant in a void context' to the Perl interpreter, which is
obviously the source of the problem! Du - uh!"

The "-w" flag wouldn't have helped this guy. He first checked the
documentation, then did the sensible thing and posted an inquiry
to comp.lang.perl.misc where his question was quickly answered.

-- 
Jim Monty
monty@primenet.com
Tempe, Arizona USA            THERE'S NOTHING WORSE THAN HYPERBOLE!


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

Date: 3 Nov 1998 13:05:12 GMT
From: hdiwan@diwanh.stu.rpi.edu ()
Subject: Re: Problem with writing to a log file
Message-Id: <slrn73u05e.fb9.hdiwan@diwanh.stu.rpi.edu>

On Mon, 2 Nov 1998 18:24:48 -0500, Matt McHugh <m0317@ix.netcom.com> wrote:
[SNIP]
>#!/usr/local/bin/perl -w
>
>open (NOTFOUND, ">>/usr/mmchugh/notfound") ||
>        die "/usr/mmchugh/notfound is not found";
>open (AIPHOSTS, "/usr/scripts/perl/hosts1") ||
>        die "/usr/mmchugh/hosts not found ";
>while (<AIPHOSTS>) {
>
>        if (/(^[^;\$\s]+)/) {
>                $ret = system ("/usr/sbin/ping $1 5 > /dev/null 2>&1") ;
>                if ($ret) { print "$1 not found\n"; }

if ($ret) { print NOTFOUND "$1 not found\n"; }

>                }
>}
You were not specifying a file handle to write to.

-- 
Hasan Diwan
Geek Code
GAT d- s-:- a--- C++++ UL++++ UX+ UA+ UH++++ P++++ L++++ E--- W-- N++ ?o ?K
w--- O- M V PS+ PE Y+ PGP+++ t 5 X-- R* tv+ b+++ DI++ D G e>++ h-- r++ y+


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

Date: 03 Nov 1998 09:52:46 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Question regarding CGI.pm
Message-Id: <83ww5dtaxt.fsf@vcpc.univie.ac.at>

Re: Question regarding CGI.pm, Greg <gbc1@axe.humboldt.edu>
said:

Greg> know, Ive always been able to pop in the following
Greg> code to find out what params are being passed after

I really can't believe that would ever have worked...unless
a much earlier CGI.pm had overloading for the object in a
string context...

Greg> $query=new CGI; print "<H2>Current Values</H2>
Greg> $query\n<P>";

Would be better to use the HTML shortcuts here:

    use CGI qw(:all);

    print header(...), start_html(...);

    print h1(...);

    print h2('Current Values'), CGI::dump(), p;

    print ...;

    print end_html;


Greg> CGI=HASH(0x140145c78)

This is because `$query' is the object (hash) reference.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Tue, 03 Nov 1998 13:17:22 GMT
From: dave@mag-sol.com
Subject: Re: Question regarding CGI.pm
Message-Id: <71mvp2$3q$1@nnrp1.dejanews.com>

In article <71lbj2$qv$1@gellyfish.btinternet.com>,
  Jonathan Stowe <gellyfish@btinternet.com> wrote:
> In comp.lang.perl.misc Greg Coit <gbc1@axe.humboldt.edu> wrote:
> > I'm trying to debug a script I wrote (with the help of CGI.pm) which
> > generates a web page with a form.  Up to know, Ive always been able to
> > pop in the following code to find out what params are being passed after
> > the submit button is pressed (per the CGI.pm man page):
> >
> > $query=new CGI;
> > print "<H2>Current Values</H2> $query\n<P>";
> >
> > but instead of a list of the parameters (which is the normal response),
> > i get this:
> >
> > Current Values
> >
> > CGI=HASH(0x140145c78)
> >
> <this used to work under 5.003_02>
>
> I would have thought that this would never have worked but I havent got a
> copy of 5.003_02 to try out.  This is certainly the behaviour I would have
> expected to see.
>
> The working equivalent would be :
>
> my $query = new CGI;
>
> print $query->header,start_html;
>
> print "<H2>Current Values: </H2>\n";
>
> foreach ($query->param())
>   {
>     print "$_ = ",$query->param($_),"<BR>\n";
>   }
>
> print $query->end_html;

 ... or the shortcut function $query->dump which prints all the parameters out
in a nice list.

> I would recommend going back to the documentation for CGI.

Seconded.

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]

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


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

Date: Tue, 03 Nov 1998 12:25:13 GMT
From: perrella@my-dejanews.com
Subject: using perl on HUGE (>2GB) files
Message-Id: <71msn8$shs$1@nnrp1.dejanews.com>

Hi,

I need to use perl scripts on very large files.  I'm talkin 4-5 GB text
and binary files.  I'm on AIX 4.2 where large file support is available.

Is there a version of Perl that is available to handle these large files?

If not, is there a set of patches or instructions I can follow to patch my
5.003 level Perl source code?

Please respond to my email address as well (perrella@yahoo.com).

Thanks,

Ron Perrella

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


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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