[7678] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1304 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 11 23:08:18 1997

Date: Tue, 11 Nov 97 20:00:22 -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, 11 Nov 1997     Volume: 8 Number: 1304

Today's topics:
     Re: "perl aware" vi editor? , snailgem@aol.com
     Re: Calling a Perl script from a Perl script CAN YOU HE (Wesley)
     Re: Calling a Perl script from a Perl script CAN YOU HE (Wesley)
     Re: Can I use a path with "use" or how can I use "use S <zenin@best.com>
     can't compile perl 5.004_04 with -ldl library <thebreez@erols.com>
     CLIPS and XS <bpatton@flash.net>
     Re: CPAN confusion (Martien Verbruggen)
     Re: creating file (Martien Verbruggen)
     Re: Diff. between Oraperl & DBI/DBD for Oracle <zenin@best.com>
     Environmental Variables <corcordt@cs.purdue.edu>
     File name problem when using PERL to send binary files  <mysun@mbox2.singnet.com.sg>
     Re: Help Perl Banner not working... (Martien Verbruggen)
     Re: Help with UDP <v3100411@student.anu.edu.au>
     Re: HTML FORM POST to DBASE (Martien Verbruggen)
     Re: installing CGI.pm (Martien Verbruggen)
     Re: Killing a child process (Martien Verbruggen)
     Re: Need to speed up s/ / /; (Martien Verbruggen)
     Newbie Question <warren5@earthling.net>
     Re: Passing a %hash via Shared mem. ?? (Jason Gloudon)
     Re: Passing Variables <markm@nortel.ca>
     Re: Perl->Java? Java->Perl? Gaaaaa! <zenin@best.com>
     Split Screen Telnet <corcordt@cs.purdue.edu>
     Re: Statistics for comp.lang.perl.misc (Danny Aldham)
     Re: VERY STRANGE: Simple perl script to display a PDF d (Martien Verbruggen)
     Re: Where can I get the pre-compiled binariy "undump" f (Peter Samuelson)
     Re: Where can I get the pre-compiled binariy "undump" f (Martien Verbruggen)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 11 Nov 1997 22:43:53 -0500
From: , snailgem@aol.com
Subject: Re: "perl aware" vi editor?
Message-Id: <346925F4.1278@aol.com>

I'm not sure what I mean, but this is what got me curious:

In "Programming Perl", on p.24 there's an example of a foreach statement
that goes like this:

foreach $user (@users) {
	if (-f "$home{$user}/.nexrc") {
		print "$user is cool ... they use a perl-aware vi!\n";
	}
}


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

Date: 11 Nov 1997 23:21:36 GMT
From: wkc@dorsai.org (Wesley)
Subject: Re: Calling a Perl script from a Perl script CAN YOU HELP??
Message-Id: <slrn66hq4d.qg9.wkc@amanda.dorsai.org>

The easiest way to do is to install CGI.pm then add ONE line at the
beginning of your perl script:

use CGI::Carp qw(fatalsToBrowser);

The error msg will show up in the browser.

Just a little off topic but I bet there will be a couple people just post
"READ THE FAQ!" without any pointers to where or which FAQ to read. 
Sometimes, it's true. Read the FAQ and the answers are there.  I found
this CGI.pm thing in the FAQ, too.  
Before I reponse to this question, I tried to look for the CGI.pm FAQ's
address so that I can point the person who asked this question to read
more about it.  I couldn't find the FAQ even I read it before.  So,
whoever just want to post "READ THE FAQ!", please also consider there are
MANY FAQs out there.  At least try to point to which FAQ to read.

Sorry for the gabbling, but just a little frustrated reading so many "READ
THE FAQ" post with no help at all.

Wes

In article <34689917.48130AD8@ait.acl.ca>, Guy Doucet wrote:
>First of all, I'm quite new at Perl...
>
>I am creating CGI scripts with Perl. Our site is run by a Novell Web
>Server. I've read a lot about people telling others to check what error
>was recieved when their scripts crash. Well the only results that I get
>from Perl is from my NetScape 4 browser. Either it comes back with the
>message "Contains no data" or that the script worked. There may be an
>error log somewhere but ...
>
>Out of curiousity, where do the others run their perl scripts that they
>can actually see Perl errors coming back to their screen?
>
>Anyway, I was wondering if there was a way to call a Perl CGI script
>from another Perl CGI script. Currently I'm having the first script
>write an HTML page with javascript which is instructed to call the next
>Perl Script. I was thinking there must be a better way. Is there?
>
>Thanks for all feedback, and thanks too for previous feedback.
>Guy Doucet
>
>



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

