[12023] in Perl-Users-Digest
Perl-Users Digest, Issue: 5623 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 11 02:07:10 1999
Date: Mon, 10 May 99 23:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 10 May 1999 Volume: 8 Number: 5623
Today's topics:
Re: apache/mod_perl: error calling Text::ParseWords::pa (Ronald J Kimball)
array help needed xdream@my-dejanews.com
Re: array help needed (Charles R. Thompson)
Re: Crypt::DES/IDEA usage question <joe@hons.cs.usyd.edu.au___REMOVE>
Re: Generate matching strings from regex ? (Ronald J Kimball)
How to convert an e-mail to HTML <eliassk@homemail.com>
ICMP packets: send & receive <zzekka@intrex.net>
Mac System calls <mcshultz@umich.edu>
Re: Mind boggling: Unmatched curly brackets worked (Ronald J Kimball)
Re: Msgbox question (Ronald J Kimball)
need a perl/cgi tutorial please <decarlo@telebot.com>
Offline Mode CTRL-D Problem trw_sqrd@my-dejanews.com
parse variables to a sub <jgough@163.net>
Re: parse variables to a sub (Charles R. Thompson)
Re: Passing Args to script via web and command line (Ronald J Kimball)
Re: perl command line args (Tad McClellan)
Please Help! .pl -> .EXE still requires DLL? (EEk!TheCat)
problem using 'system' with Perl on NT leonandrews@my-dejanews.com
Re: Q: header for no-caching of files? (Ronald J Kimball)
Running a CGI script without change the brower?? <bpsuw@broadway-ps.com>
Re: Sorting is too slow for finding top N keys... - BEN <dgris@moiraine.dimensional.com>
SQL Escape routine <darrensw@ix.netcom.com>
Re: Stupid FAQ question of the (day? month? year?) (Ronald J Kimball)
Re: undefined statements in perl?? <mpersico@erols.com>
WinNT services <cyranode@bellsouth.net>
YASPP (Yet Another Serial Port Problem) stbain@pnsinc.net
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 11 May 1999 01:08:42 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: apache/mod_perl: error calling Text::ParseWords::parse_line
Message-Id: <1drm1dj.jizq3015g4ruoN@p30.block2.tc3.state.ma.tiac.com>
Patrick Lamb <lamb@huntsville.sparta.com> wrote:
> The same script works find from the command line, with /usr/bin/perl.
> If I run it using a cgi_bin/ path (i.e., not using the cgi_perl path
> that enables mod_perl), it works OK. Any clues or suggestions would be
> appreciated and welcomed!
I would guess that you have multiple installations of Perl, and one of
them has a version of the Text::ParseWords module that is missing the
parse_line() method. Make sure all your Perl installations are up to
date.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -le 'print "Just another \u$^X hacker"'
------------------------------
Date: Tue, 11 May 1999 03:22:56 GMT
From: xdream@my-dejanews.com
Subject: array help needed
Message-Id: <7h87q3$4ol$1@nnrp1.deja.com>
Greetings. I'm trying to write a perl program to check all UNIX NIS
password entries to ensure that each has a valid group id. So far, I've
managed to read in the group information into an associative array, as
follows:
==========================
#!/usr/local/bin/perl
open(INPROC, "/usr/bin/ypcat group|");
while (<INPROC>) {
($gname,$junk2,$gid,$junk3) = split(/:/);
$group{$gname} = $gid ; $count ++ ;
}
close(INPROC);
foreach $key (sort keys %group){
print "$key\n";
}
print "count = $count\n";
==========================
I assume that I need to read the "group" field of the passwd NIS map
into another array - at this point how do I check for entries that are
in the passwd(group) that aren't in the group(gid) array? Would it be
better to use regular or an associatives arrays? (and why?).
Also, I've see people in this group suggest using perl -w and strict.
When I use this, I get the following messages (the above code works
fine without the -w and strict):
Global symbol "gname" requires explicit package name at ./groupcheck.pl
line 6.
Global symbol "junk2" requires explicit package name at ./groupcheck.pl
line 6.
Global symbol "gid" requires explicit package name at ./groupcheck.pl
line 6.
Global symbol "junk3" requires explicit package name at ./groupcheck.pl
line 6.
Global symbol "group" requires explicit package name at ./groupcheck.pl
line 7.
Global symbol "count" requires explicit package name at ./groupcheck.pl
line 8.
Global symbol "key" requires explicit package name at ./groupcheck.pl
line 12.
Execution of ./groupcheck.pl aborted due to compilation errors.
How do I correct my code so I do not get these messages?
Lastly, can someone recomment some good perl books or online tutorials?
Something between "hello world" and something geared toward
professional programmers? I've been using the "Learning Perl" book, and
it's ok, but doesn't really explain things like what @_ is/does.
Thanks.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Tue, 11 May 1999 04:58:20 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: array help needed
Message-Id: <MPG.11a18427b9c63b4998968c@news>
In article <7h87q3$4ol$1@nnrp1.deja.com>, xdream@my-dejanews.com says...
> I assume that I need to read the "group" field of the passwd NIS map
> into another array - at this point how do I check for entries that are
> in the passwd(group) that aren't in the group(gid) array? Would it be
> better to use regular or an associatives arrays? (and why?).
I think you're looking for a hash.
http://language.perl.com/newdocs/pod/perlfaq4.html#How_can_I_tell_whether
_a_list_or
> (the above code works
> fine without the -w and strict):
A grenade works if you pull the pin, but throwing it in the right
direction and in a timely manner is another story. Use the -w and strict
and become a much better programmer for it.
> Global symbol "gname" requires explicit package name at ./groupcheck.pl
^^^^^^
> line 6.
> How do I correct my code so I do not get these messages?
There's your hint. Check out...
http://language.perl.com/newdocs/pod/perlsub.html#Private_Variables_via_C
_my_
> Lastly, can someone recomment some good perl books or online tutorials?
> Something between "hello world" and something geared toward
> professional programmers?
It's been 'recomment'ed all over the world. (just about as much as here).
:)
www.perl.com, language.perl.com, the FAQ (which I referenced here), not
to mention the documents on your very computer. They can be invoked by
the magic filange-twiddlings of
perldoc perldoc
which will reveal the perldoc system and tell ya how to use it. You can
also download the entire thing in HTML format if you just can't bear the
thought of basic text.
> I've been using the "Learning Perl" book, and
> it's ok, but doesn't really explain things like what @_ is/does.
^
Ya know... I wish I would have read this whole message before I started
typing.
Take that book back.. some of the pages were obviously damaged during
shipping. Pages xvii - 271 must have gotten wet, page 15 (to be exact)
must have fallen out somewhere near Jersey. A guy named Mike is at this
very moment explaining the usage of @_ while scaling fish at the market
with his buddy Al.
(1) Check out xviii - xxvi of your book.. wow.. references.
(2) Check out Page 15 .. ahh @_ explained. 94 does it even better
(3) My? Page 96.
If you aren't going to use your book, please return it to the Perl
Advocacy Group for redistribution through the 'Books for Newbies'
program. There are plenty of other people who could use it.
--
Charles R. (The Personal Perl Index) Thompson
RainCloud Studios
"That? That's no script. That's your attempt at a rather complex README
file."
------------------------------
Date: Tue, 11 May 1999 12:26:09 +1000
From: Joe Lipson <joe@hons.cs.usyd.edu.au___REMOVE>
Subject: Re: Crypt::DES/IDEA usage question
Message-Id: <37379541.130CD67C@hons.cs.usyd.edu.au___REMOVE>
Steve Maring wrote:
> Is there a way to encrypt a string that is NOT exactly 8 bytes?
>
> The following works:
>
> use Crypt::DES;
> my $key = pack("H16","1234567890ABCDEF");
> my $cipher = new DES $key;
> my $ciphertext = $cipher->encrypt("plaintex");
> my $unpackedciphertext = unpack("H16", $ciphertext);
> print "unpacked ciphertext: ".$unpackedciphertext."\n";
> my $ciphertext = pack("H16", $uncipher);
> my $plaintext = $cipher->decrypt($ciphertext);
> print "plaintext: ".$plaintext."\n";
>
> But it won't allow me to vary the size of the "plaintex" string. Can I
> do anything other than 8 characters?
>
> -Steve Maring
> smaring@gte-es.com
> Tampa, FL
no, it's just the way DES and IDEA work, they need 8 byte plaintext. To
encrypt arbitary lengths of plaintext you should pad it, I used nul and
it worked fine.
e.g
while ($len % 8 != 0) { #make message length mod 8 == 0
$plaintext .= "\0"; #pad with null
$len++;
}
#then I substr $plaintext into 8 byte chunks and encrypt it
Joe
------------------------------
Date: Mon, 10 May 1999 22:22:32 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Generate matching strings from regex ?
Message-Id: <1drkdn6.1rqxvtwesqmz0N@p30.block2.tc3.state.ma.tiac.com>
Bart Lateur <bart.lateur@skynet.be> wrote:
> As a first side remark: you cannot do everything using regexes alone.
> Nested submatches don't translate into regexes. You probably would need
> a parser for that. Example of nested submatches:
>
> /(a(b*)c)/
I must be missing something... That *is* a regular expression. So what
do you mean when you say that nested submatches don't translate into
regexes???
And here's a grammar for it:
S -> aBc
B -> bB | <epsilon>
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 10 May 1999 18:01:01 +0300
From: Elias Skalkidis <eliassk@homemail.com>
Subject: How to convert an e-mail to HTML
Message-Id: <3736F4AD.7EED4050@homemail.com>
I want to convert an incoming e-mail in UNIX to an HTML file.
I have tried hypermail but I can't get it to work.
Any help?
Thanks
------------------------------
Date: Mon, 10 May 1999 22:28:41 -0400
From: Zekers <zzekka@intrex.net>
Subject: ICMP packets: send & receive
Message-Id: <373795D9.DB623358@intrex.net>
I am testing a commercial program (Seagate Software's Nerve Center) that
among other things, can receive and then take action on ICMP
error packets. I need to create a program that will receive the initial
ICMP request from NC and then send an ICMP error packet back to NC. This
would be repeated for the thirty or so ICMP error packets. I haven't
found a pm that handles the ICMP stuff. Is there such a thing? Is there
a UDP pm that I can build an ICMP packet with? Any thoughts would be
appreciated.
Thanx, Zekers!
------------------------------
Date: Mon, 10 May 1999 21:34:19 -0400
From: "m@ shultz" <mcshultz@umich.edu>
Subject: Mac System calls
Message-Id: <373788F1.7078FCBE@umich.edu>
are there such things as system calls in MacPerl?
obviously mac isn't command line oriented, so where could i find out
what these calls are?
thanks,
matt
------------------------------
Date: Tue, 11 May 1999 01:08:43 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Mind boggling: Unmatched curly brackets worked
Message-Id: <1drm316.1cpnhvi19ftxrlN@p30.block2.tc3.state.ma.tiac.com>
<anna@water.ca.gov> wrote:
> The interpreter complained there were one too many right curly brackets. So I
> took out the "offending" right bracket. The program ran fine afterwards. But
> when I count the number of brackets, the number of left brackets do not match
> the the number of right brackets. ?!?!?! How could this be?
>
> $
> $ runSNOWDATA.0 < z.mail
> $ grep \{ runSNOWDATA.0 | wc -l
> 26
> $ grep \} runSNOWDATA.0 | wc -l
> 25
> $
That does not count the number of braces. It counts the number of lines
with at least one brace.
$ perl -ne 'BEGIN{$l=$n=0} $l+=tr/{//;$r+=tr/}//;' \
-e 'END{print"Left:\t$l\nRight:\t$r\n"}'
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'
------------------------------
Date: Tue, 11 May 1999 01:08:44 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Msgbox question
Message-Id: <1drm3ga.1spz4eu1hijo4dN@p30.block2.tc3.state.ma.tiac.com>
Robert Maaskant <maaskant@frg.eur.nl> wrote:
> Believe it or not: I did that!
>
> Dave Evans wrote:
>
> > Try including the words "Press return to continue" in the message perhaps?
> > :-)
How about:
"Press return to begin scanning..."
?
I've never used Win32::MsgBox, but I bet you could use alarm() to set a
timeout, close the message box, and start scanning.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 11 May 1999 11:55:55 +0800
From: "Rusty" <decarlo@telebot.com>
Subject: need a perl/cgi tutorial please
Message-Id: <7h89uu$9t1$1@news.iinet.net.au>
Does anyone know of a site where I can get a good perl/cgi tutorial?
Cheers
------------------------------
Date: Tue, 11 May 1999 04:07:21 GMT
From: trw_sqrd@my-dejanews.com
Subject: Offline Mode CTRL-D Problem
Message-Id: <7h8adi$779$1@nnrp1.deja.com>
I'm using perl 5.00402 on a windows '98 OS. The
problem is when I go into offline mode to try to
test my perl scripts, CTRL-D does not work to get
out of the entering of the name-value pairs. Does
anyone know what the key mapping is supposed to
be, or is there a known problem with this?
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Mon, 10 May 1999 23:40:07 -0700
From: "james gough" <jgough@163.net>
Subject: parse variables to a sub
Message-Id: <37376e11@nemo.idirect.com>
Hi, group,
if I have a script like this,
#!/usr/local/bin/perl -w
use CGI;
$q=new CGI;
&MySub($q);
#bla,bla...
sub MySub {
my ($this, $that) = @_; # what do I get in $this and $that?
#bla,bla...
}
Thanks in advance!
_____
Regards,
James Gough
------------------------------
Date: Tue, 11 May 1999 04:59:01 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: parse variables to a sub
Message-Id: <MPG.11a17aee9ba166bc98968b@news>
In article <37376e11@nemo.idirect.com>, james gough says...
> if I have a script like this,
> #!/usr/local/bin/perl -w
> use CGI;
> $q=new CGI;
> &MySub($q);
> #bla,bla...
> sub MySub {
> my ($this, $that) = @_; # what do I get in $this and $that?
> #bla,bla...
> }
close. :)
> my ($this, $that) = @_; # what do I get in $this and $that?
a world of mess. If you are trying to access your passed data from a form
(which I think is what you were thinking would happen) then use param
from the CGI module like below. I'm not going to outline passing arrays
to subs because you need to play with CGI.pm a bit more.
---try this---
#!/usr/local/bin/perl -w
use CGI;
# ADD THIS - will keep you in line. :)
# when you get errors, look in your log files!
use strict;
$q=new CGI;
# if you don't use this, your results will not
# show in the browser
print $q->header;
# param is the same as $q->param
# you will probably see it more
# like below in documentation
# param refers to the 'input'
# tags from your form
print param('firstname');
print param('lastname');
#here you would substitute firstname or lastname
#for the names of the #HTML input tags you use.
---
Using this script, play with CGI and some forms
before you jump too far into things. Then you will
have a better sense of what is coming into your
script to work with.
Refer to FAQ 9 for more info on CGI with Perl for more info...
http://language.perl.com/newdocs/pod/perlfaq9.html
--
Charles R. Thompson
RainCloud Studios
"That? That's no script. That's your attempt at a rather complex README
file."
------------------------------
Date: Tue, 11 May 1999 01:08:45 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Passing Args to script via web and command line
Message-Id: <1drm4u2.xy3lt31uyxgofN@p30.block2.tc3.state.ma.tiac.com>
Derek Boss <boss_derek_w@email.cat.com> wrote:
> Can a perl cgi script, which gets it data from a webpage, also be set up
> to accept input from a command line??
If you use the CGI module, this is very easy. It accepts input from
STDIN automatically when run from the command line. And CGI.pm is even
part of the standard Perl distribution!
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -e 'for (@ARGV) { require $_; print "$_\n $INC{$_}\n"}' CGI.pm
------------------------------
Date: Mon, 10 May 1999 17:27:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: perl command line args
Message-Id: <v0j7h7.ece.ln@magna.metronet.com>
gwinsock (sgutti@usa.net) wrote:
: Iam a newbie to perl , and I have a question regarding PERL command
: line arguements. I want to send perl with command line arguements and
: some of those have spaces in
: between,
That won't give Perl any problems.
: and I think perl treats space as a delimitter, so if I have 3
: arguements and im calling
Perl does not treat space as a delimiter.
: xxx.prl 1 kansas city 3
: perl takes kansas as one parameter and city as aonther parameter,...how
perl doesn't "take".
perl "gets" whatever your command interpreter gives it.
: can i come across that, is there anyway i can force perl to interpret
: certain list of words as a single
: arguement?? so can i change its interpretation of arguements??? If you
: guys have any ideas, please put them across,
You do not have a Perl question.
You have a shell question.
Some shells use (single or double) quotes around args with
spaces.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 11 May 1999 01:26:32 GMT
From: ewhardy@mindspring.com (EEk!TheCat)
Subject: Please Help! .pl -> .EXE still requires DLL?
Message-Id: <373786ad.33907203@news.supernews.com>
Hello,
I've written a neat little perl script for a customer and I would like
to be able to hand over just an executable that could be run on any
Win32 machine (well ok, NT). The problem is that when I run the pl2exe
for my script and create an .EXE file it works great on my machine
(perl is installed there) but when I run it on a machine without perl
it gives me pop-ups asking for DLLs and such.
Am I doing something wrong?
Thanks,
Ted Hardy
ewhardy (@) mindspring.com
------------------------------
Date: Tue, 11 May 1999 02:45:24 GMT
From: leonandrews@my-dejanews.com
Subject: problem using 'system' with Perl on NT
Message-Id: <7h85k1$2pb$1@nnrp1.deja.com>
Hello,
I have a script which needs to call the windows FTP program, do some
stuff and then carry on. The following code sparks up FTP and seems to
do everything I want (testftp.bat simply logs on to an ftp server, gets
a directory listing, disconnects and quits ftp) but still gives me the
output of the "or" message, indicating some kind of error.
system('c:\dev\batches\testftp.bat') or print "that didn't work:
$!\n\n";
$! does not however get set.
Any ideas?
many thanks,
Leon.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Tue, 11 May 1999 01:08:49 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Q: header for no-caching of files?
Message-Id: <1drm5l2.tpp543142qi9xN@p30.block2.tc3.state.ma.tiac.com>
TheEadsNet <theeadsnet@aol.com> wrote:
> Does anyone know what the header is to prevent browser caching of files
> "print"ed by Perl?
If no one here knows, I bet people in a newsgroup having to do with CGI
or HTTP would...
I believe it's Pragma: no-cache, but don't quote me on that.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 11 May 1999 11:08:01 +0800
From: "Antony Mak" <bpsuw@broadway-ps.com>
Subject: Running a CGI script without change the brower??
Message-Id: <7h86vl$rig$1@imsp009a.netvigator.com>
Hi all,
I have a perl cgi script that each time a user run the script(e.g. input
a staff ID), it must return a message or redirect to others URL. But the
problem is everyday about a hundred of users run this script on a PC. They
don't want the brower refresh each time. I have seen something about the
status code "204". Can anyone help how to do the in a perl scipt?
thanks in advance
antony
------------------------------
Date: 11 May 1999 00:02:27 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Sorting is too slow for finding top N keys... - BENCH
Message-Id: <m34slk400c.fsf@moiraine.dimensional.com>
[mailed and posted]
lr@hpl.hp.com (Larry Rosler) writes:
> I haven't found a sort-extremes module under CPAN Sort::..., and neither
> Knuth Vol. 3 nor Sedgewick seems to have an algorithm. I will soon
> submit this to the Perl Function Repository, and perhaps make it into a
> module as a training exercise.
<snip>
I've added this version to the repository.
Thanks.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Mon, 10 May 1999 18:16:45 -0700
From: "Darren" <darrensw@ix.netcom.com>
Subject: SQL Escape routine
Message-Id: <7h80eg$24h@dfw-ixnews10.ix.netcom.com>
Hi
I am trying to find a quick subroutine which will escape characters such as
" and ' so that a user cannot try to put them into a text field ... or, even
better, to have the sub replace them with an escape character to allow them
in so that my text field can accept, for example:
I do, "therefore" I am ...
etc. etc.
All help much appreciated
Regards
Darren
------------------------------
Date: Tue, 11 May 1999 01:08:50 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Stupid FAQ question of the (day? month? year?)
Message-Id: <1drm7d2.hjc5a81ob1o91N@p30.block2.tc3.state.ma.tiac.com>
Bob Trieger <sowmaster@juicepigs.com> wrote:
> >Aren't the FAQs already text files??
>
> No, they aren't. They are in POD format and this format isn't pretty if
> simply displayed on a windows machine.
The whole point of POD is that it is easily readable without any special
formatting.
Perhaps the ugliness comes from the Windows machine, rather than from
the POD? ;)
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 10 May 1999 21:05:38 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: undefined statements in perl??
Message-Id: <37378262.7662C7A6@erols.com>
Hey, I never said I'd WRITE that! Just that IF you are using 5.005_03 on
an NT box compiled wioth VC++5.0, the result SEEMS intuitive. Access,
incr, access, incr. Now, maybe 'C''s got a problem with that, but I bet
ya that once you found a 'C' compiler that produced 2 * 2 in the 'C'
code for this expression AND youyou then compiled perl with the same
compiler, you'd get six out of the expression.
How do I know this? Just a gut feeling. Anyone out there try this and
not get $n==6, $i==4?
Larry Rosler wrote:
>
> In article <373625A0.30F80392@erols.com> on Sun, 09 May 1999 20:17:36 -
> 0400, Matthew O. Persico <mpersico@erols.com> says...
> ...
> > Now, if you had $n = $i++/$i++, you might have a quandry as there may be
> > no standard as to which $i++ is performed first. For multiplication (or
> > addition), who cares? 2 * 3 = 3 * 2. For division (or subtraction), it
> > does make a difference as 2/3 != 3/2.
>
> 2/3 != 3/2 != 2/2 !!!
>
> For multiplication, how would you like the result to be 2 * 2? This
> would be perfectly acceptable in Standard C: Do the multiplication
> first, then do an increment on each of the factors.
>
> In Standard C, the results of these operations with side effects between
> sequence points is not 'implementation-defined'. It is 'unspecified',
> which means -- in essence -- anything goes. So don't write such
> expressions.
>
> The same assumption should be made about Perl.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
--
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2
------------------------------
Date: Tue, 11 May 1999 03:15:16 GMT
From: Chuckie <cyranode@bellsouth.net>
Subject: WinNT services
Message-Id: <2B4669B2.6FA8CD16@bellsouth.net>
Hello,
I have been looking high and low for a module, function, script that
will let me remotely change the password a service uses to login, when
the account password gets changed. I have to change a service account
password for as per corp. security standards. Now I don't want to go to
each computer , logon, change the service settings and go to the next
machine. I would like to use perl if I can. It is the only programming
language I have any experience with.
Please respond to fch001@email.mot.com as well as here if you
would. I don't get allot of time in the day to browse the groups while
I am working.
Thank You,
Charlie Hutchinson
Motorola, Inc.
Advanced Manufacturing Systems Test
------------------------------
Date: Tue, 11 May 1999 01:59:45 GMT
From: stbain@pnsinc.net
Subject: YASPP (Yet Another Serial Port Problem)
Message-Id: <7h82ug$cc$1@nnrp1.deja.com>
Ladies and Gentlemen,
I know you're tired of dealing with serial port problems; however, I
have an interesting dilemma I sure could use some help with.
If you take a quick gander at:
http://metalab.unc.edu/LDP/HOWTO/mini/Windows-Modem-Sharing.html
you will see 5 lines of Perl code used to redirect incoming TCP traffic
(on a specified port) to a /dev/tty. Unfortunately, I want to do the
exact _opposite_ of that.
I want to write (actually print) to a tty (a real tty, not a named
pipe) and have it sent directly to a tcp port on another host.
I have an application running on AIX 4.2.1. This application checks
the /dev directory for valid tty ports and makes these ports available
for use with serial printers (which I have). Only one problem... the
printers moved and are now on the other side of a WAN. The printers
are attached to an Equinox ELS-16 which listens on tcp ports 4001-4016
for each of its ports.
Equinox provides C code for utilities that:
"...[use] a named pipe or a pty/ttyp device pair to create an
automatic data path for spooled print devices to a Terminal Server..."
and
"invoke a raw TCP network connection between a /dev/tty on
the host and a remote port on a terminal server."
However, the AIX version uses ttyp ports, not ttys. Unfortunately, the
application I am running will not recognize ttyp ports (or /dev/pts/#
ports) as valid serial ports for me to print to (and no... I can't use
UNIX print spooling).
The C code for both are available for download at:
ftp://ftp.equinox.com/library/els/rutiltar.Z
In addition to perlfaq8, the Camel Book, and efnet #perl, I have read
various postings in comp.lang.perl.misc and tried several code
examples. None of them seem to work and I'm out of caffeine.
Unfortunately, I do not have the time to research this any further and
learn the Tao of serial port sysopen() calls. I need a proven
solution... fast.
Free advice is always welcome (I'm still a Perl newbie eager to learn),
but my employer is willing to pay a nominal fee for a viable solution.
However, we need this ASAP (morning of 4/11/1999ish).
So... if anyone has any ideas, please email me... soon.
-- Stu Bain
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5623
**************************************