[17324] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4746 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 27 18:10:34 2000

Date: Fri, 27 Oct 2000 15:10:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972684614-v9-i4746@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 27 Oct 2000     Volume: 9 Number: 4746

Today's topics:
    Re: Newbie 5defcon5@my-deja.com
    Re: object oriented Perl consultant needed (David H. Adler)
        problem of using NET::SMTP gan22@yahoo.com
    Re: problem of using NET::SMTP <pomeranz@runner.ucdavis.edu>
    Re: Problems compiling "libnet" under 5.6.0 <dean_j_pompilio@yahoo.com>
    Re: Problems compiling "libnet" under 5.6.0 (Martien Verbruggen)
    Re: Removing line breaks from a string - HELP! <godzilla@stomp.stomp.tokyo>
    Re: should be easy, but not working - help ! <iltzu@sci.invalid>
        Show the code! (Mark-Jason Dominus)
    Re: stat / inode question (Mark-Jason Dominus)
    Re: stat / inode question (Mark-Jason Dominus)
        the silly project of Dale's <jnk@michianatoday.com>
        truncating lines <ccoffey@nims.wr.usgs.gov>
    Re: truncating lines <sariq@texas.net>
    Re: truncating lines (Tad McClellan)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 27 Oct 2000 19:31:23 GMT
From: 5defcon5@my-deja.com
Subject: Re: Newbie
Message-Id: <8tcl6c$5kv$1@nnrp1.deja.com>

This verifies user, but not password.  I can use getpwent also, but all
return x as the password.  We use shadow on our system.  Is there any
way to pick up the password from shadow.

In article <slrn8vehk3.bdk.clay@panix3.panix.com>,
  clay@panix.com (Clay Irving) wrote:
> On Wed, 25 Oct 2000 20:09:20 GMT, 5defcon5@my-deja.com
> <5defcon5@my-deja.com> wrote:
>
> >I am writing a web page that has a form taking in a username and
> >password.  I would like to verify this username and password against
> >the system password file.  Is there a module or something to help me
do
> >this and can someone give me an example of how this module is used.
>
>   #!/usr/local/bin/perl -w
>
>   chomp($me = shift);
>
>   if (getpwnam($me)) {
>       print "$me has an account\n";
>   } else {
>       print "$me doesn't have an account\n";
>   }
>
> Result:
>
>   [clay@kozmik clay]$ ./foo.pl clay
>   clay has an account
>   [clay@kozmik clay]$ ./foo.pl goober
>   goober doesn't have an account
>
> --
> Clay Irving <clay@panix.com>
> #3532. The law neither does nor requires idle acts.
> - California Civil Code, Maxims of Jurisprudence
>


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 27 Oct 2000 19:44:17 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: object oriented Perl consultant needed
Message-Id: <slrn8vjmoh.kqr.dha@panix2.panix.com>

On Wed, 25 Oct 2000 22:02:16 GMT, kathlenew@my-deja.com
<kathlenew@my-deja.com> wrote:

>Object Oriented Perl programmer needed for

You have posted a job posting or a resume in a technical group.

Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.

Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :)  (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)

Please do not explain your posting by saying "but I saw other job
postings here".  Just because one person jumps off a bridge, doesn't
mean everyone does.  Those postings are also in error, and I've
probably already notified them as well.

If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.

There is a Perl Jobs Announce list that may be more helpful to you.  See
<http://www.pm.org/mailing_lists.shtml> for details.

*And* you posted it twice. :-|

Yours for a better usenet,

dha


-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
It's not important how many people I've killed.  What's important is
how I get along with those who are still alive.
    - Jimmy "The Tulip" Tedeschi


------------------------------

Date: Fri, 27 Oct 2000 20:08:57 GMT
From: gan22@yahoo.com
Subject: problem of using NET::SMTP
Message-Id: <8tcnch$7or$1@nnrp1.deja.com>

I know this question has been posted before. I tried all answers but no
one works for me. So I have to search another solution.
Please help!!!