Date: 11 Nov 1997 23:31:42 GMT
From: wkc@dorsai.org (Wesley)
Subject: Re: Calling a Perl script from a Perl script CAN YOU HELP??
Message-Id: <slrn66hqnc.r26.wkc@amanda.dorsai.org>

Here is the FAQ for CGI.pm.  It's at: 
http://www-genome.wi.mit.edu/ftp/pub/software/WWW/


In article <slrn66hq4d.qg9.wkc@amanda.dorsai.org>, Wesley wrote:
>The easiest way to do is to install CGI.pm then add ONE line at the
>beginning of your perl script:
>
>use CGI::Carp qw(fatalsToBrowser);
>
>The error msg will show up in the browser.
>
>Just a little off topic but I bet there will be a couple people just post
>"READ THE FAQ!" without any pointers to where or which FAQ to read. 
>Sometimes, it's true. Read the FAQ and the answers are there.  I found
>this CGI.pm thing in the FAQ, too.  
>Before I reponse to this question, I tried to look for the CGI.pm FAQ's
>address so that I can point the person who asked this question to read
>more about it.  I couldn't find the FAQ even I read it before.  So,
>whoever just want to post "READ THE FAQ!", please also consider there are
>MANY FAQs out there.  At least try to point to which FAQ to read.
>
>Sorry for the gabbling, but just a little frustrated reading so many "READ
>THE FAQ" post with no help at all.
>
>Wes
>
>In article <34689917.48130AD8@ait.acl.ca>, Guy Doucet wrote:
>>First of all, I'm quite new at Perl...
>>
>>I am creating CGI scripts with Perl. Our site is run by a Novell Web
>>Server. I've read a lot about people telling others to check what error
>>was recieved when their scripts crash. Well the only results that I get
>>from Perl is from my NetScape 4 browser. Either it comes back with the
>>message "Contains no data" or that the script worked. There may be an
>>error log somewhere but ...
>>
>>Out of curiousity, where do the others run their perl scripts that they
>>can actually see Perl errors coming back to their screen?
>>
>>Anyway, I was wondering if there was a way to call a Perl CGI script
>>from another Perl CGI script. Currently I'm having the first script
>>write an HTML page with javascript which is instructed to call the next
>>Perl Script. I was thinking there must be a better way. Is there?
>>
>>Thanks for all feedback, and thanks too for previous feedback.
>>Guy Doucet
>>
>>
>



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

Date: 12 Nov 1997 00:50:03 GMT
From: Zenin <zenin@best.com>
Subject: Re: Can I use a path with "use" or how can I use "use Symbolic_linked_module" with taint checking?
Message-Id: <879295966.926792@thrush.omix.com>

crr026@email.mot.com wrote:
: I want to add my lib directories to the @INC array in a generic way. What
: I've done is put these statements
: 	BEGIN {
: 		push @INC, "/usr/local/me/my_lib/Perl";
: 	}

	DON'T EVER DO THIS!!!!  Use this code instead:

	use lib '/usr/local/me/my_lib/Perl';

: in a file called init.pm in that same directory (i.e.
: /usr/local/me/my_lib/ Perl). In my working directory
: (/usr/local/me/code/Perl), I placed a symbolic link to the init.pm file.
: Thus, in all my scripts, I can use a "use init", to update the @INC
: array.

	BTW, if you have made libs just for one app, you can keep them
	in the same directory as the app and use this code to make sure
	you can load them no matter were you start the program:

	use File::Basename;
	use lib dirname $0;

	Yes, there are cases that this won't work, but not in many.

: However when I turn on taint checking (perl -T), this doesn't work. I
: can't use "use ../../lib/Perl/init" either. Can some kind soul help me
: overcome this problem?
	Again, "use lib '/lib';"

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 11 Nov 1997 22:13:49 -0500
From: Kevin Bree <thebreez@erols.com>
Subject: can't compile perl 5.004_04 with -ldl library
Message-Id: <34691EED.BB1932CA@erols.com>

I am trying to compile perl with the -ldl library which I think is the
dynamic load library.
The "sh Configure" sees it as is shown below
===========
Directories to use for library searches?
[/usr/local/lib /shlib /lib /usr/lib]

