[15971] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3383 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 15 21:15:31 2000

Date: Thu, 15 Jun 2000 18:15:22 -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: <961118122-v9-i3383@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 15 Jun 2000     Volume: 9 Number: 3383

Today's topics:
    Re: Name/Value pair for a hyperlink? <apietro@my-deja.com>
    Re: Name/Value pair for a hyperlink? <apietro@my-deja.com>
    Re: Name/Value pair for a hyperlink? <tony_curtis32@yahoo.com>
    Re: Name/Value pair for a hyperlink? (Randal L. Schwartz)
    Re: Name/Value pair for a hyperlink? <flavell@mail.cern.ch>
    Re: Newbie needs help with script :-) <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Perl->Gnuplot (John Stanley)
    Re: Quick Network Ping : Can't make Net::Ping work? <hakon.alstadheim@oslo.mail.telia.com>
        regular expression match <chris.wrightNOchSPAM@pictureiq.com.invalid>
    Re: regular expression match (Brandon Metcalf)
    Re: regular expression match (Tad McClellan)
        strict variable declaration in subroutines <mdsohnNOmdSPAM@yahoo.com.invalid>
    Re: substr does implicit chomp? <smerr612@mailandnews.com>
        Where is a Perl/CGI site. <shawnball@uswest.net>
    Re: Where is a Perl/CGI site. <brondsem@my-deja.com>
        why does this code print two spaces? <rowlands_mark@hotmail.com>
        why does this code print two spaces? <rowlands_mark@hotmail.com>
        Win32 (win98) and Curses? <spragg@cs.ucdavis.edu>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 15 Jun 2000 23:22:03 +0100
From: "A Pietro" <apietro@my-deja.com>
Subject: Re: Name/Value pair for a hyperlink?
Message-Id: <8ibkus$lll$1@sshuraaa-i-1.production.compuserve.com>

Tony,

Thanks for the lecture. But I don't feel my original posting was off topic.

Do you cover CGI.pm queries in this newsgroup or not?
Its a borderline case probably.

AP




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

Date: Thu, 15 Jun 2000 23:23:15 +0100
From: "A Pietro" <apietro@my-deja.com>
Subject: Re: Name/Value pair for a hyperlink?
Message-Id: <8ibl13$loe$1@sshuraaa-i-1.production.compuserve.com>

>>plonk<<

Heh?
AP




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

Date: 15 Jun 2000 18:06:47 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Name/Value pair for a hyperlink?
Message-Id: <87ya46cznc.fsf@limey.hpcc.uh.edu>

>> On Thu, 15 Jun 2000 23:22:03 +0100,
>> "A Pietro" <apietro@my-deja.com> said:

> Tony, Thanks for the lecture. But I don't feel my
> original posting was off topic.

It was meant to be an explanation...

> Do you cover CGI.pm queries in this newsgroup or not?
> Its a borderline case probably.

Only if the question really relates to a perl issue.  CGI
questions are almost always *not* perl specific so they
are best posed in comp.infosystems.www.authoring.cgi.

"How do I write HTML to do XYZ?" is not perl specific.

A question specifically addressing CGI.pm may be on-topic
but you'd need to be explicit about the issues.

It's a difficult one I agree.
-- 
"Trying is the first step towards failure"
                                           Homer Simpson


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

Date: 15 Jun 2000 16:38:59 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Name/Value pair for a hyperlink?
Message-Id: <m1u2euwm3w.fsf@halfdome.holdit.com>

>>>>> "A" == A Pietro <apietro@my-deja.com> writes:

>> There goes another one.  Goodbye<
A> Why post this?

For those that respect Alan's opinion of others, it's a way for them
to share his disrespect of the poster, and to add that poster to their
killfile just as he has now done.

Trust, respect, purpose.  All interlinked.  If your purpose in being
here doesn't match the shared purpose, you lose respect and trust.
Just like any community.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 16 Jun 2000 02:09:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Name/Value pair for a hyperlink?
Message-Id: <Pine.GHP.4.21.0006160144520.14546-100000@hpplus03.cern.ch>

On 15 Jun 2000, Randal L. Schwartz wrote:

> Trust, respect, purpose.  All interlinked.  If your purpose in being
> here doesn't match the shared purpose, you lose respect and trust.
> Just like any community.

It's always been my experience that the key to solving complex
problems is to study and learn just how the pieces of the puzzle fit
together.  Understand what goes where, and how it interacts with the
other parts.  I try, in my ineffective way, to share that with anyone
who's interested.

