[15498] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2908 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 30 06:05:26 2000

Date: Sun, 30 Apr 2000 03:05:12 -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: <957089112-v9-i2908@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 30 Apr 2000     Volume: 9 Number: 2908

Today's topics:
        Array/Hash - Newbie Questions <petebeatty@csi.com>
        audio/video application <br@centurytel.net>
    Re: Denoument (Was: perl in NT .BAT files Question) (ken_i_m)
    Re: Evaluating string as math expression (Ilya Zakharevich)
    Re: Hiding Password <qa6371@pamd.cig.mot.com>
    Re: how to get a reference to an object's method and us <schan_ca@geocities.com>
    Re: how to measure processing time by millisecond unit jbellack@my-deja.com
    Re: how to measure processing time by millisecond unit jbellack@my-deja.com
        how to recognize Server's filename (for spooled files)  <yoonjung@cs.tamu.edu>
    Re: Is there an auto array or variable that lists which (Eric Bohlman)
        looking for Parse::Yapp simple example <ter@my-deja.com>
    Re: perl in NT .BAT files Question <andrew.savige@ir.com>
        php, embPerl, mod_perl, help. <anthony@outshine.com>
    Re: Print Just Once When in (<>)? (Bart Lateur)
        Problem doing host name look up. <dukat@flash.net>
    Re: Problem doing host name look up. <bwalton@rochester.rr.com>
    Re: Problem doing host name look up. <dukat@flash.net>
    Re: Problem doing host name look up. <phill@modulus.com.au>
    Re: Something isn't working, and I can't figure it out (Eric Bohlman)
    Re: Something isn't working, and I can't figure it out <lr@hpl.hp.com>
        thanks and sorry <harris@rock.upnaway.com>
        The camel steals the show  <uri@sysarch.com>
    Re: The camel steals the show (Douglas Wilson)
    Re: Using variables in 'use lib' path. <you.will.always.find.him.in.the.kitchen@parties>
    Re: Using variables in 'use lib' path. <you.will.always.find.him.in.the.kitchen@parties>
    Re: Visual Basic mid$  - Perl equivalent (data in mid s (Bart Lateur)
    Re: Which template module? CGI::FastTemplate? occitan@esperanto.org
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 30 Apr 2000 10:48:18 +0100
From: "Pete Beatty" <petebeatty@csi.com>
Subject: Array/Hash - Newbie Questions
Message-Id: <8egvfc$gd4$1@ssauraaa-i-1.production.compuserve.com>

I am trying to understand Arrays and Hashes.  I am using the following code.
@stations = (
  [ "A",  [  1, 99],["Test1", "Function_Name_1"],
             [100,101],["Test2", "Function_Name_2"]  ],
  [ "B",  [  1, 10],["B-Test", "Function_B_1"]    ],
  [ "X", [ 10, 50],["X-Test", "xFunction1", "xFunction2"]  ]
     );

$i = @stations;
print "Stations Length=$i\n";        #reports 3
foreach $code(@stations)
{
    @tmp = $code;
    $i = @tmp;
    print "Entry Length=$i\n";         # reports 1
    print "$code[0]\n";                    # reports 'blank', Remove '[0]'
reports array
  # needs additional looping for sub arrays
}

What I want to do is simply process this type of array.  I have tried using
a Hash and was unable to get anything to work.  I really do not understand
them.  I then converted the data (@stations) to an array (@) instead of hash
(%).  Everything compiled OK.  I just do not understand.  Would some kind
sole proved me with some basic code that will simply process each element,
and all sub elements.  I would really appreciate similar code for both Array
and Hash processing.  I could then being my indepth study of the the two.

Thanks in advance.




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

Date: Sun, 30 Apr 2000 04:00:00 GMT
From: brettr <br@centurytel.net>
Subject: audio/video application
Message-Id: <8egb3q$94g$1@nnrp1.deja.com>

Does any one know where I might find resources on designing an Internet
application that will stream audio and video. The software will be used
for conferencing. Similar to MS Media Player or Real Networks' software.

Thanks,
brettr


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


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

Date: Sun, 30 Apr 2000 05:42:19 GMT
From: ken_i_m@linuxstart.com (ken_i_m)
Subject: Re: Denoument (Was: perl in NT .BAT files Question)
Message-Id: <390bc309.2505205@news.mcn.net>

On Sat, 29 Apr 2000 05:28:47 GMT, David Ness <DNess@Home.Com> wrote:

>Steve Kemp wrote:
>>
>>   Ah, of course that was my mistake.
>>
>>   What I should hav said is use:
>>
>>   perl %PerlFlag% %~f0 %*
>>
>
>Well, I tried it, and there's good news and bad news.
>
>The good news is that this works very well under NT and Win2K.
>
>The bad news is that it doesn't work at all under 98 or 95.
>
>So, since my home network has 2-NTs, 2-98s, a 95 and 2K, I have to stick
>with the one that works everywhere.
>
>Anyway, thanks for all the help, even if it finally ran into this
>obstacle...

David, have you found a solution? I have been following your problem
as I have a similar one under Win98. I want to run a bat from a
script. I have tried exec and system i.e.

exec 'somefile.bat';
system 'somefile.bat';
 and
exec ('somefile.bat');
 and variations
exec 'c:/somedir/somefile.bat';
system 'c:\ somedir\somefile.bat';

I moved somefile.bat so that is was in the path. And . . . well, I
have run out of ideas.


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

Date: 30 Apr 2000 04:52:10 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Evaluating string as math expression
Message-Id: <8ege5q$ncm$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Neil Kandalgaonkar
<nj_kanda@alcor.concordia.ca>],
who wrote in article <8ee8sv$2js$1@newsflash.concordia.ca>:
> >: Is there a compact (and pref. fast) way to evaluate/convert a string
> >: as/to a mathematical expression in Perl (without splitting and
> >: iterating)? Say, for a string like "1+2*3" I want the scalar '7'.
> >
> >If you use standard Perl math syntax, eval() makes this a breeze:
> 
> There's a module on the CPAN called Math::Expr for creating mathematical
> expression parse trees and (?) returning their results. I can't quite figure
> it out in less than 5 min, but it might be useful to you.