On some systems, shared libraries may be available.  Answer 'none' if
you want to suppress searching of shared libraries for the remaining
of this configuration.

What is the file extension used for shared libraries? [so]

Checking for optional libraries...
No -lsfio.
No -lnet.
No -lsocket.
No -linet.
No -lnsl.
No -lnm.
No -lndbm.
Found -lgdbm (shared).
No -ldbm.
Found -ldb (shared).
No -lmalloc.
Found -ldl (shared).
No -ldld.
No -lld.
No -lsun.
Found -lm (shared).
Found -lc (shared).
No -lcposix.
No -lposix.
No -lndir.
No -ldir.
No -lcrypt.
No -lucb.
No -lBSD.
No -lPW.
No -lx.

Some versions of Unix support shared libraries, which make executables
smaller
but make load time slightly longer.

On some systems, mostly System V Release 3's, the shared library is
included
by putting the option "-lc_s" as the last thing on the cc command line
when
linking.  Other systems use shared libraries by default.  There may be
other
libraries needed to compile perl5 on your machine as well.  If your
system
needs the "-lc_s" option, include it here.  Include any other special
libraries
here as well.  Say "none" for none.

Any additional libraries? [-lgdbm -ldb -lm -lc] -lgdbm -ldb -lm -lc -ldl

==============

However, when the attempt to compile the test program occurs, the
following output is diaplayed

==================
Make sure you include the appropriate -L/path flags if your C linker
does not normally search all of the directories you specified above,
namely
        /usr/local/lib /shlib /lib /usr/lib
To use no flags, specify the word "none".

Any additional ld flags (NOT including libraries)? [ -L/usr/local/lib]

Checking your choice of C compiler, libs, and flags for coherency...
I've tried to compile and run a simple program with:

        cc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include
-L/usr/local/lib -o try try.c -lgdbm -ldb -lm -lc -ldl
        ./try

and I got the following output:

/usr/i486-linux/bin/ld: cannot open -ldl: No such file or directory
I can't compile the test program.
(The supplied flags might be incorrect with this C compiler.)

You have a BIG problem.  Shall I abort Configure (and explain the
problem)
[y]
Ok.  Stopping Configure.
====================

The file /usr/i486-linux/bin/ld does exist.

If I remove the -ldl everything compiles but, I cannot dynamically load
modules like Tk with use.

I am running linux 2.0.0.

Any help would be appreciated.

Kevin Bree

thebreez@erols.com




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

Date: Tue, 11 Nov 1997 19:42:29 -0600
From: "Billy Patton" <bpatton@flash.net>
Subject: CLIPS and XS
Message-Id: <64b15f$meb$1@excalibur.flash.net>

A freind of mine at work thought he remembered someone that was
trying to make CLIPS accessable from perl.  I've just recently done
this with another of my libraries and love the way it works.  I now have
a need for an expert system.

Does anyone know of anyone who has begun/finished this work.
I would be willing to beg/borrow/steal/plagerize any or all of
their work.  If someone is currently working on this I would be happy
to share in the work.

This is something I will do, but why reinvent the wheel!

bpatton@asic.sc.ti.com




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

Date: 12 Nov 1997 02:22:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CPAN confusion
Message-Id: <64b3sd$5im$1@comdyn.comdyn.com.au>

In article <34671E07.39AB0120@ticnet.com>,
	Kermit Tensmeyer <kermit@ticnet.com> writes:

>   and the assumption is that perl can connect to the CPAN site all on
>  it lonesome..  not a good assumption. 
>   At work I sit behind a firewall. I can browse the CPAN site all I want
>  with a browser, but the CPAN module can not connect unless the perl
>  is socksified.

I am behind a firewall, and just use our proxy cache server to
connect.

perl -MCPAN -e shell
o conf

That will list options 'http_proxy' 'ftp_proxy' and 'no_proxy'. Just
set those, and it will work.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: 12 Nov 1997 03:05:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: creating file
Message-Id: <64b6ed$5po$5@comdyn.comdyn.com.au>

In article <Pine.GSO.3.96.971111114105.13324B-100000@gladstone.uoregon.edu>,
	Steven Paul Adelman <crew@gladstone.uoregon.edu> writes:
> 
> Is there a better way to create a file from a CGI script using PERL than 
> 
> system('echo >/foo/bar');

The most obvious one:

