[12613] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 22 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 6 19:17:12 1999

Date: Tue, 6 Jul 1999 16:06:36 -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           Tue, 6 Jul 1999     Volume: 9 Number: 22

Today's topics:
        Another directory question <troyknight@troyknight.eurobell.co.uk>
    Re: Another directory question (elephant)
    Re: Another directory question (Abigail)
    Re: Another directory question <troyknight@troyknight.eurobell.co.uk>
        Another novice question - Pragma: no-cache <jamesthurley@hotmail.com>
        Any difference between || and or ? (Andreas Fehr)
    Re: Any difference between || and or ? (Iain Chalmers)
    Re: Any difference between || and or ? <uri@sysarch.com>
    Re: Any difference between || and or ? (Andreas Fehr)
    Re: Any difference between || and or ? (elephant)
    Re: Any difference between || and or ? (Abigail)
    Re: Any difference between || and or ? <swiftkid@bigfoot.com>
    Re: Any difference between || and or ? (Abigail)
        Any one knows good off-line perl tutorial <null@null.org>
    Re: Any one knows good off-line perl tutorial (Abigail)
    Re: Any one knows good off-line perl tutorial (Martien Verbruggen)
    Re: Application Development: How robust is Perl? <gellyfish@gellyfish.com>
    Re: Application Development: How robust is Perl? <cassell@mail.cor.epa.gov>
        Arg! LWP problems <khowe@performance-net.com>
    Re: Arg! LWP problems (Martien Verbruggen)
        Asking a server "are you there?" <ralawrence@my-deja.com>
    Re: Asking a server "are you there?" <gellyfish@gellyfish.com>
    Re: Asking a server "are you there?" (Abigail)
    Re: Asking a server "are you there?" <ralawrence@my-deja.com>
    Re: Asking a server "are you there?" (I R A Aggie)
        AUTOLOAD and inheritance <cschmitz@stud.informatik.uni-trier.de>
    Re: Backsniffing esalmon@packet.net
        Beginners question, getting error Can't find string ter <ereyes@800autos.com>
    Re: Beginners question, getting error Can't find string <swiftkid@bigfoot.com>
    Re: Beginners question, getting error Can't find string <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 5 Jul 1999 04:40:06 +0100
From: "Troy Knight" <troyknight@troyknight.eurobell.co.uk>
Subject: Another directory question
Message-Id: <7lp97r$50q$1@aub.eurobell.net>

I know you can chmodd a file using chmodd and I kow you can make a diectory
and give permission upon creating it using mkdir. But is it possible to
chmodd a directory without deleting it first? Thanks




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

Date: Mon, 5 Jul 1999 13:55:18 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Another directory question
Message-Id: <MPG.11ead7b2ea4af989ae2@news-server>

Troy Knight writes ..
>I know you can chmodd a file using chmodd and I kow you can make a diectory
>and give permission upon creating it using mkdir. But is it possible to
>chmodd a directory without deleting it first? Thanks

why don't you give it a go and then you'll be able to tell us ?

btw .. just quietly .. chmod has only one 'd'

-- 
 jason - remove all hyphens for email reply -


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

Date: 5 Jul 1999 02:11:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Another directory question
Message-Id: <slrn7o0ml4.h6v.abigail@alexandra.delanet.com>

Troy Knight (troyknight@troyknight.eurobell.co.uk) wrote on MMCXXXIV
September MCMXCIII in <URL:news:7lp97r$50q$1@aub.eurobell.net>:
!! I know you can chmodd a file using chmodd and I kow you can make a diectory
!! and give permission upon creating it using mkdir. But is it possible to
!! chmodd a directory without deleting it first? Thanks


You have a chmod daemon? ;)


Did you actually try whether you can chmod a directory? What happened
when you did?



Abigail
-- 
perl -wlne '}{print$.' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 5 Jul 1999 10:29:36 +0100
From: "Troy Knight" <troyknight@troyknight.eurobell.co.uk>
Subject: Re: Another directory question
Message-Id: <7lptpe$2nnl$1@slrn.eurobell.net>

Troy Knight <troyknight@troyknight.eurobell.co.uk> wrote in message
news:7lp97r$50q$1@aub.eurobell.net...
> I know you can chmodd a file using chmodd and I kow you can make a
diectory
> and give permission upon creating it using mkdir. But is it possible to
> chmodd a directory without deleting it first? Thanks
>
>

I guess you can chmod a dir using chmod then! Whoops!




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