When I'm in a new field, I try to listen carefully to what I'm told,
and try to develop a mental picture of what it's all about.  Discuss
it with the others, and adjust as necessary.  And then suddenly it all
falls into place; apparently effortlessly I suddenly feel that I know
what's going on, I don't start looking up HTTP commands in the HTML
specification or asking Linux kernel questions on the Perl language
group, and suddenly I find I know which spec to consult when there's
something I need, and can rattle off RFC2616 or iso-8859-7 with the
rest of them.

When I see someone aimlessly struggling around, looking for the lost
dollar under the streetlamp not because it fell there, but because the
light seems brighter there, I desperately want to convince them to
look in the proper place, so they can get the benefits that I've
experienced.

Someone who has ostentatiously refused to pay any attention to that
kind of advice has rejected help.  It's pointless to get worked up
over them, and I know I get too easily annoyed, so the killfile gets
its regular exercise.  Maybe I should just keep quiet about it and
leave them to get on with it in their own way, but somehow I often
can't resist at least dropping a hint, just in case there's a chance:
several times recently I've been accused of being childish for that.  
Oh well.

That's it, basically.



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

Date: Thu, 15 Jun 2000 16:43:12 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Newbie needs help with script :-)
Message-Id: <39496A10.755C6520@jpl.nasa.gov>

David wrote:
> I have a small mail server that I would like a couple of other people
> to be able to add new pop users to without having access as root. Is
> it possible to write a perl script to do this and how please?  Access
> will be via telnet.
> 
> Idealy the script would be able to add data to the aliases file as
> well. I am very new to all of this and my attempts at perl have
> crashed. :-(

Your questions might be answered if you: 1) choose better subject lines,
2) post code that you need help with, and 3) ask specific questions
rather than broad wishes.  How would you accomplish this task manually? 
What code has 'crashed'?

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: 15 Jun 2000 23:41:22 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Perl->Gnuplot
Message-Id: <8ibpj2$dlt$1@news.NERO.NET>

In article <slrn8kihce.lb0.rzwartje@rob.home.nl>,
Rob Zwartjes <rzwartje@knoware.nl> wrote:
>The only thing I see is a flash of a window with a figure and then it is
>gone. 

What happens when you close the pipe to a program's standard in? I.e.,
you've just ended the file gnuplot is reading for command input. What do
you expect gnuplot to do?

>What I want is that the window stays on screen as long as I want. Am I
>looking in the wright direction ? Or, and that probably is the case here, I
>am overlooking some thing.

Delay closing the pipe?



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

Date: 15 Jun 2000 18:11:52 -0300
From: Hakon Alstadheim <hakon.alstadheim@oslo.mail.telia.com>
Subject: Re: Quick Network Ping : Can't make Net::Ping work?
Message-Id: <m0n1kmk5t3.fsf@alstadhome.cyberglobe.net>

"Robert Chalmers" <robert@chalmers.com.au> writes:

> I tried the code example here on the cpan site, but can't get it to do
> anything?