open(FF, '>/foo/bar') or die "Cannot open file: $!";
close(FF);

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: 12 Nov 1997 00:06:33 GMT
From: Zenin <zenin@best.com>
Subject: Re: Diff. between Oraperl & DBI/DBD for Oracle
Message-Id: <879293353.679456@thrush.omix.com>

jamester <jamester@alumni.EECS.Berkeley.EDU> wrote:
: Can someone tell me what the difference is between Oraperl and DBD/DBI for
: Oracle? What are the advantages of using one to another?

	If you know oraperl, use the Oraperl layer if you also don't care
	about the code working with other databases.  If you don't know
	oraperl already, learn and use DBI.

	You are either doing:
		YourCode->Oraperl->DBI->Oracle
	or:
		YourCode->DBI->Oracle

-- 
-Zenin
 zenin@best.com


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

Date: Tue, 11 Nov 1997 21:46:47 -0500
From: David Corcoran <corcordt@cs.purdue.edu>
Subject: Environmental Variables
Message-Id: <34691897.1548@cs.purdue.edu>

I have written a server in Perl and am wondering what I have to do in
order to make it look right from an external telnet.  I don't believe
now that an environmental variable is being set or something.


Thanks
corcordt@cs.purdue.edu

Dave


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

Date: 12 Nov 1997 03:03:23 GMT
From: "David" <mysun@mbox2.singnet.com.sg>
Subject: File name problem when using PERL to send binary files over CGI
Message-Id: <01bcef17$73e36560$511e09a8@weixiao>

Hi , everyone,

I want to use a perl script to send different kinds of files, such as
*.exe,*.txt,*.doc etc, to a browser and this browser can open or save it.
The following is my perl scripts:

Send.pl

Print <<EOF;
Content-Type: application/x-unknown
Content-Tranfer-Encoding: binary

EOF

#Open the file to be downloaded
open DOWNFILE,$File_Name;		# $File_Name may be aa.exe,bb.doc,cc.txt etc.

#Set input file Pipe to binary mode
binmode DOWNFILE;

#Set STDOUT to binary mode
binmode STDOUT;

#Read input file & sen to STDOUT

while (<STDOUT>){
print $_;
}
close(DOWNFILE);

But when I use a browser to access this script, the browser asks me to save
file as script name Send.???,not actual file name(aa.exe, bb.doc or
cc.txt).

Any help and comment will be appreciated.

Thank.



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

Date: 12 Nov 1997 03:27:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help Perl Banner not working...
Message-Id: <64b7nl$609$2@comdyn.comdyn.com.au>

In article <346873F4.42DFD210@cyberservices.com>,
	Nathan Stanford <nathan@cyberservices.com> writes:

> My HTML FILE
 
[HTML stuff snipped]

Always use:

#!perl -w

use strict;

> My Perl file

I suppose the question, even though you didn't mention one at all, and
you didn't mention any error messages, is that your script doesn't
work, and why not?

> @files=
> ( "c://webshare//scripts//testing//r1.gif",
>   "c://webshare//scripts//testing//r2.gif",
>   "c://webshare//scripts//testing//r3.gif");

either use c:\\webshare\\foo\\bar, or even better, use c:/webshare/foo/bar

> open(LOGO,"$file");

ALWAYS, ALWAYS, ALWAYS check the return value of an open() statement.

open(LOGO, $file) or die "Couldn't open file: $!";

Please, spend some time reading the FAQ and documentaion to find out
why you had to ask this question here, while you could have known
instantly what went wrong. In your case that also includes the win32
FAQ.

http://www.perl.com/faq/index.html


Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Wed, 12 Nov 1997 13:47:10 +1100
From: M VAN OOSTERHOUT <v3100411@student.anu.edu.au>
Subject: Re: Help with UDP
Message-Id: <346918AE.3110@student.anu.edu.au>

Eric Hollander wrote:
> 
> I want to do something which should be very simple: have a program which
> listens to a UDP socket, and have another which sends, so I can pass
> messages back and forth.  I know this can be done in perl, but the only
> documentation is a cryptic example program, which I can't get to do what I
> want.  It calls functions (such as select and sockaddr_in) which has
> incomplete or non-existant documentation.  What should I do?  Has anyone
> gotten this to work?

Yup. IO::Socket::INET supports UDP. If I rememeber correctly, it works
a bit like:  