Hmm, good idea.  Say, just use PARI's evaluator:

  perl -MMath::Pari -wle 'print PARI "sin(Pi/4)"'
  0.70710678118654752440084436208

PARI evaluator has building functions, but if I remember correct, it
has no destructive system API.  Well, you can ask PARI overwrite
files, but it is probably as much as it will go...

Ilya


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

Date: Sat, 29 Apr 2000 19:08:48 +0100
From: James Hoppe <qa6371@pamd.cig.mot.com>
Subject: Re: Hiding Password
Message-Id: <390B2530.4B2A4221@pamd.cig.mot.com>

Either of these solutions will stop password echoing on NT:
1.  Get TermReadKey from Active State:
use Term::ReadKey;
ReadMode('noecho');
$password = ReadLine(0);
print "You said the secret: $password\n";

2. Get an stty.exe from www.mks.com, or somewhere:
system "stty -echo";
print "Password: ";
$password = <STDIN>;
print "You said the secret: $password\n";


Gary wrote:

> I have a perl script which runs in an NT command shell and asks the
> user for username and password, for later use in accessing SQL. How can
> I get perl to hide password (i.e. not echo to screen)as the user types
> their password in.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: Sun, 30 Apr 2000 04:25:38 GMT
From: steve <schan_ca@geocities.com>
Subject: Re: how to get a reference to an object's method and use it?
Message-Id: <390BB70F.E91458A7@geocities.com>

Tom Phoenix wrote:

> On Sat, 29 Apr 2000, steve wrote:
>
> > How do I get a reference to an object's method?
> >
> > eg: in the CGI.pm module, the CGI object has
> >       a method named "param". It returns all the
> >       CGI parameters/values like so:
> >
> >            @values = $query->param('foo');
>
> Nobody really recommends using the OOP interface to the CGI module - not
> even Lincoln Stein himself! (He just fell under the influence of the OO
> cult for a short time, but we got him deprogrammed. :-)  Instead, use the
> function-oriented interface:
>
>     use CGI qw/ :standard /;
>
>     my @values = param('foo');
>
> > How do I get a reference to   $query->param()   ?
>
> At this point, if you really need a reference to the subroutine (is _that_
> what you want?) you can get it as you would with any named sub:
>
>     my $ref = \&param;
>
> But I doubt that you want that; it's nearly useless. Could you want a
> reference to an anonymous array of the foo parameters?
>
>     my $ref = [ param('foo') ];
>
> In case you need to know, in general, how to get at the subroutine which
> implements a method, you can find that via the universal CAN method,
> documented in the perlobj manpage. But actually using that reference is
> one of the mortal sins of OOP. :-)
>
> If I've guessed wrong about what you want, try again. Cheers!
>

