[8759] in Perl-Users-Digest
Perl-Users Digest, Issue: 2375 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 21 22:07:38 1998
Date: Tue, 21 Apr 98 19:00:33 -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 Tue, 21 Apr 1998 Volume: 8 Number: 2375
Today's topics:
Re: 2 newbie questions (Andre L.)
Re: Are there things NOT answered yet ? <rootbeer@teleport.com>
Re: Array / List question <road@apdo.com>
Re: array elements -- how to exclude when reading in? (Andre L.)
Re: array of matches in s/// <rootbeer@teleport.com>
Re: array of matches in s/// (Ilya Zakharevich)
Re: beginnings.... <due@discovernet.net>
Re: Can someone give me an example of rounding! <rootbeer@teleport.com>
Re: compiling module compiles PERL?!? <rootbeer@teleport.com>
Re: die diff 5.003 and 5.004? <tchrist@mox.perl.com>
Re: Expand wildcards shellishly <rootbeer@teleport.com>
Re: Help with regular expression <lr@hpl.hp.com>
Help! (Keith L. Miller)
Re: How can I get the correct answer? <tchrist@mox.perl.com>
Re: How to load the module with calculated name? <tchrist@mox.perl.com>
Re: Interesting (?) file programming issue <rootbeer@teleport.com>
Re: Lexers / tokenizers in Perl (Phil Ptkwt Kristin)
Re: malformed header <rootbeer@teleport.com>
Newbie Question re:mkdir for nested directories <laura.morgan@itron.com>
Re: newbie trying to close off a pipe <rootbeer@teleport.com>
Re: newbie trying to close off a pipe <rootbeer@teleport.com>
Re: Password changing under Solaris <brianm@kodak.com>
Pattern Matching on HighBit Characters <hsommer@micro.ti.com>
Re: Pattern Matching on HighBit Characters (Fritz Knack)
Perl for WIN32 & SNMP (Jochen Goerner)
Re: Perl for WIN32 & SNMP <gmarzot@baynetworks.com>
perltoot, another question <bmb@ginger.libs.uga.edu>
perltoot, clarification, please <bmb@ginger.libs.uga.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Apr 1998 13:50:34 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: 2 newbie questions
Message-Id: <alecler-2104981350340001@dialup-24.hip.cam.org>
In article <353C1DCB.A7842@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:
> Andre L. wrote:
> >
> > "I apologize to the group for answering this question despite the fact
> > that my name is not Tom Phoenix or Randall Schwartz."
>
> Actually, you should apologize for spelling Randal's name wrong. :-)
For this I do indeed humbly apologize.
A.L.
------------------------------
Date: Tue, 21 Apr 1998 17:54:05 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Are there things NOT answered yet ?
Message-Id: <Pine.GSO.3.96.980421105218.21174R-100000@user2.teleport.com>
On 19 Apr 1998, Lloyd Zusman wrote:
> Tom Phoenix <rootbeer@teleport.com> writes:
>
> > Although I'm looking forward to seeing this newsgroup created, I fear that
> > c.l.p.misc will become devoid of people who can give good answers, and
> > that it may become, as my pal Randal says, "the stupid leading the blind".
>
> Well, if that's a concern of yours and Randal's, you both could always
> continue to post to c.l.p.misc even after c.l.p.moderated comes into
> existence.
I don't think Randal will, but I may do that. Most of my posts will
probably amount to "bad answer, check ______", though! :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 19:35:49 +0200
From: "A.P." <road@apdo.com>
Subject: Re: Array / List question
Message-Id: <353CD8F4.6A9771D9@apdo.com>
John Porter wrote:
> I was really thinking of the case of an identity array; that is,
> when @i = (0..$n), @i[@i] == @i.
>
This is really what I was saying :-) Now we both agree. I should have said,
that *in the case of an identity array* @i[@i]==@i are the same *in a list
context*.
Now I have a final?? question. Is there any context/type difference between
@i and @i[0..$#i]? As a matter of fact I've understood that *in scalar
context* @i amounts the number of elements of @i ($#i+1) but @i[0..$#i]
amounts the value of the last element: $i[$#i]?Might someone comment on this?
> John Porter
------------------------------
Date: Tue, 21 Apr 1998 15:04:21 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: array elements -- how to exclude when reading in?
Message-Id: <alecler-2104981504210001@dialup-24.hip.cam.org>
In article <353C198B.54D732B9@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:
> Andre L. wrote:
> >
> > It would be nice if one could write:
> >
> > @records = map { next if /\026/;
> > $_ } <>
> >
> > or
> >
> > @records = map { $_ unless /\026/ } <>
> >
> > Is there a way to do this sort of thing with map? (having map not return a
> > value if we don't want it to?) I guess not. Maybe in Perl6?
>
> Isn't that what grep is for?
In this case, of course (is my face red).
Actually, I was thinking of a mapping function that would return a
_modified_ value conditionally, like a hybrid between map and grep, and
which would allow this kind of statement, to keep the resulting array as
small as possible:
@b = grap { [ split /\t/ ] if Matches_criteria($_) } <MYFILE>;
rather than doing:
@b = map { [ split /\t/ ] }
grep { Matches_criteria($_) } <MYFILE>;
which seems like too much looping for nothing.
Anyway.
A.L.
------------------------------
Date: Tue, 21 Apr 1998 17:47:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: array of matches in s///
Message-Id: <Pine.GSO.3.96.980421102701.21174P-100000@user2.teleport.com>
On Sun, 19 Apr 1998, Bart Lateur wrote:
> Tom Phoenix wrote:
>
> >I can't see what @& could hold which would be useful there. Can you
> >describe your proposed feature in more detail?
>
> Well, what it would hold, can be represented with this code example:
>
> (@match) = /$pattern/;
>
> which basically does two things: the matching, and the returning of an
> array. This line would be equivalent to:
>
> /$pattern/;
> @match = @&;
>
> so my proposal is pretty much in agreement with the rest of Perl.
>
> In s///, you can't get at this array of matches, which is a unhappy
> circumstance for some applications, in particular if you don't know how
> many submatches to expect.
Ah, I see now. And I'd say adds real functionality only in the cases where
you don't know the number of memories - since if you knew the number were
three, you could simply use ($1, $2, $3), for example.
> Well, you could argue that the circumstances where you actually need it,
> could be pretty rare.
Yes, I was about to do that. :-) But I think this should suffice. (It's
just modified a little from your example.)
s/$pattern/ &transmutor(@&) /e
There's currently no way (AFAIK) to properly pass the memories to the sub.
(Or is there? With eval, you could... But that's not a good way to go.)
Here's my short-n-sweet definition of the proposed feature:
@& is a read-only list of all $<digit> values currently in scope.
Is that an accurate summation of what you're seeking? Maybe this could
become part of a future version of Perl.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 Apr 1998 19:10:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: array of matches in s///
Message-Id: <6hiqv6$msn$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tom Phoenix
<rootbeer@teleport.com>],
who wrote in article <Pine.GSO.3.96.980421102701.21174P-100000@user2.teleport.com>:
> Here's my short-n-sweet definition of the proposed feature:
>
> @& is a read-only list of all $<digit> values currently in scope.
>
> Is that an accurate summation of what you're seeking? Maybe this could
> become part of a future version of Perl.
When we have a patch-recepting pumpking, and I get better knowledge of
tied arrays, I plan to implement @< and @> ( maybe @- and @+ ?) which
keep offsets of starts and ends of $& and $<i> (as match-data in Emacs).
Then doing $#< will give you a limit of $<i>.
But I still do not understand what it has to do with the translation
problem which is discussed.
Ilya
------------------------------
Date: 21 Apr 1998 17:08:34 GMT
From: "Allan M. Due" <due@discovernet.net>
Subject: Re: beginnings....
Message-Id: <6hijqi$o8r$0@206.165.146.172>
Stuart McDow wrote in message <6hiehh$gnv$1@ns1.arlut.utexas.edu>...
>Alternatively, you can download the Standard distribution, which is
>newer and more complete. Unless you must use MS IIS, the ActiveState
>perl port is not the way to go. It's a down rev version of perl. The
I should have suggested this option as well. I suggested ActiveState for
the because he said he was just beginning to learn Perl. I would be curious
to know others views regarding the relative strengths and weaknesses of the
two versions. What I think I know so far, Using ActiveState as a reference.
Pros of ActiveState
1) It is a tad bit easier to install (self extracting zip which does the
autoexec.bat changes automatically.
2) Better support, they provide a fair amount of information on their web
site, including a Win95/NT FAQ and links to other information.
3) 6 megs to install vs. 20 megs to install.
4) ASP and IIS options.
5) The debugger. Does anyone know if the debugger works with the Sarathy
version?
Cons,
1) One iteration behind
2) Much more difficult to add modules. No automatic module installation.
3) No dmake included
4) The Sarathy version has many of the most popular modules already
installed (thus the greater size?)
So my feeling is if you are just installing Perl to learn the rudiments of
the language, or as a quick way to debug Perl before you move it to a UNIX
site then ActiveState might be the way to go, but if you need a full blown
Win95/NT installation one should use the Sarathy version.
Any comments?
AmD
Due@discovernet.net
------------------------------
Date: Tue, 21 Apr 1998 17:50:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: David McKay <mck@rahul.net>
Subject: Re: Can someone give me an example of rounding!
Message-Id: <Pine.GSO.3.96.980421104914.21174Q-100000@user2.teleport.com>
On 19 Apr 1998, David McKay wrote:
> % perl -e 'printf "%4.2f\n", 2.005'
> 2.00
> % perl -e 'printf "%4.2f\n", 2.0051'
> 2.01
>
> That first response of 2.00 looks like a rounding error to me -- maybe not
> by printf's definition, but I hope my bank isn't using the same method in
> interest calculations.
>
> Could this be because the internal representation of 2.005 is
> 2.004999999...,
% perl -e 'printf "%4.20f\n", 2.005'
2.00499999999999989342
My sources say 'yes'. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 17:12:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: otis@POPULUS.net
Subject: Re: compiling module compiles PERL?!?
Message-Id: <Pine.GSO.3.96.980421101027.21174O-100000@user2.teleport.com>
On Sun, 19 Apr 1998 otis@POPULUS.net wrote:
> I was trying to compile DateCalc 4.0b7 module but for some reason 'make
> test' started re-compiling perl on my machine, and not DateCalc module.
Perhaps some date stamp is incorrect or in the future? Or your perl (or
your system) isn't set up to do dynamic linking, maybe?
> This is on BSDI 2.0 with perl 5.003 (I didn't upgrade perl because I
> could not compile perl 5.004_4 on this machine).
I think you should fix that, first! 5.400 should compile cleanly on
virtually any properly-configured machine.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 Apr 1998 14:29:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: die diff 5.003 and 5.004?
Message-Id: <6hiah3$ooi$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, v2matt@btv.ibm.com () writes:
:I know you shouldn't catch errors this way, but I am
:curious to way it works in perl5.003 and not in
:perl5.004. See script below:
:
:`ls -M` or die "I DIED:$!\n";
Why are you consulting errno when you haven't just tested the return
value of a system call? Why are you using backticks improperly?
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"All things are proceeding rapidly to their contusion." --Larry Wall
------------------------------
Date: Tue, 21 Apr 1998 19:29:23 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: Expand wildcards shellishly
Message-Id: <Pine.GSO.3.96.980421122627.21174U-100000@user2.teleport.com>
On 20 Apr 1998, David Fetter wrote:
> In the course of working with an O^H^H^H legacy database, I've found a
> profound lack of wildcardishness in matching strings, so I'd like
> to build a wildcard expander in perl, which would work like this:
>
> Wildcard_Expand('.*([a-c]foo|[d-f]bar)?') would return the following
> list:
>
> %afoo_
> %bfoo_
> %cfoo_
> %dbar_
> %ebar_
> %fbar_
Do you mean that it would pick those strings from a list of possible
strings? Or that it would somehow generate those strings from its input?
> What references should I be consulting?
I'm not sure. How far have you gotten in trying to implement this?
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 09:39:12 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Help with regular expression
Message-Id: <6hii39$7mi@hplntx.hpl.hp.com>
Quentin Fennessy wrote in message ...
...
>I could not compress this to one line (the ultimate $NEWDATE
assignment).
>How can I say something like $NEWDATE = $DATE =~ s/something/else/?
>
>--
>Quentin Fennessy AMD, Austin Texas
>Secret hacker rule #11 - hackers read manuals
($NEWDATE = $DATE) =~ s/something/else/;
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Tue, 21 Apr 1998 18:48:26 GMT
From: miller@bigsky.net (Keith L. Miller)
Subject: Help!
Message-Id: <353ce8b5.96716934@news.bigsky.net>
I have a small problem with perl and a null string. When I read in a
colan delimeted data file and one field is empty, I can't get perl to
do anything with it. Ex:
test :123:more text
:456:still more text
another test:789:and still some more text
I'm opening the file and reading it line by line, but when it gets to
the second line with nothing in the first field I need it to perform
some procedure. I have tried a variety of ways such as
open (IN, filename);
while(<IN>){
@fields = split(/:/, $_);
if($fields[0] =~ /\0/){ # Attemp 1
if(length($fields) < 1){ # Attemp 2
Also, here's an interesting note. If I print the length of the blank
field, it always comes up 38 UNLESS the filed is longer than 38, then
it comes out with the correct length.
Any help would be VERY appreciated!
------------------------------
Date: 21 Apr 1998 14:26:58 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How can I get the correct answer?
Message-Id: <6hiabi$ooi$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, James_Yang@via.com.tw writes:
:55.46 + 50 -100 = 5.46000000000001
:1553.05 + 50 - 1600 = 3.04999999999995
:
:Is it a bug or I can get the correct answer in the other way?
None of the above. A computer doesn't store what a mathemetician
considers a real number. Welcome to computers. This is in the FAQ.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
:The only reason [not to use] perl is that some sysadmins don't allow software that they didn't pay for.
By all means, let them send me money if it makes them feel better. :-)
--Larry Wall in <1993Dec13.213032.26623@netlabs.com>
------------------------------
Date: 21 Apr 1998 14:34:01 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to load the module with calculated name?
Message-Id: <6hiaop$ooi$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
prikryl@dcse.fee.vutbr.cz (Petr Prikryl) writes:
:Please, how can I load the module when its name was calculated (read
:from the input text file into a variable). The module is placed in
:the subdirectory which was also calculated (it is not in @INC).
:
:My solution up to now is:
:
: require "$directory/$module.pm";
: eval "$module\::function()";
:
:where $directory and $module are variables. I do "use strict" and I want
:to keep the strict mode.
That's not really a solution. And the eval there is overkill.
--tom
[Excerpt from a draft of the Perl Cookbook follows.]
Problem: You need to load in a module that might not be present on
your system. This normally results in a fatal exception. How
do you detect and trap such failures?
Solution
Wrap the `require' or `use' in an `eval'.
# no import
unless (eval "require $mod") {
warn "couldn't load $mod: $@";
}
# imports into current package
unless (eval "use $mod") {
warn "couldn't load $mod: $@";
}
Discussion
Most of the time, you want a program to fail if it tries to load a
module that is missing or doesn't compile. Sometimes, though, you'd
like to recover from that error, perhaps trying an alternative module
instead. As with any other exception, you insulate yourself from this
one with an `eval'. Unlike most such cases, you don't want to use a
`eval { BLOCK }' to trap just run-time exceptions. You want but rather
`eval "string"' to also catch compile-time problems. This is because
that `use' is strictly a compile-time event, and because `require'
on a bareword has a slightly different meaning than using with with
a variable. It adds a *.pm* and translates double-colons into your
operating system's path separators, usually `/', `\', or `:'.
If you need to try several modules in succession, stopping at the
first one that works, you could something like this:
$found = 0;
for $mod (qw(Giant::Eenie Giant::Meanie Mouse::Mynie Moe)) {
if (eval "require $mod") {
$mod->import(): # if needed
$found = 1;
last;
}
}
die "None of @DBs loaded" unless $found;
--
Tom Christiansen tchrist@jhereg.perl.com
"I have never understood why it should be neccessary to become irrational in
order to prove that you care. Or indeed why it should be neccessary to prove
it at all." --Avon (_Blakes 7_, "The Duel")
------------------------------
Date: Tue, 21 Apr 1998 19:45:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Rich Gibson <drahcirr@netcom.com>
Subject: Re: Interesting (?) file programming issue
Message-Id: <Pine.GSO.3.96.980421124403.21174V-100000@user2.teleport.com>
On Tue, 21 Apr 1998, Rich Gibson wrote:
> If you write to a file, and then read from it as stdin, the read will not
> read all that the write wrote.
..If and only if there's an unflushed buffer, of course. Check out
perlvar's description of the magical $| variable.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 17:25:22 GMT
From: ptkwt@user1.teleport.com (Phil Ptkwt Kristin)
Subject: Re: Lexers / tokenizers in Perl
Message-Id: <6hikq0$2l0$1@user1.teleport.com>
In article <yo967k3d54x.fsf@nym.sc.philips.com>,
Frank <dont_use_this_ey@hotmail.com> wrote:
>mjd@op.net (Mark-Jason Dominus) writes:
>
>Hello all!
>
>I have an ongoing background project: it is a verilog parser written
>in perl. I tried to reuse as much as possible and started searching
>for existing solutions. As a result I found lex & yacc source code and
>additional code written in C.
Frank,
This is very interesting, I've been contemplating a similar project for
VHDL. Currently I'm working on an equation simulator - given a set of
logic equations and some input stimulus it would simulate the circuit -
this is fairly easy to do with Perl's eval and some overloading to allow
for 'X' and 'Z' values. One could imagine that doing a Verilog
(or even VHDL, but the grammer is a lot trickier) simulator
in Perl would be very much easier than the traditional way (because of the
power of eval, and Perl's regex features).
>Do you have recommendations, tips and perhaps examples, how to set up
>a project simular to my one?
>
>with kind regards
> Frank
>
Frank, Please contact me via e-mail: ptkwt@teleport.com
Phil
------------------------------
Date: Tue, 21 Apr 1998 17:08:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: ~arthur <star@sonic.net>
Subject: Re: malformed header
Message-Id: <Pine.GSO.3.96.980421100827.21174N-100000@user2.teleport.com>
On Sun, 19 Apr 1998, ~arthur wrote:
> I think i am almost there. Now I get just the header does anyone know
> why?
If you're following the proper protocol but some browser or server doesn't
cooperate, then it's the other program's fault. If you're not following
the protocol, then it's your fault. If you aren't sure about the protocol,
you should read the protocol specification. If you've read it and you're
still not sure, you should ask in a newsgroup about the protocol.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 10:09:18 -0700
From: Laura Morgan <laura.morgan@itron.com>
Subject: Newbie Question re:mkdir for nested directories
Message-Id: <353CD2BE.7D32@itron.com>
I'm trying to use the mkdir command to create nested directories. It
only seems to work when I create one directory at a time down the tree.
I'm runing Perl for WIN32.
Thanks
------------------------------
Date: Tue, 21 Apr 1998 19:08:33 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Craig Simpson <craigs@3rdstone.net>
Subject: Re: newbie trying to close off a pipe
Message-Id: <Pine.GSO.3.96.980421120750.21174S-100000@user2.teleport.com>
On Mon, 20 Apr 1998, Craig Simpson wrote:
> >close SENDMAIL;# BUT it refuses to close.
> close(SENDMAIL);
I don't think that adding parens there will help. Thanks for trying!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 19:16:13 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: David Epstein <dbae@maths.warwick.ac.uk>
Subject: Re: newbie trying to close off a pipe
Message-Id: <Pine.GSO.3.96.980421120853.21174T-100000@user2.teleport.com>
On Mon, 20 Apr 1998, David Epstein wrote:
> Here is a fragment of code I'm trying to get to work
>
> open(SENDMAIL,"|/usr/lib/sendmail -t") or die etc;
> print SENDMAIL $various;
> close SENDMAIL;# BUT it refuses to close.
>
> What happens is that the close statement hangs. I assume (but don't
> know) that this is because sendmail is busy on more important business,
> and so the child created by the pipe is not returning.
The docs for close explain that it waits for the child process to
complete. That should be happening; isn't it? (Try piping the same info to
sendmail from the shell; if it takes just as long to return, then it's not
Perl's fault! :-)
I think you want to close the pipe without waiting. In that case, you can
use the techniques in perlipc and section 8 of the FAQ to make sendmail
run in the background.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 14:07:15 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Password changing under Solaris
Message-Id: <353CE053.9F715E66@kodak.com>
Bill 'Sneex' Jones wrote:
>
> Without code, I assume you are not using Expect/TK? Nor are you using Expect.pm?
> That is a neat trick, to get the passwd piping to work and all :-)
>
> Without code I would have to believe you :-) I cannot do it without Expect/TK, and
> then, if Expect/TK is installed, why telnet anywhere? Oh well.
> __________________________
> Bill Jones...............|
Well, it's pretty simple actually. I am not using anything except
Net::Telnet. When you telnet to a machine, it flattens out all the
output, so it doesn't matter if passwd outputs on STDOUT or STDERR, so
you can watch for any strings and not have to worry about that.
Expect would have been easier, but I was writing it for an HP-UX system,
and I'll be damned if I've ever gotten anything to compile on it. I
needed a pure Perl solution to the problem. Also, telnetting solves all
suid problems, because you actually log in to the machine as the user
who's password you are changing.
I don't think this is the best solution, but there apparently isn't a
best solution to this problem.
Brian Mathis
------------------------------
Date: Tue, 21 Apr 1998 13:36:33 -0500
From: Holly Sommer <hsommer@micro.ti.com>
Subject: Pattern Matching on HighBit Characters
Message-Id: <353CE731.8E86245F@micro.ti.com>
At least, I *think* that is what the problem is.
I have a textfile which is full of junk, and I want to
strip out the junk. Simple s/<junk>//g , you'd think, except
that the junk I want to strip out starts with what *LOOKS*
like a Capital-A-accent with the accent that goes up and
to the right (not sure what the proper word for that character
is).
I emailed this question to a listserv, and the junk that I
pasted into my mailer came out as a bunch of `=E0=E00=E00=E000
looking junk, which is considerably different from the
HHCapital-A-accented stuff I copied and pasted. In fact, when
I paste it here in this post, the junk comes out as just
zeroes, so...
How the heck do I get a pattern match on this?
Thanks!
Holly, been gone for a couple months from clpm
------------------------------
Date: Tue, 21 Apr 1998 19:41:08 GMT
From: fritz.knack@nospam.POPULUS.net (Fritz Knack)
Subject: Re: Pattern Matching on HighBit Characters
Message-Id: <353cf55c.14323961@cnews.newsguy.com>
On Tue, 21 Apr 1998 13:36:33 -0500, Holly Sommer
<hsommer@micro.ti.com> wrote:
>At least, I *think* that is what the problem is.
>
>I have a textfile which is full of junk, and I want to
>strip out the junk. Simple s/<junk>//g , you'd think, except
>that the junk I want to strip out starts with what *LOOKS*
>like a Capital-A-accent with the accent that goes up and
>to the right (not sure what the proper word for that character
>is).
>
>I emailed this question to a listserv, and the junk that I
>pasted into my mailer came out as a bunch of `=E0=E00=E00=E000
>looking junk, which is considerably different from the
>HHCapital-A-accented stuff I copied and pasted. In fact, when
>I paste it here in this post, the junk comes out as just
>zeroes, so...
>
>How the heck do I get a pattern match on this?
>
>Thanks!
>
>Holly, been gone for a couple months from clpm
I routinely use
s/[^\x20-\x7E\n\t]//g;
to strip all non-printables except tabs and newlines, and it seems to
work for my purposes. If my track record with this group holds true,
however, I'm successfully using it through some fortunate accident,
not good code. <sigh>.
Fritz
-------------------------
Sorry 'bout the nospam in the From field. You know how those 'bots are.
------------------------------
Date: 21 Apr 1998 16:29:36 GMT
From: 101.129682@germanynet.de (Jochen Goerner)
Subject: Perl for WIN32 & SNMP
Message-Id: <6hihhg$mdi$1@news.seicom.net>
I am searching for a perl modul to send SNMP traps or a CLI-Tool which can do the same is also OK !!!
------------------------------
Date: 21 Apr 1998 14:11:47 -0400
From: Joe Marzot <gmarzot@baynetworks.com>
Subject: Re: Perl for WIN32 & SNMP
Message-Id: <pdra2rjb8c.fsf@baynetworks.com>
101.129682@germanynet.de (Jochen Goerner) writes:
>
> I am searching for a perl modul to send SNMP traps or a CLI-Tool which
> can do the same is also OK !!!
sorry the perl module SNMP-1.7 which does run on win32
ftp://ftp.corpeast.baynetworks.com/netman/snmp/perl5/SNMP-1.7.tar.gz
does not do traps yet - maybe some of the other SNMP modules do?
If its any consolation, I will be adding this in a month or 2. It would
really be quite easy to add to the module since the necessary primitives
are supplied by ucd-snmp libsnmp.
If you would like to work on adding this to the module with me I would
be happy to accelerate the schedule.
cheers, GSM
>
>
>
>
>
--
G.S. Marzot email: gmarzot@baynetworks.com
Bay Networks Inc. voice: (978)670-8888 x63990
600 Tech Park M/S BL60-101 pager: (800)409-6080 (4096080@skytel.com)
Billerica, MA 01821 fax: (978)670-8145
------------------------------
Date: Tue, 21 Apr 1998 14:40:38 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: perltoot, another question
Message-Id: <Pine.A41.3.96.980421143503.53384E-100000@ginger.libs.uga.edu>
In the section of perltoot, Data Members as Variables, is the following
line:
use vars qw($NAME $AGE $PEERS);
Later in that section is:
sub peers {
my $self = attr shift;
if (@_) { @PEERS = @_; }
return @PEERS;
}
Should the first '$PEERS' really be '@PEERS'? I want to make sure I'm
understanding this code. By all means, if I missed something--that's why
I'm asking.
Thanks!
----------------
Brad Baxter, UGA
ps, The URL I'm reading is:
ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/doc/FMTEYEWTK/perltoot.html
------------------------------
Date: Tue, 21 Apr 1998 14:34:18 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: perltoot, clarification, please
Message-Id: <Pine.A41.3.96.980421135520.53384D-100000@ginger.libs.uga.edu>
I was happy to read perltoot, because it clearly explains some concepts
about how perl does the OO thing that were unclear to me before. Okay, I
admit it; they are still a little unclear, but I'm working on it.
If I could, I'd like a bit of an explanation as to what the following line
of code is doing: (in the section, Inherited Autoloaded Data Methods)
@{$self}{keys %fields} = values %fields;
Following is the block it's in:
<QUOTE>
Here's how to be careful:
package Employee;
use Person;
use strict;
use vars qw(@ISA);
@ISA = qw(Person);
my %fields = (
id => undef,
salary => undef,
);
sub new {
my $that = shift;
my $class = ref($that) || $that;
my $self = bless $that->SUPER::new(), $class;
my($element);
foreach $element (keys %fields) {
$self->{_permitted}->{$element} = $fields{$element};
}
@{$self}{keys %fields} = values %fields;
return $self;
}
</QUOTE>
I think I'm clear that $self is an object that was constructed using the
superclass new(), and that the elements 'id' and 'salary' were then added
to the permitted fields list. Then comes the line beginning with
'@{$self}...', and I'm stumped.
I can't seem to figure out what it is doing. I think it is actually
adding the elements 'id' and 'salary' to the $self object, but I'm just
not following the syntax. It's the '@' that is confusing me, I think.
Thanks,
----------------
Brad Baxter, UGA
ps, The above quoted material is:
Copyright 1996 Tom Christiansen. All Rights Reserved.
:-)
------------------------------
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 2375
**************************************