--------
$sock = new IO::Socket::INET('Proto'      => 'udp',
                             'PeerAddr'   => 'othercomputer',
                             'PeerPort'   => otherport);

$sock || die "Couldn't open sock ($!)\n";
print "Connect\n";

print $sock "Message to other computer";

while(<$sock>)
{ print $_; }
---------
The particular PERL module has some help stuff in it. There's a man page
somewhere too, I think.

Hope this helps.

Martijn
Australia


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

Date: 12 Nov 1997 03:04:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HTML FORM POST to DBASE
Message-Id: <64b6b3$5po$4@comdyn.comdyn.com.au>

In article <3468A18B.41C6@pubgroup.com>,
	"Kelvin D. Olson" <kelvin@pubgroup.com> writes:

[lots of stuff deleted]

My, you're verbose. I almost closed this message, because I couldn't
find a question.

> At that point, I don't care if it e-mails it to me, writes it to a file
> on the webserver, or shoots it to the moon. I just need to get the data
> into a format that's actually useful for MSAccess, or for that matter,
> any other freakin' database program that accepts STANDARD entries.

use CGI.pm to rip the QUERY string apart, then reformat it any way you
want. it's included with perl 5.004xx

> One other option, that would work almost as well, would be if the
> e-mailed pile-o-junk (that I can easily extract into an ASCII file that
> includes ONLY the lines-o-junk) could be perl-translated into the normal
> characters. I guess the only issue is to be sure that there are no

Urldecoding. CGI.pm will do that for you.

> fields missing. For instance, if a customer doesn't request envelopes, I
> need to have "" for that entry, rather than skipping it entirely.

Business logic about what to do with empty fields is your problem. Not
a module's

> We will pay actual money to get this resolved!

Pay money to Lincoln Stein, he wrote CGI.pm. It will do what you want,
minus the actual reformatting. But that's trivial.

Martien

-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au    | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: 12 Nov 1997 03:19:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: installing CGI.pm
Message-Id: <64b77e$609$1@comdyn.comdyn.com.au>

In article <34688977.11B387D9@simlab.net>,
	Bryan Murtha <bryan@simlab.net> writes:
> Hello,
>     I am trying to install the CGI-modules-2.75.tar.gz CGI library by

2.75 ? Isn't the current version 2.36, and the beta 2.37? At least, on
CPAN they are.

And on Lincoln Stein's site they also seem to be the latest.

Odd. I wonder where you got that module, and what sort of
modifications it has been through..

Besides.. If you have perl5.004 (I do hope you do), it should already
be installed.

> Licoln Stein. I was wondering if anyone could answer why my programs are
> not compiling? I have unpacked the library in the same directory as Perl
> 5, and yet it still gives me an error whenever I try to compile my
> program telling me that it can't find this library. I'm on a Sun 5.51

You did read the documentation on how to install modules? For
example

perldoc perlfaq8
How do I install a CPAN module?

All CPAN modules should install the same way, as described in the faq
mentioned above.

Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 12 Nov 1997 02:48:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Killing a child process
Message-Id: <64b5ea$5po$1@comdyn.comdyn.com.au>

In article <19971111051500.AAA20822@ladder02.news.aol.com>,
	sibertanri@aol.com (SiberTanrI) writes:
> A Perl script makes a system call to invoke another
> tool. While this child is running, the user tries to stop
> the execution of the Perl script using ^c. How do we kill
> the child process, too, since ^c is only detected by the
> parent?

I actually haven't done this, but you might use the %SIG variables for
that. Keep a list of children, and on a SIGQUIT, SIGINT, SIGSTOP do
something with the children (like kill them).

perldoc perlvar
/%SIG
/

Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: 12 Nov 1997 02:27:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Need to speed up s/ / /;
Message-Id: <64b47b$5im$2@comdyn.comdyn.com.au>

In article <35743.4307118056luutrangeocitiescom@207.217.241.29>,
	"Luu Tran" <luutran@geocities.com> writes:
> Hi,
> 
> I have for input html-formatted text (as one long string).  I need to 
> prepare it to be included in another html file.  I need to strip comments, 
> <html><head><body> tags, and forms.

You might want to have a look at HTML::Parser as well.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: 12 Nov 1997 01:46:41 GMT
From: "Warren Smith" <warren5@earthling.net>
Subject: Newbie Question
Message-Id: <01bcef71$adb82280$2d4678c7@warrensm>