(I already did a followup to this, but I think it disappeared into the
bit-bucket. Anyway here it is again, this time wiht the exact patch
I'm using)
To recap: The problem is that some (most) sites deny the udp ping
connection, and that Net::Ping doesent check for error returns from
the recv.

--- /home/hakon/perl-5.6.0/lib/Net/Ping.pm	Sat Mar  4 00:26:55 2000
+++ /usr/local/lib/perl5/5.6.0/Net/Ping.pm	Fri Jun  9 16:20:48 2000
@@ -370,14 +370,20 @@
         {
             $from_msg = "";
             $from_saddr = recv($self->{"fh"}, $from_msg, 1500, $flags);
-            ($from_port, $from_ip) = sockaddr_in($from_saddr);
-            if (($from_ip eq $ip) &&        # Does the packet check out?
-                ($from_port == $self->{"port_num"}) &&
-                ($from_msg eq $msg))
-            {
-                $ret = 1;       # It's a winner
-                $done = 1;
-            }
+	    if(!defined($from_saddr)){
+		carp "Error in recv, $!";
+		$ret = undef;
+		$done = 1;
+	    }else {
+		($from_port, $from_ip) = sockaddr_in($from_saddr);
+		if (($from_ip eq $ip) &&        # Does the packet check out?
+		    ($from_port == $self->{"port_num"}) &&
+		    ($from_msg eq $msg))
+		{
+		    $ret = 1;       # It's a winner
+		    $done = 1;
+		}
+	    }
         }
         else                    # Oops, timed out
         {

---
Hakon Alstadheim        Ph: +1 (514) 523 6537
4579 rue Garnier
Montreal (Que) H2J 3S6
Canada 


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

Date: Thu, 15 Jun 2000 16:13:56 -0700
From: chris <chris.wrightNOchSPAM@pictureiq.com.invalid>
Subject: regular expression match
Message-Id: <3502ea40.6c35e93a@usw-ex0101-007.remarq.com>

If I have the following line and all I want is the number after
the hash sign how could I get it and store it in a variable named
$rev_num?

//depot/Embedded/common/buildset.bat#5 - edit change 12429(xtext)

For this one I's like the five.

Thanks,

Chris

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: 16 Jun 2000 00:10:08 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: regular expression match
Message-Id: <8ibr90$j92$1@bcrkh13.ca.nortel.com>

chris.wrightNOchSPAM@pictureiq.com.invalid writes:

 > If I have the following line and all I want is the number after
 > the hash sign how could I get it and store it in a variable named
 > $rev_num?
 > 
 > //depot/Embedded/common/buildset.bat#5 - edit change 12429(xtext)
 > 
 > For this one I's like the five.

$str = '//blah/buildset.bat#5 - edit change 12429(xtext)';
if ($str =~ /#(\d+)/) {
   $rev_num = $1;
}

Brandon


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

Date: Thu, 15 Jun 2000 19:51:51 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regular expression match
Message-Id: <slrn8kir0n.7qe.tadmc@magna.metronet.com>

On Thu, 15 Jun 2000 16:13:56 -0700, chris <chris.wrightch@pictureiq.com> wrote:
>If I have the following line and all I want is the number after
>the hash sign how could I get it and store it in a variable named
>$rev_num?
>
>//depot/Embedded/common/buildset.bat#5 - edit change 12429(xtext)


   my $rev_num = $1 if /#(\d+)/;


>Got questions?  Get answers over the phone at Keen.com.


What, they don't answer rudimentary Perl questions there?


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


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

Date: Thu, 15 Jun 2000 15:39:27 -0700
From: egghead <mdsohnNOmdSPAM@yahoo.com.invalid>
Subject: strict variable declaration in subroutines
Message-Id: <0946862c.bdc02c12@usw-ex0102-016.remarq.com>

Is there a way of setting the default for subroutines to require
strict variable declaration?  For example, if my code looks like
this:

#!/usr/bin/perl -Tw
use strict;
my $apple = 123;
my $pear = 789;
print "main:\t$apple\t$pear\n";
gosub();
print "main:\t$apple\t$pear\n";

sub gosub {
    my ($apple);
    $apple = 2;
    $pear = 2;
    print "sub :\t$apple\t$pear\n";
}

my output will look like:

main:  123  789
sub :  2    2
main:  123  2

I'm afraid that either (1) I just because happen to forget to
declare $pear locally, or (2) I use someone else's subroutine
that does not have rigorous variable declaration.

Is there a way to:
1) require subroutines to be declare all variables, or
2) not allow a subroutine to affect variables in the main
program?

thanks,
Mike


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Thu, 15 Jun 2000 22:11:42 GMT
From: Steven Merritt <smerr612@mailandnews.com>
Subject: Re: substr does implicit chomp?
Message-Id: <8ibkag$ie1$1@nnrp1.deja.com>

In article <8ibgf6$faa$1@nnrp1.deja.com>,
  Steven Merritt <smerr612@mailandnews.com> wrote:
