[6430] in Perl-Users-Digest
Perl-Users Digest, Issue: 55 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 5 11:37:25 1997
Date: Wed, 5 Mar 97 08:00:32 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 5 Mar 1997 Volume: 8 Number: 55
Today's topics:
Re: asosiate array - problems (Tad McClellan)
Re: Calling a Perl Program from within HTML (Curt Bousquet)
Re: can $_ be dissociated from its contents? (Tony Bass)
Re: Can't run Perl from Win95 DOS command prompt? (Steffen Heinrich)
Re: Comparing various srtings in a database (Tad McClellan)
Creating NonExisting File with Perl (Arnout Symoens)
Creating NonExisting File with Perl (Arnout Symoens)
Re: Creating NonExisting File with Perl (Honza Pazdziora)
Re: Creating NonExisting File with Perl <tchrist@mox.perl.com>
Re: Formatting numbers (Ken Williams)
Help on undef($/) <nilssone@craft.clarkson.edu>
Re: Help on undef($/) (Honza Pazdziora)
Re: How to create 666 file from www perl cgi? <charliew@atlml1.attmail.com>
Re: Initializing array contents to all zeros (Andrew M. Langmead)
Re: Initializing array contents to all zeros (Dave Thomas)
installing perl5.003 on aix 4.0 <ada@pythie.cnusc.fr>
Re: Looking for Perl OOP Book / Tutorial <merlyn@stonehenge.com>
Re: Looking for Perl OOP Book / Tutorial (Jay Flaherty)
PERL and NT4.0 <igandham@prestel.net>
Re: perl TCP/IP server <tchrist@mox.perl.com>
Re: PLEASE HELP! I don't wanna get fired tomorrow!! My (Jay Flaherty)
putting a text comment space <hydrotmp@tcac.com>
Re: Q: Good Perl Book (Jay Flaherty)
Searching Perl Tutorial (Antonio A. Amo Bogallo)
Re: Testing if a variable is a number or a string.(Newb (Dave Thomas)
Re: Testing if a variable is a number or a string.(Newb (Dave Thomas)
URGENT! Please Help! I don't wanna get fired! <stevek@unidial.com>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 5 Mar 1997 06:08:24 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: asosiate array - problems
Message-Id: <onnjf5.qi.ln@localhost>
Afgin Shlomit (vshlomit@wishful.weizmann.ac.il) wrote:
: I write a program that scan a file and put the results in a few arrays
: one of then is progs.
: At the begining I initialize the array by writing :
: @progs = ();
^
^ regular array
: then I count the line it apear with :
: $progs{$1} += 1;
^^^^
^^^^ hash
Those two lines are not operating on the same data structure (even
though they do have the same names)
: Then when I print the output to a file I got a wrong number in a very few lines.
: foreach $prog (sort progbyvalue keys(%progs)) {
: printf PROGS1 "%-17s: %-9d %-16.3f %-15d\n", $prog, $progs{$prog}, $prog
: time{$prog}, $number_of_user{$prog};
: (sub progbyvalue { $progs{$b} <=> $progs{$a}; })
: Is it my initializtion okay? I cannot reset the fields of the array because
: I dont know how much will be .
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Tue, 04 Mar 97 22:48:13 GMT
From: no@spam.please (Curt Bousquet)
Subject: Re: Calling a Perl Program from within HTML
Message-Id: <5fi8rk$f3h@thrush.sover.net>
If your clients are REALLY adverse to using SSI, maybe you can look into
having the server redirect the HTTPD request. I don't remember offhand how
this works, but basically you can instruct the server to redirect all requests
for a certain web page to another page or even (I think) to a script.
The only solution I know of DOES require Server Side Includes (but is well
worth it), and can be done like this:
<!--#include
virtual="cgi-local/yourscript.pl?parameter1=xx¶meter2=yy"-->
The parameters can then be read by your script from $ENV{'QUERY_STRING'}
Use code something like this to place the parameters into an associative
array called $parameters():
if ($ENV{'REQUEST_METHOD'} eq 'GET'){ #if data comes from command line
@pairs = split(/&/,$ENV{'QUERY_STRING'});
foreach $pair (@pairs) {
($varname, $value) = split(/=/, $pair);
$parameters{$varname} = $value;
}
}
I have used this quite a bit in the last few months...
..... Hope this helps.
In article <331A1D13.6F42@cdsnet.net>, thorsoft@cdsnet.net wrote:
>I need to include about 50 lines of html code into 10 sites. I also
>need to pass a parameter to the cgi code so I know which 50 lines of
>code that is needed. There are 4 different snippets of code each with a
>different graphic. The cgi code would then look at the parameter and
>then generate the proper html code for inclusion into the page that
>called the cgi program.
>
>Can I call a cgi program from an html page while the html page is
>loaded? This is similar to a server side include, but some of the sites
>do not want to make their "html" files "shtml" for the server side
>includes to work.
>
>Thanks,
>Rick
+++++++++++++++++++++++++++
Curt Bousquet
http://www.webrover.com/ia/
$Email = (scanline\@+sover.net =~ s/+//g);
------------------------------
Date: 5 Mar 1997 09:14:19 -0000
From: aeb@calf.saltfarm.bt.co.uk (Tony Bass)
Subject: Re: can $_ be dissociated from its contents?
Message-Id: <5fjdhb$ag4@calf.saltfarm.bt.co.uk>
>From article <3319F35C.6545@egames.com>, by Devin Ben-Hur <dbenhur@egames.com>:
[...]
> Looks like we need a anonymous scalar construct
> anologous to the anonymous array [...] and hash {...}
> construct.
I noticed this slight asymmetry myself recently, but think it is the
sort of thing that one could define for oneself if desired, on the lines
of
sub anonscalar {
my ($var) = @_;
return \$var;
}
taking the initial value as parameter.
Tony Bass
--
# Tony Bass Tel: (01473) 645305
# MLB 3/19, BT Laboratories e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 7RE DO NOT e-mail to From: line
# Opinions are my own
------------------------------
Date: Wed, 05 Mar 1997 13:39:06 GMT
From: s581009@tfh-berlin.de (Steffen Heinrich)
Subject: Re: Can't run Perl from Win95 DOS command prompt?
Message-Id: <5fjt4k$ejd@sun04.tfh-berlin.de>
__felbel@csn.net__ (Fred Elbel) wrote:
>When I try to run from a DOS command prompt line (a DOS window), the
>response is "This program can not be run in DOS mode.". According to
I can only guess here. Maybe you are using a wrong version of
command.com. Open a DOS-box from inside Win95 (do not start or restart
in DOS-mode) and type 'ver' at the command prompt. It should say
Windows 95. [Version....
Else open your DOS-prompt's properties (click right on the title
bar...) and change the command-line to window's command.com,
e.g. C:\WIN95\command.com
Running perl from the DOS-box _should_ work. I've had lot's of
problems with pathes not being found, redirection and so on.
Running perl from the Start>Run... prompt and using the cmd32-wrapper
gave much better results.
Hope it helps, Steffen
------------------------------
Date: Wed, 5 Mar 1997 06:06:13 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Comparing various srtings in a database
Message-Id: <ljnjf5.qi.ln@localhost>
Andrew (psaltis@cris.com) wrote:
: Hi all, just a real quick question...
: I am trying to write a perl script that will open a specific file (a sybase
: database file on a RS6000 running AIX ) read in a line of data and then
: compare it to all of the other lines of data in the file. And then repeat
: the process with the next line of data, thus moving down the file comparing
: each line to each other line and writing a file that lists all of the
: duplicate records
: Opening and reading the whole file is not a problem, the problem is trying
: to comapare the first line read in to all the others and then repeating
: that process and writing the file that of all duplicate records.
: All help is greatly appreciated..
You don't say that you need to preserve the order of what is
duplicated, just that they _are_ duplicated. So:
I would scrap that algorithm, and go with: "count how many times
each line appears, print any that appear more than once".
------------
#!/usr/bin/perl -w
while (<DATA>) {
$lines{$_}++;
}
foreach (sort keys %lines) {
print "[$lines{$_}] $_" if $lines{$_} > 1;
}
__DATA__
aline 2
another line 3
not aline
aline 2
another line 3
another line 3
foobar
aline
bar
------------
OR, just do it from the shell:
sort sybase_file >sybase_file.s
sort -u sybase_file >sybase_file.u
diff sybase_file.s sybase_file.u
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Mon, 03 Mar 1997 16:44:55 GMT
From: ps940566@beta.ufsia.ac.be (Arnout Symoens)
Subject: Creating NonExisting File with Perl
Message-Id: <331b0068.0@news.dma.be>
Following problem :
I'm writing a little CGI in perl (works perfectly..). But one of the
things I need is to create a none existing new file (a new one for
each new user). I can't do this with the open command, which will die
when I open a none existing file..
Ok, how do I create a new file from within perl ? It's running on an
UNIX server...Would this mean I have to send an UNIX command like ? If
yes, what command ? I can't find one..
On the other hand..It's probably me, not noticing which powerfull
command Perl has hidden somewhere for me to create a file ...
Anyone can help me out with this one...Source (small) wouldl be
appreciated..
Thank you,
Arnout Symoens
Student somewhere and somehow...
Aegir@mail.dma.be
------------------------------
Date: Mon, 03 Mar 1997 16:43:27 GMT
From: ps940566@beta.ufsia.ac.be (Arnout Symoens)
Subject: Creating NonExisting File with Perl
Message-Id: <331b000f.0@news.dma.be>
Following problem :
I'm writing a little CGI in perl (works perfectly..). But one of the
things I need is to create a none existing new file (a new one for
each new user). I can't do this with the open command, which will die
when I open a none existing file..
Ok, how do I create a new file from within perl ? It's running on an
UNIX server...Would this mean I have to send an UNIX command like ? If
yes, what command ? I can't find one..
On the other hand..It's probably me, not noticing which powerfull
command Perl has hidden somewhere for me to create a file ...
Anyone can help me out with this one...Source (small) wouldl be
appreciated..
Thank you,
Arnout Symoens
Student somewhere and somehow...
Aegir@mail.dma.be
------------------------------
Date: Wed, 5 Mar 1997 14:04:46 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Creating NonExisting File with Perl
Message-Id: <adelton.857570686@aisa.fi.muni.cz>
ps940566@beta.ufsia.ac.be (Arnout Symoens) writes:
> Following problem :
>
> I'm writing a little CGI in perl (works perfectly..). But one of the
> things I need is to create a none existing new file (a new one for
> each new user). I can't do this with the open command, which will die
> when I open a none existing file..
>
> Ok, how do I create a new file from within perl ? It's running on an
> UNIX server...Would this mean I have to send an UNIX command like ? If
> yes, what command ? I can't find one..
>
> On the other hand..It's probably me, not noticing which powerfull
> command Perl has hidden somewhere for me to create a file ...
>
> Anyone can help me out with this one...Source (small) wouldl be
> appreciated..
Use
open FILE, ">filename" or die;
And make sure all conditions in The Idiot's Guide to Solving Perl CGI
Problems (http://www.perl.com/perl/faq/idiots-guide.html) are
fullfilled.
Hope this helps.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: 5 Mar 1997 15:20:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Creating NonExisting File with Perl
Message-Id: <5fk30b$na6$1@csnews.cs.colorado.edu>
[no courtesy cc due to useless spam-avoidance idiocy]
In comp.lang.perl.misc, *ps940566@beta.ufsia.ac.be writes:
:I'm writing a little CGI in perl (works perfectly..).
A little CGI what?
Anyway, please stop posting this. You've already been answered.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
You are unlucky enough to bump into all my rough edges. --Andrew Hume
------------------------------
Date: Wed, 05 Mar 1997 10:01:27 -0500
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Formatting numbers
Message-Id: <ken-0503971001270001@news.swarthmore.edu>
In article <331C69F7.4C73@realogic.com>, Diana Duncan
<dduncan@realogic.com> wrote:
> Use sprintf.
> $rounded_number = sprintf("%.2f", $number);
>
> Now, I've heard noises that sprintf is not efficient, but haven't seen
> any other rounding functions. Are there any? What are the many ways to
> do this?
Here's one:
$rounded = &round(5164.583, 2); # Chops to 2 decimal places
$rounded2 = &round(5164.583, -2); # Chops to hundreds place
sub round {
my $number = shift @_;
my $n = shift @_;
my $mult = 10**$n;
return int($number * $mult) / $mult;
}
------------------------------
Date: 5 Mar 1997 13:12:27 GMT
From: "EriK" <nilssone@craft.clarkson.edu>
Subject: Help on undef($/)
Message-Id: <01bb09cc$cae934c0$153f9980@eriks>
When assigning a string with multiple '\n' in it, one need to set the some
environmental variable with undef($/);
How do I turn this environmental variable back to the state I had before.
The state that lets me assign to a '\n' and then stop ?
nilssone@craft.clarkson.edu
------------------------------
Date: Wed, 5 Mar 1997 14:15:01 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Help on undef($/)
Message-Id: <adelton.857571301@aisa.fi.muni.cz>
"EriK" <nilssone@craft.clarkson.edu> writes:
> When assigning a string with multiple '\n' in it, one need to set the some
> environmental variable with undef($/);
>
> How do I turn this environmental variable back to the state I had before.
> The state that lets me assign to a '\n' and then stop ?
You do not mean assigning, you mean reading, huh?
So to read the whole file as one loooong line, you undef $/.
$/ is a variable that says what is the end of line when reading from
file. So to read line by line (ended by \n), you do $/ = "\n";
Hope this helps.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Wed, 05 Mar 1997 09:37:50 -0500
From: Charlie Wu <charliew@atlml1.attmail.com>
Subject: Re: How to create 666 file from www perl cgi?
Message-Id: <331D853E.3CA2@atlml1.attmail.com>
Geoffrey Hebert wrote:
>
> I want to create a file with a perl cgi script that is initiated from
> the web.
>
> If I create the file as the owner with 666 permissions from my telnet
> account, everything works fine. I can then open with ">filename"
>
> Open works only if I created the file! I want the cgi to create the
> file. Seems as though security is stopping me.
>
> Any help appreciated thanks.
>
> email please soccer@microserve.net
You have to be more specific - where is this to-be-created-file located?
if it's in your home directory then the cgi script probably wouldn't be
able to create it unless your home dir is 666.
--
Charlie Wu
http://www.impactsite.com/charliew/
Web Applications Developer/Consultant
AT&T, Atlanta, Georgia
------------------------------
Date: Wed, 5 Mar 1997 13:53:43 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Initializing array contents to all zeros
Message-Id: <E6Kp9J.8AB@world.std.com>
really_eliot@dg-rtp.dg.com_but_mangled_to_stop_junk_email writes:
>I need to create a lot of arrays and initialize their elements to zero.
>I want to initialized them explicitly because I may well read various
>elements before writing them, and perl -w burps out many screenfuls of
>warnings about using uninitialized values.
If you want to make an array initialized to zero, you can use the
repetition opeator:
@array = (0) x $size;
--
Andrew Langmead
------------------------------
Date: 5 Mar 1997 14:09:45 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Initializing array contents to all zeros
Message-Id: <slrn5hqveq.9hp.dave@fast.thomases.com>
On 5 Mar 1997 05:19:43 GMT, Dave Thomas <dave@fast.thomases.com> wrote:
> On 04 Mar 1997 13:02:04 -0500, eliot@dg-rtp.dg.com wrote:
> - Otherwise, a more simple loop would save memory
>
> for $index (0..$#array) {
> $array[$index] = 0;
> }
Duh - stop posting while asleep Thomas...
The `simple loop' was supposed to be
for ($index = 0; $index < ....
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Wed, 05 Mar 1997 14:12:23 +0100
From: arnaud dupuy d'Angeac <ada@pythie.cnusc.fr>
Subject: installing perl5.003 on aix 4.0
Message-Id: <331D7137.34B0@pythie.cnusc.fr>
I am trying to setup perl5.003 on an IBM machine running aix 4.0.
with dynamic loading of DB_File etc...
after the configure step when I run make depend
I get messages such as: Error in message set 12, unable to retrieve
message 342,
Then, when I run make it fails when compiling the DB_File module.
Does anybody knows?
A. Dupuy d'Angeac
ada@pythie.cnusc.fr
tel: 330467605738
------------------------------
Date: 05 Mar 1997 05:34:55 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: uschwarz@wwa.com
Subject: Re: Looking for Perl OOP Book / Tutorial
Message-Id: <8c67z6v7o0.fsf@gadget.cscaper.com>
>>>>> "TDS" == TDS <uschwarz@wwa.com> writes:
TDS> [...] The "Learning
TDS> Perl" book is too old to deal with the OOP features.
"old"? Hardly. "basic" would be more accurate there. Learning Perl
is an intro to *perl*, and covers the most useful *basic* *essential*
features. OOP and references do NOT belong there. I designed the
llama knowing full well what every feature of perl version 5.000 was
going to be, because I was already playing with the alpha releases.
I am currently performing minor tweaks to the llama to update it for
things I now know to be true (like "my" over "local", "hash" instead
of "associative array", "chomp" instead of "chop"), but I am *not*
adding OOP or heavy-duty data structures or *anything* like that. If
the mythical "Learning *more* Perl" ever comes out, it'll pick up
where the Llama leaves off, probably starting with packages,
references, objects, and modules, progressing through
embedding/extending, LWP/CGI.pm, and so on.
But the llama was *never* intended to deal with OOP, and never will.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 545 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 5 Mar 1997 13:37:59 GMT
From: fty@hickory.engr.utk.edu (Jay Flaherty)
Subject: Re: Looking for Perl OOP Book / Tutorial
Message-Id: <5fjsvn$85i$1@gaia.ns.utk.edu>
Tom Christiansen (tchrist@mox.perl.com) wrote:
: [courtesy cc of this posting sent to cited author via email]
:
: In comp.lang.perl.misc,
: uschwarz@wwa.com writes:
: :
: :If you know of a good book or tutorial on this subject, please let me
: :know.
:
: http://www.perl.com/CPAN/doc/FMTEYEWTK/perltoot.html
: ftp://ftp.perl.com/perl/FMTEYEWTK/perltoot.html
:
: You can also find perltoot.man, perltoot.ps, and perltoot.pod
: in the same directory.
You can also look at Randal's Unix Review Column at:
http://w3.stonehenge.com/merlyn/UnixReview/col13.html
Good luck...Jay
--
**********************************************
Jay Flaherty fty@hickory.engr.utk.edu
------visualize whirled peas------
**********************************************
------------------------------
Date: Wed, 05 Mar 1997 12:57:15 +0000
From: Iqbal Gandham <igandham@prestel.net>
Subject: PERL and NT4.0
Message-Id: <331D6DAB.1BB5@prestel.net>
Hi
I am interested in Perl for NT . I am familiar with using Perl on unix,
but I believe there are a few changes to scripts etc which need to be
made to the scripts.
Could anyone point me in the correct direction, I just need a few
examples so I can get a feel for things. A couple of form scripts which
mail results etc.
Thanks
Iqbal
igandham@prestel.net
------------------------------
Date: 5 Mar 1997 14:08:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl TCP/IP server
Message-Id: <5fjup4$lbh$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Christian Simard <simardc@netc.net> writes:
:Hi, i'v downloaded the "Programming Perl" archive available at O'reilly
:& Associate's ftp site. The archive contains a Perl program named
:"server" that implement a TCP/IP server. The problem is that i cannot
:get it work under my SGI Indigo 2 (IRIX 5.3) and on my Sun Netra
:(Solaris 2.4) workstations, but it worked fine under my Sun IPC (SunOS
:4.1.3) other machine! On the first two i got the following error
:message: "socket: Protocol not supported at ... line ...." I'v printed
:the protocol that the program want to use and I got 6. This protocol is
:listed in my /etc/protocols. What's wrong with it?
Did you really use the suggestion from Programming Perl *VERSION 2*?
That's the one that tells you to "use Socket" in your code. There's
a FAQ on this:
=head2 Why doesn't my sockets program work under System V (Solaris)? What
does the error message "Protocol not supported" mean?
Some Sys-V based systems, notably Solaris 2.X, redefined some of
the standard socket constants. Since these were constant across all
architectures, they were often hardwired into perl code. The proper
way to deal with this is to "use Socket" to get the correct values.
Note that even though SunOS and Solaris are binary compatible, these
values are different. Go figure.
You can find examples of doing this the Right Way in the perlipc(1) man page.
If you don't have such a man page installed, perl is not proPERLy installed,
so see your sysadmin. Or see the man pages on perl.com while you're waiting
for them to fix it.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
sum to check equivalent files should use sum -a. --Andrew Hume
------------------------------
Date: 5 Mar 1997 14:15:16 GMT
From: fty@hickory.engr.utk.edu (Jay Flaherty)
Subject: Re: PLEASE HELP! I don't wanna get fired tomorrow!! My girlfriend leaves me last week now this! Ugh!
Message-Id: <5fjv5k$9ak$1@gaia.ns.utk.edu>
Steve Karr (Steve.Karr@Media-Link.Com) wrote:
: Please, oh, please help! If my boss asks "Ya got it done yet?" one
: more time I think I'll curl up into a ball and cry (while chewing on
: my camel book).
:
: SOLUTION: to be able to click on a file and have a browser pop up
: dialog to save it locally (no matter the file type) for the user to
: download it with out having to right click save as. I need to serve
: up files. No biggie? I've been working on this since Monday morning
: and I'm way burned out.
Any reason why you are not using ftp? you can then have a url like so:
ftp://your.fty.server.com/pub/path/to/your/files/here.tar.gz
Jay
--
**********************************************
Jay Flaherty fty@hickory.engr.utk.edu
------visualize whirled peas------
**********************************************
------------------------------
Date: Wed, 05 Mar 1997 08:31:30 -0800
From: James <hydrotmp@tcac.com>
Subject: putting a text comment space
Message-Id: <331D9FE2.6589@tcac.com>
How would I go about putting in a textarea for a comment section at the
bottom of this form. I would like it to have four or five lines
available.
I have tried but all has failed.
This is my .html
<HTML>
<HEAD>
<TITLE>Submit Form</TITLE>
</HEAD>
<B><blockquote><STRONG>Please fill out this form and we will view your
web page. You will be notified by E-Mail when your web page is
posted.<p><b></blockquote>
</STRONG>
<FORM ACTION="/scripts/pokey1.pl" METHOD=POST>
<TABLE>
<TR><TD ALIGN="right"><B>Your Name:</B></TD>
<TD ALIGN="left"><INPUT TYPE="text" NAME="Name" SIZE=50></TD>
</TR>
<TR><TD ALIGN="right"><B>Your Email:</B></TD>
<TD ALIGN="left"><INPUT TYPE="text" NAME="Email" SIZE=50></TD>
</TR>
<TR><TD ALIGN="right"><B>The Web Page Title:</B></TD>
<TD ALIGN="left"><INPUT TYPE="text" NAME="Title" SIZE=50></TD>
</TR>
<TR><TD ALIGN="right"><B>URL Address:</B></TD>
<TD ALIGN="left"><INPUT TYPE="text" NAME="Address1" SIZE=50></TD>
</TR>
<TR><TD ALIGN="right"><B>Telephone (optional):</B></TD>
<TD ALIGN="left"><INPUT TYPE="text" NAME="Telephone" SIZE=20></TD>
</TR>
<TR><TD ALIGN="right"><B>Fax (optional):</B></TD>
<TD ALIGN="left"><INPUT TYPE="text" NAME="Fax" SIZE=20></TD>
</TR>
<TR><TD></TD>
<TD><INPUT TYPE="submit" VALUE="Send">
<INPUT TYPE="reset" VALUE="Clear"></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
--
_______________________________________________________________
James Ross - hydrotmp@tcac.com
Hydro-Temp Corp http://www.hydro-temp.com
Air Flo Company http://www.hydro-temp.com/airflo.html
Pocahontas Web Sites http://www.hydro-temp.com/pocahontas/
_______________________________________________________________
------------------------------
Date: 5 Mar 1997 14:17:23 GMT
From: fty@hickory.engr.utk.edu (Jay Flaherty)
Subject: Re: Q: Good Perl Book
Message-Id: <5fjv9j$9ak$2@gaia.ns.utk.edu>
Sigge Eriksson (sigge.eriksson@usa.net) wrote:
: Anyone know a good book for a Perl beginner?
:
: / Sigge Eriksson
Learning perl by Randal Schwartz
ISBN: 1-56592-042-2
--
**********************************************
Jay Flaherty fty@hickory.engr.utk.edu
------visualize whirled peas------
**********************************************
------------------------------
Date: 5 Mar 1997 09:59:52 GMT
From: i42amboa@seneca.uco.es (Antonio A. Amo Bogallo)
Subject: Searching Perl Tutorial
Message-Id: <5fjg6o$ah@erika.cica.es>
If you have it please mail to:
i42amboa@sun630.uco.es
------------------------------
Date: 5 Mar 1997 14:19:32 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Testing if a variable is a number or a string.(Newbie question)
Message-Id: <slrn5hr015.9hp.dave@fast.thomases.com>
On Mon, 03 Mar 1997 23:49:28 -0400, Carl <ceklof@vt.edu> wrote:
> Can anyone tell me how to test if a vaiable is a number vs. a string?
...
> I am creating a web interface to an ODBC database. Queries are
> done/finished. Now inserting is a problem because some fields are text,
> some numbers, some dates(numbers). I am using the sql "INSERT INTO" to
> append records, which requires double quotes around text values, but not
> number values.
In which case, it seems to me that it isn;t the type of the variable that
you're worried about, but the type of the database column. You could insert
the text 1234 into a char() column, and you'd still need to quote it.
What database interface package are you using. Many of the Perl ones will
let you get at the underlying data dictionary, so you can get column types
and sizes from the database before you store.
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 5 Mar 1997 14:17:24 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Testing if a variable is a number or a string.(Newbie question)
Message-Id: <slrn5hqvt2.9hp.dave@fast.thomases.com>
On Mon, 03 Mar 1997 23:49:28 -0400, Carl <ceklof@vt.edu> wrote:
> Can anyone tell me how to test if a vaiable is a number vs. a string?
...
> I am creating a web interface to an ODBC database. Queries are
> done/finished. Now inserting is a problem because some fields are text,
> some numbers, some dates(numbers). I am using the sql "INSERT INTO" to
> append records, which requires double quotes around text values, but not
> number values.
In which case, it seems to me that it isn;t the type of the variable that
you're worried about, but the type of the database column. You could insert
the text 1234 into a char() column, and you'd still need to quote it.
What database interface package are you using. Many of the Perl ones will
let you get at the underlying data dictionary, so you can get column types
and sizes from the database before you store.
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Wed, 05 Mar 1997 09:21:49 -0500
From: Steve Karr <stevek@unidial.com>
Subject: URGENT! Please Help! I don't wanna get fired!
Message-Id: <331D817D.2B06@unidial.com>
(Sorry, this is a repost because I had the WRONG EMAIL address in the
headers! Thanks!)
Please, oh, please help! If my boss asks "Ya got it done yet?" one
more time I think I'll curl up into a ball and cry (while chewing on
my camel book).
SOLUTION: to be able to click on a file and have a browser pop up
dialog to save it locally (no matter the file type) for the user to
download it with out having to right click save as. I need to serve
up files. No biggie? I've been working on this since Monday morning
and I'm way burned out.
PROBLEM: (1) when the save box appears, the default save as filename
is my script name...I need to be able to suggest file name (2) this
script works with (successfully downloads) text files, but nothing else.
It trys, but the files are corrupt. They end up being the same size
in K (e.i. a file on the server that is 9K, ends up being 9K locally)
but its a few BYTES off. A gif I tested it with was two bytes
bigger than the original and therefore was screwed. I tested it
(in front of my boss 15 min before I was supposed to get off of work)
with a word document. The word doc came across the right size (in K),
but wouldn't load. UGH! I *don't* need this in my life right now!
(Oh, its running on the Netscape Enterprise Server, WinNT...I'm used
to Unix and Apache...oh well)
What's wrong with my program?! Any one else have a totally different
working example or know the solution to my problem? PLEASE HELP!
Thanks in advance. Oh, one more thing, PLEASE send a respond to me
via E-MAIL, because I can't access the newsgroups at work because our
sys. admin. can't get reverse DNS working)
--Steve
#!/perl/perl5/perl.exe -w -T
$|=0;
$filename = $ENV{'QUERY_STRING'};
print "Content-type: application/octet-stream\n\n";
#
# I have a feeling something else goes here to suggest filename?
&readFileContents;
exit 0;
sub readFileContents {
local($/) = undef;
open (FILE, $filename) || die "Cannot open file for input";
binmode(FILE);
print <FILE>;
close(FILE);
exit;
}
#That's it!
------------------------------------------------------
Steve Karr - Internet Services Coordinator
UniDial Communications, Inc. http://www.unidial.com
Voice (502) 244-6666 ext. 1147 Fax (502) 244-6222
E-mail: stevek@unidial.com
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 55
************************************