Date: Tue, 6 Jul 1999 20:43:34 +0100
From: "James Thurley" <jamesthurley@hotmail.com>
Subject: Another novice question - Pragma: no-cache
Message-Id: <7ltm5d$ct5$1@gxsn.com>

I am using the header "Content-type: text/html\nPragma: no-cache\n\n" in a
CGI script which is called with "<script language=javascript
src=whatever.cgi?blah></script>" which works fine, apart from the fact that
it is still caching the output of the CGI, meaning it does not work as
intended.  I thought "Content-type: text/html\nPragma: no-cache\n\n" stopped
the browser from caching, so what's going on?

Thanks,
James.




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

Date: Mon, 05 Jul 1999 07:02:04 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Any difference between || and or ?
Message-Id: <3780541f.4968434@news.uniplus.ch>

I use ActivePerl with the ODBC of Dave Roth (in case
it is important). I read the documentation!! Probably
the wrong part...

Is there any difference between || and or? I have the
following code:

use Win32::ODBC;
%DNSList = Win32::ODBC::DataSources() 
    || die("bye");
foreach $key (keys(%DNSList))
{
    print $key . " ==> " . $DNSList{$key} . "\n";
}

If I write "|| die(....)", I get the number of elements.
If I write "or die(....)", I get it correct.

So where is the problem, and who owns the problem?
Is it Perl, ActiveState, Dave Roth or did I mix something
up?

Andreas



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

Date: Mon, 05 Jul 1999 17:39:49 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: Any difference between || and or ?
Message-Id: <bigiain-0507991739490001@bigman.mighty.aust.com>

In article <3780541f.4968434@news.uniplus.ch>, backwards.saerdna@srm.hc
(Andreas Fehr) wrote:

> I use ActivePerl with the ODBC of Dave Roth (in case
> it is important). I read the documentation!! Probably
> the wrong part...
> 
> Is there any difference between || and or?

guess you didn't find the bit in perlop that says:

As more readable alternatives to && and ||, Perl provides "and" and "or"
operators (see below).  The short-circuit behavior is identical.  The
precedence of "and" and "or" is much lower, however, so that you can
safely use them after a list operator without the need for parentheses:


> So where is the problem, and who owns the problem?
> Is it Perl, ActiveState, Dave Roth or did I mix something
> up?

there is no problem, everything is working precisly as documented :-)

cheers

Iain


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

Date: 05 Jul 1999 04:01:13 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Any difference between || and or ?
Message-Id: <x7pv27y186.fsf@home.sysarch.com>

>>>>> "AF" == Andreas Fehr <backwards.saerdna@srm.hc> writes:

  AF> I use ActivePerl with the ODBC of Dave Roth (in case
  AF> it is important). I read the documentation!! Probably
  AF> the wrong part...

what did you read? and where? the difference is well documented. p94 of
the camel (i used the nice index to find it) has info. also perlop has
both operators well described too.

  AF> Is there any difference between || and or? I have the

i think there must be as why would both operators be in the language. i
doubt such an obvious problem would be ignored by all those people who
maintian perl, activestate and dave roth.

  AF> So where is the problem, and who owns the problem?
  AF> Is it Perl, ActiveState, Dave Roth or did I mix something
  AF> up?

yes.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Mon, 05 Jul 1999 08:20:46 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: Any difference between || and or ?
Message-Id: <37806a7d.10694197@news.uniplus.ch>

On Mon, 05 Jul 1999 17:39:49 +1000, bigiain@mightymedia.com.au (Iain
Chalmers) wrote:

>In article <3780541f.4968434@news.uniplus.ch>, backwards.saerdna@srm.hc
>(Andreas Fehr) wrote:
>
>> ...
>> Is there any difference between || and or?
>
>guess you didn't find the bit in perlop that says:
>
>As more readable alternatives to && and ||, Perl provides "and" and "or"
>operators (see below).  The short-circuit behavior is identical.  The
>precedence of "and" and "or" is much lower, however, so that you can
>safely use them after a list operator without the need for parentheses:
>

Thanks, so it has nothing to do with the logic of operators
but with the precedence. 

Andreas


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

Date: Mon, 5 Jul 1999 18:37:52 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Any difference between || and or ?
Message-Id: <MPG.11eb19ef183fe5b9989ae6@news-server>

Andreas Fehr writes ..
>Is there any difference between || and or?