>       {
>         substr($_, 1, 6) = "555555";
>         substr($_, 12, 15) = "8715";
>         substr($_, 63, 66) = "8715";

Sorry about that, spotted it a little while later.  Instead of giving
the beginning and end positions the substr arguements are beginning
position and number of positions to alter.  So it replaced everything
from the 63rd position to the 129th position with "8715" and that
included the newline.

--
King of Casual Play
The One and Only Defender of Cards That Blow

My newsreader limits sigs to four lines, but I cleverly bypassed this by


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


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

Date: Thu, 15 Jun 2000 18:38:15 -0700
From: "Ferk Da Jerk" <shawnball@uswest.net>
Subject: Where is a Perl/CGI site.
Message-Id: <Pwd25.152$lY4.7717@news.uswest.net>

In the present there are many great books that teach you Perl and CGI.  The
range from 200 to 800 pages.  They teach you the easy, the hard, and the
very advance code.  I will easily buy a book to learn all of this, but first
I would like to try the Internet.  So does any one know where I can find a
site that teaches you Perl and CGI as well as some of the books out at the
moment?  I would preciate it.




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

Date: Fri, 16 Jun 2000 00:25:34 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: Where is a Perl/CGI site.
Message-Id: <8ibs5f$o16$1@nnrp1.deja.com>

In article <Pwd25.152$lY4.7717@news.uswest.net>,
  "Ferk Da Jerk" <shawnball@uswest.net> wrote:
> In the present there are many great books that teach you Perl and
CGI.  The
> range from 200 to 800 pages.  They teach you the easy, the hard, and
the
> very advance code.  I will easily buy a book to learn all of this,
but first
> I would like to try the Internet.  So does any one know where I can
find a
> site that teaches you Perl and CGI as well as some of the books out
at the
> moment?  I would preciate it.


http://www.perl.com
http://www.cgi101.com
http://www.webthing.com/tutorials/cgifaq.html
http://www.smithrenaud.com/public/CGI_MetaFAQ.html
http://stein.cshl.org/WWW/software/CGI/cgi_docs.html

And, of course, just try a search engine.

>
>


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


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

Date: Thu, 15 Jun 2000 22:33:51 GMT
From: mark rowlands <rowlands_mark@hotmail.com>
Subject: why does this code print two spaces?
Message-Id: <8iblke$jal$1@nnrp1.deja.com>

my %ch_pports = map {$_ => 1} @ch_pports;
my %oh_pports = map {$_ => 1} @oh_pports;
my @new  =   grep {!$ch_pports {$_}} @oh_pports;
my @gone =   grep {!$oh_pports {$_}} @ch_pports;

print "@gone has disappeared from  $ch_here\n";
Print "@new  has shown up at $oh_here\n";

#foreach $new (@new) {print "|$new|\n";}
#foreach $gone (@gone) {print "|$gone|\n";

rather helpfully, when something has appeared, I also get a line,
where appropriate, telling me that nothing has disappeared and vice
versa. for example

199.open.tcp.unknown.  has shown up at 129.145.123.123
  gone from 129.145.123.123 #e.g. nothing has gone!
  new at  129.xxx.xxx.121
3421.open.tcp.unknown. 3421.open.udp.unknown.  gone from 129.123.249.121

Could anyone a) enlighten me as to how can I suppress the

"blankblankgone....."
"blankblanknew......"
 lines?

and for optional good karma :b) Explain in simple syllables why this is
happening : it's my second perl program so please be gentle, I am
trying to learn.


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


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

Date: Thu, 15 Jun 2000 22:43:28 GMT
From: mark rowlands <rowlands_mark@hotmail.com>
Subject: why does this code print two spaces?
Message-Id: <8ibm6d$jof$1@nnrp1.deja.com>

my %ch_pports = map {$_ => 1} @ch_pports;
my %oh_pports = map {$_ => 1} @oh_pports;
my @new  =   grep {!$ch_pports {$_}} @oh_pports;
my @gone =   grep {!$oh_pports {$_}} @ch_pports;

print "@gone has disappeared from  $ch_here\n";
Print "@new  has shown up at $oh_here\n";

#foreach $new (@new) {print "|$new|\n";}
#foreach $gone (@gone) {print "|$gone|\n";

rather helpfully, when something has appeared, I also get a line,
where appropriate, telling me that nothing has disappeared and vice
versa. for example

199.open.tcp.unknown.  has shown up at 129.145.123.123
  gone from 129.145.123.123 #e.g. nothing has gone!
  new at  129.xxx.xxx.121
3421.open.tcp.unknown. 3421.open.udp.unknown.  gone from 129.123.249.121

Could anyone a) enlighten me as to how can I suppress the

"blankblankgone....."
"blankblanknew......"
 lines?

and for optional good karma :b) Explain in simple syllables why this is
happening : it's my second perl program so please be gentle, I am
trying to learn.


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


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

Date: 15 Jun 2000 22:32:02 GMT
From: Adam Trace Spragg <spragg@cs.ucdavis.edu>
Subject: Win32 (win98) and Curses?
Message-Id: <8iblh1$poo$3@mark.ucdavis.edu>

Has ANYONE gotten the Curses module to work under Win98?  I get all sorts
of errors when I compile it (I've done POLLUTE=1 and have pdcurses made and
that works)...

Adam


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

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 3383
**************************************


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