I think I'll take your suggestion and use the function-oriented interface:

         use CGI qw/ :standard /;
         my @values = param('foo');

I am a long time cgi-lib.pl user, but for no particular reason decided to
try CGI.pm for my current project. I really don't care for the OO feature
of CGI.pm and it's size.

The reason I wanted to get a reference to a CGI.pm object's method is
I need to process either POST or GET in the same script depending
on   query->request_method()  .  To get POST parameters, I call
query->param()   and for GET parameters I call  query->url_param().
So I figure, I'd set a reference to either the   param()   or the
url_param()
method depending if it's a POST or GET and work from the reference.

Any how, I think making a reference:


                 my $ref = \&param;             # POST

                              or

                 my $ref = \&url_param;         # GET


Will suit me just fine.

Thanks
Steve













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

Date: Sun, 30 Apr 2000 01:17:29 GMT
From: jbellack@my-deja.com
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <8eg1j0$v9p$1@nnrp1.deja.com>

I have to disagree with Andrea's comments below.
Time in milliseconds can be extremely important
when optimizing code for high-traffic Web sites.
A few jobs back, I was responsible for a financial
Web site that got ~ 1m pageviews per day.  Our
application server (ColdFusion) reported
processing time for individual templates in
milliseconds; our database (SQL Server) reported
SQL query times in milliseconds.  1/100 or 1/1000
second wasn't relevant, but 1/10 of a second
variances were very relevant.  The difference
between a page taking 250 milliseconds and a page
taking 70 milliseconds had an enormous impact on
our overall server performance.  We had a few
database queries that took ~ 500ms to process, and
this time delay was actually visible to the user &
made that page appear 'sluggish' compared to other
financial sites.  We optimized the query down to <
100ms, and the complaints went away.

I'll grant that it's possible to get too
fine-grained -- 20ms vs 30ms ain't that important
-- but there is a place for sub-second response
times in code optimization.

-- Jonathan Bellack
     jonathan@bellack.com
    (web geek @ Eazel, but I own my own words)

In article <8e56ge$68s$1@nnrp1.deja.com>,
  Andrea Alexandria Sarkut
<alexandria_sarkut@my-deja.com> wrote:
>
> Measurements down to hundreds or tens of
milliseconds
> are basically useless unless you are involved in
some
> exacting scientific research using computer
technology.
> It is safe to say you do not have the type of
hardware
> needed to ensure accuracy on any time
measurement less
> than thousands of milliseconds, or what we know
as common
> day seconds. You need expensive laboratory
equipment to
> realize exacting accuracy of any time
measurement less
> than one-thousand milliseconds. At best, using a
typical
> Personal Computer, your accuracy would be plus
or minus
> five seconds for reiteration tests, in a final
analysis.
>
> These type of measurements, milliseconds, are
highly
> quesionable for realistic concerns as well.
Recently
> a person here compared benchmarks for a hand
written
> read/parse routine and the equal using cgi.pm
module.
> After one-hundred-thousand iterations, a time
difference
> of two seconds was illogically reported. I say
illogical
> because no consideration is given to margin of
error.
> Two seconds falls well within margin of error
factors.
>
> In this case, given two seconds is accurate, an
average
> internet site, using a form action with five
input variables
> experiencing twenty-thousand hits per year,
would realize
> a CPU time savings of two seconds per year or, a
one minute
> savings in CPU time over the course of thirty
years.
>
> Obviously this type of thinking, shaving off two
seconds
> over the course of a year, it most illogical and
quite
> impractical if not ludicrous.
>
> Do you truly need to worry about an amount of
time
> less than it takes you to blink your eyes?
>
> Consider removing the decimal point, appending
zeroes
> as needed and be pleased with how little effort
it takes
> to do this with no more than ten minutes time
invested
> in writing simple Perl coding.
>
> Andrea Alexandria Sarkut
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>



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


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

Date: Sun, 30 Apr 2000 01:30:02 GMT
From: jbellack@my-deja.com
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <8eg2ae$vud$1@nnrp1.deja.com>

