[11525] in Perl-Users-Digest
Perl-Users Digest, Issue: 5125 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 13 03:07:33 1999
Date: Sat, 13 Mar 99 00:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 13 Mar 1999 Volume: 8 Number: 5125
Today's topics:
Re: =?ISO-8859-1?Q?=80=80=80Special?= thanks to James = (Ronald J Kimball)
Re: \ regex problem (Ilya Zakharevich)
Re: BigInt: Decimal to Hex <jeromeo@atrieva.com>
Re: BigInt: Decimal to Hex (Ilya Zakharevich)
Re: debugger mystery... (Ronald J Kimball)
Re: Deletion of a List Array Entry <thrase@slip.net>
Re: Error Message Mystery (Ronald J Kimball)
Re: FAQ 3.21: How can I hide the source for my Perl pro <dgris@moiraine.dimensional.com>
Re: Help with an array <thrase@slip.net>
Re: newbie (Ronald J Kimball)
Re: Package usage (Ronald J Kimball)
Re: Regex $1 behavior (Ilya Zakharevich)
Re: Regex $1 behavior (Tad McClellan)
Re: Regular expression question (Tad McClellan)
Re: Regular expression question (Tad McClellan)
Re: Regular expression question <thrase@slip.net>
Re: Send a space via Net::Telnet? <kwoody@citytel.net>
Re: The Meta-problem: helping others with Perl problems (Ilya Zakharevich)
Re: The Meta-problem: helping others with Perl problems <rra@stanford.edu>
Re: use diagnostics problem? (Ronald J Kimball)
Win32::Registry::RegConnectRegistry Questions <kimntodd@dontspamus.execpc.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 13 Mar 1999 01:10:26 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: =?ISO-8859-1?Q?=80=80=80Special?= thanks to James =?ISO-8859-1?Q?Tolley!=80=80=80?=
Message-Id: <1dokykf.y1b2m91yocgnbN@bay2-395.quincy.ziplink.net>
Friday@Dragnet <in@after.noon> wrote:
> In article <bingdo19-ya02408000R1203991142540001@news.alt.net>,
> bingdo19@earthlink.net (Bob Langdon) wrote:
>
> > Special thanks to James Tolley <jamesht@idt.net> who e-mailed me to share:
> >
> > >> Glad to hear it's working for you. But if you want to improve it
> > >> slightly, use unlink() instead of rename().
> > >
>
> I mistakenly thought that you purposely would have had me delete 1500
> files by changing "rename" to "unlink" but after corresponding with you by
> e-mail, I sincerely believe it was an honest mistake that I overacted to,
> and I sincerely appologize to you for the grief I may have caused you.
Hrmm... Not sure what possible reason he would have had for thinking
that unlink() would be an improvement over rename(), though...
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 13 Mar 1999 05:15:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: \ regex problem
Message-Id: <7ccs8r$5n0$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Joel Bremson
<joelb@docent.com>],
who wrote in article <i9gG2.17435$FZ5.3910@news.rdc1.sfba.home.com>:
> -=-=-=-=-=-
>
> Hi,
>
> I am trying to write a subroutine that when passed a file name
> and a single quoted string containing a regex will apply the regex
> to the file.
>
> The problem is that I can't figure out how to get '\\' to not compress
> to '\' without resorting to extra backslashes. This program illustrates
> the problem:
>
> #!/usr/bin/perl
>
> $a = 's/([^\\]>)/$1\n/g';
This is not a REx, this is a Perl expression. *If* it were a REx, you
might have used the qr// operator.
Ilya
P.S. The only quoting construct which would not eat \\ is
$a = <<'FOO';
s/([^\\]>)/$1\n/g
FOO
------------------------------
Date: Fri, 12 Mar 1999 13:47:05 -0800
From: "Jerome O'Neil" <jeromeo@atrieva.com>
Subject: Re: BigInt: Decimal to Hex
Message-Id: <36E98B59.D20E1E83@atrieva.com>
Ilya Zakharevich wrote:
> Let me state it again for those who did not grasp it yet: the only
> purpose why Math/BigInt.pm exists is a possibility to check that
> overloading works. If you want something else, use some better
> alternative.
What are the other alternatives for handling large integers?
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 13 Mar 1999 05:04:08 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: BigInt: Decimal to Hex
Message-Id: <7ccrk8$4e4$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Jerome O'Neil
<jeromeo@atrieva.com>],
who wrote in article <36E98B59.D20E1E83@atrieva.com>:
> Ilya Zakharevich wrote:
>
> > Let me state it again for those who did not grasp it yet: the only
> > purpose why Math/BigInt.pm exists is a possibility to check that
> > overloading works. If you want something else, use some better
> > alternative.
>
> What are the other alternatives for handling large integers?
Math::Pari if you do mathematical calculations. PDL (I did never see
it, but many would pray by it) for engineering calculations.
Some advocate BitVector too.
Math::BigInt was a testbed during preparations to Math::Pari. Mark
Biggar promised to update Math::BigInt, but disappeared from Perl
horizon before finishing this task.
Ilya
------------------------------
Date: Sat, 13 Mar 1999 01:10:16 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: debugger mystery...
Message-Id: <1doktff.1j310kd1c5sfwyN@bay2-395.quincy.ziplink.net>
John Chambers <john.chambers@gte.com> wrote:
> Not harmful? It makes the debugging session utterly worthless
> and a waste of time. When it happens, I have to abandon the
> debugger and start adding print statements. If this isn't
> harmful (to the task of getting the code working), then what
> would qualify?
Is the execution of the script actually out of order, or is the debugger
just displaying the wrong line?
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Fri, 12 Mar 1999 22:37:08 -0800
From: Paul Cameron <thrase@slip.net>
To: =?iso-8859-1?Q?G=AEIM?= <noone@home.com>
Subject: Re: Deletion of a List Array Entry
Message-Id: <36EA0794.833F3C0F@slip.net>
"G.IM" wrote:
> Is it possible to delete an entry of a list array? I know it is possible to
> delete an entry in an associative array through the use of its key and its
> corresponding value, but how about an @list?
>
See the splice() entry in perlfunc.
> I've tried shift and unshift, but that doesn't seem to do much. It just adds
> the entry to the top and deletes the entry from the top, leaving the original
> entry I wanted to delete in tact. Those commands accomplish nothing.
Are you talking about push and pop ? My idea of "top" was at $array[-1] ...
> I really want to be able to execute a command like this, delete (@list[0]),
> but haven't come across any such thing.
I believe you are confusing shift/unshift with push/pop
unshift @list;
But ... if you just want to clear the value, assign "" to it, or if you want to
undefine it, use undef.
> Thanks for any help!
These are very basic questions. RTFM the Llama or Camel book. NOW !!
Paul.
------------------------------
Date: Sat, 13 Mar 1999 01:10:18 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Error Message Mystery
Message-Id: <1doktm4.1n6xkwd1tcxkxsN@bay2-395.quincy.ziplink.net>
<bmonti@my-dejanews.com> wrote:
> Anybody know what causes this error:
>
> "Out of memory! Attempt to free unreferenced scalar. "
That's two errors...
perldiag:
Out of memory!
(X|F) The malloc() function returned 0, indicating there was
insufficient remaining memory (or virtual memory) to satisfy the
request.
The request was judged to be small, so the possibility to trap it
depends on the way perl was compiled. By default it is not
trappable. However, if compiled for this, Perl may use the contents
of $^M as an emergency pool after die()ing with this message. In
this case the error is trappable once.
Attempt to free unreferenced scalar
(W) Perl went to decrement the reference count of a scalar to see if
it would go to 0, and discovered that it had already gone to 0
earlier, and should have been freed, and in fact, probably was
freed. This could indicate that SvREFCNT_dec() was called too many
times, or that SvREFCNT_inc() was called too few times, or that the
SV was mortalized when it shouldn't have been, or that memory has
been corrupted.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 13 Mar 1999 00:52:28 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: FAQ 3.21: How can I hide the source for my Perl program?
Message-Id: <m3n21hx1vn.fsf@moiraine.dimensional.com>
sholden@pgrad.cs.usyd.edu.au (Sam Holden) writes:
> On Fri, 12 Mar 1999 09:20:34 -0500,
> John Moreno <planb@newsreaders.com> wrote:
> >Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
> >
> >> Instead, banks have guards, cameras, vaults, alarms, etc. And even
> >> though everybody knows about most of the security measures, it's not
> >> easy to rob a bank.
> >
> >Actually, if your willing to shoot someone it is.
>
> OK, it's not easy to rob a bank and not end up dead or in jail...
It seems difficult to do _anything_ and not end up dead.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Fri, 12 Mar 1999 22:26:39 -0800
From: Paul Cameron <thrase@slip.net>
To: Steve Jackson <steve@cyber-distributors.com>
Subject: Re: Help with an array
Message-Id: <36EA051F.70029F1C@slip.net>
Steve Jackson wrote:
> Ok I thought I could do it - but can't figure one line out.
> basically i want to take a variable $allenter (inside that is
> a varable called $item3) and replace the existing line in @c1.
Your algorithm is flawed. But I'll give you 10 points for effort ! But
I'd never employ you.
> Here's a snip of the code (simplified) basically all rems taken out:
Rems ? Isn't that BASIC braindamage ? Don't you mean "comments" ?
> (There is an incoming variable called $in{'itemnum'})
>
> sub editrev{
> #this is the new information
> $allenter = $all3;
You should learn some variable naming standards. In fact, you should
C<use strict;>, since you lack the ability to enforce proper coding
standards upon yourself.
> open(FILE,"all.txt");
WHY DID YOU NOT CHECK FOR ERRORS ? HOW DO YOU KNOW all.txt OPENED
CORRECTLY ?!?!?!
> @c1 = <FILE>;
> close(FILE);
WHY DID YOU NOT PROCESS THE FILE LINE BY LINE ?!?!?!
> $try=0;
>
> foreach $thing(@c1) {
> @stuffy = split(/\(\(/, $thing);
Hmmm ...
> $item1 = $stuffy[0];
> $item2 = $stuffy[1];
> $item3 = $stuffy[2];
> $item4 = $stuffy[3];
> $item5 = $stuffy[4];
> $item6 = $stuffy[5];
> $item7 = $stuffy[6];
> $item8 = $stuffy[7];
> $item9 = $stuffy[8];
This looks like a massive waste of effort ? Surely there is a point to
all of this ...
>
> if ($in{'itemnum'} eq $item3) {
>
> $c1[$try] = $allenter; <-- doesnt work ??
> }
Why don't you increment $try ? Why do you never increment $allenter ? Why
don't you use push, instead
of maintaining a counter to assign to the array ? I mean, there's no real
justification for it. RTFM, man perlfunc !!!
Just because I care, you can rewrite this foreach loops as:
$c1[$try] = $allenter if $in{'itemnum'} eq (split /\(\(/, $thing)[2];
But, since your $try never incrememts, and $allenter never changes, I
wouldn't expect much excitement to come out of this.
> }
>
> open(FILE,">all.txt");
Bzzzzzt!!! How do you know the file was opened successfully ??
Use the open function correctly! Use the rename function! Use the unlink
function! Before you reply and say "but I wanted to replace the file",
read up on these commands !
> print FILE @c1;
> close(FILE);
You should really have done this line by line.
> print "Content-type: text/html\n\n";
> print "DONE...\n";
Well, yes. No comment here.
> exit;
> }
> Thanks!
My pleasure !
Paul.
------------------------------
Date: Sat, 13 Mar 1999 01:10:20 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: newbie
Message-Id: <1dokwdm.ls6eomq5stdlN@bay2-395.quincy.ziplink.net>
Kimbrough Gray <kimbrough.gray@amd.com> wrote:
> I have a line
> system ("more /etc/group group sysadmin")
>
> I could save the output in a file. Instead, I want to save the output
> in a variable called $var. Is this possible.
Have you read the documentation for the system() function?
perlfunc:
system LIST
Does exactly the same thing as "exec LIST" except that a fork is
done first, and the parent process waits for the child process to
complete. Note that argument processing varies depending on the
number of arguments. The return value is the exit status of the
program as returned by the wait() call. To get the actual exit
value divide by 256. See also exec in the manpage. This is NOT
what you want to use to capture the output from a command, for that
you should use merely backticks or qx//, as described in the section
on `STRING` in the perlop manpage.
The last sentence of the first paragraph tells you what you should use
for capturing the output, and where to find documentation on it.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sat, 13 Mar 1999 01:10:22 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Package usage
Message-Id: <1dokwgt.z70el21qo6616N@bay2-395.quincy.ziplink.net>
[posted and mailed]
Mark <admin@asarian-host.org> wrote:
> I am trying to use a module:
>
> use Net::SMTP;
> use strict;
>
> I put these lines at the tp of my program, but perl always complains with the
> message that the global variable SMTP needs explicit reference to a package.
> Then it aborts. Sigh. Do I need to include some sort of extra reference to the
> package in my program? Sorry to sound so ignorant, but I am new to this
> packages thingy.
The strict pragma requires you to either declare your variables:
use vars qw($scalar @array %hash); # for globals
my ($scalar, @array, %hash) # for lexicals
or include a package specifier:
print $main::scalar; # for globals only
@packacge::array = (1, 2, 3);
Use whichever is appropriate for your code.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 13 Mar 1999 05:11:53 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Regex $1 behavior
Message-Id: <7ccs2p$5lc$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to David L. Cassell
<cassell@mail.cor.epa.gov>],
who wrote in article <36E9A001.CD2D89B2@mail.cor.epa.gov>:
> You don't want to make a backreference from the inner parens, so use
> the new, ultra-cool (?:regex) discussed in perlre. And your '*' is probably
> eating everything up in there, so add another \d+ to deal with that:
There is nothing new about (?:regex) (unless you are used to Emacs or
TCL RExen),
Ilya
------------------------------
Date: Fri, 12 Mar 1999 18:38:53 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regex $1 behavior
Message-Id: <di8cc7.q9a.ln@magna.metronet.com>
Jeff Lovell (jalovel@orl.ilstu.edu) wrote:
: Ok, I'm sure I must be missing something fairly obvious here, but I can't
: seem to find it.
Since you have parenthesis around the entire pattern,
$1 will be set to whatever is matched.
You then replace whatever was matched with whatever was matched.
A no-op that spends cycles :-)
: When I use the $1 backreference in s/// it doesn't seem
: to work.
It is working as it is supposed to.
: Here is the code I am working with:
: #!/usr/bin/perl -w
: $address = "127.0.0.1";
: $address =~ s/((\d+\.)*)/$1/;
: print $address, "\n"; # eq "127.0.0.1" <- I don't want this.
: print $1, "\n"; # eq "127.0.0." <- I want this.
^^^^^^^^^^^
You (obviously) _have_ that.
It is in $1.
What do you want to do with it?
Maybe put it into $address?
$address = $1 if $address =~ m/((\d+\.)*)/;
: Any help would be appreciated.
If you want to delete digits at the end of a string:
$address =~ s/\d+$//;
If you want to retain only the first 3 parts of an IP address:
$address =~ s/((\d+\.){3}).*/$1/;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 12 Mar 1999 18:20:36 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regular expression question
Message-Id: <4g7cc7.q9a.ln@magna.metronet.com>
Tom Wood (thomas.wood@wichita.boeing.com) wrote:
: I am trying convert all upercase character to lowercase unless they are
: quote encapsulated.
------------------------
#!/usr/bin/perl -w
use strict;
$_ = q(STRINGS SUCH AS "THIS", 'THIS SENTENCE' AND " THAT " WOULD BE EXCLUDED);
print "before '$_'\n";
my $lower_cased;
foreach ( split /("[^"]*"|'[^']*'| )/) {
$lower_cased .= /^['"]/ ? $_ : "\L$_";
}
print " after '$lower_cased'\n";
------------------------
Of course that will fail miserably for something like:
$_ = q(TOM'S 'STRINGS' SHOULD BE LOWER CASED);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 12 Mar 1999 18:01:39 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regular expression question
Message-Id: <jc6cc7.q9a.ln@magna.metronet.com>
Jonathan Sala (Jonathan.c.sala@boeing.com) wrote:
: Here is the answer:
That is no answer.
Please don't confuse folks with code that doesn't even
come close to working.
: if (m/(["]\w+["])/){
: print "\l$`$&\L$'\n";
: }
-------------------
$_ = 'HE SAID "Hello"';
if (m/(["]\w+["])/){
print "\l$`$&\L$'\n";
}
-------------------
Prints:
hE SAID "Hello"
I think you answered some _other_ question there...
: Tom Wood wrote:
: >
: > I am trying convert all upercase character to lowercase unless they are
: > quote encapsulated.
: >
: > for example:
: >
: > strings such as "THIS", 'THIS SENTENCE' and " THAT " would be excluded
: > from the conversion.
: >
: > I've tried using the tr function and match and substitution operators.
: > I can convert the case were a single word is quoted but not multiple
: > words or words with leading or trailing spaces.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 12 Mar 1999 23:27:24 -0800
From: Paul Cameron <thrase@slip.net>
To: Tom Wood <thomas.wood@wichita.boeing.com>
Subject: Re: Regular expression question
Message-Id: <36EA135C.CE55B3CD@slip.net>
Tom Wood wrote:
> I am trying convert all upercase character to lowercase unless they are
> quote encapsulated.
>
> for example:
>
> strings such as "THIS", 'THIS SENTENCE' and " THAT " would be excluded
> from the conversion.
Well anyhow. People have provided their own answers, and here's mine.
$_ = qq[This is the "QUOTED TEXT" AND 'quOte' bLAh "it iS Quoted" bYE.\n];
s{
([^"']*) # Matches normal text outside quotes
(
(?:(["'])[^"]*\3) | # And then match either quoted text
$ # Or the end of line
)
}
{\L$1\E$2}gx;
print;
# Here is the result.
this is the "QUOTED TEXT" and 'quOte' blah "it iS Quoted" bye.
Well, there you go. In one expression. That should work unless my brain
farted.
Paul.
------------------------------
Date: Fri, 12 Mar 1999 22:39:23 -0800
From: Keith Woodworth <kwoody@citytel.net>
Subject: Re: Send a space via Net::Telnet?
Message-Id: <Pine.BSI.3.95.990312223704.21398A-100000@rosencrantz.citytel.net>
On 12 Mar 1999, I R A Aggie wrote:
>>On Fri, 12 Mar 1999 12:34:50 -0800, Keith Woodworth <kwoody@citytel.net> wrote:
>>
>>+ send a \n to continue. But the cisco you send a \n and you get the next
>>+ line only. You have to hit the spacebar to finish the scroll and see the
>>+ rest of the who output.
>>
>>Using the space is the way most pagers work. A ' \n' isn't, tho...
>>
I know, I guess I'm just looking for the equivelnet of a what a new line
character is to a space? Does that sound right?
>>+ Using Net::Telnet what char can I use to send a spacebar hit (for
>>+ lack of a better term?)
>>
>>Looking at the examples in the Net::Telnet documentation:
>>
>> ## Wait for first prompt and "hit return".
>> $t->waitfor('/continue:.*$/');
>> $t->print("");
>>
>>Would seem to me that what you want is:
>>
>>$t->print(" ");
Tried that. Have not had time to do any more xperimenting but the above
didnt work.
Thanks though..
Keith
------------------------------
Date: 13 Mar 1999 05:19:18 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: The Meta-problem: helping others with Perl problems
Message-Id: <7ccsgm$5o8$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Jay Glascoe
<jglascoe@giss.nasa.gov>],
who wrote in article <36E9BC43.EC717914@giss.nasa.gov>:
> ---------- Forwarded message ----------
> Date: Thu, 28 Jan 1999 20:00:07 -0700 (MST)
> From: gnat@frii.com
> 1. Perl development has taken two courses: 5.004_05 is the latest
> stable version, while 5.005_02 is the latest experimental version.
Ouch! Ouch! Ouch!
Is it necessary to pepper newcomers with info which is *so* wrong?
Ilya
------------------------------
Date: 12 Mar 1999 23:40:29 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: The Meta-problem: helping others with Perl problems
Message-Id: <ylzp5hsuqa.fsf@windlord.stanford.edu>
David L Cassell <cassell@mail.cor.epa.gov> writes:
> Oh no, I didn't want to go that far. I just suggested an intermediate
> stage. An autobot *posted* reply to new posters, which could be
> killfiled by everyone else. Of course it would be a hit on the signal
> to noise ratio...
It'd also get filtered/cancelled at most Usenet sites as spam, after about
the twentieth of them.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Sat, 13 Mar 1999 01:10:24 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: use diagnostics problem?
Message-Id: <1dokxzd.dd37eg11e6962N@bay2-395.quincy.ziplink.net>
Mick <horizon@internetexpress.com.au> wrote:
> Ronald J Kimball wrote:
>
> > > which in my error log is
> > > premature end of script headers.
> >
> > Are there more errors, or just that? That's not a very helpful error,
> > all it means is your script exited before it finished printing the
> > headers. But it doesn't say _why_ your script exited early.
> >
>
> That's why I'm trying to use diagnostics, my error_log only contains
> premature end of script errors....Is the level of information given in the
> error_log determined in the httpd.conf (I'm using Apache by the way :) ) ?
I thought you said that your script ran fine when you didn't add use
diagnostics? So you're using diagnostics to fix a problem that only
occurs when you use diagnostics... That doesn't make sense. :)
> I also comapared Carp.pm and diagnostics.pm for there format (To see if the
> diagnostics.pm was different in any way, but, no, they are set out exactly
> the same.)
Carp.pm and diagnostics.pm are two extremely different modules.
diagnostics.pm outputs extra information with Perl's builtin errors and
warnings.
Carp.pm allows subroutines to output errors for the file and line where
the subroutine was called, rather than the file and line containing the
output command.
I don't think either one would be helpful in the situation you describe.
You say there are no error messages from the Perl script... All I can
figure is that there is a bug in your script so that it executes
successfully (i.e. no compile or runtime errors or warnings) but still
doesn't output a complete set of headers.
What output do you get when you run your script from the command line?
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Fri, 12 Mar 1999 23:14:16 -0600
From: "End User" <kimntodd@dontspamus.execpc.com>
Subject: Win32::Registry::RegConnectRegistry Questions
Message-Id: <7ccs7n$n9m@newsops.execpc.com>
Ok, so I found the entire two sentences that were dedicated to accessing
remote NT registries (well, NT and 95, but I really only use NT so there you
go). There is one terrible example that I cannot seem to make sense of:
use Win32::Registry;
Win32::Registry::RegConnectRegistry("\\\\somemachine", HKEY_LOCAL_MACHINE,
$key) || die "connect: $!";
I understand some of this. I get the use comand, and the Win32::reg... and
the somemachine, and the hkey_local_machine, but what is with the $key part?
how do I now go about slicing and dicing the remote registries based on
this? I am not a great programmer, just an admin. though I have quickly
surpassed those that have taught me. Sorry, I digress.
Do I need to do something like this:
use Win32::Registry;
Win32::Registry::RegConnevtRegistry("\\\\172.16.1.5", HKEY_LOCAL_MACHINE,
$SSD);
$SSD=GetVal(\%vals);
foreach $k (keys %vals){
if ($keys =~ /cpqssd/i){
print "$vals{$k}\n";}
}
in order to get a value for a particular key from a remote machine?
If I this is close, but not quite there, please tell me. If this isnt even
on the same planet, I need to know that too.
Thanks a million times in advance,
--
Todd Hayward
Global Analyst, Systems Engineer
MCSE, Compaq ACT
noc at bakernet dot com
------------------------------
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 5125
**************************************