[7677] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1303 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 11 19:16:45 1997

Date: Tue, 11 Nov 97 16:00:26 -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: 1303

Today's topics:
     Re: "perl aware" vi editor? <lyonsj@bgnet.bgsu.edu>
     Re: Alternatives to CGI.pm (was Re: Continuations in pe <ajh@rtk.com>
     Re: beginner <camerond@mail.uca.edu>
     Can you check for existence of a Window <rtremble@ctissrv1.plt.ford.com>
     CGI Script Permission Problems <brad.bradley@bridge.bellsouth.com>
     COMPILED PERL CODE???POSSIBLE? (Hafeezhussein Hatimabana )
     Concurrent writes to one named pipe <sherlock.holmes@worldnet.att.net>
     Re: CPAN confusion <abeam@holly.ColoState.EDU>
     Re: CPAN confusion <jhi@alpha.hut.fi>
     creating file <crew@gladstone.uoregon.edu>
     Re: creating file <tycage@infi.net>
     Endless loop during "make depend" (Jason van Zyl)
     Re: how do I get a binary representation of a number in <brad.bradley@bridge.bellsouth.com>
     Re: HTML FORM POST to DBASE (Toutatis)
     Re: Installing modules? (Steffen Beyer)
     Re: little endin (Mike Stok)
     Re: little endin (Andrew M. Langmead)
     Re: odd difference between C and Perl (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     open2 question (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman)
     Re: Passing Variables <dchavez@horizonint.com>
     Re: Passing variables (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman)
     Perl 5.04.01 on AIX 4.21 <gabriel.zavala@cpa.state.tx.us>
     Problem building perl on IRIX6.2 <hanan@tx.technion.ac.il>
     Re: Question::Socket Handles as Variables. <mark@tstonramp.com>
     type casting (David Siebert)
     Re: type casting (Mike Stok)
     Re: Will pay $$ for FORM-to-DBASE perl script <justinb@ebony.cray.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 11 Nov 1997 14:51:51 -0500
From: Jen Lyons <lyonsj@bgnet.bgsu.edu>
Subject: Re: "perl aware" vi editor?
Message-Id: <Pine.SGI.3.95.971111145130.25595A-100000@sigma.bgsu.edu>

What do you mean?  You might try VIM....  

Jen

On Mon, 10 Nov 1997, it was written:

> Does anyone know what a "perl aware" vi editor is?
> Thanks.
> 
> 

*********************************************************************
"The impossible often has a kind of integrity to it which the merely
 improbable lacks."
				--Douglas Adams
*********************************************************************



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

Date: Tue, 11 Nov 1997 11:06:05 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: Alternatives to CGI.pm (was Re: Continuations in perl?)
Message-Id: <64aa7b$ge5$1@brokaw.wa.com>

Rahul Dhesi wrote in message <649ib9$3g3$1@samba.rahul.net>...
>The real choice is between server-is-stateless and server-is-stateful.
>This choice determines the style of cgi programming.

Agreed, although I think that 'server-is-stateful' could mean either
'server-keeps-program-position' or
'server-keeps-variables-between-invocations', which are also programmed in
wildly different styles.

>In an environment where most clients will be anonymous, it could get
>quite expensive to keep much state, never knowing when if ever a client
>will send back a reply.  If you send output to 100,000 clients, and
>90,000 of them never respond, how long do you keep the state information
>before timing it out?

I agree is this is tricky.  How about a scheme with these processes:

1. "Session" processes.  These stay around for the duration of a user's
session.  There exists one of these for each active user session.

2. "Broker" process.  This forwards requests from CGI scripts to the Session
processes, or creates a new Session as appropriate.  There is only one of
these.
This process is also responsible for killing unused Sessions.  It would
probably have a maximum process count (perhaps 10,000), and a LRU list to
use when the process count approaches the limit.

3. CGI scripts.  These do nothing but forward their requests to the Broker
along with a session ID from a hidden field, cookie, or whatever.

This definitely could have some problems with too much server state, but it
seems like the other stateful solutions have the same problem (though not to
this degree).

It seems like this solution wouldn't scale up to a Yahoo-sized site. The
machines I use have 16bit PIDs, so there's a limit right there (which is why
I was looking at continuations).  But I doubt a small-to-medium sized site
would have, say, 5,000 active sessions.

I also think that scripts programmed this way would be useful only for
certain pages on a site.  The home page, and the 'About our site' page would
probably be traditional HTML -- only users that actually want to place an
order create any state on the server.  In this case, I think it's entirely
possible that the active script count would stay in triple-digits on a
medium sized site, and that most of the users of the script would actually
run it to completion.

In any case, I think that most of these limits can be overcome.  It just
occured to me that I could store multiple Session processes in a
multi-threaded C program that has one PerlInterpreter variable per thread
(or is that not yet safe?).  And I suspect you'd see a performance boost for
applications that are storing any sort of complex state between invocations
(database handles, file descriptors, etc).


>Also, maintaining a very large number of active TCP/IP connections might
>require the ability to keep TCP/IP connection information in pageable
>memory.  This sounds tricky.

I'm not sure what you mean here.  Probably not connections to the browser,
since those disappear after each HTTP request.

Do you mean connections between the Session and Broker processes?  I hadn't
thought about that limit.  I suppose you could use a FIFO instead of a
socket.

>--
>Rahul Dhesi <dhesi@spams.r.us.com>

Thanks for the response.  This is really helping me flesh out the design.




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

Date: Tue, 11 Nov 1997 14:18:33 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: beginner
Message-Id: <3468BD99.9DD68DBD@mail.uca.edu>

LE CORRE wrote:
> 
> Help ! I don't know how to use perl in spite of faq and readme files.
> I'm
> just a beginner and I don't speak fluently english !! I've downloaded
> and
> uncompressed Perl 5.004_04 in a Perl directory (running under win 95)
> but I
> don't know how to run my " firstscript.pl " written with a simple text
> editor. Thanks.
> lecorre@hotmail.com

Have I missed something here? The most recent version I've seen
(compiled binaries, anyway) was GS's 5.00402. However,...

go to http://hjs.geol.uib.no/Perl/index6.html-ssi and follow directions.
It's the best short guide to getting set up I've seen.

Cameron Dorey
camerond@mail.uca.edu


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

Date: Tue, 11 Nov 1997 16:27:59 -0500
From: "Robert J. Trembley" <rtremble@ctissrv1.plt.ford.com>
Subject: Can you check for existence of a Window
Message-Id: <3468CDDE.56B3@ctissrv1.plt.ford.com>

Using Perl for Win32, is there a way to query if a window is visible,
based on either its title or text in its client area?  

=======================================
Robert J. Trembley

Standard Disclaimers Apply:

-----------------------------------------
This is a business email account.
Unsolicited email (SPAM) is unwelcome and will NOT be tolerated.


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

Date: Tue, 11 Nov 1997 13:24:29 -0600
From: Brad Bradley <brad.bradley@bridge.bellsouth.com>
Subject: CGI Script Permission Problems
Message-Id: <3468B0ED.F9A62C5A@bridge.bellsouth.com>

I have an HTTP File Upload program that runs with webserver permissions.
(very low, for security purposes.) I need it to access different
directories on the shared server with much higher permissions. One of
the suggestions I have run across is to write a C wrapper to executes
the perl script. I understand that the script is then executed with the
wrapper permissions. I am looking for a good starting point to research
this idea or some other suggestions on how to make the program run at
higher permissions without jeopardizing the security of the webserver.

Thanks,
Brad Bradley



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

Date: 11 Nov 1997 22:47:26 GMT
From: exalter@yallara.cs.rmit.edu.au (Hafeezhussein Hatimabana )
Subject: COMPILED PERL CODE???POSSIBLE?
Message-Id: <64an9u$298$1@goanna.cs.rmit.edu.au>


Hi everyone,
Is is possible it write perl scripts scuh that your code is not visible?e.g for instance,the perl interpreter compiles the code before it is interpreted..sort of a temporary compiltion..but this state is not preserved.Is there a way around it such that code remains unseen?

I would also like to know where the FAOS for this news group and anyother perl rnews groups are kept,

Thanks in advance,
Yours Sincerely,
hafeez



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

Date: Tue, 11 Nov 1997 18:26:37 -0500
From: "Alan Fahrner" <sherlock.holmes@worldnet.att.net>
Subject: Concurrent writes to one named pipe
Message-Id: <64aps9$t7g@bgtnsc03.worldnet.att.net>

Hi again folks...

I have just recently started using named pipes.  What I would like to do is
a have a single named pipe with one perl process waiting to read on it.
However, I need to deal with the possibility that multiple processes might
want to write to it at the same time.

Originally, I used a modified version of what's found in the O'Reilly book,
where you loop through an open, read to end, and close -- but I found that
if two processes wrote at the same exact time, the first one one.  If I ran
multiple copies, it worked fine (as long as at a given time the number of
processes writing didn't exceed the number of processes reading.

So, I tried to use the select function (not the one for selecting a
filehandle) with sysread to open, wait for input, fork of a child to take
care of the input, close, and go through the process again (and again...).

However, even though a child is taking care of a processes write, the select
is still saying there is data to deal with, so I'm spawning multiple
children for one processes write.

Below is the "unclean" test code I'm writing.  Any suggestions.

Thanks ahead of time!

Alan
alan@protix.com

#!/usr/local/bin/perl
# function to take care of problematic children...attach to $SIG{CHLD}
# Should take care of zombies...
sub REAPER {
    $SIG{CHLD} = \&REAPER;  # problem with sys 5
    my $tkchildpid = wait;
    }
$SIG{CHLD} = \&REAPER;
unless (-p "fifotest") {
    unlink "fifotest";
    die "mkfifo failed" if system("mkfifo","fifotest");
    }
$eof = 1;
while (1) {
    open(FIFO, "fifotest") or die "Can't open FIFO fifotest";
    $rin = '';
    $fileno = fileno(FIFO);
    vec($rin, fileno(FIFO), 1) = 1;

    #$nfound = select($rout=$rin,undef,undef,undef);
    $nfound = select($rin,undef,undef,undef);
    if ($nfound) {
        print STDERR "GOT HERE:$fileno:$eof:$nfound!!!\n";
        }
    else {
        print STDERR "GOT HERE TOO:$fileno:$eof:$nfound!!!\n";
        }
    $pid = fork;
    exit 0 if !defined($pid);
    if ($pid) { # parent
        ++$eof;
        close(FIFO);
        sleep 1;
        next;
        }
    while(($bytes_read = sysread(FIFO,$buffer,1024)) > 0) {
        print STDERR "Bytes read $eof:$fileno:$bytes_read\n";
        sleep 1;
        }
    close(FIFO);
    last;
    }










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

Date: 11 Nov 1997 12:47:07 -0700
From: Andrea Beam <abeam@holly.ColoState.EDU>
Subject: Re: CPAN confusion
Message-Id: <64acnr$7q42@holly.ColoState.EDU>

Martien Verbruggen <mgjv@comdyn.com.au> wrote:
: In article <waan2jkyss9.fsf@am.ucsc.edu>,
: 	hermit@cats.ucsc.edu (William R. Ward) writes:

: > Maybe I'm just missing something here, but I find CPAN to be a total
: > pain in the ass to browse.  If I access the module list I am unable to

: No one is forcing you to use CPAN. You could always just write all the
: modules yourself.

He didn't complain about the quality of the modules.  He complained
about the layout of CPAN.  How would writing all the modules himself
solve that?


: > Who maintains the CPAN web interface that I see mirrored all over the
: > place and how can I get him/her to change this?

: If you are going to request a change, I would suggest that you change
: your tone of voice a bit. I for one (and obviously others) found it at
: least slightly on the offensive side.

Wow.  If something is a pain in the ass why beat around the bush?  Why
don't you spare us all the parenting bit, and come back when you've grown a
thicker skin.


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

Date: 11 Nov 1997 23:03:16 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
To: hermit@cats.ucsc.edu
Subject: Re: CPAN confusion
Message-Id: <oeeu3djqh2j.fsf@alpha.hut.fi>


In article <waan2jkyss9.fsf@am.UCSC.EDU>, hermit@cats.ucsc.edu (William R. Ward) wrote:

>Who maintains the CPAN

I am the CPAN Master Librarian.

>Maybe I'm just missing something here, but I find CPAN to be a total
>pain in the ass to browse.  If I access the module list I am unable to
>find any documentation or detaile descriptions of the modules.  It
>seems to me that the package name should be a hyperlink to that
>package's manpage.  If I go to the author's page I can usually find
>the docs I'm looking for but it's awkward to do it that way.

If you had read the CPAN/CPAN.html you would have found two great CPAN
modules search engines:

http://ls6-www.informatik.uni-dortmund.de/CPAN.html
http://theory.uwinnipeg.ca/search/cpan-search.html

>Who maintains the CPAN web interface that I see mirrored all over the
>place and how can I get him/her to change this?

What do you mean by this?  There is no 'CPAN web interface'.  There
are a few top level HTML files in CPAN and some of the CPAN sites
offer a http interface to CPAN.  If you were more specific in
what you have tried people could guide you more.

CPAN was never meant to be a 'Web interface'.  It was started just
barely before the great Web boom.  CPAN offers the content: it is for
others to build the interfaces.

CPAN is maintained by a handful of volunteers: for its price, CPAN
has been known as hard to beat.

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Tue, 11 Nov 1997 11:42:05 -0800
From: Steven Paul Adelman <crew@gladstone.uoregon.edu>
Subject: creating file
Message-Id: <Pine.GSO.3.96.971111114105.13324B-100000@gladstone.uoregon.edu>


Is there a better way to create a file from a CGI script using PERL than 

system('echo >/foo/bar');

thankyou 

SPA




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

Date: Tue, 11 Nov 1997 16:45:10 -0500
From: Ty Cage Warren <tycage@infi.net>
Subject: Re: creating file
Message-Id: <3468D1E6.6AB98B0C@infi.net>

Steven Paul Adelman wrote:
> 
> Is there a better way to create a file from a CGI script using PERL than
> 
> system('echo >/foo/bar');
> 
> thankyou
> 
> SPA

I usually just

open(FILE,'>/foo/bar') or die "Didn't create /foo/bar: $!";
close(FILE);

Hope this helps,
   Ty
+---+
Ty Cage Warren                                           tycage@infi.net
Systems Engineer                                                 InfiNet
The Web Site of Love: http://tazer.engrs.infi.net/mst3k/
PGP Public Key: http://tazer.engrs.infi.net/~tycage/pgpkey.html
PGP Fingerprint: FF C1 28 CA 80 B5 31 78  B1 24 2E 8C AB DA FB D2
------------->Never invoke anything bigger than your head.<-------------


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

Date: 11 Nov 1997 18:40:00 GMT
From: jason@bolt.boltmedia.com (Jason van Zyl)
Subject: Endless loop during "make depend"
Message-Id: <slrn66h9k8.gd2.jason@bolt.bookshelf.ca>
Keywords: endless loop

I just put together a new P200/MMX box running Slackware Linux/2.0.29
and I'm having the weirdest problem with perl 5.003_004.

It seems to configure itself properly but when Configure runs "make depend"
it gets stuck in an endless loop. I went for dinner, came back an hour later
and it was still running.

I then tried to build perl on a box identical to it except for the processor
and perl built itself in about 15 minutes.

It would certainly seem weird if it was the processor? Is it too fast? Is
there stuff going on in the backround during make? I don't know myself, I
looked at the makefiles and said "not a chance", I can't tell what's going on.

If anyone has any ideas I would be greatful.


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

Date: Tue, 11 Nov 1997 17:03:52 -0600
From: Brad Bradley <brad.bradley@bridge.bellsouth.com>
Subject: Re: how do I get a binary representation of a number in a string
Message-Id: <3468E457.858B3597@bridge.bellsouth.com>

> Here's what I want to have,
>
>   $i = "12";   # or any number 0-15.
>   $tmp = somefunc($i);
>   print "$i in binary is $tmp\n";
>
> Then get for output:
>   1100
>
> (if $i = 3, it would return 0011, etc.)
>
> So the question is, how can I implement 'somefunc'?
>
> I've tried doing stuff w/ unpack, but that doesn't seem to be what I
> want.

Tom,

It looks like a recursive divide procedure would be the answer to your
question.

sub foo
{
   local($some_num) = @_;
   return 1 if $some_num < 2;
   # Push the remainder onto an array
   push(@bar, &foo($some_num / 2));
}

This should give you something to start with. I pulled it off the top of my
head, so it may take a tweak or two, but its fairly quick and elegant.

Sincerely,
Brad
----------------------------------------------------
This is a business address.
Unsolicitied e-mail (SPAM) will NOT be tolerated!
----------------------------------------------------



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

Date: 11 Nov 1997 23:50:53 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: HTML FORM POST to DBASE
Message-Id: <toutatis-ya023180001211970050570001@news.euro.net>

Kelvin D. Olson <kelvin@pubgroup.com> wrote:

[pile-o-junk cut]
> We will pay actual money to get this resolved!
> KDO
> -- 
> ==============================================================
> Kelvin D. Olson                     Director of Media Services
> kelvin@pubgroup.com                       The Publishing Group
> (612) 522-1200 x302                            Minneapolis, MN

Are people actually paying *you* to spam this newsgroup with your clueless
waffle?

-- 
Toutatis


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

Date: 11 Nov 1997 18:53:39 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Installing modules?
Message-Id: <64a9jj$4hp$1@en1.engelschall.com>

Erik Y. Adams <erik@earthlink.net> wrote:

> So, I've downloaded a module from my nearest CPAN mirror.  I've done "perl
> Makefile.PL" and "make".  Now I've got a bazillion files sitting around,
> and I'm not sure which ones to move into the @INC directories.

> I realize this is probably different for each module, but are there
> step-by-step instructions on how to do this?

RTFM: In this case, the module's README file.

Or the Perl documentation.

The standard procedure is:

% perl Makefile.PL
% make
% make test                # optional
% make install

"make install" automagically does everything that is necessary.

Yours,
-- 
    Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
     "There is enough for the need of everyone in this world,
      but not for the greed of everyone." - Mahatma Gandhi
   >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: 11 Nov 1997 19:26:38 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: little endin
Message-Id: <64abhe$lm2@news-central.tiac.net>

In article <64a8kq$k8c$1@news.gate.net>,
David Siebert <dsiebert@gate.net> wrote:
>I need to write a binary 16bit value to a file in little endin format any 
>suggestions

The perlfunc man page describes pack which says v packs 'A short in "VAX"
(little-endian) order' so you can say

  $value = 12345;
  $packed = pack 'v', $value

which leaves $packed containing 2 bytes which happen to be printable (in
ASCII, characters 57 and 48 are 9 and 0, and 57 + 48 * 256 is 12345)

One way to write the data is to use syserite which is also documented in
the perlfunc man page.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 11 Nov 1997 20:52:04 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: little endin
Message-Id: <EJI1ys.853@world.std.com>

dsiebert@gate.net (David Siebert) writes:

>I need to write a binary 16bit value to a file in little endin format any 
>suggestions

Take a look at the pack() function in the perlfunc man page. The 'v'
template characters converts a perl scalar into a bit pattern that
matches a sixteen bit little endian number.


     print FILEHANDLE pack 'v', $number;
-- 
Andrew Langmead


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

Date: Tue, 11 Nov 97 10:36:20 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: odd difference between C and Perl
Message-Id: <34687cf9$4$ofn$mr2ice@speaker>

In <34682A19.3A74@mukh.asc.ox.ac.uk>, on 11/11/97 at 09:49 AM,
   John Davis <jd@mukh.asc.ox.ac.uk> said:
+-----
| the C code 
| 	x = (Hy * 0.970224) + 622.540000;
| produces 1948.836182 (x is declared as a float)
| whereas the Perl code
| 	 $x = ($Hy * 0.970224) + 622.540000;
| produces 1948.836208
+--->8

A C (float) usually only handles 7 significant digits (it's machine-dependent,
hence the "usually"); Perl uses C (double)s, which usually handle 15
significant digits.  So the C code, using (float) variables, actually produces
1948.836(mumble) for some (mumble) which is dependent on how the processor's
FPU (or emulation thereof) is implemented and/or how the C compiler and/or
support library use it.

I have rarely found a reasonable use for C (float)s, except to save memory
when manipulating large arrays of floating-point numbers which don't need high
precision... and even then, I usually use (double) instead because I never
know when the specs might change and the extra precision will be required.

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
"Never piss off a bard, for they are not at all subtle and your name scans to
 `Greensleeves'."  ---unknown, quoted by Janet D. Miles in alt.callahans



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

Date: 11 Nov 1997 20:43:04 GMT
From: thartman@nospam.dontuse.this_email_addr (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman)
Subject: open2 question
Message-Id: <64ag0o$g5k$1@ausnews.austin.ibm.com>


I'm trying to use open2 to send commands to an executable and capture
its output (the exe's name is dcecp).

Here's a very simple example:

<code snippet>
#!/usr/contrib/bin/perl -w

use FileHandle;
use IPC::Open2;

$pid = open2(\*dcecp_result, \*dcecp_cmd, "/opt/dcelocal/bin/dcecp");
dcecp_cmd->autoflush(1);

print dcecp_cmd "principal show cell_admin\n";

while (<dcecp_result>) {
    print;
}
</code snippet>


Now, I've read the docs concerning IPC and buffering.  When I run a
command like this:

   cat | dcecp

every line I type gets a response to stdout.  Should I take it to mean
that this executable does not have the buffering problem discussed in
the previously mentioned caveat?  Or am I doing something wrong?

I know I can send I/O to a file and get at it from there, but starting
and stopping the executable every time can be costly and I'm trying to
speed this thing up.

Whenever I run this script, it hangs at the while condition.
Does anybody have any suggestions?

I'm running:
  This is perl, version 5.003 with EMBED
          built under aix at Aug 27 1996 15:12:12
          + suidperl security patch

on an old RS/6000, AIX 4.1.5.0

--
Todd Hartman           thartman@austin.iNOSPAMbm.com      (512)838-8789
The opinions which may or may not be explicitly implied in this document
are completely my own and are not necessarily those of my employer.
(remove NOSPAM from e-mail address to mail)


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

Date: Tue, 11 Nov 1997 12:33:52 -0700
From: Dale Chavez <dchavez@horizonint.com>
To: Mark Mielke <markm@nortel.ca>
Subject: Re: Passing Variables
Message-Id: <3468B31F.F5D83BD1@horizonint.com>

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.

Mark,

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?

'Scuse me for being dense.

Dale



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

Date: 11 Nov 1997 20:57:02 GMT
From: thartman@nospam.dontuse.this_email_addr (Todd "Waxahachiefortudinouslyexportitionismistically" Hartman)
Subject: Re: Passing variables
Message-Id: <64agqu$g5k$2@ausnews.austin.ibm.com>

Doug (dougw@dbis.ns.ca) wrote:
: I am designing an html form which asks for data from the user. I will then
: e-mail the results to my address. However, before I e-mail the data I want
: to give the user another page to 'confirm' they want to mail this
: infomation. I am using the cgi-lib.pl library and need to pass the
: variables from one cgi to another. Any ideas......

On the confirm page, you could put all the data in modifiable input objects,
like textfields, selection boxes or whatever they were in originally, or
you could pass them through
 <input type=hidden name="var1" value="var1_value">

(of course, this is HTML, I'm not all that familiar with the perl CGI
module, but I suspect it can be done through that easily enough--the
idea here is to use 'type=hidden' attribute to an input tag)

You can pass worlds of information like this to maintain state.  Be aware
that if you try to store something that you don't want the user to be able
to modify (like a password or some secret/confidential piece of data), this
isn't the safest way to go because anybody can write a URL to pass bogus
information back to your script regardless of whether or not such a set
of data could have been put in a page by your script.
Like most software that has to deal with a user:  expect the worst.


todd.

--
Todd Hartman           thartman@austin.iNOSPAMbm.com      (512)838-8789
The opinions which may or may not be explicitly implied in this document
are completely my own and are not necessarily those of my employer.
(remove NOSPAM from e-mail address to mail)


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

Date: Tue, 11 Nov 1997 12:55:24 -0600
From: "Gabriel Zavala" <gabriel.zavala@cpa.state.tx.us>
Subject: Perl 5.04.01 on AIX 4.21
Message-Id: <64a9ns$pm2$1@news.tdh.state.tx.us>

Has anyone successfully compiled Perl 5.04.01 on AIX 4.21 using xlc? When
compiling, I get the following error,

        Making DynaLoader (static)
Writing Makefile for DynaLoader
The Unsupported function umask function is unimplemented at
 ../../lib/ExtUtils/I
nstall.pm line 249.
make: 1254-004 The error code from the last command is 2.


Any ideas?




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

Date: Tue, 11 Nov 1997 23:05:26 +0200
From: Hanan Moller <hanan@tx.technion.ac.il>
Subject: Problem building perl on IRIX6.2
Message-Id: <3468C896.964@tx.technion.ac.il>

Hi,

 I am trying to build perl 5.001 on an SGI Power Challange running
IRIX6.2. No success :-(

 When I let the Configure script take all the default answers, I get
compilation errors (I can work around most with casting). 

 If anyone has a config.sh file for a similar setup (I guess it does not
have to be a power challange system), I'd be grateful if it can be sent
to me.

 Please reply by mail to:

   hanan@tx.technion.ac.il  

    or:

   moller@netvision.net.il

TIA,

   Hanan


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

Date: Mon, 10 Nov 1997 23:27:16 -0800
From: "Mark J. Schaal" <mark@tstonramp.com>
Subject: Re: Question::Socket Handles as Variables.
Message-Id: <346808D4.FE4@tstonramp.com>

David Corcoran wrote:
> 
> I'm using the following code
> 
> use IO::Handle
> .
> . Here i just initialized My_socket.
> .
> 
> $users = new IO::Handle;
> $remote = accept ($users,MY_SOCKET);
> 
> print $users "Hello\n";
> 
> This doesn't work and I would like to write a server which I can
> select the handle to print to.  Of course i would change $users
> to an array but I can't seem to print to the varible filehandle
> Any Suggestions ????
> Thanks
> Dave

Just use IO::Socket and print to the socket.  That should also
make the socket initialization easier.

mark


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

Date: 11 Nov 1997 19:47:05 GMT
From: dsiebert@gate.net (David Siebert)
Subject: type casting
Message-Id: <64acnp$1noq$1@news.gate.net>

I type case a variable to be a byte in perl?



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

Date: 11 Nov 1997 21:16:31 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: type casting
Message-Id: <64ahvf$14m@news-central.tiac.net>

In article <64acnp$1noq$1@news.gate.net>,
David Siebert <dsiebert@gate.net> wrote:

>I type case a variable to be a byte in perl?

Perl scalars are essentially untyped from the programmers point of view,
they automatically morph from string of bytes to double precision floating
point depending on the context they're used in (and there's a pragma which
lets you use integers rather than floating point.) 

So a scalar that's a character string one character long (assuming 1 char
== 1 byte) could be considered a byte.

pack/unpack or chr/ord are some of the ways to manipulate and examine
scalars containing bytes; they're documented in the perlfunc man page.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 11 Nov 1997 14:49:43 -0600
From: Justin Banks <justinb@ebony.cray.com>
Subject: Re: Will pay $$ for FORM-to-DBASE perl script
Message-Id: <o8n67pz88bc.fsf@ebony.cray.com>

"Kelvin D. Olson" <kelvin@pubgroup.com> writes:

> I want a perl script that will take an ASCII text file consisting of the
> HTML form data like:
> 
> sName=Kelvin+D.+Olson&salenum=54321&sAddr=7512+Aldrich+Ave.... etc.
> 
> and convert it to something like:
> 
> "Kelvin D. Olson","54321","7512 Aldrich Ave... etc.
> 
> Plain and simple. A one-to-one ratio of input fields to output fields.
> No fields missing. I will provide you with any data you require,
> including editing the HTML form so it e-mails the ACTUAL submissions to
> your address. Worry not, the form ain't really "live" yet. That is, it
> isn't being used by customers; only by me (and you, if you'd like) to
> submit pretend customers' data.
> 
> I'm done playing with this. Inasmuch as I intend to learn to do many fun
> things with perl, but for this particular need, I can't help feeling
> that I'm re-inventing a VERY POPULAR WHEEL.
> 
> (612) 522-1200 x302                            Minneapolis, MN

When do you want it? I've written something similar, but it would require
a little tweaking, and I probably couldn't get it to you before tomorrow.

Let me know,

justinb

-- 
Justin Banks      \ 
Silicon Graphics  \ Polar bear: a Cartesian bear after a coordinate transform.
Eagan, Minnesota  \ 
		    


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

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

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