In article <Pine.GHP.4.21.0004291313580.5307-100000@hpplus01.cern.ch>,
  "Alan J. Flavell" <flavell@mail.cern.ch> wrote:
> Here's a relevant comment that you say you disagree with:
>
> > > It is safe to say you do not have the type of hardware
> > > needed to ensure accuracy on any time measurement less
> > >  than thousands of milliseconds,
>
> Please support your claim.  While it's certainly possible to achieve
> that in a well-controlled environment, we're talking here about real
> life server job mix situations, as I understand it.

Well, it seemed to me that Andrea was saying that time measurements
below one second weren't useful in a real-world situation.  My real-
world experience is that sub-second measurements *can* be useful, so
that's all I was trying to say.  I'm supporting my claim by stating
that two commercial appliations, Cold Fusion and MS SQL Server, report
performance in milliseconds, and that the information was consistent,
reproducible, and relevant to our observed server performance.

The data we collected was most valuable in 100ms intervals, but I would
prefer to have a benchmark that has extra significant digits that I can
ignore, rather than just having the benchmark say ".1s" or ".2s".



> And pay attention to your posting style.  The killfile is currently
> seeking new applicants.

I responded to this comment in private.





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


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

Date: Sat, 29 Apr 2000 22:54:50 -0500
From: "yoon" <yoonjung@cs.tamu.edu>
Subject: how to recognize Server's filename (for spooled files) in file-upload using cgi-lib(2.18)
Message-Id: <8egaao$smk$1@news.tamu.edu>

I would like to recognize server's filename in file_uploading.
There is no problem to recognize when there is only one file uploading.

But the problem is that when I want to make the form that can enable several
file uploading function.
I defined my form like this way.

