[21816] in Perl-Users-Digest
Perl-Users Digest, Issue: 4020 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 24 03:10:39 2002
Date: Thu, 24 Oct 2002 00:10:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 24 Oct 2002 Volume: 10 Number: 4020
Today's topics:
Re: Perl compilation <goldbb2@earthlink.net>
Problems using CPAN without root access <kerry@shetline.com>
Re: Problems using CPAN without root access <kevin@vaildc.net>
Re: Problems using CPAN without root access <randy@theoryx5.uwinnipeg.ca>
Re: Problems using CPAN without root access <kerry@shetline.com>
regular expression (Mary Wong)
Re: regular expression <pinyaj@rpi.edu>
Re: RMI Equivalent in Perl? <uri@stemsystems.com>
Re: Sending Mail, How many SMTP Servers used? <goldbb2@earthlink.net>
Re: some questions <REMOVEsdnCAPS@comcast.net>
Re: Using the \n escape code (Beginner question) (dragondwy)
Re: Using the \n escape code (Beginner question) <jurgenex@hotmail.com>
Re: waitpid not returning pid? ctcgag@hotmail.com
Re: What is a file XXX.pl.swp ?? <jurgenex@hotmail.com>
Re: Writing Microsoft Outlook Notes With Perl <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 24 Oct 2002 02:20:07 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Perl compilation
Message-Id: <3DB79117.FB9E2BC@earthlink.net>
Chris wrote:
>
> Hi all,
>
> Running under Solaris 8
> I'm newbie to Perl.
> I tried to compile a simple program named chris.pl by using this
> command :
>
> # cd /opt/redhat/stronghold/perl/bin
> # ./perlcc chris.pl
All you should need to run your program is:
perl chris.pl
Don't try to use the "perlcc" program -- it's quite buggy, and not at
all supported. If you really and truly need to make perl programs that
are standalone programs, then use either perlapp or perl2exe.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Thu, 24 Oct 2002 01:06:01 GMT
From: Kerry Shetline <kerry@shetline.com>
Subject: Problems using CPAN without root access
Message-Id: <ZHHt9.53823$Hj7.22678@rwcrnsc53>
Since I don't have root access on my web server, I need to install Perl
modules in my home directory.
From what I can tell so far, I should be able to use CPAN in shell mode
like this:
perl -MCPAN -e shell
or
perl -MCPAN -e 'install Foo::Bar'
All I get in response is:
Your configuration suggests "/root/.cpan" as your
CPAN.pm working directory. I could not create this directory
due to this error: mkdir /root/.cpan: Permission denied at
/usr/local/lib/perl5/5.6.1/CPAN.pm line 499
Since I can't even get started to do a set-up, how do I get CPAN to use
~/.cpan instead of /root/.cpan?
Are there addition arguments I can use with "perl -MCPAN -e shell" to
point it to a .cpan directory, or additional arguments I can use with
"perl -MCPAN -e 'install Foo::Bar'" to tell CPAN where I want to install
a module?
Is there a shell variable that I can set to change the .cpan directory?
-Kerry
------------------------------
Date: Wed, 23 Oct 2002 21:32:59 -0400
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: Problems using CPAN without root access
Message-Id: <kevin-78E7D2.21325323102002@news.his.com>
In article <ZHHt9.53823$Hj7.22678@rwcrnsc53>,
Kerry Shetline <kerry@shetline.com> wrote:
> Since I don't have root access on my web server, I need to install Perl
> modules in my home directory.
>
> From what I can tell so far, I should be able to use CPAN in shell mode
> like this:
>
> perl -MCPAN -e shell
>
> or
>
> perl -MCPAN -e 'install Foo::Bar'
>
> All I get in response is:
>
> Your configuration suggests "/root/.cpan" as your
> CPAN.pm working directory. I could not create this directory
> due to this error: mkdir /root/.cpan: Permission denied at
> /usr/local/lib/perl5/5.6.1/CPAN.pm line 499
>
> Since I can't even get started to do a set-up, how do I get CPAN to use
> ~/.cpan instead of /root/.cpan?
When I ran into this problem, it told me how to create a MyConfig.pm
file off my home directory. I did that and then no more problems. I
can't remember exactly where it wanted the file, though, but I think it
was ~/.cpan/CPAN/MyConfig.pm. I copied the system's Config.pm and made
some changes to it, and then CPAN would run for me.
--
Kevin Michael Vail | Dogbert: That's circular reasoning.
kevin@vaildc.net | Dilbert: I prefer to think of it as no loose ends.
http://www.vaildc.net/kevin/
------------------------------
Date: Wed, 23 Oct 2002 20:46:11 -0500
From: "Randy Kobes" <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Problems using CPAN without root access
Message-Id: <AhIt9.15831$EX4.78732@news1.mts.net>
"Kerry Shetline" <kerry@shetline.com> wrote in
message news:ZHHt9.53823$Hj7.22678@rwcrnsc53...
> Since I don't have root access on my web server, I need to install Perl
> modules in my home directory.
> From what I can tell so far, I should be able to use CPAN in shell mode
> like this:
> perl -MCPAN -e shell
> or
> perl -MCPAN -e 'install Foo::Bar'
> All I get in response is:
>
> Your configuration suggests "/root/.cpan" as your
> CPAN.pm working directory. I could not create this directory
> due to this error: mkdir /root/.cpan: Permission denied at
> /usr/local/lib/perl5/5.6.1/CPAN.pm line 499
>
> Since I can't even get started to do a set-up, how do I get CPAN to use
> ~/.cpan instead of /root/.cpan?
[ ... ]
See the CONFIGURATION section of the CPAN.pm documentation,
particularly on creating a MyConfig.pm in your home directory.
best regards,
randy kobes
------------------------------
Date: Thu, 24 Oct 2002 02:38:19 GMT
From: Kerry Shetline <kerry@shetline.com>
Subject: Re: Problems using CPAN without root access
Message-Id: <v2Jt9.74597$zE6.260911@rwcrnsc51.ops.asp.att.net>
Kevin Michael Vail wrote:
> When I ran into this problem, it told me how to create a MyConfig.pm
> file off my home directory. I did that and then no more problems. I
> can't remember exactly where it wanted the file, though, but I think it
> was ~/.cpan/CPAN/MyConfig.pm. I copied the system's Config.pm and made
> some changes to it, and then CPAN would run for me.
Ah! I was searching my web hosting service's system for an existing file
called MyConfig.pm, rather than Config.pm, to modify.
Having created my own MyConfig.pm from this Config.pm file, now at least
CPAN is getting off the ground. My next step is to figure out why I'm
getting a couple of warnings plus this error:
Can't locate object method "data" via package "CPAN::Modulelist"
(perhaps you forgot to load "CPAN::Modulelist"?) at (eval 16) line 1.
CPAN::Index::rd_modlist('CPAN::Index',
'~/.cpan/sources/modules/03modlist.data.gz') called at
/usr/local/lib/perl5/5.6.1/CPAN.pm line 3002
CPAN::Index::reload('CPAN::Index') called at
/usr/local/lib/perl5/5.6.1/CPAN.pm line 620
CPAN::exists('CPAN=HASH(0x8465d08)', 'CPAN::Module',
'CPAN::Modulelist') called at /usr/local/lib/perl5/5.6.1/CPAN.pm line 1735
CPAN::Shell::expandany('CPAN::Shell', 'CPAN::Modulelist')
called at /usr/local/lib/perl5/5.6.1/CPAN.pm line 1969
CPAN::Shell::rematein('CPAN::Shell', 'install',
'CPAN::Modulelist') called at /usr/local/lib/perl5/5.6.1/CPAN.pm line 2056
CPAN::Shell::install('CPAN::Shell', 'CPAN::Modulelist') called
at /usr/local/lib/perl5/5.6.1/CPAN.pm line 75
CPAN::AUTOLOAD('CPAN::Modulelist') called at -e line 1
I was trying to install Mail::Sendmail when I got this error, so I
decided to try to install CPAN::Modulelist first, but ended up getting
the same error again.
-Kerry
------------------------------
Date: 23 Oct 2002 21:40:18 -0700
From: mary_wong1232002@yahoo.com (Mary Wong)
Subject: regular expression
Message-Id: <5b85cd30.0210232040.7732510e@posting.google.com>
Hello,
Can anyone tell me what's wrong in this program?
Everytime when i run it. I got nothing.
while($_=<FH>)
{
#print words begin and end with b's
print $_ if/^b.+b$/;
#print words contain 4 or more d
print $_ if/.*d{4,}.*/;
#print words 3 or more letters long without vowels
print $_ if/[^aeiou]{3,}/;
}
file:
bbb
bbbb
abcdefgdhijddd
qwdfgh
qaeioud
vfghj
------------------------------
Date: Thu, 24 Oct 2002 01:17:28 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: Mary Wong <mary_wong1232002@yahoo.com>
Subject: Re: regular expression
Message-Id: <Pine.A41.3.96.1021024011410.6614A-100000@cortez.sss.rpi.edu>
[posted & mailed]
On 23 Oct 2002, Mary Wong wrote:
>Can anyone tell me what's wrong in this program?
>Everytime when i run it. I got nothing.
You didn't show us the entire program (I hope). Where do you open the
filehandle?
>while($_=<FH>)
>{
> #print words begin and end with b's
> print $_ if/^b.+b$/;
You can just say
print if /regex/;
since print()'s default argument is $_.
That regex should probably be
/^(b.*b|b)$/
or better yet
/^b/ and /b$/
because your regex doesn't allow "b" or "bb", although they begin and end
with b.
> #print words contain 4 or more d
> print $_ if/.*d{4,}.*/;
That only matches a word with 4 or more CONSECUTIVE d's. The .*'s are
extraneous where you have them.
print if /d.*d.*d.*d/;
will match on words like "diddled".
> #print words 3 or more letters long without vowels
> print $_ if/[^aeiou]{3,}/;
That will match any word with three consecutive non-vowels.
--
Jeff "japhy" Pinyan RPI Acacia Brother #734 2002 Acacia Senior Dean
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Thu, 24 Oct 2002 04:10:38 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: RMI Equivalent in Perl?
Message-Id: <x765vs4gua.fsf@mail.sysarch.com>
>>>>> "B" == Brian <lucid1@mediaone.net> writes:
B> Hi, I have a perl script executed on an NT machine, and I need to
B> be able to execute system calls on a unix server as the current
B> user. I do not want to use RSH. I want to use a more solid method.
B> In Java, there is RMI which would do the job. I'm wondering if
B> perl has some equivalent?
check out stem (stemsystems.com). it runs under cygwin on windows (and
soon will be ported to natively run there) and on all unix flavors. it
is a message passing system which can do rmi very easily.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 24 Oct 2002 02:32:35 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Sending Mail, How many SMTP Servers used?
Message-Id: <3DB79403.4BB024D5@earthlink.net>
> Christoph Wagner wrote:
>
> Thank you for the detailed explanations, but
>
> as I read in books and on some sites, there are 3 Mail Protocols:
>
> UUCP and X.400
> "
> The UUCP mail is based on the "store and forward" algorithm, i.e. each
> computer sends the entire message to its "neighbor" via phone lines,
> and that neighbor then transfers it to its neighbor, and so on till
> the message is delivered to the recipient computer.
> "
>
> SMTP
> "
> The SMTP mail system uses the DNS to convert the domain part of an
> E-mail address to the network address of that computer, establishes a
> communication link with the SMTP server software on that machine and
> transfers the message directly to the recipient machine. Messages are
> transferred without being stored on intermediate hosts.
> "
Please not that the "transferred without being stored on intermediate
hosts" isn't entirely true. The difference is that unlike UUCP, a
message sent with SMTP is usually forwarded within a very short amount
of time -- within a few minutes, generally. Of course, this all depends
on the particular implementation... some SMTP servers might indeed
forward "immediately", without storing.
> So my Conclusion only could be, that there is no way to get
> feedback that a mail really receives the recipient.
Correct.
There are *some* situations when you can discover if a mail will go to a
recpient -- if you do an DNS MX lookup on the domain, and connect
directly to the machine looked up, you *may* be talking to the machine
which directly transfers files to the recpient's POP or IMAP account, or
mailspool... this machine can give you an immediate failure if the
user's account doesn't exist, or his mailbox is full.
> The highest chance to successfull send mail is to use a Sender SMTP
> Server to the Recipients POP Account.
Not everyone uses the POP protocol... some use the IMAP protocol, and
some have the SMTP daemon put the mail directly into their mailbox file.
> Then Monitoring the LogFiles of the Server, and if an error occurs
> resend until it is done.
This may not be possible. And for some errors, you may not want to send
again.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Wed, 23 Oct 2002 18:20:40 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: some questions
Message-Id: <Xns92B0C4DAB1ED3sdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
agoodguygonebad@aol.com (AGoodGuyGoneBad) wrote in
news:20021023135432.27003.00003394@mb-mh.aol.com:
> 1)If I call this sub several times
>
> sub Option{
> print "<SELECT NAME=\"$pre\">\n";
> print "<OPTION VALUE = \"\"></OPTION>\n";
> for ($ii=1;$ii<15;$ii++) {
> print "<OPTION VALUE = \"$ii\">$ii</OPTION>\n";
> }
> print "</SELECT>\n";
> }
>
> is it any quicker to just do
Quicker, fooey. They're both very fast. The difference would be
trivial. When you have two choices that are about as efficient, pick the
one that'd be easier to maintain. Suppose you have to extend it to 25
<OPTION> sets.
Which do you think would be easier to do, change one loop termination
condition, or count and copy and paste ten lines and renumber them?
> 3) to avoid stringification, should this
> print "$Step2<br>\n";
> be something like
> print $Step2."<br>\n";
> or does it really matter ?
You should in theory do:
print $Step2, "<br>\n";
Note that it's a comma, not a period.
In practice, however, it makes almost no difference whatsoever. Choose
whichever you find easier to read and type.
You may want to learn how to use the Benchmark module.
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPbcu32PeouIeTNHoEQLd4ACfQGSb0Y6QCV+bjVgwtlxJKasBsVsAn1n0
mCkmqIwYZb5HmzkPGFUUclDV
=drzW
-----END PGP SIGNATURE-----
------------------------------
Date: 23 Oct 2002 18:17:32 -0700
From: dragondwy@21cn.com (dragondwy)
Subject: Re: Using the \n escape code (Beginner question)
Message-Id: <984b86ca.0210231717.24a122a8@posting.google.com>
in HTML ,the newline is a tag, that is "<br>"
your code should be like this:
print "hello world <br> i am a newbie";
------------------------------
Date: Thu, 24 Oct 2002 05:58:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Using the \n escape code (Beginner question)
Message-Id: <4_Lt9.5250$iV1.1305@nwrddc02.gnilink.net>
Francois Pichette wrote:
> I can't seem to be able to write a script that uses the newline
> escape code (\n)
>
> When I run the script:
>
> ********
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
> print "Hello \n there";
> *********
>
> It doesn't create a new line between "Hello" and "there" in my web
> browser. When I look at the source the newline appears.
Then obviously it is not a Perl problem because (as you already checked)
Perl produces the correct output with the newline (as you saw yourself in
the HTML source file).
Think again! If you would write the HTML source file in your favourite
editor, and open the file in your favourite browser, would the browser
render a newline or not?
How would you write the HTML source code such as to produce a line break in
the rendered page?
Now, if you still don't get it please ask in a NG that deals with HTML
because your question has nothing to do with Perl.
jue
------------------------------
Date: 24 Oct 2002 00:16:58 GMT
From: ctcgag@hotmail.com
Subject: Re: waitpid not returning pid?
Message-Id: <20021023201658.458$Yk@newsreader.com>
dkoleary@attbi.com wrote:
> 4 while ($stiff = waitpid(-1, &WNOHANG) > 0)
> Yet,
> according to the log, $stiff == 1. Obviously, init isn't dead,
The obvious problem is that the expression 'waitpid(-1, &WNOHANG) > 0'
evaluates to true, and then true (i.e. 1) is stuffed into $stiff.
while (($stiff = waitpid(-1, &WNOHANG)) > 0)
But I'd also worry about what happens if reaper gets interrupted by
itself. Should you be waiting on all zombies, or just the one zombie
that presumably triggered reaper?
Xho
> otherwise, I'd be having a radically different day. So, the question:
> What am I messing up?
>
> The full script, should anyone need it, will be sent as a followup to
> this post in what's probably a vain attempt to keep this to a reasonable
> length.
>
> Thanks for any hints/tips/suggestions.
>
> Doug O'Leary
>
> --------
> Senior UNIX Admin
> Independent consultant
> dkoleary@attbi.com
> resume: http://home.attbi.com/~dkoleary/resume.html
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
------------------------------
Date: Thu, 24 Oct 2002 06:00:55 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: What is a file XXX.pl.swp ??
Message-Id: <r0Mt9.5253$iV1.4310@nwrddc02.gnilink.net>
Steve wrote:
> I just had a programmer write a script for my web site. When I
> installed it, there were a couple of files ending in .swp. This script
> was installed on a Linux server.
>
> What type of file is this?
Not that this has anything to do with Perl, but file name extensions have no
meaning on Unix to begin with.
If you want to know what type of file a certain file ist then the command
"file" will do a pretty good guess in most cases.
jue
------------------------------
Date: Wed, 23 Oct 2002 23:11:54 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Writing Microsoft Outlook Notes With Perl
Message-Id: <3DB72C22.1070308@rochester.rr.com>
Chris wrote:
> Bob Walton <bwalton@rochester.rr.com> wrote in message news:<3DB60885.70804@rochester.rr.com>...
>
>>Chris wrote:
>>
>>
>>>I've got this half-baked idea for writing a program that will
>>>dynamically generate Microsoft Outlook Notes from information gathered
>>>from a database. I know how to do everything except create the
>>>Outlook Note. Can anyone point me in the direction of information for
>>>accomplishing this? I've seen others do this (not with Perl) where
>>>the program will seek data from the weather service and write that
>>>data into an Outlook Note. That's similar to what I am trying to do.
>>>
>>>Any help will be greatly appreciated.
>>>
>>>Chris
>>>
>>>
>>By "Outlook Note", do you mean "email note"? If so,
>>
>> use Net::SMTP;
>>
>
> No, I'm talking about the Memo's part of Outlook that allows you to
> write individual's "notes" which look like Post-It notes.
Well, then:
use Win32::OLE;
You will need to refer to Outlook's help screens to figure out what
Outlook commands you need to execute to accomplish your task.
>
> Chris
>
--
Bob Walton
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4020
***************************************