[12954] in Perl-Users-Digest
Perl-Users Digest, Issue: 364 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 4 12:07:17 1999
Date: Wed, 4 Aug 1999 09: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 Wed, 4 Aug 1999 Volume: 9 Number: 364
Today's topics:
Re: << Print Command Won't Work (Larry Rosler)
Re: [offtopic]RE:Quot St and the Jeop Gm <aqumsieh@matrox.com>
Re: [offtopic]RE:Quot St and the Jeop Gm (llornkcor@earthlink.net)
Re: chdir isn't working when using a variable for the d (Larry Rosler)
checking for a filename in a directory <acollado@uiuc.edu>
CHMOD files under NT?? <saxbourne@yahoo.com>
Re: download available <dalleyjo@pilot.msu.edu>
getting date from HTTP::Headers maxime69@my-deja.com
Re: How to create "function pointers"? (Matthew David Zimmerman)
How to turn off cashing in perl??? <codeman@gol.com>
Matching <rvdd@iafrica.com>
Re: Newbie Q: How to check if invoked as CGI program (Larry Rosler)
Re: password protected site (Abigail)
Perl script as a FTP client <cmd@nospam_altnews.com.au>
Re: Question for Perl gurus <alex@kawo2.rwth-aachen.de>
Re: Question for Perl gurus (Anno Siegel)
Re: Repetition in RE substitutions <uri@sysarch.com>
Re: Repetition in RE substitutions <jcreed@cyclone.jprc.com>
Re: SELECT MULTI (Perl FORM data parsing) <elvis@fallenones.org>
Turning off cashing from Perl??? <codeman@gol.com>
Re: Useless error when {} unbalanced (Jerome O'Neil)
Re: working with = sign in a directory name - please he <tflynn@iastate.edu>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 4 Aug 1999 08:08:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: << Print Command Won't Work
Message-Id: <MPG.1211f734581c3248989db7@nntp.hpl.hp.com>
In article <37A7FEE7.632E8845@kawo2.rwth-aachen.de> on Wed, 04 Aug 1999
10:50:47 +0200, Alex Farber <alex@kawo2.rwth-aachen.de> says...
> remove the spaces
>
> zexl wrote:
> > print "Content-type:text/html \n\n";
> ^here
>
> > print << 'End';
> ^and here
#!/usr/local/bin/perl -w
use strict;
print << 'End';
Content-type:text/html \n
Neither of those spaces has any significance.
As you could have determined by testing before posting.
Or -- gasp -- reading the appropriate documentation.
End
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 04 Aug 1999 15:11:26 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <7o9l6j$gdh$1@nnrp1.deja.com>
In article <hfmg16r3.fsf@wind.localdomain>,
llornkcor <llornkcor@llornkcor.com> wrote:
> And you call this ng has quality of answers?
Apparently you haven't been around here for long. Most people here are
willing to spend their time helping others for free. Their only
condition is that the person seeking help would try first to read some
docs and figure out what to do himself. If he fails, then he is welcome
to post, and only THEN should he post to Usenet. Unfortunately, most
posters are too lazy to do that, and the first thing they do is post
just because they think their time is more valuable than everyone
else's.
I believe that the high traffic of lazy newbies around here is due to
the tremendous help the Perl community is willing to offer for free.
Would you like it if posts were answered one week after they were
posted? This would cut down a lot of noise for sure!
> hmm, I am trying to have a kinder place here. This is what I am asking
> for.
Then educate newbies. Teach them to go and read some docs or a chapter
in a book, before even thinking about posting to Usenet. Lurk around
here for a while, and you'll see the quality of the posts by the "Perl
gods"; the same ones you are criticising. But they only come to those
who deserve them. I admit I learnt a lot just by reading posts in this
ng.
> [1]- The FAQ's are hopelessly inept. ( my opinion) About as bad as
> Microsofts documentation. When I say that, I mean that it's about as
> hard to find what I want as this newsgroup.
Now you are being a troll here. I can find anything I want in the
perldocs within 30 seconds. You can time me if you want :)
Maybe you don't know how to use 'perldoc'. Or perhaps you work on a
winblows machine that doesn't offer little useful utilities such as
'grep'. In any case, you should learn to browse the docs. It is a VERY
VERY useful habit, and much faster than waiting for a reply from Usenet.
Personally, I do a grep on all *.pod files to see where my keyword is
located, and then browse the appropriate file using 'perldoc'.
Perl's docs and FAQs and the best I have ever seen for any piece of
software. They are particularly impressive because they are complete,
they are always up to date, and they are completely FREE. What else do
you want? Do you know how much time and energy was spent on the docs?
(Thanks Tom ... you are the greatest)
Are the MS docs complete? No.
Are the MS docs up to date? No.
Are the MS docs free? No.
How do you compare Perl's docs to MS's then?
> [2]- I hate being told what to do. I don't dictate to you to post in
> any 'style', or what you should put in your sig file.
Obviously you are missing the point. Did you teach yourself to speak?
Did you teach yourself to read? Did you teach yourself to count?
The answer is NO .. someone taught you. This is the basis of the
academic system. Others have spent time and energy to figure out the
best way to do things, and we are being taught their ways to make life
simpler; and because their ways have been tested and proven; and to
prevent us from reinventing the wheel.
Same thing with the posting style. No one really dictates what style you
use. You can also create your own language and go around communicating
with it. But no one will understand, and you will start annoying people
around you.
--Ala
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 04 Aug 1999 09:52:44 -0600
From: llornkcor@earthlink.net (llornkcor@earthlink.net)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <wk672vwnjn.fsf@earthlink.net>
Uri Guttman <uri@sysarch.com> writes:
>you should be called tommy since you are deaf, dumb and blind (i bet he
>doesn't get the rocknroll reference). the perl FAQ's are among the most
>complete and well written around. almost all the newbie questions are
>answered there. you either can't read or search or ask a logical
>question if you can't get any use out of them. comparing them to
>redmonddocs is absurd and incredibly insulting. but coming from a twit
>like you, it makes sense.
Ok, I'll admit, THIS was a low blow, and uncalled for. I'm
sorry. NOTHING can be as bad as anything out of redmond. I apologize
to those people that put in long hours processing information.
>obviously you have never learned from your betters. so get out of this
>group and stay in alt.perl. you have been posting stuff there with the
>great disclaimer "i think this works". very helpful. such confidence. i
I did that just because of the discussion here. Of course it
works. maybe. Nothing is guaranteed to work.
>and there are rules in usenet and in this group. conventions are
>rules. those who drive on the wrong side of the road break rules and
>necks. jeopardy style (i like that term!) posts are very annoying and
>another virus from redmond and the crappy emailers out there. by making
>it hard to edit the quote and always putting the cursor BEFORE the
>quoted text, it encourages this most confusing style of replying. i see
I happen to _prefer_ where the comment is before the quoted text, that
way I dont have to scroll through it all. Personal choose.
>intelligent unix users doing it where i work and i can't stand
>it. people just seem to tolerate crap email. we don't tolerate it
>here any more than non-perl questions, faq's and trolls.
Toleration goes a long way in the world. You should try it.
>go away, often!
No.
------------------------------
Date: Wed, 4 Aug 1999 08:25:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: chdir isn't working when using a variable for the directory
Message-Id: <MPG.1211fb47377ef413989db8@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <37A7F3C9.B26278CA@lucent.com> on Wed, 04 Aug 1999 09:03:21
+0100, Randy Wyatt <rwyatt1@lucent.com> says...
...
> #!/opt/perl5/bin/perl
-w
use strict;
my
> $tmpdir = "tmp";
> chdir('$tmpdir');
>
> The directory tmp is in the current working directory and the permissions are
> the directory are 755. Does anybody have any ideas ?
You already have two correct but incomplete answers.
chdir $tmpdir or die "Couldn't chdir to '$tmpdir'. $!\n";
Now the single-quotes around $tmpdir are functional. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 04 Aug 1999 10:59:04 -0500
From: Andy Collado <acollado@uiuc.edu>
Subject: checking for a filename in a directory
Message-Id: <37A86348.F586FC17@uiuc.edu>
How would I check to see that a filename inputted from a form is a
valid filename within a directory that is also specified from the same
form? (ie. a web user tells Perl their username, which is the
directory, and specifies a file to delete, but I don't have a way to
verify that the file actually exists!)
Thanks.
Andy
------------------------------
Date: Wed, 4 Aug 1999 16:38:48 +0100
From: "rezn8" <saxbourne@yahoo.com>
Subject: CHMOD files under NT??
Message-Id: <7o9mpj$l29$1@pegasus.csx.cam.ac.uk>
How do you set CHMOD settings under NT, I am running Apache for NT.
------------------------------
Date: Wed, 04 Aug 1999 11:25:21 -0400
From: Joel <dalleyjo@pilot.msu.edu>
Subject: Re: download available
Message-Id: <37A85B61.41B2EDC1@pilot.msu.edu>
Jonathan Stowe wrote:
> Joel <dalleyjo@pilot.msu.edu> wrote:
> > The Goods is a cool web application that runs on UNIX systems.
> >
> >
> > http://dalleyjo.user.msu.edu/cgi-bin/goods/goods_home.cgi
> >
>
> Ooh. no -w, no 'strict', hand-rolled parameter decoding, no check on the
> success of file opens -
>
>
> system "mkdir $user_path/$new_user";
> open (FILE, ">$user_path/$new_user/$new_user.dat");
> print FILE $confirm_password;
> close (FILE);
> system "chmod -R 700 $user_path/$new_user";
>
> Ooh ...
>
> $test_time_check_time = localtime(time);
> $test_new_time1 = substr($test_time_check_time, 11,2);
> $test_new_time2 = substr($test_time_check_time, 14,2);
> $test_time_check_time = $test_new_time1.$test_new_time2;
>
> All topped off with hundreds and hundreds of print statements with nary
> a here document ...
>
> This could be the evil twin of Matt Wright.
>
> /J\
> --
> "When the boys in the playground found out that I had a potentially
> fatal peanut alergy they would shove me up against a wall and make me
> play Russian roulette with a bag of Revels" - Milton Jones
Well - take it or leave it, I guess. I'm simply offering it up; certainly
someone in this world besides
myself will find it useful. Concerning the reference to Matt Wright, is that
a slam or a compliment. I ask
only because he's been doing this for a long time now and I've been web
programming / using Perl
for about a month and a half; this program is my first web app. Think back
to when you were that far along and what you'd done to date...
- Joel
------------------------------
Date: Wed, 04 Aug 1999 15:40:15 GMT
From: maxime69@my-deja.com
Subject: getting date from HTTP::Headers
Message-Id: <7o9mst$ho7$1@nnrp1.deja.com>
Hi,
I have the following code:
$request = new HTTP::Request 'GET', 'http......';
$header = new HTTP::Headers;
$response = $UserAgent->request($request, $header);
print "date is ", $header->date(), "\n";
At this point after succesfully downloaded the page how can I write the
last date since the page has been modified ?
Thank you
Max
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 4 Aug 1999 15:59:11 GMT
From: mdz4c@node9.unix.Virginia.EDU (Matthew David Zimmerman)
Subject: Re: How to create "function pointers"?
Message-Id: <7o9o0f$7uh$1@murdoch.acc.Virginia.EDU>
In article <7o8fag$lm1$1@murdoch.acc.Virginia.EDU>,
Matthew David Zimmerman <mdz4c@node9.unix.Virginia.EDU> wrote:
>In article <7o7gv1$3su$1@news-int.gatech.edu>, <kirk@kaybee.org> wrote:
>
>>Also, is there an easy way to store a reference to an exsiting named
>>(i.e. non-anonymous) function in a scalar?
>
>$MyFunction = \&function(); #I think, at least, not tested.
Of course, I meant:
$MyFunction = \&function; #This one is tested.
Matt
--
Matthew Zimmerman ------------ http://www.people.virginia.edu/~mdz4c
Interdisciplinary Biophysics Program --------- University of Virginia
| "You got to be very careful if you don't know where you're going, |
| because you might not get there." -- Yogi Berra |
------------------------------
Date: Thu, 5 Aug 1999 00:26:39 +0900
From: "Scott" <codeman@gol.com>
Subject: How to turn off cashing in perl???
Message-Id: <7o9m3i$6hq$1@nn-tk001.ocn.ad.jp>
Dear Sir/Madame,
I am working on a project in Japan at the moment and
live in Tokyo. I am having trouble with the code as it
keeps going to the cache and I want it to refresh on the
first time around.
I was wondering if you had any ideas about how I could
achieve the effect of it not going to cache. I have tried
quite a few things.
Scott
#!/perl/bin/perl.exe -w
#print "<Meta HTTp-equiv=\"Pragma\" Content=\"No-cache\";
print "Content-type: text/html\n\n";
#Cache-Control: must-revalidate
#Cache-Control: max-age=3600
print "Cache-Control: no-cache\n\n";
#print "Pragma: no-cache\n\n";
#print "Pragma: no-cache \n\n";
#Content-type: text/html Pragma: no-cache
#use CGI qw(:standard);
#print header(-expires=>'-1d');
#print header(-Refresh=>'1';);
#use CGI;$query = new CGI;
#print $query->header(-expires>'now');
#print "<Meta Http-equiv=\"Pragma\" Content=\"No-cache\">"
#print "Pragma: no-cache\n\n";
#&NoCache; # defaults to text/html
local(*FORM_DATA)=@_;
local($request_method,$query_string,@key_value_pairs,$key_value,$key,$value)
;
$netmarketprice="OFF";
$highwatermark="OFF";
etc;
------------------------------
Date: Wed, 4 Aug 1999 17:05:49 +0200
From: "Romiko" <rvdd@iafrica.com>
Subject: Matching
Message-Id: <7o9l8s$1794$1@nnrp01.ops.uunet.co.za>
I have one flat file which contains:
CIF NO|CUSNO|NAME |ACCOUNTNO |Name
The first three fields acually came from a seperate file and I merge the two
files to give the following format.
Firstly the last two fields will have more records than the first three.
This is a banking database and each customer has ONE customer number
therefore only 1 CIFNO, CUSNO,NAME. However they may have multiple accounts
thus MORE than one ACCOUNTNO. What I need to do is match the CUSNO to the
ACCOUNTNO and print out a final file thus all fields have the same number of
records. The ACCOUNTNO has an attribute I can use as a KEY to match to the
CUSNO. The ACCOUNTNO has the following format:
xxxxxccccc/xx , where ccccc is the CUSNO. Lets take a perfect example
100250|566 |BOBS |0290100566/51|BOBS
100251|568 |JOES |0290100568/11|JOES
100252|570 |BOGS |0290200568/12|JOES
|0290100570/31|BOGS
As you can see JOES has two accounts, now the final file needs to assign the
JOES CIFNO and CUSNO to the extra accounts so that the output looks as
follows:
100250|566 |BOBS |0290100566/51
100251|568 |JOES |0290100568/11
100251|568 |JOES |0290200568/12
100252|570 |BOGS |0290100570/31
That is the first task, You must be wondering why the I have the names
twice in the original flat file?
The reason why I had take the Names twice is incase a customer has a CIFNO &
CUSNO but NO account OR has an ACCOUNTNO but no CIFNO & CUSNO. Lets take
an Example
100250|566 |BOBS |0290110568/13|JOES
100251|568 |JOES |0290100568/11|JOES
100252|570 |BOGS |0290200568/12|JOES
|0290100570/31|BOGS
The final format for this would be
100250|566 |BOBS
100251|568 |JOES |0290110568/13|JOES
100251|568 |JOES |0290100568/11|JOES
100251|568 |JOES |0290200568/12|JOES
100252|570 |BOGS |0290100570/31|BOGS
Above those names came from the 3rd column as there was no ACCNO and NAME
(last column) for BOBS). If a customer had an ACOUNTNO and NAME and NO
CIFNO CUSNO then it would be the opposit where name comes from 4th column.
100251|568 |JOES |0290100568/11|JOES
100252|570 |BOGS |0290200568/12|JOES
|0290100566/51|BOBS
|0290100570/31|BOGS
Would be :
100251|568 |JOES |0290100568/11|JOES
100251|568 |JOES |0290200568/12|JOES
|0290100566/51|BOBS
100252|570 |BOGS |0290100570/31|BOGS
I have tried my best to explane the task, I think I will be using if and
else statements and a pattern where
$2 == $4 . I dont now exactly how to match it and then obviously the two
cases wherer $2 !== $4 or
$4 !== $2. I hope I have given a good explination, I will see if I can get
somewhere. This is pretty Diffs!
Once I have figured out the program I will apply it to 9111 records then
push in the account balances (Made the script for that already)
Your tips will really help, thanks guys
Romiko
------------------------------
Date: Wed, 4 Aug 1999 08:49:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie Q: How to check if invoked as CGI program
Message-Id: <MPG.121200ed83d961e1989dba@nntp.hpl.hp.com>
In article <37a851a4_2@newsread3.dircon.co.uk> on 4 Aug 1999 15:43:48
+0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
...
> In addition to these, the header lines received from the client, if
> any, are placed into the environment with the prefix HTTP_ followed by
> the header name. Any - characters in the header name are changed to _
> characters. The server may exclude any headers which it has already
> processed, such as Authorization, Content-type, and Content-length. If
> necessary, the server may choose to exclude any or all of these headers
> if including them would exceed any system environment limits.
A few days ago, someone suggested $ENV{REQUEST_METHOD}, which makes
eminent sense, I think.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 3 Aug 1999 21:41:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: password protected site
Message-Id: <slrn7qfa24.s67.abigail@alexandra.delanet.com>
Fulko van Westrenen (fulko@trane.wtm.tudelft.nl) wrote on MMCLXIII
September MCMXCIII in <URL:news:slrn7qef09.d1.fulko@trane.wtm.tudelft.nl>:
||
|| I would like to make a password protected page with perl:
|| after you enter a user/password you can update a database.
|| I have some ideas about how this should be done but is
|| the some documentation on this subject?
I'd say, that part of the transaction *shouldn't* be done with Perl.
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
-----------== 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: Thu, 05 Aug 1999 01:35:33 +1000
From: Craig <cmd@nospam_altnews.com.au>
Subject: Perl script as a FTP client
Message-Id: <37A85DC5.FB07603E@nospam_altnews.com.au>
Hi all,
I found a Perl script a while ago which could be used as a FTP client to
do things such as make dirs, delete & upload etc....
Does anyone know where I could find this script?
Thanks guys,
Craig.....
[cmd@altnews.com.au]
------------------------------
Date: Wed, 04 Aug 1999 17:55:30 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: Mr Amigo21 <amigo21@pacific.net.sg>
Subject: Re: Question for Perl gurus
Message-Id: <37A86272.659F70D8@kawo2.rwth-aachen.de>
Hi,
Mr Amigo21 wrote:
> I'm new to the language perl and have tried writing a few CGI
> scripts in perl but I would like to know how we can open an external program
> via the Perl-CGI script to run on the server?
see "perldoc -tf system", "perldoc -tf exec" and
"perldoc perlop" on qx, but be cautious...
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: 4 Aug 1999 15:57:54 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Question for Perl gurus
Message-Id: <7o9nu2$cm2$1@lublin.zrz.tu-berlin.de>
Mr Amigo21 <amigo21@pacific.net.sg> wrote in comp.lang.perl.misc:
>Dear Gurus,
>
> I'm new to the language perl and have tried writing a few CGI
>scripts in perl but I would like to know how we can open an external program
>via the Perl-CGI script to run on the server?
perldoc -f system
Anno
------------------------------
Date: 04 Aug 1999 11:29:42 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Repetition in RE substitutions
Message-Id: <x73dxzk1i1.fsf@home.sysarch.com>
>>>>> "DB" == Don Blaheta <dpb@cs.brown.edu> writes:
DB> Here's an example. Say I have a lot of text, in which occur serial
DB> numbers of the form \d+(-\d+)* . I need to go through and remove the
DB> hyphens from these numbers, without removing the hyphens from the rest
DB> of the text. Conceptually, what I want is something like
DB> s/(\d+)(?:-(\d+))*/$1($2)*/g
i just solved a similar problem where the input was like:
12:34:(5:23:22):23:1:(2:12):4
and the goal was to convert the : inside () to %.
DB> but of course that won't work. My first thought was to do something
DB> along the lines of
DB> while (m/\d+(-\d+)*/g) {
DB> $& =~ s/-//g;
DB> }
DB> but $& is read-only. Now I'm working on coming up with something like
DB> s/(\d+(-\d+)*)/ $1=~s{\-}{}g /eg
my first solution to my problem was to grab the insides of () and run a
tr/:/%/ on them with the /e modifier. it worked but i didn't like it.
the trick you missed is that $1 is also read only so you have to assign
it to a temp var to modify it.
so to fix that code you would do this:
s/(\d+(-\d+)*)/ ($tmp = $1) =~ tr{-}{} /eg
but that is as ugly as mine was. so after a little (or a lot of) thought
i realized, i really just wanted to do a s/:/%/ where i had selected
which : to change. you have the same issue, which - to delete. but how
to set the criteria?
the word for today is assertion. the term normally used for that is look
ahead/behind which is more graphical but not as clear as assertion. i
needed to assert that my : were inside a () with only digits and :'s as
neigbors. you need to assert your - are between digits. so let's rewrite
them in terms of assertions.
my code became:
s/(?<=\([:\d]+):(?=[:\d]+\))/%/g ;
that worked great. but i realized i could simplify it as only the right
or the left side assertion would be needed:
s/:(?=[:\d]+\))/%/g ;
so yours would become:
s/(?<=\d)-(?=\d)//g ;
we assert there is a digit on either side of the - which we replace with
the null string.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 04 Aug 1999 11:27:23 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: Repetition in RE substitutions
Message-Id: <a1907rsh0k.fsf@cyclone.jprc.com>
dpb@cs.brown.edu (Don Blaheta) writes:
> Now I'm working on coming up with something like
>
> s/(\d+(-\d+)*)/ $1=~s{\-}{}g /eg
>
> but nothing quite seems to work (and it's messy, too).
OWTDI:
{
my $tmp;
s/(\d+(-\d+)*)/(($tmp=$1)=~s,-,,g),$tmp/eg
}
No guarantees about it being the most clear
or efficient way...
---Jason
------------------------------
Date: Wed, 4 Aug 1999 10:33:10 -0400
From: "Elvis" <elvis@fallenones.org>
Subject: Re: SELECT MULTI (Perl FORM data parsing)
Message-Id: <HaYp3.48$nI1.3756@iad-read.news.verio.net>
As somenoe emailed me
@name = param('user') ;
worked.
I had to specifiy the name to get more than one value (the other method
works fine gathering single values)
Elvis <elvis@fallenones.org> wrote in message
news:FyXp3.32$nI1.3367@iad-read.news.verio.net...
> If I create an HTML file that passes form data...from a multi select form
>
> <select name=user size=5 multiple>
> <option>User1
> <option>User2
> etc
>
> If I read in the data via Perl:
>
> my @name = param ;
> my @value ;
> my $max = @name ;
> for (0..--$max) {
> $value[$_] = param($name[$_]);
> }
>
> If I select more than one of those options I only get one value, instead
of
> all.
>
> I assume due to the fact that the <SELECT has only one name, that would
> explain that.
>
> So I tried
>
> <SELECT SIZE=5 MULTIPLE>
> <option name=User1>User1
> <option name=User2>User2
>
> etc
>
> but then no data came out.
>
> I must be readnig in the form data incorrectly but cannot find an example
on
> how to do this correctly.
>
> Any pointing in the right direction would be appreciated.
>
> Thanks.
>
> Bill
>
>
------------------------------
Date: Thu, 5 Aug 1999 00:30:38 +0900
From: "Scott" <codeman@gol.com>
Subject: Turning off cashing from Perl???
Message-Id: <7o9mb1$6k1$1@nn-tk001.ocn.ad.jp>
Dear Sir/Madame,
I am working on a project in Japan at the moment and
live in Tokyo. I am having trouble with the code as it
keeps going to the cache and I want it to refresh on the
first time around.
I was wondering if you had any ideas about how I could
achieve the effect of it not going to cache. I have tried
quite a few things.
Scott
#!/perl/bin/perl.exe -w
#print "<Meta HTTp-equiv=\"Pragma\" Content=\"No-cache\";
print "Content-type: text/html\n\n";
#Cache-Control: must-revalidate
#Cache-Control: max-age=3600
print "Cache-Control: no-cache\n\n";
#print "Pragma: no-cache\n\n";
#print "Pragma: no-cache \n\n";
#Content-type: text/html Pragma: no-cache
#use CGI qw(:standard);
#print header(-expires=>'-1d');
#print header(-Refresh=>'1';);
#use CGI;$query = new CGI;
#print $query->header(-expires>'now');
#print "<Meta Http-equiv=\"Pragma\" Content=\"No-cache\">"
#print "Pragma: no-cache\n\n";
#&NoCache; # defaults to text/html
local(*FORM_DATA)=@_;
local($request_method,$query_string,@key_value_pairs,$key_value,$key,$value)
;
$netmarketprice="OFF";
$highwatermark="OFF";
etc;
------------------------------
Date: 4 Aug 1999 15:35:38 GMT
From: jeromeo@atrieva.com (Jerome O'Neil)
Subject: Re: Useless error when {} unbalanced
Message-Id: <7o9mka$8r7$2@brokaw.wa.com>
In article <7o8om2$9g3$1@usenet01.srv.cis.pitt.edu>,
fmgst+@pitt.edu (Filip M. Gieszczykiewicz) writes:
> URGH! The longer my scripts get, the more annoying the perl error for
> unbalanced {} is getting. Missing { is informative:
>
> Oh gurus, what's the answer?
When you start a new block, always put the closing bracket in before
you do anything else.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.i-filezone.com
------------------------------
Date: Wed, 4 Aug 1999 10:10:20 -0500
From: "Timothy J Flynn" <tflynn@iastate.edu>
Subject: Re: working with = sign in a directory name - please help!
Message-Id: <7o9l4u$gh1$1@news.iastate.edu>
I'm sorry but I never saw where you addressed my problem. Does anyone know
why perl can't work with the = sign at the beginning of the directory name?
I posted examples like you asked with no response...
Thanks,
-Tim
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.120f9efc58ef04c3989d9e@nntp.hpl.hp.com...
> In article <37A5F811.3BD6D8F3@mail.cor.epa.gov> on Mon, 02 Aug 1999
> 12:57:05 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> ...
> > That's the PSI:ESP module. But I can tell that you knew
> > that already. Next time, don't let your boss distract you
> > while you're typing. :-)
>
> PSI::ESP ???
>
> Next time, don't let your boss distract you while you're typing. :-)
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
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 364
*************************************