Foreach $i (1..5){
     if ($i eq 1)
        {$name = 'upload1'}
    elsif ($i eq 2) {$name = 'upload2'}
    .......
    <TD><INPUT TYPE = \"text\" NAME = \"hw1 $i\"
    <TD><INPUT TYPE = \"file\" NAME = \"$name\"
    VALUE=$homew[9]></TD>";


I tried to move (upload ) the file using this short function(I used sample
program for file uploading).

For example, each $data{'upload$i}, I tried this.

my ( %cgi_data,       %cgi_cfn,     %cgi_ct,  ....      %cgi_sfn,   ,
$ids) =@_;
}
 ......
     if ($data{'upload2'} ne "")
 {
   $file_name = $data{'upload2'};
   @temp_name=split(/\\/,$file_name);
  $file_name = pop(@temp_name);
   $file_name = $cgi_lib::writefiles.$file_name;
   @move= `mv $cgi_sfn{'upload2'} $file_name`;

The problem is that it can't recognize  the 'cgi_sfn{'upload2'}' which is
the temporary location in server before moving into real lcation.
When I printed 'cgi_sfn('upload2'}, it does not have the vaule.
However, when I printed the value of 'cgi_sfn{'upload'}in case that the FORM
only contains one INPUT for file uploading, it printed where the file is
located before 'mv command.'.

I would like to know whether the identification of serveral server's
location where file is kepted for a moment is not possible or I made some
mistake in the program. If I can't know the location of the file is kept for
temoparary, is there another way?

Thanks







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

Date: 30 Apr 2000 02:48:14 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Is there an auto array or variable that lists which subs are defined in my program ?
Message-Id: <8eg6te$ddj$2@nntp9.atl.mindspring.net>

Richard A. DeVenezia (ctemp5NOctSPAM@specialmetals.com.invalid) wrote:
: Never mind (blush)
: 
: if (defined &$method) { &$method(); }

Do you *really* want anybody with a connection to the Net to be able to 
execute arbitrary subroutines in your code?  You might want to do a Deja 
search of the last month or so of this group for posts containing the 
phrase "dispatch table" to see a safer way of doing this.



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

Date: Sun, 30 Apr 2000 03:18:43 GMT
From: Tim Richardson <ter@my-deja.com>
Subject: looking for Parse::Yapp simple example
Message-Id: <8eg8ma$6n2$1@nnrp1.deja.com>



I want to use Parse::Yapp to process a BAI bank statement. The grammar
is simple, but I've never used Bison or Yapp. Writing the grammar
doesn't look too hard, but I don't understand how I put everything
together. For instance, what does a lexer look like? I'm wondering if
anyone has a simple, complete example of a Perl script that parses
something simple using Parse::Yapp.


--
Tim Richardson
(search string: qweeblebeast)


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


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

Date: Sun, 30 Apr 2000 16:32:47 +1000
From: "Andrew Savige" <andrew.savige@ir.com>
Subject: Re: perl in NT .BAT files Question
Message-Id: <8egk3p$m0p$1@merki.connect.com.au>

Brent Stroh <brents@newsguy.com> wrote in message
news:mrdkgssflvkrs9au58rdr5d731vu7cfoj3@4ax.com...
> David Ness <DNess@Home.Com> wrote:
>
> >I have successfully used, but without completely understanding, a
> >Windows/perl `pun' under NT which allows a single file to contain both
the OS
> >commands to execute perl and the perl code itself. I don't remember the
source
> >of this pun, but it has been a part of lots of my perl work for the last
> >couple of years, and some help about the use of '-w' and `strict'
> >now cause me to want to see if there is a better way to do things
> >with respect to this fragment.
> >Alternatively, is there some better way to handle this whole problem in
> >Windows/perl?
>

This is discussed in the ActivePerl FAQ 'Windows 9X/NT/2000' section:
"What's the equivalent of the shebang syntax for Win32?"

I use ActiveState's pl2bat utility all the time with no problems
and all my scripts are 'perl -w' and 'use strict'.
The trouble with file association (as explained in the FAQ)
is that I/O redirection does not work.
If you look at the .BAT files in ActiveState's bin directory,
you will notice they use pl2bat too.

AndrewS.




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

Date: Sun, 30 Apr 2000 02:58:26 -0700
From: Anthony Boyd <anthony@outshine.com>
Subject: php, embPerl, mod_perl, help.
Message-Id: <anthony-9691C0.02582630042000@news.slip.net>

I spent a while going though deja.com to read up on database-to-web 
stuff.  I read a lot about what people preferred, but there was little 
on how things actually worked.  I'd be grateful for that kind of info.

I'm looking to use mySQL on a Linux box with Apache.  I'll have about 5 
"shell" pages that'll pull in data from mySQL.  Assuming the box is 
around a 750mhz pentium III with 256 megs of RAM, how will any of the 
following plans work for a site that gets about 100,000 hits/day?

1.  Build .shtml files, use SSI calls to .pl files that use DBI to pull 
data from mySQL.  I like this because I can understand it, and it 
separates Perl from HTML.  But my guess is this is too slow.

2.  Use embPerl.  I gather it does a PHP kind of thing.  Is the concept 
something like an Apache module that then parses all .html files for 
Perl?  How fast is that?  Is PHP more robust and in wider use?

3.  What about mod_perl?  Do I need it for 100,000 hits/day?  If I 
understand it correctly, mod_perl is an Apache module.  So if I have a 
 .cgi file in Perl, I do something like "#!/bin/apache -w" (am I close?) 
instead of "#!/usr/bin/perl -w" in my Perl code?  It sounded like people 
on c.l.p.m found mod_perl to be burdensome?

4.  Is Apache::DBD something that extends Apache, or a Perl DBI driver?

5.  Can anyone with experience in this area share some wisdom or 
suggestions that might help me to have a more successful first-try?  I'm 
not a fan of Perl's sprawling documentation, but I'll buy books on 
recommendation, and print Web articles.

-Tony


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

Date: Sun, 30 Apr 2000 07:20:29 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Print Just Once When in (<>)?
Message-Id: <390cca7f.1033798@news.skynet.be>

Elisa Roselli wrote:


>         while (<>)
>         #print "# This program has already been run on this file\n";

You're missing the "{" somewhere in between those. Anyway, us an
additional flag.

	my $done;
	while(<>) {
	   $done++ or 
             print "# This program has already been run on this file\n";
	   print;
	}

-- 
	Bart.


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

Date: Sun, 30 Apr 2000 05:14:13 GMT
From: Eric Miller <dukat@flash.net>
Subject: Problem doing host name look up.
Message-Id: <390BC14B.D9A5584C@flash.net>


I've been trying to write a script to take an IP address
and look up the host name.  I haven't had much sucess.
It will work fine if I give it the 'localhost' IP 127.0.0.1,
but any other IP won't work.  Using the Net::hostent module 
doesn't work either, and only the HTML documentation for 
Net:DNS came with ActiveState's Perl for Win32 build 611,
on Windows 98.  Am I going about this the right way,
and any ideas why it's not working?

use Socket;
my $addr = inet_aton('127.0.0.1');
my $addrtype1 = Socket::AF_INET();

my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyaddr($addr,
$addrtype1);

print "Name: $name\n";
print "Addresses:\n";
foreach $iaddr (@addrs) {
  printf "\t%s\n", inet_ntoa($iaddr);
}

exit;


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

Date: Sun, 30 Apr 2000 05:58:36 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Problem doing host name look up.
Message-Id: <390BCA9D.E811462F@rochester.rr.com>

Eric Miller wrote:
> 
> I've been trying to write a script to take an IP address
> and look up the host name.  I haven't had much sucess.
> It will work fine if I give it the 'localhost' IP 127.0.0.1,
> but any other IP won't work.  Using the Net::hostent module
> doesn't work either, and only the HTML documentation for
> Net:DNS came with ActiveState's Perl for Win32 build 611,
> on Windows 98.  Am I going about this the right way,
> and any ideas why it's not working?
> 
> use Socket;
> my $addr = inet_aton('127.0.0.1');
> my $addrtype1 = Socket::AF_INET();
> 
> my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyaddr($addr,
> $addrtype1);
> 
> print "Name: $name\n";
> print "Addresses:\n";
> foreach $iaddr (@addrs) {
>   printf "\t%s\n", inet_ntoa($iaddr);
> }
> 
> exit;

You're making it too hard.  Try:

@result=gethostbyaddr(pack('CCCC',204,152,190,72),0);
print "$result[0]\n";

That works on my Windoze 98 system, where the IP address is
204.152.190.72, for example.
-- 
Bob Walton


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

Date: Sun, 30 Apr 2000 06:53:56 GMT
From: Eric Miller <dukat@flash.net>
Subject: Re: Problem doing host name look up.
Message-Id: <390BD8AA.FFD852B9@flash.net>

Bob Walton wrote:
> 
> Eric Miller wrote:
> >
> > I've been trying to write a script to take an IP address
> > and look up the host name.  I haven't had much sucess.
> > It will work fine if I give it the 'localhost' IP 127.0.0.1,
> > but any other IP won't work.  Using the Net::hostent module

Well, thanks, turns out it was my firewall, not Perl.  I'm
just beginning to write scripts to access the Internet.

--
for your amusement: 
Jargon File Resources
http://www.tuxedo.org/~esr/jargon/


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

Date: Sun, 30 Apr 2000 16:48:09 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Problem doing host name look up.
Message-Id: <390BD729.72C9@modulus.com.au>

Eric Miller wrote:
> 
> I've been trying to write a script to take an IP address
> and look up the host name.  I haven't had much sucess.
> It will work fine if I give it the 'localhost' IP 127.0.0.1,
> but any other IP won't work.  Using the Net::hostent module
> doesn't work either, and only the HTML documentation for
> Net:DNS came with ActiveState's Perl for Win32 build 611,
> on Windows 98.  Am I going about this the right way,
> and any ideas why it's not working?
> 
> use Socket;
> my $addr = inet_aton('127.0.0.1');
> my $addrtype1 = Socket::AF_INET();
> 
> my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyaddr($addr,
> $addrtype1);
[snip]
Just a suspicion; in the ActivePerl docs "Quirks" for build 522, the
following:

QUOTE
Here is a complete list of unimplemented functions:
 ......many others....
getnetbyname(), getnetbyaddr(), getnetent(), getprotoent(),
     getservent(), sethostent(), setnetent(), setprotoent(),
     setservent(), endhostent(), endnetent(), endprotoent(),
     endservent(), socketpair()
UNQUOTE

Things may have improved in build 612, but it's the first place to look
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: 30 Apr 2000 02:26:22 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Something isn't working, and I can't figure it out
Message-Id: <8eg5ke$ddj$1@nntp9.atl.mindspring.net>

Larry Rosler (lr@hpl.hp.com) wrote:
:   use CGI::Carp qw(fatalsToBrowser);
: 
: Someone chose to use stupid studly caps to define the function (instead 
: of rational underscores: 'fatals_to_browser'), and this error is the 
: result.

You do know, don't you, that the javaites refer to this form of 
StudlyCaps as "camelCase" (the internal capitalization is the "hump")?  Ugh.



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

Date: Sat, 29 Apr 2000 23:55:33 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Something isn't working, and I can't figure it out
Message-Id: <MPG.137578be260a6b5c98a9bb@nntp.hpl.hp.com>

In article <8eg5ke$ddj$1@nntp9.atl.mindspring.net> on 30 Apr 2000 
02:26:22 GMT, Eric Bohlman <ebohlman@netcom.com> says...
> Larry Rosler (lr@hpl.hp.com) wrote:
> :   use CGI::Carp qw(fatalsToBrowser);
> : 
> : Someone chose to use stupid studly caps to define the function (instead 
> : of rational underscores: 'fatals_to_browser'), and this error is the 
> : result.
> 
> You do know, don't you, that the javaites refer to this form of 
> StudlyCaps as "camelCase" (the internal capitalization is the "hump")?  Ugh.

Who would conceive that they hijacked the Perl camel?  Is nothing 
sacred?

I guess 'fatalsToBrowser' is a Bactrian camel -- two humps, you know.  
Ugh, Ugh.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 30 Apr 2000 12:46:03 +0800
From: "Garret Harris" <harris@rock.upnaway.com>
Subject: thanks and sorry
Message-Id: <390bb2fd@usenet.per.paradox.net.au>

the database is to be viewed as a html

thanks for the help
No more help required




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

Date: Sun, 30 Apr 2000 07:09:59 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: The camel steals the show 
Message-Id: <x7og6syshl.fsf@home.sysarch.com>


[posted and emailed to fwp]

an amusing read about a nice camel.

http://www.boston.com/dailyglobe2/120/living/The_camel_steals_the_show+.shtml

The camel steals the show

By Susan King Los Angeles Times, 4/29/2000 

HOLLYWOOD - Steve Barron, director of ABC's "Arabian Nights,"
describes one of the stars of the four-hour fantasy that begins airing
Sunday night as "brilliant," with a most "expressive" face.

Indeed, this actress, who makes her film debut in the movie, more than
holds her own opposite British actor Rufus Sewell, who plays the
infamous Ali Baba. In fact, she dominates every scene she's in with
Sewell - no small feat considering she's such a newcomer to the
business.

Who is this budding talent, this fresh face, this unexpected vamp? Her
name is Safra. An 8-year-old camel, she literally stumbled into her
calling as an actress just in the nick of time.

Safra so enchanted the cast and crew of the production in Antalaya,
Turkey, last year that they named her character in the spectacle after
her. In her role as Ali Baba's sidekick and confidant, Safra spits her
disapproval over her master's actions, is very vocal in her opinions,
and is far more clever than her master. She can express more with her
all-knowing deep brown eyes and strong face than many actors can with
even the most sharply written dialogue. No animatronics or enhancements
needed.

"She does one look which is so knowing and so human," says the
British-born Barron, who fell in love with camels and desert sagas after
seeing "Lawrence of Arabia" as a child.

When Safra arrived on the set, she was thin and undernourished. Slated
to be someone's main course - camel meat is common in Turkey - Safra had
just been rescued when she was brought on the set to audition for the
role of Ali Baba's trusty camel.

The animal wrangler tried her out and discovered, says Barron, that
unlike most ill-tempered camels, Safra had a sunny personality. And from
all reports, she was brighter and more willing to follow commands than
any camel they had encountered.

Because she was so scrawny, the craft services crew on the set began to
fatten her up. So much so that she began to pack on the pounds, which
led to a continuity problem. "She got a bit too fat," says Barron,
"and then they got her in the right state."

There was talk that Safra would emigrate to England after production
wrapped, but a spokesperson for "Arabian Nights" said there was too
much red tape and paperwork involved in having her make the journey.

So Safra is now enjoying a life outside of Antalaya with the person who
rescued her. Although she hasn't acted since the ABC movie, according to
Barron, Safra is now something of a local celebrity.


uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sun, 30 Apr 2000 08:00:44 GMT
From: dwilson@gtemail.net (Douglas Wilson)
Subject: Re: The camel steals the show
Message-Id: <390bc36d.1301341@news>

On Sun, 30 Apr 2000 07:09:59 GMT, Uri Guttman <uri@sysarch.com> wrote:

>HOLLYWOOD - Steve Barron, director of ABC's "Arabian Nights,"
>describes one of the stars of the four-hour fantasy that begins airing
>Sunday night as "brilliant," with a most "expressive" face.

>Who is this budding talent, this fresh face, this unexpected vamp? Her
>name is Safra. An 8-year-old camel, she literally stumbled into her
>calling as an actress just in the nick of time.

LOL
Bummer. Safra.(com|net|org) are all taken :)
Some perl project ought to be named after it anyway, though.
Maybe it can be worked into the PerlDB project somehow :)

