[12409] in Perl-Users-Digest
Perl-Users Digest, Issue: 6009 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 20:07:22 1999
Date: Tue, 15 Jun 99 17:00:16 -0700
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, 15 Jun 1999 Volume: 8 Number: 6009
Today's topics:
Re: Afraid to ask about Y2K! <juex@my-dejanews.com>
Re: Afraid to ask about Y2K! <tchrist@mox.perl.com>
Re: Afraid to ask about Y2K! <tchrist@mox.perl.com>
Re: Binary File Uploading - Part 2 <rootbeer@redcat.com>
date formats <eblatham@unity.ncsu.edu>
Re: date formats <tchrist@mox.perl.com>
Re: date formats <eblatham@unity.ncsu.edu>
Re: date formats <tchrist@mox.perl.com>
Re: Events in CGI/Perl <rootbeer@redcat.com>
Help - Process tried to write to a nonexistent pipe? <thomas@shurflo.com>
Re: Help - Process tried to write to a nonexistent pipe <thomas@shurflo.com>
Re: Help - Process tried to write to a nonexistent pipe <thomas@shurflo.com>
Re: Page Refresh <rootbeer@redcat.com>
Re: param($variable) dejamty@my-deja.com
Re: Perl and CGI <emschwar@rmi.net>
saving uploaded file <uucon@my-deja.com>
user IP <leonid76@erols.com>
Re: What is functional difference between .pm and .pl? <rootbeer@redcat.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jun 1999 16:55:48 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7k6p5d$cq8@news.dns.microsoft.com>
Tom Christiansen <tchrist@mox.perl.com> wrote in message
news:3766bcef@cs.colorado.edu...
> [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
> bart.lateur@skynet.be (Bart Lateur) writes:
> :Tell that to the designers of my digital clock. They took special care
> :so that midnight displays as "12 AM", and midday as "12 PM".
>
> I was always taught that noon is 12am, midnight is 12pm.
> Of course, that's wrong, because noon and midnight are neither,
> being between the two. Apparently I had one-based not zero-based
> trainers. :-)
Is there anything wrong with 31.Dez, 24:00 being the same as 01.Jan, 00:00 ?
And 12:00 of course means noon, it can't be midnight, because you would use
either 24:00 or 00:00 to refer to the moment, where a new day is born.
jue
--
J|rgen Exner
------------------------------
Date: 15 Jun 1999 17:58:27 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <3766e8a3@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"J|rgen Exner" <juex@my-dejanews.com> writes:
:Is there anything wrong with 31.Dez, 24:00 being the same as 01.Jan, 00:00 ?
You can't have 24:00 -- that's out of the valid range. Hours are
guaranteed less than 24. After 11:59:59pm comes 12:00:00midnight.
--tom
--
If you consistently take an antagonistic approach, however, people are
going to start thinking you're from New York. :-)
--Larry Wall to Dan Bernstein in <10187@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 15 Jun 1999 17:59:40 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <3766e8ec@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"J|rgen Exner" <juex@my-dejanews.com> writes:
:And 12:00 of course means noon, it can't be midnight
I'm sorry, but you're wrong. It's not your fault though, because
you're probably not a native speaker of English. But it simply
doesn't work that way. The clock strikes twelve twice a day.
It never strikes 0. It never strikes 24. See also "Big Ben"
for a live demo.
--tom
--
Comments on data are usually much more helpful than on algorithms. --Rob Pike
------------------------------
Date: Tue, 15 Jun 1999 16:18:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Binary File Uploading - Part 2
Message-Id: <Pine.GSO.4.02A.9906151616160.10614-100000@user2.teleport.com>
On 15 Jun 1999, Filip M. Gieszczykiewicz wrote:
> For this reason, when I get any of the fun fun 500 errors I output a partial
> header in the first line of code and then if I get an error (as long as it's
> not a perl compile err - like a module not being found), I actually get a
> browser error not the useless 500-series. Give it a whirl. I've found modules
> I was using generating debugging messages this way - grrr.
But some browsers may send errors (from your program's stderr) to strange
places where you'll never find them. Here's a better way, especially if
you're worried that modules aren't loading right. There are other ways to
do this, but for debugging, I sometimes put something like this near the
top of a script.
# Remove this block when done debugging!
BEGIN {
local($|) = 1; # Temporarily turn off buffering
print "Content-type: text/plain\n\n";
my $date = localtime;
print "Script $0\nrunning on $date (Perl version $])\n\n";
unless (open STDERR, ">&STDOUT") {
print "Can't redirect STDERR: $!";
exit;
}
print "\n";
}
Now you should be able to see any error messages (and everything else)
produced by your script, right on your browser. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 18:53:36 -0400
From: Emily Brock Latham <eblatham@unity.ncsu.edu>
Subject: date formats
Message-Id: <3766D970.3352D4AB@unity.ncsu.edu>
I have a user putting in a date of several different styles of input,
and I have to convert it to numerical month and day stuff. I also have
to find from the date what the day of the week is? Is there an easier
way than loads of if/else statements? and I have no idea where to begin
getting the day of the week info?
--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Time's fun when you're having flies!
@..@ eblatham@eos.ncsu.edu
(----) CHECK OUT THE LILY PAD at....
( >__< ) http://www4.ncsu.edu/~eblatham/home.html
^^ ~~ ^^
------------------------------
Date: 15 Jun 1999 17:10:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: date formats
Message-Id: <3766dd54@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Emily Brock Latham <eblatham@unity.ncsu.edu> writes:
:I have a user putting in a date of several different styles of input,
:and I have to convert it to numerical month and day stuff. I also have
:to find from the date what the day of the week is? Is there an easier
:way than loads of if/else statements? and I have no idea where to begin
:getting the day of the week info?
% man perlfaq4
NAME
perlfaq4 - Data Manipulation ($Revision: 1.49 $, $Date:
1999/05/23 20:37:49 $)
DESCRIPTION
The section of the FAQ answers question related to the
manipulation of data as numbers, dates, strings, arrays, hashes,
and miscellaneous data issues.
[deletia]
Data: Dates
How do I find the week-of-the-year/day-of-the-year?
The day of the year is in the array returned by localtime() (see
the section on "localtime" in the perlfunc manpage):
$day_of_year = (localtime(time()))[7];
or more legibly (in 5.004 or higher):
use Time::localtime;
$day_of_year = localtime(time())->yday;
You can find the week of the year by dividing this by 7:
$week_of_year = int($day_of_year / 7);
Of course, this believes that weeks start at zero. The
Date::Calc module from CPAN has a lot of date calculation
functions, including day of the year, week of the year, and so
on. Note that not all businesses consider ``week 1'' to be the
same; for example, American businesses often consider the first
week with a Monday in it to be Work Week #1, despite ISO 8601,
which considers WW1 to be the first week with a Thursday in it.
How do I find the current century or millennium?
Use the following simple functions:
sub get_century {
return int((((localtime(shift || time))[5] + 1999))/100);
}
sub get_millennium {
return 1+int((((localtime(shift || time))[5] + 1899))/1000);
}
On some systems, you'll find that the POSIX module's strftime()
function has been extended in a non-standard way to use a `%C'
format, which they sometimes claim is the "century". It isn't,
because on most such systems, this is only the first two digits
of the four-digit year, and thus cannot be used to reliably
determine the current century or millennium.
How can I compare two dates and find the difference?
If you're storing your dates as epoch seconds then simply
subtract one from the other. If you've got a structured date
(distinct year, day, month, hour, minute, seconds values), then
for reasons of accessibility, simplicity, and efficiency, merely
use either timelocal or timegm (from the Time::Local module in
the standard distribution) to reduce structured dates to epoch
seconds. However, if you don't know the precise format of your
dates, then you should probably use either of the Date::Manip
and Date::Calc modules from CPAN before you go hacking up your
own parsing routine to handle arbitrary date formats.
How can I take a string and turn it into epoch seconds?
If it's a regular enough string that it always has the same
format, you can split it up and pass the parts to `timelocal' in
the standard Time::Local module. Otherwise, you should look into
the Date::Calc and Date::Manip modules from CPAN.
How can I find the Julian Day?
You could use Date::Calc's Delta_Days function and calculate the
number of days from there. Assuming that's what you really want,
that is.
Before you immerse yourself too deeply in this, be sure to
verify that it is the *Julian* Day you really want. Are they
really just interested in a way of getting serial days so that
they can do date arithmetic? If you are interested in performing
date arithmetic, this can be done using either Date::Manip or
Date::Calc, without converting to Julian Day first.
There is too much confusion on this issue to cover in this FAQ,
but the term is applied (correctly) to a calendar now supplanted
by the Gregorian Calendar, with the Julian Calendar failing to
adjust properly for leap years on centennial years (among other
annoyances). The term is also used (incorrectly) to mean: [1]
days in the Gregorian Calendar; and [2] days since a particular
starting time or `epoch', usually 1970 in the Unix world and
1980 in the MS-DOS/Windows world. If you find that it is not the
first meaning that you really want, then check out the
Date::Manip and Date::Calc modules. (Thanks to David Cassell for
most of this text.)
There is also an example of Julian date calculation that should
help you in
http://www.perl.com/CPAN/authors/David_Muir_Sharnoff/modules/Tim
e/JulianDay.pm.gz
How do I find yesterday's date?
The `time()' function returns the current time in seconds since
the epoch. Take twenty-four hours off that:
$yesterday = time() - ( 24 * 60 * 60 );
Then you can pass this to `localtime()' and get the individual
year, month, day, hour, minute, seconds values.
Note very carefully that the code above assumes that your days
are twenty-four hours each. For most people, there are two days
a year when they aren't: the switch to and from summer time
throws this off. A solution to this issue is offered by Russ
Allbery.
sub yesterday {
my $now = defined $_[0] ? $_[0] : time;
my $then = $now - 60 * 60 * 24;
my $ndst = (localtime $now)[8] > 0;
my $tdst = (localtime $then)[8] > 0;
$then - ($tdst - $ndst) * 60 * 60;
}
# Should give you "this time yesterday" in seconds since epoch relative to
# the first argument or the current time if no argument is given and
# suitable for passing to localtime or whatever else you need to do with
# it. $ndst is whether we're currently in daylight savings time; $tdst is
# whether the point 24 hours ago was in daylight savings time. If $tdst
# and $ndst are the same, a boundary wasn't crossed, and the correction
# will subtract 0. If $tdst is 1 and $ndst is 0, subtract an hour more
# from yesterday's time since we gained an extra hour while going off
# daylight savings time. If $tdst is 0 and $ndst is 1, subtract a
# negative hour (add an hour) to yesterday's time since we lost an hour.
#
# All of this is because during those days when one switches off or onto
# DST, a "day" isn't 24 hours long; it's either 23 or 25.
#
# The explicit settings of $ndst and $tdst are necessary because localtime
# only says it returns the system tm struct, and the system tm struct at
# least on Solaris doesn't guarantee any particuliar positive value (like,
# say, 1) for isdst, just a positive value. And that value can
# potentially be negative, if DST information isn't available (this sub
# just treats those cases like no DST).
#
# Note that between 2am and 3am on the day after the time zone switches
# off daylight savings time, the exact hour of "yesterday" corresponding
# to the current hour is not clearly defined. Note also that if used
# between 2am and 3am the day after the change to daylight savings time,
# the result will be between 3am and 4am of the previous day; it's
# arguable whether this is correct.
#
# This sub does not attempt to deal with leap seconds (most things don't).
#
# Copyright relinquished 1999 by Russ Allbery <rra@stanford.edu>
# This code is in the public domain
Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Short answer: No, Perl does not have a Year 2000 problem. Yes,
Perl is Y2K compliant (whatever that means). The programmers
you've hired to use it, however, probably are not.
Long answer: The question belies a true understanding of the
issue. Perl is just as Y2K compliant as your pencil--no more,
and no less. Can you use your pencil to write a non-Y2K-
compliant memo? Of course you can. Is that the pencil's fault?
Of course it isn't.
The date and time functions supplied with perl (gmtime and
localtime) supply adequate information to determine the year
well beyond 2000 (2038 is when trouble strikes for 32-bit
machines). The year returned by these functions when used in an
array context is the year minus 1900. For years between 1910 and
1999 this *happens* to be a 2-digit decimal number. To avoid the
year 2000 problem simply do not treat the year as a 2-digit
number. It isn't.
When gmtime() and localtime() are used in scalar context they
return a timestamp string that contains a fully-expanded year.
For example, `$timestamp = gmtime(1005613200)' sets $timestamp
to "Tue Nov 13 01:00:00 2001". There's no year 2000 problem
here.
That doesn't mean that Perl can't be used to create non-Y2K
compliant programs. It can. But so can your pencil. It's the
fault of the user, not the language. At the risk of inflaming
the NRA: ``Perl doesn't break Y2K, people do.'' See
http://language.perl.com/news/y2k.html for a longer exposition.
[deletia]
--
X-Windows: Form follows malfunction.
--Jamie Zawinski
------------------------------
Date: Tue, 15 Jun 1999 19:22:32 -0400
From: Emily Brock Latham <eblatham@unity.ncsu.edu>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: date formats
Message-Id: <3766E038.175AF95E@unity.ncsu.edu>
Thank you for your input, but I was hoping that there was some function
that would do a bit more of the work for me, you know? the only way I
see to use localtime() to do what i need is to get the current day, then
find the difference in today's date and the date entered by the user.
I was also trying to take in dates of multiple formats (4/21 and apr 21
and convert them all to numerical m/d format).
It's not just current day stuff. I was hoping that I didn't have to do
all the calculating between the current day and the date entered by the
user.
Is there just NO EASIER WAY?
------------------------------
Date: 15 Jun 1999 17:53:32 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: date formats
Message-Id: <3766e77c@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
You sent me a stealth mail CC without indicating such. Evil!
In comp.lang.perl.misc,
Emily Brock Latham <eblatham@unity.ncsu.edu> writes:
:Thank you for your input,
It wasn't just input. It was the answer.
:but I was hoping that there was some function
:that would do a bit more of the work for me, you know? the only way I
:see to use localtime() to do what i need is to get the current day, then
:find the difference in today's date and the date entered by the user.
:
:I was also trying to take in dates of multiple formats (4/21 and apr 21
:and convert them all to numerical m/d format).
:
:It's not just current day stuff. I was hoping that I didn't have to do
:all the calculating between the current day and the date entered by the
:user.
:
:Is there just NO EASIER WAY?
WHY YES, THERE IS. I'll highlight it for you so you don't
miss it this time.
+----------------------------------------------------------+
| +------------------------------------------------------+ |
| | How can I compare two dates and find the difference? | |
| +------------------------------------------------------+ |
+----------------------------------------------------------+
+------------------------------------------------------------------+
| If you're storing your dates as epoch seconds then simply |
| subtract one from the other. If you've got a structured date |
| (distinct year, day, month, hour, minute, seconds values), then |
| for reasons of accessibility, simplicity, and efficiency, merely |
| use either timelocal or timegm (from the Time::Local module in |
| the standard distribution) to reduce structured dates to epoch |
| seconds. However, if you don't know the precise format of your |
| dates, then you should probably use either of the Date::Manip |
| and Date::Calc modules from CPAN before you go hacking up your |
| own parsing routine to handle arbitrary date formats. |
+------------------------------------------------------------------+
+-------------------------------------------------------------+
| +---------------------------------------------------------+ |
| | How can I take a string and turn it into epoch seconds? | |
| +---------------------------------------------------------+ |
+-------------------------------------------------------------+
+------------------------------------------------------------------+
| If it's a regular enough string that it always has the same |
| format, you can split it up and pass the parts to `timelocal' in |
| the standard Time::Local module. Otherwise, you should look into |
| the Date::Calc and Date::Manip modules from CPAN. |
+------------------------------------------------------------------+
I honestly don't know what you want. I just gave you the answer,
several times.
--tom
--
"You need to go and find someone to teach you the rudiments of irrational
discourse." --Larry Wall
------------------------------
Date: Tue, 15 Jun 1999 16:31:07 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Events in CGI/Perl
Message-Id: <Pine.GSO.4.02A.9906151630160.10614-100000@user2.teleport.com>
On Tue, 15 Jun 1999, Raj wrote:
> How can an OnClick event on a link on my CGI/Perl Script
> 1. Invoke a " Save As" Message Box to let the user save the target file
> into the local hard drive..?
> 2.Maintain a counter of OnClicks on the Server ( to track the downloads)
It sounds as if you want to ask a remote browser to do something. Check
the docs, FAQs, and newsgroups about browers (or maybe servers?) for more
information. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 16:19:36 -0700
From: Thomas/Shurflo <thomas@shurflo.com>
Subject: Help - Process tried to write to a nonexistent pipe?
Message-Id: <3766DF88.2BDC8C89@shurflo.com>
I keep getting a message about a non-existent pipe when I call this
function.
Anyone have any ideas what that means? It seems to work fine.
This is done on a PC with Activestate Perl.
I call it like this:
$value = lookupext($test);
Here is the function.
sub lookupext {
($lookup) = @_;
open(PBXFILE,"type i:\\din\\pbx |");
while (<PBXFILE>) {
($user,$ext) = split(':');
$user = substr($user,1,length($user)-1);
chop $ext;
if ($user eq $lookup) { return "(" . $ext . ") "; }
}
close(PBXFILE);
}
Here is the error message (I call the function twice)
The process tried to write to a nonexistent pipe.
The process tried to write to a nonexistent pipe.
--
Shurflo does not accept responsibility for any views expressed or
implied
in the text or graphics of this email response/inquiry. I don't either.
Thomas/Shurflo
------------------------------
Date: Tue, 15 Jun 1999 16:23:25 -0700
From: Thomas/Shurflo <thomas@shurflo.com>
Subject: Re: Help - Process tried to write to a nonexistent pipe?
Message-Id: <3766E06D.F0A7B13F@shurflo.com>
I've found a little more.
The problem is in the return statement.
Apparently this is not valid:
return "(" . $ext . ") ";
It prints fine, but I'll keep looking...
Thomas/Shurflo wrote:
> I keep getting a message about a non-existent pipe when I call this
> function.
> Anyone have any ideas what that means? It seems to work fine.
>
> This is done on a PC with Activestate Perl.
>
> I call it like this:
>
> $value = lookupext($test);
>
> Here is the function.
>
> sub lookupext {
> ($lookup) = @_;
> open(PBXFILE,"type i:\\din\\pbx |");
> while (<PBXFILE>) {
> ($user,$ext) = split(':');
> $user = substr($user,1,length($user)-1);
> chop $ext;
> if ($user eq $lookup) { return "(" . $ext . ") "; }
> }
> close(PBXFILE);
> }
>
> Here is the error message (I call the function twice)
>
> The process tried to write to a nonexistent pipe.
> The process tried to write to a nonexistent pipe.
>
> --
> Shurflo does not accept responsibility for any views expressed or
> implied
> in the text or graphics of this email response/inquiry. I don't either.
>
> Thomas/Shurflo
--
Shurflo does not accept responsibility for any views expressed or implied
in the text or graphics of this email response/inquiry. I don't either.
Thomas/Shurflo
------------------------------
Date: Tue, 15 Jun 1999 16:37:00 -0700
From: Thomas/Shurflo <thomas@shurflo.com>
Subject: Re: Help - Process tried to write to a nonexistent pipe?
Message-Id: <3766E39C.760ABBDF@shurflo.com>
Found it. It needed to be the last thing evaluated or something like that...
1 return $returnvalue;
2 }
3 close(PBXFILE);
4 }
It would only work if I moved it after line 2, probably because I was still
in the middle of a WHILE. I thought the return would exit the loop. Too many
other custom languages...
Thomas/Shurflo wrote:
> I've found a little more.
> The problem is in the return statement.
>
> Apparently this is not valid:
> return "(" . $ext . ") ";
>
> It prints fine, but I'll keep looking...
>
> Thomas/Shurflo wrote:
>
> > I keep getting a message about a non-existent pipe when I call this
> > function.
> > Anyone have any ideas what that means? It seems to work fine.
> >
> > This is done on a PC with Activestate Perl.
> >
> > I call it like this:
> >
> > $value = lookupext($test);
> >
> > Here is the function.
> >
> > sub lookupext {
> > ($lookup) = @_;
> > open(PBXFILE,"type i:\\din\\pbx |");
> > while (<PBXFILE>) {
> > ($user,$ext) = split(':');
> > $user = substr($user,1,length($user)-1);
> > chop $ext;
> > if ($user eq $lookup) { return "(" . $ext . ") "; }
> > }
> > close(PBXFILE);
> > }
> >
> > Here is the error message (I call the function twice)
> >
> > The process tried to write to a nonexistent pipe.
> > The process tried to write to a nonexistent pipe.
> >
> > --
> > Shurflo does not accept responsibility for any views expressed or
> > implied
> > in the text or graphics of this email response/inquiry. I don't either.
> >
> > Thomas/Shurflo
>
> --
> Shurflo does not accept responsibility for any views expressed or implied
> in the text or graphics of this email response/inquiry. I don't either.
>
> Thomas/Shurflo
--
Shurflo does not accept responsibility for any views expressed or implied
in the text or graphics of this email response/inquiry. I don't either.
Thomas/Shurflo
------------------------------
Date: Tue, 15 Jun 1999 16:23:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Page Refresh
Message-Id: <Pine.GSO.4.02A.9906151623070.10614-100000@user2.teleport.com>
On Tue, 15 Jun 1999, Raj wrote:
> How do i refresh the previos CGI/Perl script Page when the browser
> back button is clicked?
It sounds as if you want to ask a browser to do something. Check the docs,
FAQs, and newsgroups about browsers for more information. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 21:34:14 GMT
From: dejamty@my-deja.com
Subject: Re: param($variable)
Message-Id: <7k6gsl$2fl$1@nnrp1.deja.com>
Simply do:
my $NW = param("NDD$loop");
push @NWONE, $NW;
or even simpler:
push @NWONE, param("NDD$loop");
this should work.
Michael
In article <ant151846256Lh==@ch0128.charis.co.uk>,
James Stewart <james@britlinks.co.uk> wrote:
> Hi,
>
> I'm trying to read a list of fields from a form using CGI.pm. The
fields
> are named
>
> NDD1, NDD2 ... NDD10 etc. and I want to make it easy to develop my
code
> as the page grows.
>
> The variable $entriesone contains the final form number and I tried to
> use the following code snippet to move the values to an array. The
only
> problem is that it doesn't seem to receive anything into $NW.
>
> for ($loop=1; $loop<=$entriesone; $loop++) {
> $variable = "NDD".$loop;
> my $NW = param($variable);
> push @NWONE, $NW;
> }
>
> James.
> --
> James Stewart - james@britlinks.co.uk | "Telecom ignored us
and
> The Britlinks - http://www.britlinks.co.uk | democracy has died."
> Phantom Tollbooth - http://www.tollbooth.org | -- Fat And
Frantic
>
> Sixpence None The Richer in the UK -
http://www.britlinks.co.uk/sixpence/
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 15 Jun 1999 17:42:04 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Perl and CGI
Message-Id: <xkfaeu1m3oz.fsf@valdemar.col.hp.com>
Chen & Jinlin <linchen88@prodigy.net> writes:
> I have a web server that doesn't support CGI! Is there a work around
> this? (Such as an executable file...)
Yes! The workaround is to replace the web server with one that does
support CGI. For more information see the comp.infosystems.www.servers.*
newsgroup appropriate for your platform.
-=Eric
------------------------------
Date: Tue, 15 Jun 1999 22:05:13 GMT
From: Ryan Corder <uucon@my-deja.com>
Subject: saving uploaded file
Message-Id: <7k6imh$35c$1@nnrp1.deja.com>
ok, following the advice of the newsgroup community, i have managed to
configure my script with CGI.pm so that a user can upload a file. Now, how
do i save the file in a particular dir. I want to be able to save the
uploaded image in: /home/<username>/images here is the code i used to read
the filename and the MIME type so that users can only upload images:
## Set the uploaded file's name to the following variable.
$filename = $query->param('image');
## Read the MIME type and make sure it is only an image
$filename = $query->param('image');
$type = $query->uploadInfo($filename)->{'Content-Type'};
unless ($type eq 'image/gif' || $type eq 'image/jpeg') {
die "IMAGE FILES ONLY!";
}
thanks!
Ryan
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 15 Jun 1999 19:37:07 -0400
From: "Leonid Goltser" <leonid76@erols.com>
Subject: user IP
Message-Id: <7k6o0p$231$1@autumn.news.rcn.net>
I want my script can recognize IP of a user who call it.
------------------------------
Date: Tue, 15 Jun 1999 16:49:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: What is functional difference between .pm and .pl?
Message-Id: <Pine.GSO.4.02A.9906151638440.10614-100000@user2.teleport.com>
On Tue, 15 Jun 1999, Scratchie wrote:
> Some people use .pl to represent a perl script.
A better choice, if you _must_ use an extension, is .plx for "PerL
eXecutable". This can be a big help if your system has no other way to
recognize executable files than by their extensions. After all, Perl
Libraries (with the .pl extension) are to be loaded, not to be executed.
Of course, this assumes that a single file can't fit in more than one
category. I'm sure that Chip or Randal could make a single file that works
simultaneously as a Perl Library, Perl executable, csh executable, and a
recipe for chili. (.rch, I think). And Chip's chili might even taste good.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 6009
**************************************