[8601] in Perl-Users-Digest
Perl-Users Digest, Issue: 2218 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 31 17:07:19 1998
Date: Tue, 31 Mar 98 14:00:28 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 31 Mar 1998 Volume: 8 Number: 2218
Today's topics:
$100 for Perl chat install <staff@salestraining.com>
Re: accessing variables EXPORTed then "use"d <rootbeer@teleport.com>
Re: Anon Scalar Expression (was: Evaluate expression in <rootbeer@teleport.com>
Re: Can't delete file using a perl script <rootbeer@teleport.com>
Re: cgi: works form cmd line only <rootbeer@teleport.com>
Re: help needed with grep type function for perl script (just another $wanna{$be} perl hacker)
Re: Help with NT4 Wks <karld@feklore.demon.co.uk>
Identifying how a perl program was called <Glenn.J.Schworak@state.or.us>
Re: Is there a "Newsgroup" for Newbies to Perl? smitty77@pacbell.net
Re: Is there a "Newsgroup" for Newbies to Perl? (Chris Vogel)
Re: Is there a "Newsgroup" for Newbies to Perl? (Chris Vogel)
Re: newbie question:how to embed perl in html <karld@feklore.demon.co.uk>
Re: newbie question:how to embed perl in html <jdporter@min.net>
Re: Odd or even function (Ronald L. Parker)
Re: Odd or even function (Craig Berry)
Re: Odd or even function <jdporter@min.net>
Re: Perl Cgi Questions <karld@feklore.demon.co.uk>
Re: Public Key Encryption (non pgp) <rootbeer@teleport.com>
Question on one of Abigail's obfuscated sigs (Just Another $wanna{$be} Perl Hacker)
Re: Question: Sybperl routine to configure packet size mpeppler@mbay.net
readdir/grep/map <sakalauk@coam.usm.edu>
REQ Help <dkubilo@oxnardsd.org>
see cookie problem... (Jan Camp)
Re: see cookie problem... (Mike Stok)
Re: small letters into capital letter (Craig Berry)
Striped Tables (was: why have "push" and "unshift"?) <ragoff@sandia.gov>
Re: Suppressing "used only once" <rootbeer@teleport.com>
Textarea Problems <karld@feklore.demon.co.uk>
What to do about "regexp *+ operand could be empty"? (Michael Schuerig)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 31 Mar 1998 14:24:45 -0600
From: mark pantak <staff@salestraining.com>
Subject: $100 for Perl chat install
Message-Id: <129292E67B9BACA6.51D3BF33785D787C.C06B4CF8E547C61B@library-proxy.airnews.net>
I need someone to install a perl chat program on a server for me.
Any takers?
Have contract work from time to time, like NOW!
Jason Baird
jason@weboutsourcing.com
972-931-9341
------------------------------
Date: Tue, 31 Mar 1998 12:57:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Rick Schofield <Richard.Schofield@fmr.com>
Subject: Re: accessing variables EXPORTed then "use"d
Message-Id: <Pine.GSO.3.96.980331125606.18076J-100000@user2.teleport.com>
On Tue, 31 Mar 1998, Rick Schofield wrote:
> use Socket;
> ...
> if ( defined(PF_INET) ) {
> $pf_inet = PF_INET;
> $sock = SOCK_STREAM;
> }
> print "pf_inet = $pf_inet\n";
>
> OUTPUT:
> pf_inet = PF_INET
That's not right. It should give you the value of PF_INET on your system.
It does on mine! Maybe your Socket.pm is broken...? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 31 Mar 1998 12:23:21 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stuart McDow <smcdow@arlut.utexas.edu>
Subject: Re: Anon Scalar Expression (was: Evaluate expression inside print "")
Message-Id: <Pine.GSO.3.96.980331122119.18076F-100000@user2.teleport.com>
On 31 Mar 1998, Stuart McDow wrote:
> Tom Phoenix <rootbeer@teleport.com> writes:
> > $scalar_ref = \eval { my $temp = 'default value' };
>
> Tom, I believe that
>
> $scalar_ref = \'default value';
>
> will work.
That actually makes a reference to a constant, instead of a reference to a
scalar. If you subsequently assign something to $$scalar_ref, it's a fatal
error. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 31 Mar 1998 12:43:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Leslie Long <leslielong@tinet.ie>
Subject: Re: Can't delete file using a perl script
Message-Id: <Pine.GSO.3.96.980331124238.18076H-100000@user2.teleport.com>
On Sat, 28 Mar 1998, Leslie Long wrote:
> The script runs perfectly when I Telnet into the server and run 'perl
> myprog.cgi', but, when I try from a browser, the write and delete parts
> of my script don't work.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 31 Mar 1998 12:59:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Collins <mike@w3z.com>
Subject: Re: cgi: works form cmd line only
Message-Id: <Pine.GSO.3.96.980331125819.18076K-100000@user2.teleport.com>
On Tue, 31 Mar 1998, Mike Collins wrote:
> Subject: cgi: works form cmd line only
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 31 Mar 1998 21:13:07 GMT
From: root@127.0.0.1 (just another $wanna{$be} perl hacker)
Subject: Re: help needed with grep type function for perl script.
Message-Id: <35245b76.446439225@client1.news.psi.net>
On Mon, 30 Mar 1998 21:18:59 -0800, Larry Rosler <lr@hpl.hp.com>
wrote:
>> >: if (/$ip_to_find/) {
>
>> >or better yet, use /\Q$ip_to_find\E/, so '128a0b0c2' won't be matched.
>
>Or best of all, use
>
> if ($_ eq $ip_to_find) {
>
>which is what this comes down to!
>
>Larry Rosler
I cannot find the meanings for the \Q and \E in the blue camel book.
hint please.
------------------------------
Date: Tue, 31 Mar 1998 21:18:35 +0100
From: Karl Dyson <karld@feklore.demon.co.uk>
Subject: Re: Help with NT4 Wks
Message-Id: <kdO5eHAb+UI1Ewp$@feklore.demon.co.uk>
>> Do you have your File Associations set correctly (.pl associatd with your
>> Perl exe)?
>
> Yes, I did it, but it doesn't work
If you're planning on use Server Side Includes are you sure you have
them enabled and have the HTML files saved with the appropriate
extension?
That was the source of my problems for some time. Silly really.
Should've spotted it ages ago.
Karl
--
Karl Dyson <karld@feklore.demon.co.uk>
"A look can be deceiving; a touch can be lethal."
------------------------------
Date: Tue, 31 Mar 1998 13:53:45 -0800
From: Glenn Schworak <Glenn.J.Schworak@state.or.us>
Subject: Identifying how a perl program was called
Message-Id: <352165E9.730A7D63@state.or.us>
I am new to perl and have looked for this answer in the man pages and a
couple perl books but I suspect I am not looking for the right key
phrases or words. So please don't laugn too much if this is a really
basic question.
I have an HTML document calling my perl program using the inline method
#exec and I am passing it parameters. This works great. I have also done
a couple using forms to call the perl code. I am wondering, is there a
way for my perl program to know what HTML document called it without
using an argument passed via the #exec line for an inline call?
To clerify, is there some ENV variable (or any other variable) that perl
can check to see the name of the HTML document that initiated the perl
script?
Why would I do this? I want to write a few scripts that act in special
ways depending on what HTML document calls them. But I don't want to
trust the HTML coder to properly set the arguments passed to perl.
Especially since they will most likely use a cut/paste method to add the
code that calls the perl script.
Thanks for your time and patients in dealing with a new guy on the
block.
------------------------------
Date: Tue, 31 Mar 1998 14:46:41 -0600
From: smitty77@pacbell.net
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6frkic$9pn$1@nnrp1.dejanews.com>
I've been checking out this newsgroup for a while now, learning new tricks a
lot of the time. And then the rest of the time, shaking my head in utter
amazement that people can be so arrogant. I'm a programmer who doesn't
pretend to know everything about everything, and will always try and find the
answer in a book or some other form of documentation. But when time is of the
essence, and it is most of the time in this business, sometimes I just ask
someone who might know the answer. I've never been afraid to ask a colleague
a question. I'd hate to work with some of the pricks in this newsgroup,
though.
My first experience with perl was in a class at Silicon Graphics
taught by Randall Schwartz. It was a pretty good class, but even then I could
tell that Randall had no patience for people who asked what he felt were
'stupid questions'. To each his own, I guess. I use perl in my everyday
tasks, and I learn something new nearly every day. I learn through any means
possible, but a lot of times, the initial question I ask may appear ignorant
because I simply don't know any better yet. That's why I ask the question. I
don't understand anyone who is so caught up in themselves that they require
the virtual power rush of flaming me for asking a question that might be
answered in the middle of some mile long document. What exactly is the
point? If you don't want to answer the question, don't answer at all. If
you have the common courtesy of helping out a fellow programmer, your help is
much appreciated. The attitudes in here remind me of cliques in high school.
It's adolescent.
I've seen people try and compare being a programmer to being a surgeon. How
silly. I am a programmer. I make a hell of a lot of money doing it. And I
don't feel threatened by anyone who asks a question about programming, whether
they are a professional programmer or an amateur. Who cares? There are good
programmers and bad programmers. It's not an exact science. I try and become
a better programmer every day. I do that by using many different techniques.
One technique is reading this newsgroup and sorting through the crap to find
where decent people provide answers to people's questions.
The reason I attached my post to Lloyd's is because I find his post to be
extremely well written. He makes a lot of sense. Way to go, Lloyd.
Dave
In article <luemzkdv9i.fsf@asfast.com>,
Lloyd Zusman <ljz@asfast.com> wrote:
>
> cberry@cinenet.net (Craig Berry) writes:
>
> > James Hurd (jhurd@ucs.indiana.edu) wrote:
> > : Then is is impossible for a non-programmer to use Perl,
> > : so this debate is actually as ridiculous as it initally appears.
> >
> > It is impossible for a non-programmer to use Perl in the same sense that
> > it is impossible for a teetotaller to drink a Martini; either action
> > removes one from the corresponding category.
> >
> > However, I think what's being suggested is that, to make *effective* use
> > of Perl (or any other programming language), there is a certain mental
> > attitude and behavioral approach which will lead one toward being a *good*
> > programmer. Such things as compulsively reading all available docs,
> > performing simple experiments to isolate poorly understood language
> > elements, and extending professional courtesy to fellow programmers all
> > compound to make one a better programmer.
>
> Well, these are all qualities that some of the more accomplished
> regular contributors here in comp.lang.perl.misc often request of
> other posters to this newsgroup, but I don't consider all of these to
> be intrinsic qualities of a "good" programmer. These behaviors might
> certainly be considered good netiquette, however.
>
> It's true that many experienced programmers I know will jump in and
> try things before researching them, and this comes close to the
> "simple experiments" mentioned above. However, how many experienced
> programmers do you know of who read all available docs? How many
> would laugh in your face if you tried to make this a "compulsory"
> practice? Many of us programmers read the docs as a last resort,
> after we have tried hacking our way through a problem with no positive
> results.
>
> As for professional courtesy, I think that its absence or presence
> have nothing to with being a good programmer or a bad programmer.
> Some good programmers are courteous, others are not. Some bad
> programmers are courteous, others are not. In my experience, the
> place where person stands on the courtesy spectrum and the place where
> he or she stands on the programming-ability spectrum are completely
> uncorrelated.
>
> Some of the more experienced (in Perl), respected, and prolific
> posters in comp.lang.perl.misc are often extremely discourteous.
> Certain of these posters often behave like arrogant, immature twits
> who seem to go out of their ways to make condescending statements to
> people who ask naive questions here. My impression is that when these
> naive posters are asked to be "courteous", they are often really being
> asked to be obsequious in response to some experienced Perl user's
> childish, arrogant pronouncements.
>
> > A person who posts a FAQ, clearly without having done ten minutes of
> > research on the topic, is violating at least two and usually three
> > of the precepts above. And that's what causes the gurus to heap
> > scorn on such a person. Why should they respect someone who doesn't
> > want to become a good programmer, but instead expects others to do
> > the hard work?
>
> What you are talking about here is netiquette, not good programming
> practice. It is true that inexperienced net users will often not go
> to the FAQ list before asking questions here, and I do understand the
> frustration that many long-time contributors to comp.lang.perl.misc
> feel at having the same questions asked over and over by people who
> seem to have no clue about what is going here.
>
> However, in my opinion, few of these people are expecting others to do
> hard work, and there is not one of them who is not worthy of common
> human respect.
>
> In my opinion, there is a respectful, courteous way to reply to people
> who are posing frequently asked questions, and there is a polite,
> respectful, considerate way to let someone know that their answer
> already appears in a FAQ list. In my opinion, the arrogant,
> condescending replies that some people here seem to almost gleefully
> make in response to these posters are totally uncalled for.
>
> --
> Lloyd Zusman
> ljz@asfast.com
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 31 Mar 1998 00:00:00 +0100
From: C.VOGEL@LINK-GOE.de (Chris Vogel)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6qtPzqi2tSB@-sweet.link-goe.de>
Goettingen, Stardate 0929.92
Hi there,
doswald (David Oswald) wrote in 3508c605.180930773@news.xmission.com on
30.03.98 following lines, starting with '*'
* Why do people resent being
* asked FAQ type questions on this group?
Because some people learn more from dialogue and discussions. I think
there are different types of learners: People who sit and read
happily, search through ressources and work on their own and other
people who feel the need to discuss things they learn with other
learners or with mentors (this is the reason why there are
universities out there and not just places to exchange books).
I do not disagree that there are to much people who just want to
steel time to get the things they need for free, but I see some people
discouraged in trying to find people to exchange experiences while
learning.
For these people it would be nice to have a place to go to - as I
wrote before - maybe some kind of virtual university to share their
experiences.
I understand that people like that are not in place in this newsgroup
because I myself feel that I nearly can't keep up reading. A got idea
might be a stack of moderated and in number of user limited
mailinglists with some people moderating away the 'can anybody write a
script for me' - questions.
This is not ment to share knowledge - it's out there all over the net,
it is ment to share experiences in getting knowledge.
Chris.
--
Alt-Glas? Die Taste 'Glas' finde ich nicht...
(J.Ohlig@Link-Goe.de)
------------------------------
Date: Tue, 31 Mar 1998 00:18:00 +0100
From: C.VOGEL@LINK-GOE.de (Chris Vogel)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6qtP-ItItSB@-sweet.link-goe.de>
Goettingen, Stardate 0930.00
Hi there,
joergen.lang (Joergen W. Lang) wrote in 1d60032.ljml7cpmmvwgN@host026-206.seicom.net on
31.03.98 following lines, starting with '*'
* newbie ---void---void---void---void---void--- expert
to scared by some postings to write
Chris.
--
Der redet heute wieder Amok...
------------------------------
Date: Tue, 31 Mar 1998 21:30:31 +0100
From: Karl Dyson <karld@feklore.demon.co.uk>
Subject: Re: newbie question:how to embed perl in html
Message-Id: <RcRkuMAnJVI1EwfE@feklore.demon.co.uk>
>I have a perl script for a discussion group that outputs html. if I type:
>perl script.pl it gives the desired html output in my shell account.
>Question: How do i call this script from a html page?
You need to use Server-Side includes.
Which means
a) You need to make sure your web server supports them and
b) You need to find out how to use them. :) Try looking in the help
files for your webserver.
An example would be
<!--#exec cgi="/cgi-bin/script.pl" -->
or some such.
Karl
--
Karl Dyson <karld@feklore.demon.co.uk>
"A look can be deceiving; a touch can be lethal."
------------------------------
Date: Tue, 31 Mar 1998 16:51:59 -0500
From: John Porter <jdporter@min.net>
Subject: Re: newbie question:how to embed perl in html
Message-Id: <3521657F.40E1@min.net>
Karl Dyson wrote:
>
> >I have a perl script for a discussion group that outputs html. if I type:
> >perl script.pl it gives the desired html output in my shell account.
> >Question: How do i call this script from a html page?
>
> You need to use Server-Side includes.
Wrong. That is exactly the wrong answer.
Ever heard of CGI? Forms?
hand,
John Porter
------------------------------
Date: Tue, 31 Mar 1998 20:56:21 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Odd or even function
Message-Id: <352157ff.27661955@10.0.2.33>
On 31 Mar 1998 12:06:53 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:
>Which leads to the obvious
>
> chomp($number); # integer divide by 10
That's not so obvious:
C:\> perldoc perlfunc
[...]
chomp VARIABLE
chomp LIST
chomp This is a slightly safer version of the chop entry elsewhere
in this document . It removes any line ending that
corresponds to the current value of `$/' [...]
:-)
------------------------------
Date: 31 Mar 1998 21:00:40 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Odd or even function
Message-Id: <6frlho$13i$1@marina.cinenet.net>
Dan Serban (judas@interprice.com) wrote:
: Is there an odd or even perl function that could be used as a boolean
: operator? ie
:
: if odd(variable)
Well, you'd actually have to write that as 'if (odd($variable))', of
course.
: meaning that when the variable is operated on the if statement is only true
: (executable) when the number whithin the variable at the time is odd...
The most direct ways are
$var & 1 # True if $var is odd
$var % 2 # True if $var is odd
You can negate (!) either of these to get an is-even test.
HTH...
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 31 Mar 1998 16:48:44 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Odd or even function
Message-Id: <352164BC.69AF@min.net>
Craig Berry wrote:
>
> Dan Serban (judas@interprice.com) wrote:
> :
> : if odd(variable)
>
> Well, you'd actually have to write that as 'if (odd($variable))', of
> course.
uh...
sub variable() { yadda(); }
print "odd" if odd(variable) ;
hand,
John Porter
------------------------------
Date: Tue, 31 Mar 1998 21:26:25 +0100
From: Karl Dyson <karld@feklore.demon.co.uk>
Subject: Re: Perl Cgi Questions
Message-Id: <c8En2JAxFVI1EwcQ@feklore.demon.co.uk>
>Why do you munge your address, then put it unmunged in your .sig? The
>spammers have it now, so there's no point in munging it in the future;
>munging inconveniences those who would help you, and it keeps you from
>getting the email replies that you may want, but it accomplishes nothing
>helpful for anyone. :-(
I don't want to disgress too much but changing the reply-to addresses
etc. etc. *will* stop many spam spiders. Many pieces of software for
grabbing email addresses from newsgroups only read the header not the
whole message.
However, instead of putting the full correct email address in your sig
why not do something like this:
Change your reply-to etc. etc. to
you@no-spam.com
but then in your signature file say
"For my real email address change the word no-spam to your_domain."
That's much more effective.
Personally, I can't be arsed. :)
Karl
--
Karl Dyson <karld@feklore.demon.co.uk>
"A look can be deceiving; a touch can be lethal."
------------------------------
Date: Tue, 31 Mar 1998 12:13:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jamie Hoglund <jhoglund@mirage.skypoint.net>
Subject: Re: Public Key Encryption (non pgp)
Message-Id: <Pine.GSO.3.96.980331121215.18076E-100000@user2.teleport.com>
On 31 Mar 1998, Jamie Hoglund wrote:
> Hate to followup to my own followup, but there are many reasons PGP
> isn't acceptable for this, one of them is the fact that it isn't always
> available, (and in fact usually isn't in this case. It's for people who
> don't have the inclination to install PGP on their systems, and various
> cranky ISP's that refuse to have it.)
If someone refuses to use pgp, why would they use some other public key
encryption? In other words, what reason could someone have which would
oppose one and not the other?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 31 Mar 1998 20:16:57 GMT
From: root@127.0.0.1 (Just Another $wanna{$be} Perl Hacker)
Subject: Question on one of Abigail's obfuscated sigs
Message-Id: <35234a7c.442093436@client1.news.psi.net>
shown below is direct from her sig and below that my trying to
unobfuscate
#original:
#perl -we '$_ = "4a75737420616e6f74686572205065726c204861636b65720as";
# for (s;s;s;s;s;s;s;s;s;s;s;s)
# {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
$_ = "4a75737420616e6f74686572205065726c204861636b65720az";
for (/z/;/z/;/z/) {
s/(..)z?/qq'print chr 0x$1 and \161 ss'/ee;
}
I have made changes to help me better understand.
I do not understand the quoting in the last line.
I realize the right side is evaluated twice as an EXPR, but am
confused as to what exactly is occurring.
If someone could offer a sincere tip, I would appreciate the help.
------------------------------
Date: Tue, 31 Mar 1998 14:05:26 -0600
From: mpeppler@mbay.net
Subject: Re: Question: Sybperl routine to configure packet size
Message-Id: <6fri50$7l9$1@nnrp1.dejanews.com>
In article <6fqr9c$mdk@bgtnsc03.worldnet.att.net>,
Varanasi <varanasi@worldnet.att.net> wrote:
>
> I would like to know the name of the routine in Perl 5.0x (sybperl
> libraries) that will allow me to configure the connection packet size.
> The corresponding Sybase DBLib function is DBSETLPACKET(LOGINREC
> *dbloginrec, int size).
If you had looked at the sybperl man page you would have found
DBSETLPACKET($packet_size)
which does what you want.
>
> Please let me know is there is a dedicated newsgroup that caters to such
> queries.
There is a mailing list dedicated to sybperl: sybperl-l@trln.lib.unc.edu.
To subscribe send a note to sybperl-l-REQUEST@trln.lib.unc.edu.
Michael
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 31 Mar 1998 15:04:23 -0600
From: Peter Sakalaukus <sakalauk@coam.usm.edu>
Subject: readdir/grep/map
Message-Id: <35215A57.6F5992E1@coam.usm.edu>
Using the readdir examples in the "Camel Book", I've tried to
read in the contents of a directory (skipping . .. and the file
region.area) and then map the pwd directory onto each array element.
I can only seem to either skip the unwanted files OR map the pwd
but not both. I'm sure it can be done, but I'll be darned if I
know.
Insight anyone? Please. :)
...Pete
sakalauk@coam.usm.edu
------------------------------
Date: Tue, 31 Mar 1998 23:57:15 -0800
From: Dan Kubilos <dkubilo@oxnardsd.org>
Subject: REQ Help
Message-Id: <3521F35B.541AC162@oxnardsd.org>
I am trying to install
the *req* help ticket system on my server
sunos 4.1.3 on a sparc
No luck. I am using Perl 5
I downlarded req_patched_for perl no luck.
Anyone who has had luck with req and could give me some guidance it
would be greatly appreciated.
I have spent a full day looking through available docs and searching
already
Thanks again
DK
--
===========================
Dan Kubilos, Technology Coordinator
Oxnard School District
www.oxnardsd.org
------------------------------
Date: Tue, 31 Mar 1998 20:03:46 GMT
From: camp@IAEhv.nl (Jan Camp)
Subject: see cookie problem...
Message-Id: <35214bb1.1293376@news.IAEhv.nl>
If I upload (In ascii) this, the browser don't recognize it, do I have
to chmod ?
Or what do I wrong ?
Thanks
Jan
print "Content-Type: text/html\n";
print "Set-Cookie: "Cookie=CGI_Demo; expires=Sun, 28-11-1999 17:00:00
GMT; path=/demo;domain=.realm.nl;
print "\n"
print "<HEAD>\N";
print "<TITLE>Cookie</TITLE>\n";
$ENV{'HTTP_COOKIE'}
print "</body>\n";
------------------------------
Date: 31 Mar 1998 21:35:42 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: see cookie problem...
Message-Id: <6frnje$15a@news-central.tiac.net>
In article <35214bb1.1293376@news.IAEhv.nl>, Jan Camp <camp@IAEhv.nl> wrote:
>
>If I upload (In ascii) this, the browser don't recognize it, do I have
>to chmod ?
>Or what do I wrong ?
>Thanks
>Jan
>
>print "Content-Type: text/html\n";
>print "Set-Cookie: "Cookie=CGI_Demo; expires=Sun, 28-11-1999 17:00:00
>GMT; path=/demo;domain=.realm.nl;
>print "\n"
>print "<HEAD>\N";
>print "<TITLE>Cookie</TITLE>\n";
>
>$ENV{'HTTP_COOKIE'}
>print "</body>\n";
You might want to consider the use of CGI.pm if you're using a recent perl
as it takes care of things for you:
#!/usr/local/bin/perl -wT
use strict;
use CGI qw/:standard/;
use HTML::Entities;
my $cookie = cookie ('-name' => 'CGI_Demo',
'-value' => '',
'-expires' => '+1d',
'-path' => '/demo',
'-domain' => '.realm.nl',
);
print header ('-cookie' => $cookie),
start_html ('-title' => 'Cookie');
print encode_entities $ENV{'HTTP_COOKIE'} if defined $ENV{'HTTP_COOKIE'};
print end_html;
__END__
The CGI documentation will explain what's going on. One way to view it on
most properly installed perls is:
perldoc CGI
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 31 Mar 1998 21:38:35 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: small letters into capital letter
Message-Id: <6frnor$12a$1@marina.cinenet.net>
I have a life, and I can prove it! (jefpin@bergen.org) wrote:
: >I4d like to transform small letters (saved in a variable) into capital
: >letters.
:
: aw hell:
: $word =~ tr/a-z/A-Z/;
: is what you want.
Provided you have a moral objection to 'uc', of course.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 31 Mar 1998 14:35:51 -0700
From: Robert Goff <ragoff@sandia.gov>
Subject: Striped Tables (was: why have "push" and "unshift"?)
Message-Id: <352161B7.546C4353@sandia.gov>
> Here's a PerlTip: put striped output in your HTML tables like this:
> my @colors = ("#cccccc", "#ccccff"); my $i = 0;
> for (@your_data) {
> print qq(<tr bgcolor="$colors[$i]"><td>$_</td></tr>);
> $i= !$i; } # anyone have a better way?
I use
push(@colors, shift @colors);
which allows me more than two colors. But with only two yours is
better; I like.
--
=================================================
Robert Goff email: ragoff@sandia.gov
Sandia National Labs Phone: (505)284-3639
------------------------------
Date: Tue, 31 Mar 1998 13:01:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John Porter <jdporter@min.net>
Subject: Re: Suppressing "used only once"
Message-Id: <Pine.GSO.3.96.980331130126.18076L-100000@user2.teleport.com>
On Tue, 31 Mar 1998, John Porter wrote:
> Perl does not see this as a use of $MAXLEN, so in my program,
> if I use $MAXLEN only once -- I get that warning.
use vars qw/$MAXLEN/;
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 31 Mar 1998 21:40:25 +0100
From: Karl Dyson <karld@feklore.demon.co.uk>
Subject: Textarea Problems
Message-Id: <N8WjWRA5SVI1Ew+z@feklore.demon.co.uk>
I'm sure this is so obvious to all of you that you'll have no problem
helping me out. :)
I'm using the ReadParse function from Cgi-lib to read in data submitted
via the Post method with a textarea (named 'Body').
E.g.
&ReadParse(*input);
If I output the data again with something like
print <<"Ending";
<html>
<body>
<pre>
$input{'Body'}
</pre>
</body>
</html>
Ending
Then for some reason where there should be a line-feed there is actually
two being printed. This is no good.
Plus, since the textarea wraps but does not insert CR/LF signals at the
end of each line, the text can actually be displayed all in one huge
line.
I need to find a nice way of display this text exactly who it looks in
the textarea. Does anyone know of a quick way of doing this?
I can't be the first one in this predicament. :)
Thanks,
Karl
--
Karl Dyson <karld@feklore.demon.co.uk>
"A look can be deceiving; a touch can be lethal."
------------------------------
Date: Tue, 31 Mar 1998 23:28:51 +0200
From: schuerig@acm.org (Michael Schuerig)
Subject: What to do about "regexp *+ operand could be empty"?
Message-Id: <1d6s23d.1c3300zjckrquN@rhrz-isdn3-p46.rhrz.uni-bonn.de>
I'm using a snippet from Tom Christiansen's striphtml to (rough and
ready) replace HTML markup with whitespace.
$text =~ s{ <
(?:
[^>'"] *
|
".*?"
|
'.*?'
) +
>
}{ }ogsx;
It worked once upon a time (around Perl 5.002(?), I think), but now I'm
getting this error message:
# / <
(?:
[^>'"] *
|
".*?"
|
'.*?'
) +
>
/: regexp *+ operand could be empty.
I've tried to look it up in perldiag, but it's not in there. Can anyone
enlighten me what's wrong and how to correct it?
Sigh, maybe I should use to LWP to do some real parsing...
Thanks for your help,
Michael
--
Michael Schuerig
mailto:schuerig@acm.org
http://www.uni-bonn.de/~uzs90z/
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2218
**************************************