Cheers,
Douglas Wilson


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

Date: Sun, 30 Apr 2000 17:55:59 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Using variables in 'use lib' path.
Message-Id: <957074094.421592@shelley.paradise.net.nz>


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:390B82C9.A0B46C2A@rochester.rr.com...
> Tintin wrote:
> >
> > Can someone explain to my why:
> >
> > use FindBin qw($Bin);
> > use lib "$Bin/lib";
> >
> > use MyModule;
> >
> > works, but if I use:
> >
> > $Bin='/home/peters/';
> > use lib "$Bin/lib";
> >
> > use MyModule;
> >
> > It fails to update @INC.
>
> From the 'lib' doc page:
>
>      lib - manipulate @INC at compile time
>                               ^^^^^^^^^^^^
>
> Your statement $Bin=... is executed at run time, while the 'use'
> statement is executed at compile time.

OK.  Well that explains why.

>
> Try [not tested]:
>
> BEGIN{
>      $Bin='/home/peters/';
>      use lib "$Bin/lib";
> }
>
> That will probably work, since the $Bin=... is executed at compile time.

Unfortunately, it doesn't work.  How ever if I use:

BEGIN {
   $Bin='/home/peters';
   push @INC, "$Bin/lib";
}

it will work.





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

Date: Sun, 30 Apr 2000 17:57:20 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Using variables in 'use lib' path.
Message-Id: <957074174.930861@shelley.paradise.net.nz>


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:390B82C9.A0B46C2A@rochester.rr.com...
> Try [not tested]:
>
> BEGIN{
>      $Bin='/home/peters/';
>      use lib "$Bin/lib";
> }
>
> That will probably work, since the $Bin=... is executed at compile time.