man .. I'm on your side there Andreas .. I've checked ALL the 
documentation as well (literally read every single page) and I have 
absolutely no idea where my code is going wrong either .. I mean is there 
any difference between the == and the eq operators ????!!!!??? .. who's 
stuffing up here .. is it Linus Torvalds ? .. or is it Larry Wall ?? .. 
or are the document writers just idiots ??!! .. I don't know where to 
turn

here's my code

#--begin
$a = 'a';
$b = 'b';

print "a equals b\n" if ( $a == $b);
#--end

I'm adding the following filter for this newsgroup

  /(read|checked|looked|scanned|know)[^!?.]+documentation/i

-- 
 jason - remove all hyphens for email reply -


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

Date: 5 Jul 1999 04:52:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Any difference between || and or ?
Message-Id: <slrn7o101e.h6v.abigail@alexandra.delanet.com>

Andreas Fehr (backwards.saerdna@srm.hc) wrote on MMCXXXIV September
MCMXCIII in <URL:news:3780541f.4968434@news.uniplus.ch>:
** 
** Is there any difference between || and or?

Yes. Did you check the manual?

** If I write "|| die(....)", I get the number of elements.
** If I write "or die(....)", I get it correct.

Yes. Did you check the manual?



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 5 Jul 1999 14:14:14 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Any difference between || and or ?
Message-Id: <7lr0ad$coh1@news.cyber.net.pk>

> here's my code
>
> #--begin
> $a = 'a';
> $b = 'b';
>
> print "a equals b\n" if ( $a == $b);

translated into english:
print "a equals b\n" if 0 is equal 0


eq - for string matching
== - for numeric matching


print "a equals b" if $a eq $b; # false
print "a equals b" if $a == $b; # true

on ==, both sides are converted to their numeric
equivalents.




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

Date: 5 Jul 1999 04:58:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Any difference between || and or ?
Message-Id: <slrn7o10eb.h6v.abigail@alexandra.delanet.com>

elephant (e-lephant@b-igpond.com) wrote on MMCXXXIV September MCMXCIII in
<URL:news:MPG.11eb19ef183fe5b9989ae6@news-server>:
?? 
?? man .. I'm on your side there Andreas .. I've checked ALL the 
?? documentation as well (literally read every single page) and I have 
?? absolutely no idea where my code is going wrong either .. I mean is there 
?? any difference between the == and the eq operators ????!!!!??? .. 

Well, yes there is. 

What is unclear about:

       Binary "==" returns true if the left argument is
       numerically equal to the right argument.

       Binary "eq" returns true if the left argument is
       stringwise equal to the right argument.


Or did you "miss" that when you checked the documentation?


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 5 Jul 1999 19:18:38 +0530
From: "rajagopal" <null@null.org>
Subject: Any one knows good off-line perl tutorial
Message-Id: <7lrhnu$d6t$1@news.vsnl.net.in>

Any one knows of good off-line perl tutorials.

I'm especially looking for good explanation of concepts relating to "state
maintaining" in  perl. Or development of self-refrential scripts.





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

Date: 5 Jul 1999 15:11:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Any one knows good off-line perl tutorial
Message-Id: <slrn7o24bj.h6v.abigail@alexandra.delanet.com>

rajagopal (null@null.org) wrote on MMCXXXIV September MCMXCIII in
<URL:news:7lrhnu$d6t$1@news.vsnl.net.in>:
== Any one knows of good off-line perl tutorials.

"Perl: The Programmers Companion".  It's a book.


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 06 Jul 1999 03:02:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Any one knows good off-line perl tutorial
Message-Id: <ileg3.98$Qx3.7431@nsw.nnrp.telstra.net>

In article <7lrhnu$d6t$1@news.vsnl.net.in>,
	"rajagopal" <null@null.org> writes:
> Any one knows of good off-line perl tutorials.

"Off-line"? As in printed? Books, maybe?

http://www.perl.com/ has quite an extensive list of them, with
critiques and all. I'd suggest the top three of the critiques list.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


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

Date: 3 Jul 1999 10:27:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Application Development: How robust is Perl?
Message-Id: <7lkoj1$2pd$1@gellyfish.btinternet.com>

On Fri, 02 Jul 1999 23:19:20 GMT Alastair wrote:
> cwaller@my-deja.com <cwaller@my-deja.com> wrote:
>>However, I'm a bit nervous about using Perl because this program must be
>>very robust. It will be used in high transaction environment and cannot
>>crash every day.
> 
> Robustness is no problem. Perl is usually as robust as your OS :-)
> 

