[12904] in Perl-Users-Digest
Perl-Users Digest, Issue: 314 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 30 15:07:20 1999
Date: Fri, 30 Jul 1999 12:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 30 Jul 1999 Volume: 9 Number: 314
Today's topics:
Re: <<END_OF_TEXT function <jbc@shell2.la.best.com>
Re: <<END_OF_TEXT function (Mike G.)
Best way to build a complex data structure kirk@kaybee.org
Re: Best way to build a complex data structure (Eric Bohlman)
CGI.pm bug? repeating values (Peter Bismuti)
Re: Die process, Die! <cassell@mail.cor.epa.gov>
Re: Easy way to emulate Unix's "sort" command? <cassell@mail.cor.epa.gov>
Re: framekeeper.pl <cassell@mail.cor.epa.gov>
Re: How to count clicks to HTML link. (Ray Green)
Re: How to: run a DOS batch in perl/cgi? <cassell@mail.cor.epa.gov>
Re: is process still running? mrduane@my-deja.com
Re: is process still running? <tchrist@mox.perl.com>
Re: is process still running? (Abigail)
Re: NEWSFLASH: Supremes rule anti-advert-ware illegal <jbc@shell2.la.best.com>
Re: perl IP to OS mapping help <cassell@mail.cor.epa.gov>
Re: perl port to windows CE ? dtbaker_dejanews@my-deja.com
qc check on dir <tom.kralidis@ccrs.nrcanDOTgc.ca>
Re: Re: How to read the submit button as a name or valu <Webdesigner@NewWebSite.com>
Re: Re: How to read the submit button as a name or valu <tchrist@mox.perl.com>
Re: Sorting by more than one variable !? <cassell@mail.cor.epa.gov>
Re: two forms interact with one script? <cassell@mail.cor.epa.gov>
Re: Use of uninitialized value at ...... warning with h <cassell@mail.cor.epa.gov>
Re: Warrning with Variable <anonymous@web.remarq.com>
Re: when writing to data file, last letter is missing <cassell@mail.cor.epa.gov>
Re: Why is this regexp not working ? (M.J.T. Guy)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Jul 1999 18:36:38 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: <<END_OF_TEXT function
Message-Id: <37a1f0b6$0$13652@nntp1.ba.best.com>
Paul Christopher Reid <paulreid@cableinet.co.uk> wrote:
> I have tried to execute a script with the <<END_OF_TEXT function for the
> first time without results.
That's here-document quoting. The part after the << is a string that
serves to mark the beginning and end of the quoted text. There's no
END_OF_TEXT function; that just happens to be what this person chose to
use for their string. It (the part after <<, 'END_OF_TEXT' in this
case) needs to be all by itself at the end of the quoted material, on
its own line with no spaces before or after it.
Something like this should work:
print <<Walnuts;
I really like to use
here-document quoting.
Walnuts
You probably need to check your server's error log, or try running the
script manually from the shell, to see what the specific problem is in
this case. One problem that happens frequently is that someone FTPs
the script in binary, rather than ASCII, mode from a Windows machine to
a Unix Web server, such that a stray carriage return gets stuck on that
line, preventing the end of the here-documented-quoted string from
being recognized.
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: 30 Jul 1999 18:44:01 GMT
From: tcsh@holly.colostate.edu (Mike G.)
Subject: Re: <<END_OF_TEXT function
Message-Id: <slrn7q3sjh.34lm.tcsh@yuma.ACNS.ColoState.EDU>
paulreid@cableinet.co.uk (Paul Christopher Reid):
> I have tried to execute a script with the <<END_OF_TEXT function for the
> first time without results. I keep getting internal server error and i
>
Where's your code?
--
Mike G.
------------------------------
Date: 30 Jul 1999 18:39:22 GMT
From: kirk@kaybee.org
Subject: Best way to build a complex data structure
Message-Id: <7nsrgq$bt0$1@news-int.gatech.edu>
Okay, I need to build a very large list of files and have some
attributes associated with each file. The number of files in this list
may be the full path of every file on the system, so I'm trying to do
this as efficiently (both in speed and memory usage) as possible. Once
the list is built, I will then have to go through and remove certain
items... so I'll be searching through and removing items from the list.
I will have to go through and remove files many times, so I want the
search and removal process to be as efficient as possible.
One idea I had is to store it is a hash:
$FileList{'/some/path/to/some/file'} = "attributes";
However, this means that in order to search through and prune out
certain entries based on certain regular expressions, I would have to do
something like this:
foreach $ThisFile (keys %FileList) {
if ($ThisFile =~ /regex/) {
delete $FileList{$ThisFile};
}
}
This last statement seems that it could be very CPU intensive. The
other idea I thought of was to store each one like this:
push @FileList, "/some/path/to/some/file||||attributes";
where I use something unique (i.e. ||||) to seperate the filename from
the attributes. I could then do this kind of command to remove items:
grep /^regex||||.*$/, @FileList;
to go through and remove certain files.
Which way would be more efficient? Anybody have any better suggestions?
--
Kirk Bauer -- CmpE, Georgia Tech -- kirk@kaybee.org -- Avid Linux User
GT Sport Parachuting Club! http://cyberbuzz.gatech.edu/skydive
Opinions expressed are my own, but they should be everybody's.
------------------------------
Date: 30 Jul 1999 18:59:08 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Best way to build a complex data structure
Message-Id: <7nssls$qhg@dfw-ixnews5.ix.netcom.com>
kirk@kaybee.org wrote:
: Okay, I need to build a very large list of files and have some
: attributes associated with each file. The number of files in this list
: may be the full path of every file on the system, so I'm trying to do
: this as efficiently (both in speed and memory usage) as possible. Once
: the list is built, I will then have to go through and remove certain
: items... so I'll be searching through and removing items from the list.
: I will have to go through and remove files many times, so I want the
: search and removal process to be as efficient as possible.
:
: One idea I had is to store it is a hash:
:
: $FileList{'/some/path/to/some/file'} = "attributes";
:
: However, this means that in order to search through and prune out
: certain entries based on certain regular expressions, I would have to do
: something like this:
[snip slow linear search]
:
: This last statement seems that it could be very CPU intensive. The
: other idea I thought of was to store each one like this:
:
: push @FileList, "/some/path/to/some/file||||attributes";
:
: where I use something unique (i.e. ||||) to seperate the filename from
: the attributes. I could then do this kind of command to remove items:
:
: grep /^regex||||.*$/, @FileList;
That still involves a linear search; it will be somewhat faster since the
looping is done in highly-optimized C code rather than in Perl operators,
but the time complexity will still be the same.
If your regexes basically just test for the existence of specific path
components, then you might want to use a multi-dimensional hash,
something like:
: $FileList{some}{path}{to}{some}{file} = "attributes";
which would partition your list of files into a tree of easily-accessible
sub-lists.
------------------------------
Date: 30 Jul 1999 18:41:09 GMT
From: bismuti@cs.fsu.edu (Peter Bismuti)
Subject: CGI.pm bug? repeating values
Message-Id: <7nsrk5$egd$1@news.fsu.edu>
I have had a problem with several of my CGI scripts using CGI.pm.
This is what some of the values look like after a form is used
for a while:
app_semester = FallFallFallFallFallFallFallFall
app_year = 20002000200020002000200020002000
calendar_grad = semester hours
calendar_ugrad = quarter hours
citizenship = USAUSA
city_perm = OlympiaOlympia
city_pres = TallahasseeTallahassee
contents_true = yesyesyesyes
country_perm = USAUSA
country_pres = USAUSA
day = 3030303030303030
This doesn't happen to all the variables, although there doesn't
seem to be any reason why some will repeat and some won't.
I've also had a problem with values being erased, perhaps the two
are related.
Does anyone know how to fix this?!
Thanks!!
------------------------------
Date: Fri, 30 Jul 1999 11:27:22 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Die process, Die!
Message-Id: <37A1EE8A.C5153B33@mail.cor.epa.gov>
Michel Dalle wrote:
[snip]
> Several free CGI scripts (*) show this on line 17 :
> # expressly forbidden. In other words, please ask first before you try and #
>
> Could this be the problem ? :-)
Wow. It's scary how prescient Abigail is. Line 17, just as
predicted.
However, prescience isn't all it's cracked up to be. I'll
bet Abigail's prescience ruins a lot of movies in the first
few minutes...
> Michel.
> (*) found on Matt's Script Archive...
Of course. What a surprise. Well, I knew you weren't going
to find a line like that in one of TomC's scripts. Not unless
the preceding line looked like:
# and running this program anywhere near a Tool of Bill is #
:-)
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 11:23:22 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Easy way to emulate Unix's "sort" command?
Message-Id: <37A1ED9A.C5843BF2@mail.cor.epa.gov>
Anno Siegel wrote:
[snip]
> Only perl can parse Perl. And Larry Rosler, apparently. How on earth
> did you spot that missing paren in the line of comics-swearing above?
Larry cheats. He actually slaps code into an editor and runs
it. The nerve of some people! :-)
Now if only I could do that all the time with my *own* code...
Oh yeah, and I need a spell checker for my posts.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 11:13:10 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: framekeeper.pl
Message-Id: <37A1EB36.706F89BF@mail.cor.epa.gov>
Benjamin Dälken wrote:
>
> does anyone now where i can get the script "framekeeper.pl" ?
>
> this is a script which takes you in the right frameset, when you only load
> one frame of the set.
I think you'll probably want to use some web search engine
to track it down. That will be far more efficient than
hanging around here while angry Perl programmers flame you
for asking for a program in a newsgroup about *writing*
programs.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 18:37:11 GMT
From: wraygreen@hotmail.com (Ray Green)
Subject: Re: How to count clicks to HTML link.
Message-Id: <37a1cddc.2201498@nntp.netcomuk.co.uk>
gbacon@itsc.uah.edu (Greg Bacon) wrote:
> Faisal Nasim" <swiftkid@bigfoot.com> writes:
>: <a href="blah.cgi?/mydir/mypage.html">
>:
>: Use any nice database and increase hits .... and then redirect
>: to the page... easy eh?
>Your design is broken. Counting HTTP accesses is impossible. Give
>it up.
Proxies or no proxies, please explain why this wouldn't work. Surely
the script would run on the server every time the link was clicked and
increment a counter. Or am I missing something. Hmm I think I am
because even the Perl FAQ says :
"Didn't anyone ever tell you web-page hit counters were useless?"
But why?
Thanks for any pointers to some answers.
W. Ray Green
------------------------------
Date: Fri, 30 Jul 1999 11:20:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <37A1ED00.8CA920F6@mail.cor.epa.gov>
Tim Nettleton wrote:
>
> I am sorry that I did not state it clearly enough. I really am a bit
> apprehensive about perl because I have no experience with it.
Well then, dive in! I recommend going to
http://www.netcat.co.uk/rob/perl/win32perltut.html
which isn't actually win32-specific.
Then go out and but "Learning Perl" or "Learning Perl for
Win32 Systems", which ever seems more appropriate for you.
> Simply stated, I have a batch file that I would like to run on the server
> that would get one parameter from a web page form and would display the
> results to that same web page. I have looked at formmail.pl and am not sure
> how to modify something like that to do what I would like.
*which* formmail.pl program? No, never mind. I haven't
seen anything named formmail.pl which I would put up on *my*
webpage. Besides, you just want to put HTML up, you don't
want to mail something off to someone else, do you?
> This seems like an easy one for you(the group) but I am not sure where to
> start. I have already done some searched for key words like batch dos perl
> and found nothing that looks like a fit. I have a unix and an NT account
> that I can load the script to.
I suggest you look into the CGI.pm module, which will take
care of the hard parts for you. It comes with lots of docs,
which have lots of helpful examples. There are web tutorials
for it as well. And there are lots of examples of using it
in the archives of this newsgroup to be found at deja.com .
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 17:55:11 GMT
From: mrduane@my-deja.com
Subject: Re: is process still running?
Message-Id: <7nsotq$pc1$1@nnrp1.deja.com>
Thanks for the info. I was aware that kill($pid) just calls the unix
kill command. What I wasn't aware of was that it is the kill command
it self that you use to check if a process is running.
Again, thanks to all for the help.
-Duane
In article <bx8o3.95$g91.7238@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
> In article <7nq361$t7n$1@nnrp1.deja.com>,
> mrduane@my-deja.com writes:
> > Is there a function call available that can tell me if a UNIX
process is
> > still running, given that I have the pid?
>
> Yes, kill will, but it's not a perl question. The perl kill just calls
> the systems' kill. It's really a question about unix, and a usenet
> group that talks about unix programming would have been more
> appropriate.
>
> # perldoc -f kill
> [snip]
> See L<perlipc/"Signals"> for details.
>
> # perldoc perlipc
> [snip]
> Another interesting signal to send is signal number zero.
> This doesn't actually affect another process, but instead
> checks whether it's alive or has changed its UID.
> [snip]
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | If at first you don't succeed,
try
> Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use
being
> NSW, Australia | a damn fool about it.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 30 Jul 1999 12:47:42 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: is process still running?
Message-Id: <37a1f34e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, mrduane@my-deja.com writes:
:Thanks for the info. I was aware that kill($pid) just calls the unix
:kill command.
No, it doesn't. It performs the kill(2) system call directly.
The kill(1) command is certainly not invoked.
--tom
--
"Do we define evil as the absence of goodness? It seems only logical
that shit happens--we discover this by the process of elimination."
--Larry Wall
------------------------------
Date: 30 Jul 1999 13:55:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: is process still running?
Message-Id: <slrn7q3t7j.h2a.abigail@alexandra.delanet.com>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCLIX September
MCMXCIII in <URL:news:7nsent$3f1$1@lublin.zrz.tu-berlin.de>:
{} Tom Christiansen <tchrist@mox.perl.com> wrote in comp.lang.perl.misc:
{}
{} [...]
{}
{} >or
{} >
{} > ${"it's alive and its uid hasn't changed"} = kill(0, $hispid);
{} >
{} >Of course, we're assuming that $hispid is positive here.
{}
{} We're also assuming that a zombie is alive. Just a side note.
Well, zombies aren't dead....
Abigail
--
I know, cause there lives one in my garden.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 30 Jul 1999 18:20:26 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: NEWSFLASH: Supremes rule anti-advert-ware illegal
Message-Id: <37a1ecea$0$13652@nntp1.ba.best.com>
In comp.lang.perl.misc mike cardeiro <mikecard@my-deja.com> wrote:
> arent you all the same people who are always whining about the signal to
> noise ratio whenever a newbie asks a question
This is one of those "all animals were created equal, but some are more
equal than others" kind of things. It *is* interesting, though, that
Tom and Abigail, who tend to fall toward the harsher end of the
spectrum in their views regarding the influence of newbies in the
group, have given some exceptional examples lately of posting behavior
that, if it came from a newcomer, would be cited as a prime example of
how not to behave.
Clearly, Tom and Abigail have contributed mightily to the group, and
deserve to take whatever liberties they like. For myself, I consider
their off-topic stuff more interesting than the on-topic postings. It's
the nature of Usenet, anyway, that in a non-moderated group everyone
pretty much gets to say whatever the hell they want, and you end up
with a clear picture of what makes a given individual tick, warts and
all.
In that sense, Usenet is impressively democratic. Tom and Abigail are
free to bitch about newbie repostings and Web discussion while engaging
in similar behavior themselves, but by the same token you and I get to
chatter about their hypocrisy in doing so.
It's the regulars' appreciation of the shortcomings of that sort of
democracy, and their desire for something better, that leads to the de
facto aristocracy (or, more properly, meritocracy) under which a given
utterance is classified as noise or signal based on who said it, rather
than what was said.
But yeah, from a certain perspective it does suck.
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: Fri, 30 Jul 1999 11:34:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl IP to OS mapping help
Message-Id: <37A1F021.DDD78412@mail.cor.epa.gov>
Malcolm Ray wrote:
>
> On Fri, 30 Jul 1999 15:19:36 GMT, ffr200 <ffr200@my-deja.com> wrote:
> >hello,
> > I need to write a perl program that receives an IP address and a
> >hostname, and is able to return an operating system and OS
> >information. Does anyone know how to get an OS from a given IP? Help
> >is greatly appreciated.
>
> If the IP address is within your own organisation, then just ask the
> person responsible for that host (you do keep track of ownership of
> IP addresses, right?). If the IP address is outside your organisation,
> then it's none of your business what OS is running on that host.
Yep. And if the given IP address is a firewall or a proxy
or the ISP of the user, then the available info [even via nmap]
may not be what the poster wanted.
Why would anyone need the OS from a given IP?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 18:14:10 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: perl port to windows CE ?
Message-Id: <7nsq19$q6v$1@nnrp1.deja.com>
In article <hx0o3.8720$J5.96181@c01read02-admin.service.talkway.com>,
"dcw" <worenklein@iname.com> wrote:
> The current opinion is that it's not doable. The small OSes (CE,
> PalmOS) don't allow you to allocate a large block of continuous
memory.
>
> I believe there's going to be a get-together at the O'Reilly
conference
> to discuss it.
---------------------------
boy, I hope somebody figures out how to get perl running on it... the
only scripting language that I can find running on CE is "REBOL". An
interesting small-footprint language (see http://www.rebol.com ) But it
has some pretty different syntax and seems to be pretty "new" and
therefor missing a lot of nice built-in stuff we take for granted as
well as extensive user libs of cool utilities.
Anyway, seems that if just the core of perl and maybe a few of the basic
libs were made available it would be possible to make a small footprint
perl? I just got an HP Jornada 680, and it has all the "pocket" versions
of MS products, so there must be a pretty good size chunk of memory
available?!
Dan
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 30 Jul 1999 14:29:08 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: qc check on dir
Message-Id: <37A1EEF4.F485D73F@ccrs.nrcanDOTgc.ca>
What's the best way to check if a directory exists?
I am writing a file mover to specific dirs, where if the dir does ont
exist, the script will create it.
I thought of
if (opendir TMPDIR, "/home/user/$first/$second." or die "directory does
not exist: $!";){
system("mv $first*$second* TMPDIR");
} # The variables are picked up earlier in the script.
else{
mkdir "/home/user/$first/$second", 0775;
system("mv $first*$second* TMPDIR");
}
Also, is there anything more native to Perl than using a system move
command? I have looked high and low, but no luck.
Any advice is appreciated. Please email reply also (change dot to .) if
possible.
Thanks alot
..Tom
-----------------------------------------------------------------------------------------
Tom Kralidis Geo-Spatial Technologist
Canada Centre for Remote Sensing Tel: (613) 947-1828
588 Booth Street , Room 241 Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------
------------------------------
Date: Fri, 30 Jul 1999 18:26:51 GMT
From: Floyd Morrissette <Webdesigner@NewWebSite.com>
Subject: Re: Re: How to read the submit button as a name or value
Message-Id: <7nsqov$qnp$1@nnrp1.deja.com>
In article <37a19b21@cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
> Never do form-cracking by hand. People who've written their own web
> browsers and the author of CGI.pm are exempt, but the rest of you,
SHAME!
>
> --tom
> --
> "That must be wonderful! I don't understand it at all."
>
I have a question. Its seems to me that it would be better, if all you
want to do is read and parse, to cut and paste the ReadParse sub from
CGI.pm to the script where you want to use it. That way the server does
not have to read and compile and execute the entire 200k+ CGI.pm module.
I am not extremely familiar with CGI.pm so I don't know if that would
work. I realize I may be wrong and that is why I am asking the question.
Floyd
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 30 Jul 1999 12:51:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Re: How to read the submit button as a name or value
Message-Id: <37a1f44a@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Floyd Morrissette <Webdesigner@NewWebSite.com> writes:
:I have a question. Its seems to me that it would be better, if all you
:want to do is read and parse, to cut and paste the ReadParse sub from
:CGI.pm to the script where you want to use it. That way the server does
:not have to read and compile and execute the entire 200k+ CGI.pm module.
% time perl -MCGI -e 1
0.062u 0.009s 0:00.08 36.8%
Don't blink. You'll miss it.
--tom
--
"It's easier to make up sayings people like to hear than sayings they
like to heed."
--Larry Wall
------------------------------
Date: Fri, 30 Jul 1999 11:30:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Sorting by more than one variable !?
Message-Id: <37A1EF36.92C74CD9@mail.cor.epa.gov>
Ryan Ngi wrote:
[snip]
> by sorting the [1] of array if the [1] of array is equal then perform
> second sort on [0]
>
> ...... i expect the result as
>
> Jack James John Jim
>
> how to implement the clean algorithm for this job !?
I think that you'll want to read the FAQ which deals with
this. You can find the question by the use of
perldoc perltoc
or you can just go to perlfaq4 and look for the question:
"How do I sort an array by (anything)?"
This also contains a URL to Tom's FMTEYEWTK on sorting,
which has even more helpful material on the topic.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 11:11:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: two forms interact with one script?
Message-Id: <37A1EADA.8C19CD9F@mail.cor.epa.gov>
Niek Slatius wrote:
>
> The problem is I (still) don't use any type of Unix OS and thus I don't have the
> proper perl environment to test things for my self. The only thing I do is start
> up NOTEPAD and copy paste the things I need from other scripts that I have
Then first get yourself an adequate working setup. You can go to perl.com and
look at the editors page to get a long list of win32 editors which will let
you edit and run form within the editor. PFE (the programmer's file editor)
might be the fastest to get running in a simple way. Notepad will do, but
it's not optimal.
If you want to do CGI too, get the CGI.pm module. With it and a tiny
webserver, you can do webwork from the comfort of your own command line.
It's much easier than the try-and-fail-and-guess technique when trying
CGI scripts on your ISP's machine when you can see his server logs.
> encountered and adjust thing to my specific needs. I haven't encountered any good
> PERL documentation/ tutorials on the web so far and my at my local liberary every
Try http://www.netcat.co.uk/rob/perl/win32perltut.html for
starters. And be sure to look at the tutorials page at perl.com
also.
> PERL book seem to have been stolen :-(. Although I haven't checked out the links
> yet that I was sent by this newsgroup automaticly and I will do so right now ;-).
Well, the most up-to-date docs are the perl* manpages on your hard
drive. Use man or perldoc or an HTML browser or whatever you like,
but find them and read them. Especially the FAQ. You'll be glad
you did.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 11:14:45 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Use of uninitialized value at ...... warning with hash of hash
Message-Id: <37A1EB95.32DA3576@mail.cor.epa.gov>
I already answered this one via e-mail. I didn't realize that
he had posted this as well.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 30 Jul 1999 10:22:10 -0800
From: Samay <anonymous@web.remarq.com>
Subject: Re: Warrning with Variable
Message-Id: <933358934.6097@www2.remarq.com>
Very Nice, Thank You..
Mat's post actually solved my problem, since my output and
warning were going to the same file handler, But Ala's
solution is more elegant.
I read Perldoc -q SIG to see how nicely clousers are used.
and the other ways of using SIG.
It prompted to me to check %SIG.
and to my surprise "__WARN__" was not there..
I also read perlipc
How does this works?
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Fri, 30 Jul 1999 11:37:59 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: when writing to data file, last letter is missing
Message-Id: <37A1F107.7F1B7C5E@mail.cor.epa.gov>
vmacri@my-deja.com wrote:
>
> This may be a little vague but,
A little. But I've got my PSI::ESP module working again, so...
> I've got a script that once a user fills in their info the script writes
> it to text file. All the info is put into fields in the text file. My
> problem is that everything is written to that file correctly except the
> email address. The last letter of that field is always missing. An
> example is, if you type in your email as you@yourcompany.com the script
> wirtes to the text file as you@yourcompany.co The last letter is always
> missing. Then if someone goes in to change their info and re-enters the
> info again, then a second letter from the end goes missing.
Hmmm... let's see... the mists are parting...
I see a chop() in your code.
Is that it? Is your $email variable getting a chop() once it
comes back to you? If so, cut it out. chop() cuts off the
last character, whether it's a newline or not. And you sure
don't seem to be adding a newline on the end if this is what's
happening.
chomp() is safer anyway. Read about it in your perlfunc
manpage, using man or perldoc or an HTML browser or whatever
you like.
I also see... Hmmm. You might want to keep an eye on that
mole you were wondering about. Yeah, that one.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 30 Jul 1999 18:11:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Why is this regexp not working ?
Message-Id: <7nspsu$nq4$1@pegasus.csx.cam.ac.uk>
In article <7nskma$m5j$1@nnrp1.deja.com>, <aschmied@earthlink.net> wrote:
>
>\w matches numbers too. It is equivalent to [a-zA-Z0-9] (As stated by
>the nutshell.)
Not quite. Make that [a-zA-Z0-9_]. And add the obligatory
comment about locales, of course.
Mike Guy
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 314
*************************************