[16263] in Perl-Users-Digest
Perl-Users Digest, Issue: 3675 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 14 21:10:25 2000
Date: Fri, 14 Jul 2000 18:10:16 -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: <963623415-v9-i3675@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 14 Jul 2000 Volume: 9 Number: 3675
Today's topics:
Re: onclick option valid? (David Efflandt)
Re: Parameter passing (David Efflandt)
Re: perl for automated scp <gorbeast@SPAMSUCKS.subduction.org>
Re: PERL IDES (Mads Orbesen Troest)
Re: Perl Rocks!(OT?) <nospam@nospam.com>
Re: PRINTing " "" " (Logan Shaw)
Re: printing out list of checkboxes to a file. <palincss@his.com>
Re: Qs for professional Perl/CGI developers (Tad McClellan)
Re: Sending a Escape using Net::Telnet (David Efflandt)
Re: sending files to a printer in Win32? <rrauer@mitre.org>
Re: sound editing aaronp@removeme-shore.net
Re: String length? <nospam@nospam.com>
Re: String length? <care227@attglobal.net>
Re: String length? <nospam@nospam.com.invalid>
Re: The newbie question <lr@hpl.hp.com>
Re: Trying to use an array as a hash value (Tad McClellan)
Re: UDP / ICMP checksum generation - 1's complement sum <nospam@nospam.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Jul 2000 23:53:31 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: onclick option valid?
Message-Id: <slrn8mv9v6.c2v.efflandt@efflandt.xnet.com>
On Fri, 14 Jul 2000 13:31:32 +0800, Tom <chaptera@hotmail.com> wrote:
>Can I do that on the *.pl for generate the html page?
>.....
>print checkbox(-name=>'test1',
> -value=>'',
> -label=>'test1',
> -onClick='function()'
> );
perldoc CGI
JAVASCRIPTING: checkbox() recognizes the -onClick
parameter. See checkbox_group() for further details.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: 14 Jul 2000 23:56:36 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Parameter passing
Message-Id: <slrn8mva50.c2v.efflandt@efflandt.xnet.com>
On Fri, 14 Jul 2000, squidrocks@my-deja.com <squidrocks@my-deja.com> wrote:
>Is it possible to pass parameters to suid?
Yes, you just have to untaint them.
See: perldoc perlsec
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sat, 15 Jul 2000 00:28:07 GMT
From: Gorby <gorbeast@SPAMSUCKS.subduction.org>
Subject: Re: perl for automated scp
Message-Id: <396FB017.1B3CE036@SPAMSUCKS.subduction.org>
arandachristian@hotmail.com wrote:
> All,
>
> I am writing a perl cgi script that will hopefully be used in the
> following way:
>
> 1) it will use secure copy to copy a file to a predetermined
> destination server.
>
> 2) it will allow users to enter a source host and filename
>
> 3) it will use RSA authentication
>
> The script is running as nobody when it executes on the web server.
> This is what I believe poses the problem. When running as nobody, I
> receive the following error:
>
> Could not create directory '//.ssh'.
> The authenticity of host 'me.myco.com' can't be established.
> Key fingerprint is [fingerprint here].
> Are you sure you want to continue connecting (yes/no)?
>
> If I am logged in as myself and chmod +s scriptname and run it as
> nobody I get the same results.
>
> Security isn't the main concern here since the servers are internal. I
> understand that it's possible using RSA and CGI that the security could
> be compromised.
>
> What I am looking for is if anyone has done something similar to this,
> and if so, how was it accomplished.
>
> Many thanks,
>
> Christian M. Aranda
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
"If I had one wish, I would ask for a big enough ass for the whole world to
kiss."
--Marshall Mathers
------------------------------
Date: Fri, 14 Jul 2000 22:24:19 GMT
From: mads@troest.NEVERMORE.dk (Mads Orbesen Troest)
Subject: Re: PERL IDES
Message-Id: <k6fk2tedC4v7-pn2-LdxbUIWG5yQd@mads.lokal.net>
On Fri, 14 Jul 2000 20:44:07, "Robin Bank" <rbank@csf.edu> wrote:
> Anyone know any good PERL IDEs for Win98, I'm sick of notepad, and I need to
> be able to rapidly develop perl.
I use the great (and cheap) shareware editor MEd (formerly Mr.Ed). It
comes with Perl syntax-highlighting out of the box. A bit of
configuration and I could also syntax-check the souce from inside MEd
with a simple keystroke, capturing errors in MEd's error window which
allows one to jump directly to the error by clicking on it. Works
great for me. As I recall it can be found at www.bmtmicro.com (among
other places).
If you're doing CGI development consider running a local webserver (I
use Xitami) and perhaps a local MySQL; that way it is very easy and
rapid to test one's code during the development.
... /\/\\ads Orbesen Troest <mads@troest.NEVERMORE.dk>
(Please remove NEVERMORE from address when replying via email...)
------------------------------
Date: 15 Jul 2000 00:38:13 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Perl Rocks!(OT?)
Message-Id: <8kobpl$6h6$3@216.155.32.162>
In article <slrn8mt1o5.cjh.tadmc@magna.metronet.com>,
tadmc@metronet.com (Tad McClellan) wrote:
| >I don't see much
| >point in using it on a non-UNIX based machine,
|
|
| Eh?
|
| The more crippled the machine, the more tools you need (because
| they are not provided).
|
| Perl is good for writing tools (http://language.perl.com/ppt/).
|
| Folks on non-Unix systems need Perl *more* than Unix(ites?) do.
perl ROCKS on my Macintosh too, and I definitely not only SEE a use and
a need for it but have made extensive use of it since I found out about
the MacPerl implementation. :D
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 14 Jul 2000 19:29:17 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: PRINTing " "" "
Message-Id: <8kob8t$fo3$1@provolone.cs.utexas.edu>
In article <MPG.13d92870fc6a777598abcb@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>Why tolerate them? Golf, of course! A string containing exactly one
>quote is one stroke shorter if the string is backslashed than if
>alternate quote characters are used.
>
> "\"\n"
>
> qq("\n)
Um, how about this?
'"'
That's the shortest possible way to write a string that contains
exactly one quote. (Well, o.k., it's not -- it's the shortest
way to write such a string as a literal.)
Of course,
'"\n'
doesn't work out too well if you want to do that...
- Logan
------------------------------
Date: Fri, 14 Jul 2000 20:51:56 -0400
From: Steve Palincsar <palincss@his.com>
To: "Paul [[AGGTA] Total Fuckup]" <none@init.com>
Subject: Re: printing out list of checkboxes to a file.
Message-Id: <396FB5AC.4B6B664@his.com>
"Paul [[AGGTA] Total Fuckup]" wrote:
>
> "Drew Simonis" <care227@attglobal.net> wrote in message
> news:396F57B0.F1ECC469@attglobal.net...
> >
> > #!/usr/local/bin/perl -Tw
> > use strict;
> > use CGI qw/:standard/;
> >
> > my @game_array = param('game');
> >
> > print header; # better than print "Content-type: text/html\n\n";
> >
> > open (CHECK, ">$filename") or die "can't open $filename: $!";
> > print CHECK map $_ . "\n" => @game_array;
> > close CHECK;
>
> Thanks,
>
> It kinda of half works....heres my script (bit dodgy but im still learning)
> The listing of the checkboxes only work if i take out
>
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> if ($fields{$name}) { $fields{$name} = $fields{$name}.",".$value; }
> else { $fields{$name} = $value; }
> }
>
> but then i get an 500 error, but it still prints the checkboxes to the file.
> weird.
> If i leave that form parsing in the listing of the checkboxes doesnt work,
> but the rest does.
> Any more ideas?
Let's see if I understand what happened here. You tried CGI.pm and
couldn't figure out how to deal with multiple values, so you wrote your
own parsing routine. I have a better idea. Personally, I find CGI.pm
way too complicated for my needs. I use CGI_Lite.pm instead. It has a
parse_multiple_values method that returns an array of the values if a
param has multiple values. The documentation for the entire module is
about 6 screens long, it will take you about 5 minutes to download and
install, and you won't be wasting your time writing your own parsing
routines.
------------------------------
Date: Fri, 14 Jul 2000 16:54:54 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Qs for professional Perl/CGI developers
Message-Id: <slrn8muvgu.eq3.tadmc@magna.metronet.com>
On 14 Jul 2000 20:01:45 GMT, Nobody <nobody@contract.Sun.COM> wrote:
>>On Fri, 14 Jul 2000 00:01:47 GMT, Pjtg0707 <Pjtg0707@Netscape.net> wrote:
>>
>>>What is the general going rate for a Perl developer?
>>
>>
>It varies.
>Note: This is in the Boston area, where the demand is so high (for Perl
>and anything web-related) that I could employ a dozen or so
>of me...if only I could clone myself :-)
One of my clients is in the Boston area.
They looked for Perl programmers (with some help from me and from
headhunters) for about six months, then gave up and had me come
teach Perl to several of their employees instead.
Boston must be hot for Perl programmers...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jul 2000 00:14:42 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Sending a Escape using Net::Telnet
Message-Id: <slrn8mvb6s.c2v.efflandt@efflandt.xnet.com>
On Fri, 14 Jul 2000, hamed53@my-deja.com <hamed53@my-deja.com> wrote:
>
>I am using Net::Telnet to connect to a program of mine... that program
>is menu based, which for example if i like to go select any options in
>the menu i have to type the options number, for example 1, or... and if
>i wanted to go to previuos menu i need to press ESC... and that referes
>me to the previuos menu...
>
>Now... i can connect to that program and go to any option in any menu,
>but if i wanted to change to another menu and get another info, i have
>to send ESC to go there, i cant figure out how to send this ESC in
>Net::Telnet...
From looking at the special characters that can be used for pattern
searches I would say "\e" is Escape.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Fri, 14 Jul 2000 15:44:08 -0700
From: Ron Auer <rrauer@mitre.org>
To: djones@excalib.com
Subject: Re: sending files to a printer in Win32?
Message-Id: <396F97B8.B7517037@mitre.org>
Here is what I did
print /d:\\\\printserver\\printername file
Hope it helps/works for you.
Ron
djones@excalib.com wrote:
>
> I've been programming perl for years on UNIX and have just recently been
> asked to write a bunch of code for Win98 and NT. One problem I've run
> into over and over again that I'm not sure how to send files to a
> network printer on Windows. Is this even possible and if so how would I
> go about doing this?
>
> -david
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 14 Jul 2000 23:34:41 GMT
From: aaronp@removeme-shore.net
Subject: Re: sound editing
Message-Id: <lsNb5.229$y5.29734@news.shore.net>
Thank you for the suggestions. Audio::DSP is close. We can easily record
and playback with it. Now I need to just find a program somewhere which
will take a sound file ana analyze it for signal strength or FFT. Thanks
again for the help.
------------------------------
Date: 14 Jul 2000 23:03:29 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: String length?
Message-Id: <8ko681$orv$1@216.155.32.162>
In article <wJKb5.195$Mt6.960@newsfeed.slurp.net>, "Jim Kauzlarich"
<o1technospam@skyenet.nospam.net> wrote:
| > There _is_ only one Camel book...
| >
| >
| > >"Programming Perl"?
| >
| >
| > ... and that is it.
| >
|
| My confusion came from the fact that, looking in the back of my "Learning
| Pearl" book, I see Camels on "Perl 5 Desktop Reference", "Perl in a
| nutshell", and the "Perl Resouce Kit" (I realize is more than a book) and
| did not know if that was a complete list.
well the Perl5 Desktop Reference links to both Programming Perl and
Learning Perl.
Only ONE of those is a Camel though. :>
(what's the other one, a Dromedary? I forget :D )
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Fri, 14 Jul 2000 19:09:54 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: String length?
Message-Id: <396F9DC2.5379D7EA@attglobal.net>
The WebDragon wrote:
>
> well the Perl5 Desktop Reference links to both Programming Perl and
> Learning Perl.
>
> Only ONE of those is a Camel though. :>
>
> (what's the other one, a Dromedary? I forget :D )
Learning Perl = Llama
Programming Perl = (you know)
drom·e·dar·y (drm-dr, drm-)
n., pl. drom·e·dar·ies.
The one-humped domesticated camel (Camelus dromedarius),
widely used as a beast of burden in northern Africa and
western Asia. Also called Arabian camel.
------------------------------
Date: 15 Jul 2000 00:08:54 GMT
From: The WebDragon <nospam@nospam.com.invalid>
Subject: Re: String length?
Message-Id: <8koa2m$6h6$1@216.155.32.162>
In article <396F9DC2.5379D7EA@attglobal.net>, care227@attglobal.net
wrote:
| The WebDragon wrote:
| >
| > well the Perl5 Desktop Reference links to both Programming Perl and
| > Learning Perl.
| >
| > Only ONE of those is a Camel though. :>
| >
| > (what's the other one, a Dromedary? I forget :D )
|
| Learning Perl = Llama
| Programming Perl = (you know)
|
| drom·e·dar·y (drm-dr, drm-)
| n., pl. drom·e·dar·ies.
|
| The one-humped domesticated camel (Camelus dromedarius),
| widely used as a beast of burden in northern Africa and
| western Asia. Also called Arabian camel.
Doh. Guess this makes me a lamah, eh? :D
correction noted. Thanks!
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Fri, 14 Jul 2000 17:48:19 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: The newbie question
Message-Id: <MPG.13d954aca4036a5b98abcd@nntp.hpl.hp.com>
In article <MPG.13d977b6fc3224e49896af@news> on Fri, 14 Jul 2000
09:16:22 GMT, jason <elephant@squirrelgroup.com> says...
> Andrew Johnson wrote ..
...
> > 1) No, do not attempt a lame reply.
> >
> > 2) Yes, do attempt a careful, tested, thought out reply.
2a) Don't consider any code 'tested' unless it compiles correctly
and executes without warnings when using the '-w' flag and
the 'use strict;' pragma.
> > 3) Of course, we all make mistakes -- do not let fear paralyze
> > you and prevent you from becoming a contributor to the group
> > (but, see 1 and 2 above :-)
>
> 4) preface your answer with a small bit about your level of experience
> and don't state your answer as fact if you're not 100% certain that
> it is
>
> eg.
>
> "
> I'm working through these comparison tests as well. The following seems
> to work, not sure if it's correct though because I'm still a beginner.
>
> $A = "A\nB";
> if ( $A = "" ) { print "empty"; }
> "
My advice 2a above would have saved you from the embarrassment of this
response. Try it and see.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 14 Jul 2000 16:58:08 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Trying to use an array as a hash value
Message-Id: <slrn8muvn0.eq3.tadmc@magna.metronet.com>
On Fri, 14 Jul 2000 22:10:23 +0000, rhys <rhys.tucker@dtn.ntl.com> wrote:
>slurp up a file into an array - @message = <MESSAGE>; and use this
>somehow.
>
>I've been wondering that the solution may be to slurp up the file into a
>scalar variable somehow?.
my $message;
{
local $/; # undef is slurp mode
$message = <MESSAGE>; # the whole file in a single scalar
}
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jul 2000 00:35:39 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: UDP / ICMP checksum generation - 1's complement sum
Message-Id: <8kobkr$6h6$2@216.155.32.162>
In article <smtdk843nd6139@corp.supernews.com>, "Ingmar"
<wizard_oz@gmx.net> wrote:
| $cor = 0x0000FFFF; # THIS WILL BE USED LATER TO GET RID OF FFFFs
| @data=(0x030d,0x0000,0x4500,0x0030,0x03a7,0x4000,0x7e06,0x62a9,0xa9c5,0x0
| a2a
| ,0xa9c5,0x38c3,0x0492,0x0018,0x20ec,0xac2e);
not that it's critical, but you should use #!perl -w to turn compiler
warnings on, as you would need to set
$sum = 0;
here since below you are adding $_ to the undefined value.
| # ADD ALL WORDs TOGETHER AND AUTOMATICALLY ACCUMULATE THE CARRY OVER BIT
| for (@data)
| { $sum = $sum + $_ }
|
| $carryover = ($sum & 0xFFFF0000) / 0xFFFF;
| $word = $sum & 0x0000FFFF;
|
| print "CHECKSUM: ";
|
| # ADD CARRY OVER BIT TO THE SUM
| $checksum = $word + $carryover;
| # INVERT (COMPLEMENT) FINAL SUM AND REMOVE TRAILING FFFFs
| $checksum = ~$checksum & $cor;
|
| print sprintf "%lx", $checksum;
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3675
**************************************