And if that OS comes from the Pacific Northwesst of the US then probably
more robust ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 03 Jul 1999 14:43:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Application Development: How robust is Perl?
Message-Id: <377E8407.4ECE33CC@mail.cor.epa.gov>

Jonathan Stowe wrote:
> 
> On Fri, 02 Jul 1999 23:19:20 GMT Alastair wrote:
> > cwaller@my-deja.com <cwaller@my-deja.com> wrote:
> >>However, I'm a bit nervous about using Perl because this program must be
> >>very robust. It will be used in high transaction environment and cannot
> >>crash every day.
> >
> > Robustness is no problem. Perl is usually as robust as your OS :-)
> >
> 
> And if that OS comes from the Pacific Northwesst of the US then probably
> more robust ...

s/more/a *lot* more/;

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 5 Jul 1999 15:32:17 -0300
From: "Kevin Howe" <khowe@performance-net.com>
Subject: Arg! LWP problems
Message-Id: <ZN6g3.873$j3.4761@tor-nn1.netcom.ca>

THe following code works fine on NT servers, but on my UNIX server, despite
our Perl Syntax Checker finding no coding errors, I still get an Internal
Server Error. The problem occurs when I create the $req variable, so it has
something to do with HTTP::Request, but I can't determine what.

Any help would be much appreciated,
Kevin

P.S. The code is taken almost exactly from perl documentation

sub post{
 use HTTP::Request;
 use LWP::UserAgent;
 $ua = new LWP::UserAgent;

 $req = new HTTP::Request
'POST','http://www.missultimate.com/cgi-bin/members/post_here.pl';
 $req->content_type('application/x-www-form-urlencoded');
 $req->content('match=www&errors=0');

 my $res = $ua->request($req);

 print "Content-type: text/html\n\n";

 print $res->as_string;
}







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

Date: Tue, 06 Jul 1999 02:55:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Arg! LWP problems
Message-Id: <oeeg3.94$Qx3.7431@nsw.nnrp.telstra.net>

In article <ZN6g3.873$j3.4761@tor-nn1.netcom.ca>,
	"Kevin Howe" <khowe@performance-net.com> writes:
> THe following code works fine on NT servers, but on my UNIX server, despite
> our Perl Syntax Checker finding no coding errors, I still get an Internal
> Server Error. The problem occurs when I create the $req variable, so it has
> something to do with HTTP::Request, but I can't determine what.

# perldoc perlfaq9
(Question 1)
     My CGI script runs from the command line but not the
     browser.   (500 Server Error)

Look in the server logs to see what exactly the error message is.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd.       | great height, over water.
NSW, Australia                      | 


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

Date: Tue, 06 Jul 1999 11:10:05 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Asking a server "are you there?"
Message-Id: <7lso69$bgf$1@nnrp1.deja.com>

Hello there!

I've written some code that generates as its output a list of FTP
sites. What I would like to do is be able to write a simple bit of perl
code that looks at the address for each of them and determine if the
site is up and running (at the moment, its just if the site exists not
whether the ftp service is running or anything quite as complicated as
that)

I have to admit I have no idea how to do this in Perl. I actually don't
know where I can start, but since I know you guys are much more
responsive to someone who has *at least* made an attempt I'll show you
what I have :o)