I am creating a script for the net on a foreign server. I don't know the
physical path of my directory. How do I get the actual path of the script I
am running?



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

Date: 12 Nov 1997 03:51:51 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Passing a %hash via Shared mem. ??
Message-Id: <64b94n$nmo$1@daily.bbnplanet.com>

Dharmen Sanghvi (dharmen@netcom.com) wrote:
: Hi, 

: 	Any Ideas as to how to pass a %hash via shared mem 
: 	from a child to a parent ?? 

If it's a simple hash containing text and not references, and you don't
mind using a file you can do this using a tie'd array. man perltie for 
specifics.


Jason Gloudon


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

Date: 11 Nov 1997 22:34:36 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: Passing Variables
Message-Id: <lq1affaokdv.fsf@bmers2e5.nortel.ca>

Dale Chavez <dchavez@horizonint.com> writes:
> Mark Mielke wrote:
> > Using normal HTML, the proper way to communicate data across "forms" is
> > via the: <input type=hidden name=Stuff value="Some Stuff"> tag. You would
> > read the "Stuff" field through your CGI the same way you might read any
> > other input field. This is now more a CGI question than a perl question.
> I use hidden fields for passing variables when I'm using Javascript, but I
> don't follow the logic here. Would the:
>     <input type=hidden name=stuff value=stuff>
> tag go in the original HTML document *and* the HTML document I'm creating
> dynamically?  How does the variable get passed to multiple forms?

One has to remember that in the world of HTTP, and therefore CGI, "state"
is not maintained between invocations. If you want to maintain this "state"
you have to pass yourself the data either through the url <form action=...>
or through the more generic use of <input type=hidden name=... value=...>

Say you have a shopping cart CGI... here's the normal "way of things":
   1. User tells netscape to "goto url http://www.dvp.com/shoppingcart.cgi"
   2. User selects "add this CD to the shopping cart"... shopping cart updates.
   3. User selects "add this tape to the shopping cart"... shopping cart upd's.
   4. User selects "buy the damn stuff"... screen comes up with request for
      more info... (credit card number? etc)
   5. User selects ok... receives page "You should receive the items request
      within the next 9 months... This transaction will show up on your visa
      card as "Domestic Violence Products".

Guess what? Unless you got some cool java code to do all that using a single
connection to the "shopping cart server", you've just issued 5 separate
transactions... As HTTP (and therefore CGI) is based under a transaction model,
the CGI has no way of automatically keeping track of the shopping cart
content. In this case what is usually done is that a session id is assigned
at the time of #1. This session id can be passed via a <input type=hidden>
field, or simply included in the CGI path:

    http://www.dvp.com/shoppingcart.cgi/123456

It doesn't really matter. The only important thing is that, upon CGI
invocation, the cgi must be able to figure out which session you belong too so
it knows what's in your shopping cart. (this data is normally kept in
a temporary request database indexed initially by session id)

I don't think i've been very clear... i'm kinda tired right now...
Hope this makes sense... If your next possible CGI invocation requires
information only known to the current one... you MUST pass it via one of
several methods. (in the URL, in a hidden field, etc...)

> 'Scuse me for being dense.

excused?  (What am i supposed to say? :-) )

hoping this is helping...
mark

--                                                  _________________________
 .  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Northern Telecom Ltd. |
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | Box 3511, Station 'C' |
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, ON    K1Y 4H7 |
  markm@nortel.ca  /  al278@freenet.carleton.ca     |_______________________|


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

Date: 11 Nov 1997 23:59:17 GMT
From: Zenin <zenin@best.com>
Subject: Re: Perl->Java? Java->Perl? Gaaaaa!
Message-Id: <879293092.345652@thrush.omix.com>

lvirden@cas.org wrote:
: Actually, setting aside the seemingly popular Java bashing sledgehammer
: for a moment, I don't find Java any more of this "Write once, debug everywhere"
: paradigm than any other language.  It's been that way for folk trying
: to write portable C, C++, Tcl, Perl, Python, etc. for years.

	Funny, I've written _vary_ little Perl that didn't run perfect right
	out of the box on funky systems. -eg, Microsoft beasts.  This includes
	GUI Tk code.  But then, I can't remember the last time I used system(),
	qx(), and et al. :)