Actually, I just tryed again and realised the 'use lib' has to be outside
the BEGIN block to work.




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

Date: Sun, 30 Apr 2000 07:41:09 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Visual Basic mid$  - Perl equivalent (data in mid string)
Message-Id: <390ee325.7343637@news.skynet.be>

Kent FitzGerald wrote:

>if mid$(rec$,1,4) = "fooo"" then

	if (substr($rec, 0, 4) eq "fooo") { ...

VB starts counting at 1, Perl at 0. Another way to look at it, is that
Perl wants to know how many characters come before the section you want.

-- 
	Bart.


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

Date: Sun, 30 Apr 2000 08:30:41 GMT
From: occitan@esperanto.org
Subject: Re: Which template module? CGI::FastTemplate?
Message-Id: <8egqvi$ppn$1@nnrp1.deja.com>

Saluton retanoj!

In article <390A6EC4.77970071@momsathome.on.ca>,
  Jennifer <webmaster@momsathome.on.ca> wrote:
> There seems to be an abundance of template modules out there.
> I've read about Text::Template, Text::FillIn, Text::MetaText,
> HTML::Template, HTML::ParsedForm, and CGI::FastTemplate

> Are there any other modules on templates that I missed?

While it is not advertised as such, Text::iPerl can well be seen as a
template mechanism.  In fact, based on Randal's article in april
Sysadmin mag, I just created a little example, which amounts to a
template fill in.

> Also, I don't see an option to choose my variable format with
> this module. I have tons of templates already using
> <%VARIABLE%>.

I'm starting to think about creating a dedicated template style, which
would give you such options.  I.e. <%VARIABLE%> might come from
$VARIABLE, $foo{VARIABLE} or even in CGI context param( 'VARIABLE' ).

--
Bring text-docs to life!              Erwecke Textdokumente zum Leben!
                   http://beam.to/iPerl/
Vivigu tekstodokumentojn!


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


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

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


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