I figured that a simple ping of 2 packets to the site would be one way
of doing this (since I can't think of any other). So I came up with:

#!/usr/bin/perl -w

use strict;

sub valid_site
{
  open(RES, "ping -c 2 $_[0] |") || die "Can't ping!: $!";
  while (<RES>)
  {
    if (/\d+ packets transmitted\, \d+ packets received, (\d+)\% packet
loss/)
    {
      if ($1 == 0)  # if there is 0% packet loss
      {
        return 1;  # a good site
      }
      return 0;  # down or glitchy site
    }
  }

  # duff address
  return 0;
}

printf "\nValidating $ARGV[0] ... ";
if (valid_site($ARGV[0]))
{
  printf "Okay!\n";
}
else
{
  printf "Down / No such site\n";
}

 1. Is this the best way to go about doing this?
 2. If not, what should I do?
 3. If so, is there any way I can improve on this?

Thanks for your help

Rich


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 6 Jul 1999 13:07:04 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Asking a server "are you there?"
Message-Id: <3781f168@newsread3.dircon.co.uk>

Richard Lawrence <ralawrence@my-deja.com> wrote:
> 
> I figured that a simple ping of 2 packets to the site would be one way
> of doing this (since I can't think of any other). So I came up with:
> 

<snip pinging code>

> 
>  1. Is this the best way to go about doing this?
>  2. If not, what should I do?
>  3. If so, is there any way I can improve on this?
> 

You might want to look at the module Net::PING that comes as part of the 
standard Perl distribution.

Example from the manpage:

           use Net::Ping;

           $p = Net::Ping->new();
           print "$host is alive.\n" if $p->ping($host);
           $p->close();

           $p = Net::Ping->new("icmp");
           foreach $host (@host_array)
           {
               print "$host is ";
               print "NOT " unless $p->ping($host, 2);
               print "reachable.\n";
               sleep(1);
           }
           $p->close();

/J\
-- 
"I came on the train but I think I managed to pass it off as an asthma
attack" - Jenny Eclair


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

Date: 6 Jul 1999 08:14:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Asking a server "are you there?"
Message-Id: <slrn7o4092.tch.abigail@alexandra.delanet.com>

Richard Lawrence (ralawrence@my-deja.com) wrote on MMCXXXV September
MCMXCIII in <URL:news:7lso69$bgf$1@nnrp1.deja.com>:
%% 
%% I've written some code that generates as its output a list of FTP
%% sites. What I would like to do is be able to write a simple bit of perl
%% code that looks at the address for each of them and determine if the
%% site is up and running (at the moment, its just if the site exists not
%% whether the ftp service is running or anything quite as complicated as
%% that)
%% 
%% I have to admit I have no idea how to do this in Perl. I actually don't
%% know where I can start, but since I know you guys are much more
%% responsive to someone who has *at least* made an attempt I'll show you
%% what I have :o)


You do it the same way as in C. You open a socket to the well known
ftp port of the remote machine. If you can't reach the machine, either
the remote machine is down, or there's a network failure somewhere.
If you reach the machine, but there's nothing on the port listening,
chances are there's no FTP service on the machine. If you get connected,
look at the welcome message. If it doesn't look like FTP, there might
be something else on the port.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 06 Jul 1999 14:30:12 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: Asking a server "are you there?"
Message-Id: <7lt3t4$fdk$1@nnrp1.deja.com>

In article <3781f168@newsread3.dircon.co.uk>,
  Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> You might want to look at the module Net::PING that comes as part of
the
> standard Perl distribution.
>
> Example from the manpage:
>
>            use Net::Ping;
>
>            $p = Net::Ping->new();
>            print "$host is alive.\n" if $p->ping($host);
>            $p->close();

Thanks for the reply! I tried the following:

#!/usr/bin/perl

use Net::Ping;
$p = Net::Ping->new();
print "$host is alive.\n" if $p->ping("localhost");
$p->close();

and got:

$ site2.pl
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be
16 at /usr
/lib/perl5/5.00503/i386-linux/Socket.pm line 295.
$

So I tried doing:

  p = Net::Ping->new("tcp");

and now I get:

$ site2.pl
$

Localhost is down!? So I try:

  p = Net::Ping->new("icmp");

and now I get:

$ site2.pl
icmp ping requires root privilege at ./site2.pl line 4
$

So I finally try:

  p = Net::Ping->new("udp");

and get:

$ site2.pl
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be
16 at /usr
/lib/perl5/5.00503/i386-linux/Socket.pm line 295.
$

Errrr, am I doing something wrong here?

Any help appreciated

Regards

Rich


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 6 Jul 1999 16:03:58 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Asking a server "are you there?"
Message-Id: <slrn7o4abp.1vi.fl_aggie@thepentagon.com>

On Tue, 06 Jul 1999 14:30:12 GMT, Richard Lawrence <ralawrence@my-deja.com>, in
<7lt3t4$fdk$1@nnrp1.deja.com> wrote:

+ $ site2.pl
+ Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be
+ 16 at /usr
+ /lib/perl5/5.00503/i386-linux/Socket.pm line 295.

Out of curiousity, how did you get 5.005_03 with a linux distro? Most of
the pre-compiled packages are usually 5.004_04.

I ran into this problem last week, with a debian system. I manually
trashed the installed perl -- libraries, binaries, the whole thing,
and downloaded/built the latest-greatest, which happened to be
5.005_03 -- not _02 as the web site advertised.

If you've used the cpan module to build non-bundled extensions, I would
advise that you let it create an autobundle for you, so that you can
download and install CPAN (it isn't part of the core??) module, and let
it rebuild your perl as it is now.

James


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

Date: 5 Jul 1999 10:06:15 GMT
From: Christoph Schmitz <cschmitz@stud.informatik.uni-trier.de>
Subject: AUTOLOAD and inheritance
Message-Id: <7lq02n$hqk$1@fu-berlin.de>

Consider the following situation:

package A;

sub foo { ... }

 ...

package B;
@ISA = qw(A);

sub foo { ... }

 ...

package main;

$b = new B;

$b->foo();     # this means B::foo($b)


In this situation, B::foo should be invoked for $b. But what if I want
to put B::foo in an extra file and use a B::AUTOLOAD method to load 
it on demand (e.g. by using AutoSplit and friends)? The perlobj man page 
says that if B::foo doesn't exist, _first_ the base classes of B are 
searched for foo and _then_ B::AUTOLOAD is called (it's in the paragraph
titled "A Class is Simply a Package"). In this situation, first A would 
be searched, and thus A::foo($b) would be called.

This means that using AutoSplit changes the semantics of my program. 
Am I missing anything?

Thanks,

Christoph

-- 
-- Christoph Schmitz <cschmitz(at)stud.informatik.uni-trier.de> --
"We all know Linux is great...it does infinite loops in 5 seconds."
(Linus Torvalds about the superiority of Linux on the Amterdam
Linux Symposium)


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

Date: Sun, 04 Jul 1999 21:16:04 -0400
From: esalmon@packet.net
Subject: Re: Backsniffing
Message-Id: <37800754.6A71@packet.net>

Chris wrote:
> 
> Hi,
> 
> Can anyone tell me how to find out what URL a visitor to my page visited
> before coming to mine?  Would I use cookies or some other method?
> Know any URL where I could find the PErl sourcecode for this?
> 
> Thanks,
> 
> Chris

You can only view URL's that actually linked to your site. In other
words, if a link to your site is clicked upon you can grab the url for
which the link came and your HTTPD can stor it to a log. If someone
types your domain name in directly it will not have a refferer and you
can not see the URL from which it came. Beyound link referrers, there is
no way that I know of to view a persons past history unless they are
using a very old web browser.

Browsers were updated years ago to restrict access to browsing histories
for privacy reasons. So, unless you can find a one-percenter, a real
software cracker, that knows a workaround for accessing a browsers
history, you are out of luck.

If you want to learn more about loging link referrers, see the
associated doc's for your httpd server. Also, most httpd servers store
the info into an $ENV scalar that can easily be referenced from perl. On
the Apache HTTPD: $referrer = $ENV{'HTTP_REFERER'};

	Eric R. Salmon


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sat, 03 Jul 1999 02:27:18 -0400
From: Edgar Reyes <ereyes@800autos.com>
Subject: Beginners question, getting error Can't find string terminator
Message-Id: <377DAD46.49409E0B@800autos.com>

I'm writing a scrip and I get the following massage:
Can't find string terminator "EndOfHTML" anywhere before EOF at
/u/web/seni30/cgi-local/refer.cgi line 276.

any help would be appreciated. Please email me the responds

edgar@totalcreations.com



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

Date: Sat, 3 Jul 1999 12:18:41 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Beginners question, getting error Can't find string terminator
Message-Id: <7llgpo$9c92@news.cyber.net.pk>

> I'm writing a scrip and I get the following massage:
> Can't find string terminator "EndOfHTML" anywhere before EOF at
> /u/web/seni30/cgi-local/refer.cgi line 276.
>
> any help would be appreciated. Please email me the responds

You forgot to close the <<EndOfHTML....

Example:

print <<EndOfHTML;
blah
blah

exit;

[ You forgot EndOfHTML before 'exit;' ]




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

Date: 3 Jul 1999 09:57:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Beginners question, getting error Can't find string terminator
Message-Id: <7lkmq5$2ou$1@gellyfish.btinternet.com>

On Sat, 03 Jul 1999 02:27:18 -0400 Edgar Reyes wrote:
> I'm writing a scrip and I get the following massage:
> Can't find string terminator "EndOfHTML" anywhere before EOF at
> /u/web/seni30/cgi-local/refer.cgi line 276.
> 

You will find it useful to check out what it says in perlfaq4:

=head2 Why don't my <<HERE documents work?

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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 V9 Issue 22
************************************


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