I tried to use a perl programs to send email on Windows 98. I used an
example code from Active Perl documentation.

use Net::SMTP;

   $smtp = Net::SMTP->new($mailserver, =>Debug 1);
    $smtp->mail($mailsender);
    $smtp->to($mailto);

    $smtp->data();
    $smtp->datasend("Subject: $subject\n");
    $smtp->datasend("To: $mailto\n");
    $smtp->datasend("From: $mailsender\n\n");
    $smtp->datasend($mailbody);

    $smtp->datasend();
    $smtp->quit;

First, When I run the perl program from the command promt it works - in
that the email gets sent, but it then says "bad command or filename"
before exiting. Then I tried to use it in some web page. It does not
work at all, and even the perl program can not be active.

"Bad command or file name" is not normally returned by a Perl
function.  That's a DOS/Windows error message.  So I wonder whether I
need to set some environment variable? By the way, I tested my program
by sending e-mail to myself.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 27 Oct 2000 20:27:13 GMT
From: Alex Pomeranz <pomeranz@runner.ucdavis.edu>
Subject: Re: problem of using NET::SMTP
Message-Id: <8tcof1$h1s$1@mark.ucdavis.edu>

> I tried to use a perl programs to send email on Windows 98. I used an
> example code from Active Perl documentation.

> First, When I run the perl program from the command promt it works - in
> that the email gets sent, but it then says "bad command or filename"
> before exiting. Then I tried to use it in some web page. It does not
> work at all, and even the perl program can not be active.

I ran into this problem after installing the netlib library from
ActivePerl.  When you install netlib, it asks you a bunch of questions
(what is your smtp server?  what is your pm server? blah blah blah).  The
first time through, I only filled out a few of them.  The second time
through, I filled out as many as I could, and the messages went away.

So it seems that the message is related to not answering one of the
questions it asks.  I'm not sure which one though.

Alex


------------------------------

Date: Fri, 27 Oct 2000 19:27:29 GMT
From: Dean J. Pompilio <dean_j_pompilio@yahoo.com>
Subject: Re: Problems compiling "libnet" under 5.6.0
Message-Id: <8tckum$59k$1@nnrp1.deja.com>

In article <slrn8vhcjh.ksa.mgjv@verbruggen.comdyn.com.au>,
  mgjv@tradingpost.com.au wrote:
> On Thu, 26 Oct 2000 22:01:11 GMT,
> 	Dean J. Pompilio <dean_j_pompilio@yahoo.com> wrote:
> > I stupidly removed Perl 5.005, which Net::FTP was working fine with.
> > Doh!
>
> Never remove an installation until you are happy that the new version
> works :). This is one of the reasons I always install perl in
> /opt/perl-$VERSION, and maintain a symlink /opt/perl to there (as well
> as symlinking /usr/bin/perl and /usr/local/bin/perl to
> /opt/perl/bin/perl). It makes it much easier to roll back and forward
> between versions.
>
Great suggestion.  I'll make sure to do this in the future.

