[18902] in Perl-Users-Digest
Perl-Users Digest, Issue: 1070 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 6 03:05:52 2001
Date: Wed, 6 Jun 2001 00:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <991811113-v10-i1070@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 6 Jun 2001 Volume: 10 Number: 1070
Today's topics:
context explain <davidx@viasoft.com.cn>
Decimal to Hex <winz@prodigy.net>
Re: Decimal to Hex (Sweth Chandramouli)
Re: Deleting old files (Craig Berry)
Re: delimiter? <bigiain@mightymedia.com.au>
dereferencing a HoL (was Re: interpolate (syntax help u (Tad McClellan)
Re: Dereferencing undefined value (Garry Williams)
Executing perl Scripts? (Harsh Strider)
Re: Executing perl Scripts? <taboo@comcen.com.au>
Re: Executing perl Scripts? <a5singh@db.uwaterloo.ca>
Re: FAQ 5.5: How can I manipulate fixed-record-length (Tad McClellan)
Re: format/write with alternate linefeeds ? <webmaster@webdragon.unmunge.net>
Re: format/write with alternate linefeeds ? <buggs-clpm@splashground.de>
Re: Help on CPAN shell <buggs-clpm@splashground.de>
need help for win32::eventlog <Frank.bederke@debeka.de>
Re: Net::RawIP anybody can help? <frank.castle@marvelknights.net>
Re: perl debugging questions (Clinton A. Pierce)
Re: perl debugging questions <uri@sysarch.com>
Perl Tattoo (Chris)
Re: Process form WITHOUT feedback page PART 2 <iltzu@sci.invalid>
Re: Recursing a directory tree <nwang@shell3.shore.net>
Re: Setting cgi variable from form data (Wide Eyed)
Re: Setting cgi variable from form data (Wide Eyed)
Re: The FlakeyMind/Bryce Jacobs FAQ (v0.1) (Topmind)
Re: who is authentic? $hash_ref->{'key'} or $hash_ref{k <Jac@Oppers.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 6 Jun 2001 14:57:53 +0800
From: "David Xu" <davidx@viasoft.com.cn>
Subject: context explain
Message-Id: <9fkjln$jhd$1@news.cz.js.cn>
Hi all,
I am confused by following piece of code:
$scalar1 = (3, 2, 1);
@array=(3, 2, 1);
$scalar2 = (@array);
print "scalar1=$scalar1, scalar2=$scalar2\n";
it prints
"scalar1=1, scalar2=3"
why is (@array) different with (3, 2, 1)?
Regards,
David Xu
------------------------------
Date: Tue, 5 Jun 2001 23:07:05 -0500
From: "Winston Kotzan" <winz@prodigy.net>
Subject: Decimal to Hex
Message-Id: <9fka9s$62l2$1@newssvr06-en0.news.prodigy.com>
Hello,
I'm writing a CGI program for the registration of shareware. The trouble
I'm having is converting a long decimal number to a hexadecimal number. I
tried something similar to this:
$CodeStr = 25194917170125117;
$RegCode = sprintf("%X", $CodeStr);
However, the result of printing RegCode yielded FFFFFFFF. What did I do
wrong, and is there an alternative to the sprintf() command?
Assistance is very much appreciated.
--
Winston Kotzan
http://wak.cjb.net/
------------------------------
Date: Wed, 06 Jun 2001 04:58:35 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: Decimal to Hex
Message-Id: <%LiT6.57266$G5.12384181@news1.rdc1.md.home.com>
In article <9fka9s$62l2$1@newssvr06-en0.news.prodigy.com>,
Winston Kotzan <winz@prodigy.net> wrote:
>Hello,
>
>I'm writing a CGI program for the registration of shareware. The trouble
>I'm having is converting a long decimal number to a hexadecimal number. I
>tried something similar to this:
>
> $CodeStr = 25194917170125117;
> $RegCode = sprintf("%X", $CodeStr);
>
>
>However, the result of printing RegCode yielded FFFFFFFF. What did I do
>wrong,
You gave us code "similar to" your code, rather than your
actual code. The above snippet returns "C812193C", not "FFFFFFFF".
> and is there an alternative to the sprintf() command?
There are many, depending on what you are trying to do.
If you just want to print $RegCode, you can do a `printf("%X\n",$CodeStr)'
instead.
-- Sweth.
--
Sweth Chandramouli ; <sweth+perl@gwu.edu>
------------------------------
Date: Wed, 06 Jun 2001 04:56:15 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Deleting old files
Message-Id: <thrdvfbvcpbv6d@corp.supernews.com>
Abigail (abigail@foad.org) wrote:
: Craig Berry (cberry@cinenet.net) wrote on MMDCCCXXXV September MCMXCIII
: in <URL:news:thq7jp64oq11b7@corp.supernews.com>:
: ** By convention, ordinary perl variables are mixed or lower-case. Following
: ** this convention will make you code more readable by others and cleaner
: ** looking when mixing your own names with those imported from modules.
:
: Readability is in the eye of the beholder. Just because you (and some
: others) feel so doesn't make it universal. I do utterly fail to see the
: remark related to importing names from modules - are you implying that
: using names for modules suddenly decreases readabilty, but changing the
: case of non-imported variable names magically fixes that?
No; I'm saying that most names imported from modules follow the convention
I suggested, and thus your code combining imported and local names will
look more coherent if the local names do too.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Wed, 06 Jun 2001 14:10:08 +1000
From: Iain Chalmers <bigiain@mightymedia.com.au>
Subject: Re: delimiter?
Message-Id: <bigiain-4D204A.14100806062001@news.pacbell.net>
In article <3B1DA595.9C2F00C6@worldnet.att.net>, Tim
<timster@worldnet.att.net> wrote:
> perl -e "@INC" shows:
> D:/Perl/libD:/Perl/site/lib.
Errr, _really?
[bigiain@webdev www]$ perl -e "@INC"
[bigiain@webdev www]$
sure you didn't mean perl -e "print @INC"???
[bigiain@webdev www]$ perl -e "print @INC"
/usr/lib/perl5/5.00503/i386-linux/usr/lib/perl5/5.00503/usr/lib/perl5/sit
e_perl/5.005/i386-linux/usr/lib/perl5/site_perl/5.005.
>
> I don't see a delimiter between "D:/Perl/lib" and "D:/Perl/site/lib".
> How does it know that this is really two directories instead of one?
>
Remember that @INC is an _array_...
try perl -e 'print join "\n", @INC'
[bigiain@webdev www]$ perl -e 'print join "\n", @INC'
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005
.[bigiain@webdev www]$
cheers
big
------------------------------
Date: Wed, 6 Jun 2001 00:03:35 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: dereferencing a HoL (was Re: interpolate (syntax help understand))
Message-Id: <slrn9hrasn.3sh.tadmc@tadmc26.august.net>
X3 <imiten@yahoo.com> wrote:
>hello....I am looking at code snippet from perl cookbook and would
>appreciate if one could help on whats interpolation...
There is no "interpolation" anywhere in your article. You've
got the wrong term.
[ "interpolation" means "replace a variable's name with its value".
Interpolation only happens in double quoted (and double quotish)
strings.
]
It appears that what you want to know about is "dereferencing"
a reference. The best place to find out about that is:
perldoc perlreftut
>snippet goes
>like this: push (@{$ttys{$user}}, $tty)
Apply "Rule 1" in the "Using References" section. First write it
as a plain ol' array:
push(@array, $tty); # pretend its a "normal" array
push(@ array, $tty); # pad with spaces to line stuff up
push(@{ }, $tty); # replace name with a block...
push(@{ $ttys{$user} }, $tty); # ... that returns a reference.
# hash values are refs in HoL data structure
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 06 Jun 2001 04:47:14 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Dereferencing undefined value
Message-Id: <slrn9hrdei.3tf.garry@zfw.zvolve.net>
On Tue, 5 Jun 2001 10:02:45 -0400, Tad McClellan <tadmc@augustmail.com> wrote:
> Garry Williams <garry@ifr.zvolve.net> wrote:
>
>>Subject: Dereferencing undefined value
>
>
> At this point, Perlified brains are thinking "autovivification".
Hmm. Need more perlification...
>>I ran across some behavior that puzzled me.
>>
>>Consider:
>>
>> $ perl -Mstrict -wle 'my $x; for (@$x) { print 1 }'
>> $
>>
>>There's no complaint. In other words, dereferencing an undefined
>>value as an array reference (apparently) yields an empty list.
>
>
> foreach provides an "lvalue context" (due to its aliasing, I suppose),
> so autoviv occurs.
>
> perl _creates_ (autovivifies) an (empty) anonymous array (not a list)
> and makes $x a reference to it.
Well, now that you point it out (Randal did, too), it makes sense.
It's subtle, though. Aliasing didn't jump out at me when trying to
understand why an lvalue was being used.
[snip]
> autoviv gets not enough coverage in the docs, but at least you
> know the search term to use now.
That is a good idea, but I found nothing directly addressing the
lvalue context of for (...) in either the doc or Google. (I looked
through `lvalue' hits, too.)
--
Garry Williams
------------------------------
Date: Wed, 06 Jun 2001 05:02:53 GMT
From: harsh_strider@yahoo.com (Harsh Strider)
Subject: Executing perl Scripts?
Message-Id: <3b1f0875.19312429@netnews.worldnet.att.net>
I have a problem executing perl scripts on one of my Linux sytems, but
not the other.
On the sytem that I have problems with this its what I get:
(Run from a terminal window inside GNOME)
root@localhost Perl# ./test.pl
bash: /home/root/perl/test.pl: Permission Denied
root@localhost Perl#
I am logged on as root.
Any thoughts?
The system config is this:
Mandake 7.2
GNOME 1.4
Kernel 2.2.17
ActiveState Perl 5.6.1-626
On my other system the same command works fine.
Configuration:
RedHat 7.0
Kernel 2.4.5
GNOME 1.4
ActiveState Perl 5.6.1-626
Thanks,
Harsh Strider
------------------------------
Date: 6 Jun 2001 15:16:30 +1000
From: "Kiel R Stirling" <taboo@comcen.com.au>
Subject: Re: Executing perl Scripts?
Message-Id: <3b1dbcae$1@nexus.comcen.com.au>
harsh_strider@yahoo.com (Harsh Strider) wrote:
>I have a problem executing perl scripts on one of my Linux sytems, but
>not the other.
>
>On the sytem that I have problems with this its what I get:
>(Run from a terminal window inside GNOME)
>
>root@localhost Perl# ./test.pl
>bash: /home/root/perl/test.pl: Permission Denied
>root@localhost Perl#
>
>I am logged on as root.
>Any thoughts?
>
>The system config is this:
>Mandake 7.2
>GNOME 1.4
>Kernel 2.2.17
>ActiveState Perl 5.6.1-626
>
>On my other system the same command works fine.
>Configuration:
>RedHat 7.0
>Kernel 2.4.5
>GNOME 1.4
>ActiveState Perl 5.6.1-626
>
>
>Thanks,
>Harsh Strider
Permissions problem read chmod(1)
Regard,
Kiel R Striling
------------------------------
Date: Wed, 6 Jun 2001 01:18:11 -0400
From: "Aameek Singh" <a5singh@db.uwaterloo.ca>
Subject: Re: Executing perl Scripts?
Message-Id: <9fkefo$5tk$1@watserv3.uwaterloo.ca>
"Harsh Strider" <harsh_strider@yahoo.com> wrote in message
news:3b1f0875.19312429@netnews.worldnet.att.net...
> root@localhost Perl# ./test.pl
> bash: /home/root/perl/test.pl: Permission Denied
> root@localhost Perl#
> I am logged on as root.
> Any thoughts?
Yeah! plenty, but I guess the following would suffice:
chmod +x test.pl
hth
adios
--aameek
>
> The system config is this:
> Mandake 7.2
> GNOME 1.4
> Kernel 2.2.17
> ActiveState Perl 5.6.1-626
>
> On my other system the same command works fine.
> Configuration:
> RedHat 7.0
> Kernel 2.4.5
> GNOME 1.4
> ActiveState Perl 5.6.1-626
>
>
> Thanks,
> Harsh Strider
------------------------------
Date: Tue, 5 Jun 2001 23:49:00 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: FAQ 5.5: How can I manipulate fixed-record-length files?
Message-Id: <slrn9hra1c.3sh.tadmc@tadmc26.august.net>
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>Eli the Bearded wrote:
>>
>> In comp.lang.perl.misc, Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>> > Not only doesn't it scale well, but it's a bad habit to get into -- you
>> > should almost never use symbolic references, when there are other ways
>> > to do what you want.
>>
>> Agreed.
That is such good advice that I couldn't bring myself to snip it,
even though I have nothing to add to it.
>> > our ($PS_T) = 'A6 A4 A7 A5 A*';
>> > our (@PS_N) = qw!pid tt stat time command!;
>> ...
>> > Here I've eliminated the variables ($pid, $tt, $stat, $time, $command)
>> > which were never really needed in the first place, and changed
>> > everything which was global, but didn't need to be, into a lexical.
^^^^^^
Perl doesn't have truly global variables. Using that term when
trying to figure out how Perl's scoping works leads astray.
For instance, I'm not sure if your "global" there means "dynamic"
or "file scoped", $PS_T above is both of those.
All $PS_T _needs_ to be is visible in the lines where you want to
use it. A file-scoped lexical variable will work as well as a dynamic
one in that code. You said you changed "everything". Looks like you
missed one (two actually :-)
>> Huh? Do I misunderstand 'our'? Your variables, since not 'my'ed or
>> 'local'ed are global variables.
^^^^^^
gak! Now ETB is using it.
>> $ perldoc -f our
>> our EXPR
>> An "our" declares the listed variables to be valid
>> globals within the enclosing block, file, or
>> ^^^^^^^
gak gak! Now the docs are too!
>> Elijah
>> ------
>> would use 'my' since he does not like to gratuitously break compatibility
I agree with the advice, but not with the reason :-)
I would use my() since you should always prefer lexical over dynamic
variables anyway.
Judging from the indenting of the code, I guess the declaration
is file-scoped (ie. not in a block or eval). If this is a
single-file program, then file-scoped could be (loosely) called
"global", and any one of these would work:
my $PS_T; # file-scoped lexical
our $PS_T; # file-scoped dynamic
use vars '$PS_T'; # package scoped dynamic
or even just sprinkle some colons around when you _use_ the
variable, and skip the declaration altogether.
$::PS_T = 'A6 A4 A7 A5 A*';
...
my @ps = unpack $::PS_T, $_;
^^
^^ "use strict" is now happy
>Well, you could use use vars, if you want,
Then we would be back to "package scoped".
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Jun 2001 04:31:28 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: format/write with alternate linefeeds ?
Message-Id: <9fkbn0$t68$0@216.155.32.224>
In article <9fjd2l$16k$3@bob.news.rcn.net>,
ebohlman@omsdev.com (Eric Bohlman) wrote:
| Scott R. Godin <webmaster@webdragon.unmunge.net> wrote:
| > Well, the thing is, the two output files (one .html and one .txt) are
| > dumped into a .tgz archive to make downloading them both simpler and
| > easiler, so any 'conversion' would need to be done beforehand.
|
| Yep.
|
| > Since it's a write and not a print, there are no "\n"'s in the output
| > statements, so I'm not exactly certain how to change the default \n to a
| > \015\012 instead for a write operation.
|
| You'll need to do your formatted writing by calling formline()
| directly and then doing a substitution on $^A (see "Accessing Formatting
| Internals" in perlform; you'll probably want something similar to the
| swrite() described there).
|
ok thanks for the tip.. I'll go browse and post back if I run into a
confusion trap[1]. :)
[1] damn, I've been playing too much Angband[2] again. Almost as
addicting as Perl is. :-)
[2] news://rec.games.roguelike.angband
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Wed, 6 Jun 2001 08:18:58 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: format/write with alternate linefeeds ?
Message-Id: <9fki1q$ngv$07$1@news.t-online.com>
Scott R. Godin wrote:
> news://rec.games.roguelike.angband
Actually I think news URLs don't have a '//'.
So it would be:
news:rec.games.roguelike.angband
Please correct me if I'm worng :)
Buggs
------------------------------
Date: Wed, 6 Jun 2001 06:18:23 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: Help on CPAN shell
Message-Id: <9fkavp$t7j$04$1@news.t-online.com>
Tim wrote:
> Why does the make fail? What's with the syntax error??? All I want to
> do is run XSLint, but since it needs XML::DOM and XML::Parser (per the
> notes), I am trying to get those modules, but I have not been successful
> at all so far. Any suggestions?
>
Have you installed Expat ?
It is mentioned in the README.
Have read the README ?
Buggs
------------------------------
Date: 06 Jun 2001 08:46:44 +0200
From: Frank Bederke <Frank.bederke@debeka.de>
Subject: need help for win32::eventlog
Message-Id: <3b1dd1d5$1@netnews.web.de>
Hello,
i am a newbie in Perl and need help!!
i want to install a Perl-service on an Win2k server. The service should write all
server-events in a protokol on an other server and append all new events.
Any help is appreciated.
Regards,
Frank
--
__________________________________________________________
News suchen, lesen, schreiben mit http://newsgroups.web.de
------------------------------
Date: Wed, 6 Jun 2001 08:49:35 +0200
From: "Alex Randol" <frank.castle@marvelknights.net>
Subject: Re: Net::RawIP anybody can help?
Message-Id: <9fkk0l$1ha$02$1@news.t-online.com>
Thanks! The example looks exactly like the one I wrote. I think it shoudkl
work well on Irix, because everything compiled fine without errors and Irix
is also able to create packages with other tools.
Alex
Michael Fuhr <mfuhr@dimensional.com> schrieb in im Newsbeitrag:
9fjnup$6eo@flatland.dimensional.com...
> "Alex Randol" <frank.castle@marvelknights.net> writes:
>
> > I set source source to an adress (in ip => {...}) to some others host
adress
> > to fake a ip (udp) package to look like from another host. But send told
me
> > that it could not send this package ("sendto(): Cannot assign requested
> > adress") because it could n't be assigned. Is it possible to fake an IP
> > package with Net::RawIP and how does it work? I think it should be
possible
> > because this package is intended to manipulate IP packages.
>
> Indeed it is, and it's worked fine for me. Spoofing packets is a
> useful White Hat tool, although Black Hats can certainly use it for
> their own nefarious purposes. I've used Net::Rawip extensively to
> troubleshoot connectivity problems through firewalls.
>
> > Note: I am using Irix 5.3, Net::RawIP compiled fine
>
> I suppose there could be an issue with Irix; it's worked for me on
> Solaris, FreeBSD, and Linux. Here's an example that should send
> a UDP packet from 10.1.2.3:1234 to 10.3.4.5:5678:
>
> #!/usr/bin/perl -Tw
>
> use Net::RawIP;
> use strict;
>
> my $ip = Net::RawIP->new({
> ip => {
> saddr => "10.1.2.3",
> daddr => "10.3.4.5",
> },
> udp => {
> source => "1234",
> dest => "5678",
> data => "What hath Larry wrought?",
> },
> });
>
> $ip->send(0, 1);
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
------------------------------
Date: Wed, 06 Jun 2001 04:08:17 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: perl debugging questions
Message-Id: <R0iT6.36003$DG1.6039375@news1.rdc1.mi.home.com>
In article <3B1DA079.6F525007@yahoo.com>,
Michael Still <mystill@yahoo.com> writes:
> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
Ugh. I can't read this to decipher. In the future, please post
TEXT ONLY to Usenet groups.
Sorry 'bout that.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours *and*
clintp@geeksalad.org Perl Developer's Dictionary -- May 2001
"If you rush a Miracle Man, for details, see http://geeksalad.org
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Wed, 06 Jun 2001 04:13:22 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perl debugging questions
Message-Id: <x7r8wyxn30.fsf@home.sysarch.com>
gack! don't post in html. it makes no sense in general. even the case of
mime and plain text and html is bad but just html is useless.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: 5 Jun 2001 23:51:10 -0700
From: chrisl_ak@hotmail.com (Chris)
Subject: Perl Tattoo
Message-Id: <b62b39cb.0106052251.12e447a7@posting.google.com>
Slashdot had an interesting thread about what mathematical formula
would make the best tattoo
(http://slashdot.org/askslashdot/01/05/04/0144208.shtml).
So what would be the best perl tattoo? No other language seems as ripe
with possibility.
Any ideas except RSA code tattoo
(http://www.cypherspace.org/~adam/rsa/), though I do like the two line
version:
print pack"C*",split/\D+/,`echo
"16iII*o\U@{$/=$z;[(pop,pop,unpack"H*",<>
)]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`
------------------------------
Date: 5 Jun 2001 11:12:25 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Process form WITHOUT feedback page PART 2
Message-Id: <991738932.5334@itz.pp.sci.fi>
In article <6f51e848.0106041249.1e41b58d@posting.google.com>, GearGirl wrote:
>As suggested, I used the "Status: 204 No Response" lines in my Perl
>script to try to capture some hidden info on one of my pages WITHOUT
>giving the user a feedback page, and now I'm getting a new browser
>window ANYWAY that is titled "No page to display -- Microsoft Internet
>Explorer" and has an "Action Canceled" message in it. At least I'm no
>longer getting "500 Internal Server Error" but I'd rather not have ANY
>pages popping up once the script has executed.
Odd. Did it open a new browser window before you started returning 204?
Is there a BASE tag with a target attribute somewhere?
In any case, there are (basically) two ways to get a new browser window.
Either a "target" attribute or Javascript. Look for either of those.
Of course, I'm just a Perl expert. It's been years since I had to mess
with frames and browser windows last time, so I might be forgetting some
important detail. Or I might just be plain wrong.
You might want to ask in one of the comp.infosystems.www.authoring.*
groups instead. (Followups set.)
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Wed, 06 Jun 2001 04:42:07 GMT
From: Nan Wang <nwang@shell3.shore.net>
Subject: Re: Recursing a directory tree
Message-Id: <zwiT6.280$iH6.23064@news.shore.net>
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On Mon, 04 Jun 2001 19:58:41 GMT,
> Nan Wang <nwang@shell3.shore.net> wrote:
>> Eric Bohlman <ebohlman@omsdev.com> wrote:
>>> Nan Wang <nwang@shell3.shore.net> wrote:
>>>> I don't know why you think I was being defensive, I have nothing to be
>>>> ashamed off. Like I said I write scripts to get things done, not for
>>>> people to frame it and stick it on the wall and boggle at how few lines it
>>>> took. I was rather pissed off at his nitpicking, anal retentiveness and
>>>> his holier-than-thou attitude. Can I improve my code? Definitely, but
>>>> I'll improve it the way I want, not as Martien mandates.
>>
>>> He wasn't *mandating* anything, just *suggesting* things based on his own
>>> experience and that of a lot of other very experienced programmers.
>>
>> What makes you think I wanted his suggestions in the first place?
> You posted your code here. The code didn't work, and couldn't work in
> the way you said it should. Posting crap to this newsgroup gets your
> free code reviews.
> Rest assured, you won't get any more from me. You state you write code
> to get the job done, which is obviously not true, judging by the
> sample you posted. You are obviously not interested in improving your
> code, or your attitude towards coding, so..
I already admitted that I goofed on that part before ever had the displeasure
of talking to you. WTF was your problem?
> see ya. or rather, won't.
Big loss, not!
------------------------------
Date: 5 Jun 2001 21:56:07 -0700
From: char@wideeyed.com (Wide Eyed)
Subject: Re: Setting cgi variable from form data
Message-Id: <564699e3.0106052056.19d62ad8@posting.google.com>
see-sig@from.invalid (David Efflandt) wrote in message news:<slrn9hqudt.2ot.see-sig@typhoon.xnet.com>...
> On 5 Jun 2001 16:38:01 -0700, Wide Eyed <char@wideeyed.com> wrote:
> > I'd like to set a variable in a guestbook script to specify the page
> > the script writes the entry to according to a button checked on the
> > guestbook entry form.
> >
> > The guestbook form has several different pushbutton fields with
> > different values, (i.e., Actors, Writers, PCTechs, etc). I have named
> > each of the fields "listingpage", and each has a different value
> > pointing to a web page (i.e., actors.htm, writers.htm, pctechs.htm,
> > etc.)
> >
> > The variable in the guestbook script is named $listingpage
> >
> > $listingpage plugs into the $guestbookurl variable to complete the
> > link to the correct page (i.e., $guestbookurl =
> > "http://www.domainname.com/$listingpage")
> >
> > If I can get this to work, using the $guestbookurl example above, if
> > the user clicks on the pctech button on the form, the $guestbookurl
> > will change to "http://www.domainname.com/pctech.htm.
> >
> > Can someone supply a snippet of code I can use to do this, or point me
> > in the right direction to find out how to do it?
>
> The *.cgi newsgroup perhaps. But here is an example of simple form and
> processing that prints an example of such a link. Note that lc() changes
> the selected mixed case radio button label/value to lower case:
>
> #!/usr/bin/perl -w
> use CGI qw/:standard/;
> print header,start_html('Page Title'),h1('Test'),hr;
> if (param) {
> $listingpage = lc(param('listingpage')) . ".htm";
> print a({href=>"http://www.domainname.com/$listingpage"},
> $listingpage),p;
> }
> print start_form,'Pick One:',br,radio_group('listingpage',
> ['Actors','Writers','PCTechs'],undef,'true'),p,
> submit(undef,'Test'),end_form,end_html;
Thanks for your work, David... Sorry if I confused you. The script
and form are already set up and working... all I need to do now is
figure out how to change the variable in the script using input from
the form.
When the user fills out and submits the form, it should write the
$listingpage variable into the script. (I have named each of the form
radio buttons "listingpage", and gave them a value -- "pctech.htm",
"actors.htm", etc.) When the value of the button "listingpage" (the
web page specified by which radio button is chosen) is plugged into
the script, the script will then do further processing and write the
user's input to the specified web page. ... does that make sense?
Thanks again for your time.
------------------------------
Date: 5 Jun 2001 22:11:17 -0700
From: char@wideeyed.com (Wide Eyed)
Subject: Re: Setting cgi variable from form data
Message-Id: <564699e3.0106052111.20a26e0@posting.google.com>
Robert Sherman <rsherman@ce.gatech.edu> wrote in message news:<3B1CF0FD.737498C4@ce.gatech.edu>...
> Wide Eyed wrote:
>
> > I'd like to set a variable in a guestbook script to specify the page
> > the script writes the entry to according to a button checked on the
> > guestbook entry form.
> >
> > The guestbook form has several different pushbutton fields with
> > different values, (i.e., Actors, Writers, PCTechs, etc). I have named
> > each of the fields "listingpage", and each has a different value
> > pointing to a web page (i.e., actors.htm, writers.htm, pctechs.htm,
> > etc.)
> >
> > The variable in the guestbook script is named $listingpage
> >
> > $listingpage plugs into the $guestbookurl variable to complete the
> > link to the correct page (i.e., $guestbookurl =
> > "http://www.domainname.com/$listingpage")
> >
> > If I can get this to work, using the $guestbookurl example above, if
> > the user clicks on the pctech button on the form, the $guestbookurl
> > will change to "http://www.domainname.com/pctech.htm.
> >
> > Can someone supply a snippet of code I can use to do this, or point me
> > in the right direction to find out how to do it?
> >
> > Thanks so much for your time.
>
> if you are using CGI.pm:
>
> $listingpage = $q->param('listingpage');
Thanks Robert:
I have CGI.pm... it's not called in the script... How would I include
it...or is that possible? (Obvious major newbie here...)
------------------------------
Date: Wed, 06 Jun 2001 04:13:20 GMT
From: topmind@technologist.com (Topmind)
Subject: Re: The FlakeyMind/Bryce Jacobs FAQ (v0.1)
Message-Id: <MPG.15874fc57b048b7e98994e@news.earthlink.net>
> I think the best strategy on USENET is to steel yourself and assume
> that the readers whose opinions you care about will be able to decide
> which responses are legit and which are bogus. Let's not worry about
> defaming people explicitly; hopefully the people whose opinions we
> care about, can see that the people we hate are as dumb as we think
> they are.
>
>
> Lex
>
>
I don't understand why he doesn't create a FAQ about my frequently
used anti-OO arguments and simply refer his "warnees" to that
*instead*. That would be much more professional than, "Look at
the stupid thing topmind said back in 1998 about Perl......".
-T-
------------------------------
Date: Wed, 06 Jun 2001 08:45:47 +0200
From: Jac.m.a.m.Oppers <Jac@Oppers.nl>
Subject: Re: who is authentic? $hash_ref->{'key'} or $hash_ref{key}?
Message-Id: <g8wdO4mRh4gNfi+UvzVt15atLQ7C@4ax.com>
On Wed, 06 Jun 2001 02:31:51 -0000, gbacon@HiWAAY.net (Greg Bacon)
wrote:
>In article <lggT6.60$DB3.7855@chrome-fe.eng.netapp.com>,
> kalasend at YAHOO dot COM <dontuspamme@nospammers.com> wrote:
>
>: oh no, i was asking, for the key, should I quote it or not?
>: seems like both are syntactically ok to me...
>
>Here's what the perldata manpage has to say:
>
> As in some shells, you can enclose the variable name in braces to
> disambiguate it from following alphanumerics. You must also do this
> when interpolating a variable into a string to separate the variable
> name from a following double-colon or an apostrophe, since these
> would be otherwise treated as a package separator:
>
> $who = "Larry";
> print PASSWD "${who}::0:0:Superuser:/:/bin/perl\n";
> print "We use ${who}speak when ${who}'s here.\n";
>
> Without the braces, Perl would have looked for a $whospeak, a
> `$who::0', and a `$who's' variable. The last two would be the $0 and
> the $s variables in the (presumably) non-existent package `who'.
>
> In fact, an identifier within such curlies is forced to be a string,
> as is any simple identifier within a hash subscript. Neither need
> quoting. Our earlier example, `$days{'Feb'}' can be written as
> `$days{Feb}' and the quotes will be assumed automatically. But
> anything more complicated in the subscript will be interpreted as an
> expression.
>
>ObDamianWorship: I've been using Text::Autoformat lately, and it's a
>wonderful piece of code that's always been on my wish list.
Yes, it is a very nice tool, but I would not advice to use it in this
newsgroup :-) If *I* apply Text::Autoformat to the text above, it
seems to mess up especially this part :
> $who = "Larry";
> print PASSWD "${who}::0:0:Superuser:/:/bin/perl\n";
> print "We use ${who}speak when ${who}'s here.\n";
Text::Autoformat is not capable of recognizing its own authentic
language anymore :-) Maybe I did not try all options yet ?
>Greg
Jac.
jac.oppers@philips.com (replaces jac@natlab.research.philips.com)
j.m.a.m.oppers@(hccnet|hetnet|chello).nl
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 1070
***************************************