: The primary reason Java gets bashed isn't that it isn't portable but that
: it's the most recent language to claim that it is portable. Shrug.

	That, and it's being far over-hyped.  Java is by no stretch of the
	imagination the end-all, be-all programming language, and never will
	be.  It will also be _years_ before it's anything even _remotely_
	portable. -eg, Will actually work out of the box on anything other
	then NT/95/Solaris.  But then, that _is_ cross-platform to most. :-)

-- 
-Zenin (zenin@best.com)
 The Bawdy Caste (San Jose, CA)       http://www.netmagic.net/~dmcgrath/bawdy/
 Barely Legal   (Berzerkly, CA)                    http://www.barelylegal.org/
 Zenin's Rocky Archive (Moving soon!)              http://www.best.com/~zenin/


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

Date: Tue, 11 Nov 1997 21:47:24 -0500
From: David Corcoran <corcordt@cs.purdue.edu>
Subject: Split Screen Telnet
Message-Id: <346918BC.1D9C@cs.purdue.edu>

Does anyone know how to split a telnet screen in Perl ????


Thanks
corcordt@cs.purdue.edu

Dave


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

Date: 11 Nov 1997 16:37:37 -0800
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <64atoh$s3j$1@lennon.postino.com>

Greg Bacon (gbacon@cs.uah.edu) wrote:
: Following is a summary of articles spanning a 7 day period,
: beginning at 01 Nov 1997 13:18:11 GMT and ending at
: 08 Nov 1997 19:31:46 GMT.
: Top 10 Posters by Number of Posts
: Top 10 Posters by Volume
: Top 10 Posters by OCR (minimum of five posts)
: Bottom 10 Posters by OCR (minimum of five posts)
: Top 10 Threads by Number of Posts
: Top 10 Threads by Volume
: Top 10 Targets for Crossposts
: Top 10 Crossposters

Would it be possible to get the Top 10 Posters of RTFM posts?
I swear, close to 50% of the posts are such a beast. Couldn't
they just be sent as e-mail?

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I wak'd, she fled, and day brought back my night. jm


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

Date: 12 Nov 1997 02:56:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: VERY STRANGE: Simple perl script to display a PDF document
Message-Id: <64b5t8$5po$2@comdyn.comdyn.com.au>

In article <879255690.19978@dejanews.com>,
	nkaiser@reisys.com writes:

> I have a simple program which display's a PDF document.

No, it doesn't. It sends data to standard output. In this case I
suppose it's a CGI binary, and you send data to a browser.

>     print "Content-type: application/pdf\n\n";

Not all browsers might understand the application/pdf MIME type. Hell,
not even all browsers handle any MIME type correctly.

> print "Content-type: text/html\n\n";
> print "<FORM METHOD=POST ACTION=/cgi-bin/sbir/read.cgi><INPUT TYPE=SUBMIT
> NAME=PDF VALUE=PDF>\n\n";

This isn't actually valid HTML. Where is the <HTML></HTML> block? What
about a <HEAD></HEAD> and <BODY></BODY>? Not all browsers will be
forgiving enough to do anything sensible with this.

Come to think of it.. What does this have to do with perl?

> Please email to nkaiser@reisys.com directly.

Don't think so. Post here, read here.

> Thanks.

sure.

Martien

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: 11 Nov 1997 18:23:38 -0600
From: psamuels@sampo.creighton.edu (Peter Samuelson)
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <64asua$e7k$1@sampo.creighton.edu>

[M. Mustun <mustun@active.ch>]
> <HTML>
> <TT>Hello!</TT><TT></TT>

Hello.  Please set your "newsreader" to use plain text.  I do not like
having to read things like

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M. Mustun
> &nbsp;&nbsp;&nbsp;&nbsp; <A HREF="mailto:mustun@active.ch">mailto:mustun@active.ch</A>
> &nbsp; <A HREF="http://www2.active.ch/~mustun">http://www2.active.ch/~mustun</A></PRE>

-- 
Peter Samuelson
<psamuels at sampo.creighton.edu>


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

Date: 12 Nov 1997 02:58:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <64b60n$5po$3@comdyn.comdyn.com.au>

In article <34681F01.5E352E11@active.ch>,
	"M. Mustun" <mustun@active.ch> writes:
> <HTML>
> <TT>Hello!</TT><TT></TT>

Please configure your news reader to send something that we can read,
especially if you want answers. HTML is not supported by most of the
newsreaders out here.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd.       | excuse - Lazarus Long
NSW, Australia                      | 


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V8 Issue 1304
**************************************

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