> There are _some_ problem with this that you can run into when you are
> trying to install modules that have binary parts for an older version
> of perl than the current one, but they're not insurmountable.
>
> > Now, I can't find anything older than 5.6.0 for HP-UX.  After
> > installing 5.6.0 successfully, I tried to install "libnet-1.0703".
>
> Older versions of Perl are kept on CPAN. Not all of them (there are
> other places for that), but reasonably recent ones are available from
> CPAN/src/5.0 (substitute your local CPAN mirror, or
> http://www.cpan.org for CPAN). But, it shouldn't be necessary to go
> back to 5.005_03 for this reason.
>
> > The make runs fine, but make test fails with the following errors.
I
> > don't have enough experience with modules *not* compiling correctly.
> > Is this version of libnet compatible with Perl 5.6.0?
> >
> > Any help would be greatly appreciated!!!
> > --------------------------------------------------------------------
---
> > 	PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -
> > I/opt/perl5/lib/5.6.0/PA-RISC1.1 -I/opt/perl5/lib/5.6.0 -e 'use
> > Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
t/*.t
> > t/ftp...............Can't locate package  for @Net::Config::ISA at
> > t/ftp.t line 3.
>
> Did you install all the prerequisites for libnet? I can't remember
> whether there are any non-standard ones, but there may be. Check the
> README file, and heed any warnings that you get during
>
> # perl Makefile.PL
>
> When you removed the old perl, did you really, really remove it? Every
> last binary and link? /usr/bin/perl, /usr/local/bin/perl, and anything
> else all point to your new perl? Maybe you should search your system
> for all perl binaries that may be around.
>
> # perl -v
>
> gives you the output you expect?

After doing a "swremove" to uninstall perl 5.6.0 from my HP-UX system,
there were still many perl files around.  Most of these were man pages
which didn't get removed.  I removed my symbolic links and reinstalled
fresh.

Perl -v gives me 5.6.0, so that is not a problem.  When I run "perl
Makefile.PL" in the libnet directory, it verifies that I have Socket
and Socket::IO installed... no problem.

After running "make test", I am still getting the same errors.

Can't locate package  for @Net::Config::ISA at blah blah blah...

I can't find any reference to "@Net::Config::ISA".  Shouldn't this be
included in the "libnet-1.0703" archive?  Where can I get this package?



>
> Martien
> --
> Martien Verbruggen              |
> Interactive Media Division      | +++ Out of Cheese Error +++
Reinstall
> Commercial Dynamics Pty. Ltd.   | Universe and Reboot +++
> NSW, Australia                  |
>


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Sat, 28 Oct 2000 08:49:36 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Problems compiling "libnet" under 5.6.0
Message-Id: <slrn8vju3g.c8.mgjv@martien.heliotrope.home>

On Fri, 27 Oct 2000 19:27:29 GMT,
	Dean J. Pompilio <dean_j_pompilio@yahoo.com> wrote:
> In article <slrn8vhcjh.ksa.mgjv@verbruggen.comdyn.com.au>,
>   mgjv@tradingpost.com.au wrote:
> > When you removed the old perl, did you really, really remove it? Every
> > last binary and link? /usr/bin/perl, /usr/local/bin/perl, and anything
> > else all point to your new perl? Maybe you should search your system
> > for all perl binaries that may be around.
> 
> After running "make test", I am still getting the same errors.
> 
> Can't locate package  for @Net::Config::ISA at blah blah blah...
> 
> I can't find any reference to "@Net::Config::ISA".  Shouldn't this be
> included in the "libnet-1.0703" archive?  Where can I get this package?

This is odd. I can't of course reproduce your complete system, since I
already have libnet installed, and installign acompletely new perl just
to test this is not what I want to do right now :)

All I can say is that for me it works, but since libnet detects that you
already have an old installation, there might be a problem when there
isn't an old installation yet. Maybe you should send Graham Barr a
message?

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.   | from a rich salesperson.
NSW, Australia                  | 


------------------------------

Date: Fri, 27 Oct 2000 12:26:06 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Removing line breaks from a string - HELP!
Message-Id: <39F9D6CE.3A65F6A0@stomp.stomp.tokyo>

alphazerozero@my-deja.com wrote:

>   "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
 
> > Your inherent ignorance beguiles your own malice intent
> > and significant degree of illiteracy, consistently.
 
> Being illiterate I am, no doubt, incorrect when I say that that ain't
> grammatical. (to use an 19th century expression)


"...that that...." ??


"Being the illiterate I am...."

"Being illiterate as I am...."


Use "illiterate" a pronoun or as
a noun, or as an adjective for 
your sentence, not as an adverb.
As an adverb, it is 'illiterately'
for correct usage under different
semantic syntax.


"...incorrect by saying that...."

"...incorrect in saying that...."


Use of "incorrect in" is a better choice
for rhythmic alliteration. Use of "when"
is temporally incorrect. You have already
uttered your words, now, not in the future.


"grammatical, to use a nineteenth century...."

"grammatical, to coin a nineteenth century...."


Use "a" for an indefinite article unless a 
following word begins with a vowel or sounds 
like it begins with a vowel, noting some very
rare exceptions to this general rule.

Don't use parenthetical statements unless a
pseudo footnote is to be implied; a moderately
unrelated topic. Never use 'numbers' in written
language unless your topic is inherently related
to numbers, such as statistics, mathematics or 
similar inherently numerical topics. Spell out
numbers for all other cases and, never mix pure
numbers with spellings of numbers. Use one or
the other but not both.


Here you are frequently trying to give lessons
in English under myriad fake names and, you 
cannot write a simple single sentence without
making myriad grammatical errors, Frank.


* laughs *


Godzilla!

Dr. Kiralynne Schilitubi
Professor of English
University of California at Riverside


------------------------------

Date: 27 Oct 2000 19:25:50 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: should be easy, but not working - help !
Message-Id: <972674093.27147@itz.pp.sci.fi>

In article <YQ9I5.410$bM2.1047@newsfeed.slurp.net>, none wrote:
>@line = qw($input{toppings});
>$toppingtotal = @line;

I can't know where %input comes from, but whatever it is, you most
likely ought to throw it away and use CGI.pm instead.  You'll avoid a
lot of problems later that way.

  use CGI qw(:standard);
  my @toppings = param('toppings');

Of course, CGI.pm will do a lot of other things for you if you ask it
to, including proper HTTP/CGI headers and persistent forms.

Oh, and start your script like this, it'll also help you later:

  #!/usr/bin/perl -w
  use strict;

If your perl isn't in /usr/bin, substitute the proper path.  One more
tip would be to choose better subject lines for your messages.  I only
saw your message because it got sorted just after another thread I'd
been reading.  Normally I'd just skip such vague subjects.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla  | "By promoting postconditions to
and its pseudonyms -    |  preconditions, algorithms become
do not feed the troll.  |  remarkably simple."  -- Abigail



------------------------------

Date: Fri, 27 Oct 2000 21:31:52 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Show the code!
Message-Id: <39f9f448.2824$4@news.op.net>

In article <39f9ec25.277d$333@news.op.net>,
Mark-Jason Dominus <mjd@plover.com> wrote:
>If you show the *real* code, someone else might see the bug.

I was rummaging through some old files, and I just happened to find
the following example that shows why it is so useless to report a
problem like this without showing the real code, and so futile for
someone else to try to guess what the real problem is when you have
not done this.

One day someone came into the #perl IRC channel, and they wanted to
know how get the size of an array, so we told them how to do that.
Then a few minutes later, they said `it didn't work'.

Now it's tempting to guess what they did wrong here, but my claim is
that at this point there is no good response except to say `show the
code'.  

I want you to try to guess what might be wrong.  The write down your
guess.  Then peek at the answer below.












Here is the code that they showed:

        @result = [my_function()];
        $n = @result;

How could anyone have guessed that?

The chance of anyone guessing the actual problem, instead of some other
irrelevant problem, is vanishingly small, because:


        FIRST LAW OF PROGRAMMING LANGUAGE SYNTAX

        There are ten billion different ways to fuck up.  






------------------------------

Date: Fri, 27 Oct 2000 20:57:10 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: stat / inode question
Message-Id: <39f9ec25.277d$333@news.op.net>

In article <39F954E8.BBCC7CBC@eed.ericsson.se>,
Christelle Gibergues  <toto@neuneu.com> wrote:
>I want to find those hard links, so used stat to work out the inode
>numbers. My problem is that the output of stat($file)[1] seems to be
>different from that of a 'ls -i $file'. 

Since 

        stat($file)[1]

is a syntax error, I know you are not telling the truth here.  

You are asking us to help you find a bug in your code, but you did not
show us the code.  Instead, you showed us something else that you made up.

If you show the *real* code, someone else might see the bug.

If you don't do this, it is impossible for anyone to guess the right answer.


------------------------------

Date: Fri, 27 Oct 2000 21:41:17 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: stat / inode question
Message-Id: <39f9f67d.287e$32b@news.op.net>

In article <7jhK5.12797$AM5.241071@news1.nokia.com>,
Elaine Ashton <elaine@chaos.wustl.edu> wrote:
>It shouldn't be and yes it matters much. I would guess that something
>about your perl compiler is not right. 

I consulted my File of Good Advice on this one, and it said:

#11907 Looking for a compiler bug is the strategy of LAST resort.  LAST resort.

(No, I didn't just make this up; I really do have such a file and it
really does say that.)

On the one hand, there's a chance that the compiler has a broken
'stat' and is subtracting 6 or something.  Maybe that sounds likely to
you but it sounds really weird to me.  I cannot imagine how such a
thing could possibly occur.  Why 6?  It all seems very unlikely.

Well, in the absence of an alternative hypotheis, we have to take what
we can get.  But in this case, there is an alternative hypothesis!
The alternative hypothesis is that Christelle's program has a bug.

Now, which seems more likely to you?

        Weird, inexplicable compiler bug that nobody has ever seen before

or

        Programmer fucked up


Hmmm.  Let me think.

I'll take Door #2, Monty.

>For grins, download a fresh copy, build it and install it in your
>home dir or some temp space and try again.

This is going to take an hour or two; more if Christelle has never done it
before.  And it is a long shot because it is a big bet on Door #1.

>Also, you might post the program you are using which could also be
>wrong and misleading you.

Yes, I like that a lot better.

Good Advice #11907 is unusually good.  It has saved me a lot of
trouble in the past.



------------------------------

Date: Fri, 27 Oct 2000 16:53:34 -0500
From: mark richards <jnk@michianatoday.com>
Subject: the silly project of Dale's
Message-Id: <MPG.1463c365683c75989680@news.skyenet.net>

Hello,
	I am interested in a program to parse log files and 
count and categorize the words that exist there and then do the next log 
file, adding the totals and proceeding to the next log file in 
succession. I write in basic and really don't want to learn to write perl 
code for such a seemingly simple job. Is there a perl coded script 
available out there that might do such a silly task? Or, alternatively, 
would someone be willing to write the code for me? I would be eternally 
grateful for any help that I receive on this project.
		Yours very Truly,
			Dale Baney
dalebaney@hotmail.com


------------------------------

Date: Fri, 27 Oct 2000 18:49:11 GMT
From: Chris Coffey <ccoffey@nims.wr.usgs.gov>
Subject: truncating lines
Message-Id: <Pine.LNX.4.10.10010271142060.7743-100000@nims.wr.usgs.gov>

What I want to do is this.  I need to create output from a file such that
if there is a space, a line feed will be performed, so each word will have
there own line.  Example:  this is a line

this
is 
a 
line

This is probably such a stupid question, but I just can't think how to do
it.  Thanks.




------------------------------

Date: Fri, 27 Oct 2000 19:22:20 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: truncating lines
Message-Id: <39F9D5EC.CF34BAF2@texas.net>

Chris Coffey wrote:
> 
> What I want to do is this.  I need to create output from a file such that
> if there is a space, a line feed will be performed, so each word will have
> there own line.  Example:  this is a line
> 
> this
> is
> a
> line

perl -i -pe 'y/ /\n/s' file

You may or may not want the 's' modifier.

perldoc perlrun
perldoc perlop

- Tom


------------------------------

Date: Fri, 27 Oct 2000 15:30:05 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: truncating lines
Message-Id: <slrn8vjltt.k9u.tadmc@magna.metronet.com>

On Fri, 27 Oct 2000 18:49:11 GMT, Chris Coffey <ccoffey@nims.wr.usgs.gov> wrote:
>What I want to do is this.  I need to create output from a file such that
>if there is a space, a line feed will be performed, so each word will have
>there own line.  Example:  this is a line
>
>this
>is 
>a 
>line
>
>This is probably such a stupid question, but I just can't think how to do
>it.  Thanks.


   $_ = "this is a line\n";
   print "$_\n" foreach split;


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4746
**************************************


home help back first fref pref prev next nref lref last post