[15656] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3069 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 16 21:05:35 2000

Date: Tue, 16 May 2000 18:05: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: <958525513-v9-i3069@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 16 May 2000     Volume: 9 Number: 3069

Today's topics:
    Re: Accurate IP return? (David Efflandt)
    Re: Annoying -w messages from standard distributed modu <johnlin@chttl.com.tw>
        Any way to un-bless a ref? <aperrin@davis.DEMOG.Berkeley.EDU>
    Re: Any way to un-bless a ref? (Sean McAfee)
    Re: converting array of arrayrefs to hash (Neil Kandalgaonkar)
    Re: counter <edbubbleluk@hotmail.com>
    Re: crypt() question (David Efflandt)
    Re: How to COPY a website (Malcolm Hoar)
    Re: How to COPY a website (Charles DeRykus)
        I want to split on more than one word  <cure@texas.net>
    Re: I want to split on more than one word <lr@hpl.hp.com>
        Inheritance -- what am I doing wrong? (Steve Leibel)
    Re: Inheritance -- what am I doing wrong? (Neil Kandalgaonkar)
    Re: Inheritance -- what am I doing wrong? (Abigail)
    Re: Is my Perl 5.005_03 Compiler broken? <rootbeer@redcat.com>
    Re: Is my Perl 5.005_03 Compiler broken? (Ilya Zakharevich)
    Re: Link Extractor <samay1NOsaSPAM@hotmail.com.invalid>
        NDBM <ksoares@beancreative.com>
    Re: Now serving 15? (How can I setup a small server in  (David Glasser)
    Re: Odd behaviour, I think its my use of map()? <mjcarman@home.com>
    Re: perl auto post to web form <famouswizardNOfaSPAM@yahoo.com.invalid>
    Re: Perl code editors? <occitan@esperanto.org>
        pre-ipo hitech oppty - UNIX admin WANTED <mike@globalnetr.com>
    Re: Problem or normal?? <andrew.mcguire@walgreens.com>
    Re: Problem or normal?? <mjcarman@home.com>
    Re: Problem or normal?? <anmcguire@ce.mediaone.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 17 May 2000 00:11:27 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Accurate IP return?
Message-Id: <slrn8i3ot8.bi8.efflandt@efflandt.xnet.com>

On Tue, 16 May 2000, [TNN]G.Bloke <GBloke@actiongames.co.uk> wrote:
><SNIP>
>> Your plan is misconceived, I'm afraid.  Try a CGI FAQ.  This is not a
>> Perl language issue.
>
>Ah...well, thanks anyway...
>
>Does anyone want to actually help me then?

Unfortunately what you are trying to do is nearly impossible (Perl issue
or not).  There is no webserver variable that will identify a unique
user.  The REMOTE_ADDR is not necessarily unique (proxies, firewalls and
dynamic IP's).  Even the suggestion to e-mail a user a unique ID code
would not do it.  I could have an unlimited number of e-mail addresses
forwarded to me from several different domains.

So unless you can find some ID that can be verified by a reliable 3rd
party (like SS# or credit card number) and the user is willing to give you
that info, it is quite impossible to tell if a web user is unique.

I guess you could flag any IP that produces multiple hits in less than a
minute to minimize Perl script voting, but if it is something like an
aol-proxy, it may be a valid bunch of different users.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Wed, 17 May 2000 08:31:52 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: Annoying -w messages from standard distributed modules
Message-Id: <8fsp9v$881@netnews.hinet.net>

Tom Phoenix wrote
> Scott Houck wrote:
>
> > Maybe he could do something funky like $^W=0; use BuggyModule; $^W=1;
>
> Well, he could - but it wouldn't help. :-)

Why didn't I think of this!!!  The following are the experiments:

BEGIN {
    local $^W=0;
    use Win32::OLE::Const 'Microsoft Word';  # 'require' may be better
}

It won't work, still gets warning messages.  But

no warnings 'redefine';
use Win32::OLE::Const 'Microsoft Word';
use warnings;
print undef + undef;

It works!!!  Warnings from Win32::OLE::Const disappear
and it still keeps the warnings from my own code.

So can I say '$^W=0' happens at run time
and 'no warnings' at compiling time?

John Lin





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

Date: 16 May 2000 15:58:22 -0700
From: Andrew Perrin - Demography <aperrin@davis.DEMOG.Berkeley.EDU>
Subject: Any way to un-bless a ref?
Message-Id: <u5kln1aayr5.fsf@davis.DEMOG.Berkeley.EDU>


Greetings. Writing a database module, I'm writing a simple method
remove() to be called on a blessed object of class Record; the idea is
(where Person @ISA Record):

$homer = Person->new({last_name=>'simpson',first_name=>'homer'});

$homer->put;

$homer->remove;

The issue is that presumably the perl object $homer should be
destroyed when remove is called, since the underlying database record
is destroyed.  I don't want to end up with an orphaned object to which
an unsuspecting user could do something after it's been deleted from
the database.

So, how can I un-bless the $homer reference from a subroutine?  I've
used:

sub remove {
  my $rec = shift;
  #code here to do the delete
  %$rec = ();
}

which makes homer into an empty, blessed hash:

$  DB<10> x $homer
0  Person=HASH(0x5c375c)
     empty hash

I'd like $homer to be completely unblessed and undef.  Thanks.

-- 
---------------------------------------------------------------------
Andrew J. Perrin - aperrin@demog.berkeley.edu - NT/Unix Admin/Support
Department of Demography    -    University of California at Berkeley
2232 Piedmont Avenue #2120  -    Berkeley, California, 94720-2120 USA
http://demog.berkeley.edu/~aperrin --------------------------SEIU1199


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

Date: Tue, 16 May 2000 23:16:20 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Any way to un-bless a ref?
Message-Id: <8FkU4.1869$R12.37201@news.itd.umich.edu>

In article <u5kln1aayr5.fsf@davis.DEMOG.Berkeley.EDU>,
Andrew Perrin - Demography  <aperrin@davis.DEMOG.Berkeley.EDU> wrote:
>Greetings. Writing a database module, I'm writing a simple method
>remove() to be called on a blessed object of class Record; the idea is
>(where Person @ISA Record):

>$homer = Person->new({last_name=>'simpson',first_name=>'homer'});
>$homer->put;
>$homer->remove;

>The issue is that presumably the perl object $homer should be
>destroyed when remove is called, since the underlying database record
>is destroyed.  I don't want to end up with an orphaned object to which
>an unsuspecting user could do something after it's been deleted from
>the database.

>So, how can I un-bless the $homer reference from a subroutine?

Just assign something else (such as undef) to $homer.  Assuming there are
no other references to the underlying object anywhere, the object will
be destroyed.

You can also let Perl take care of this automatically by using my()
variables:

{
    #  some code
    my $homer = Person->new({last_name=>'simpson',first_name=>'homer'});
    #  some more code
    $homer->put;
    #  yet more code
}

(This could also be the body of a subroutine or loop rather than just an
unnamed block.)

This will destroy the $homer object when the block exits, again assuming
that no other references to it exist.  If you can't guarantee this, I can't
think of a convenient way to do what you want.

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: 17 May 2000 00:17:22 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: converting array of arrayrefs to hash
Message-Id: <8fsoei$1gf$1@newsflash.concordia.ca>

In article <8frqfu$cga$1@nnrp1.deja.com>,  <bsmith@webnetint.com> wrote:
>I realized I had error in sql statement which fixed my problem.
>However, I would appreciate feedback on whether there is a better way to
>do what I'm doing.  I suspect mine is slow, since I have to iterate over
>my dataset, transform it to a new hash, and iterate again.


>> my $seen;
>> my %menus; # the new hash
>>
>> # $m is an arrayref of hashrefs
>>
>> for my $item (@$m)
>> {
>> 	if($seen ne $item->{name})
>> 	{
>> 		$menus{ $item->{name} } = [ $item ];
>> 	}
>> 	else
>> 	{
>> 		push @{ $menus{$item->{name}} }, $item;
>> 	}
>> 	$seen = $item->{name};
>> }
>>

The 'seen' machinations are not useful. (Furthermore they would only
have worked in your code if @$m was already sorted by name.) 

Perl autovivifies. 

my %menus;
for my $item (@$m) {
  push @{ $menus{ $item->{'name'} } }, $item;
}



-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: Tue, 16 May 2000 20:49:16 -0400
From: "Ed" <edbubbleluk@hotmail.com>
Subject: Re: counter
Message-Id: <8fsq3f$vt7$1@slb7.atl.mindspring.net>

HI again,

I got the script by Malverian to work, I tried to get the one by Christian
to work, but it just does not.

Here is working script..I added the part where the users IP is written to
the visitors file:
THere is no expiration thing on it which is bad, and if somebody happens to
visit page while this person is on it then does a refresh, it will increment
I guess..is there anytying I could add to this so it will work like the
script by Christian..,

also how can I add this to the bottom of my existing HTML so it will just
show the counter as text...

Thanks so much for your help, I wish I knew what you guys/gals know....I am
still learning

Ed

#!/usr/bin/perl

use CGI;
$query = new CGI;

#$usr_addr = $ENV{'REMOTE_USER'};
$usr_addr = $ENV{'REMOTE_ADDR'};
$counterdata = 'counter.data';
$users = 'counter.visitors';
open(HITS, $counterdata);
@data = <HITS>;
close(HITS);
open(VISITORS, $users);
@visitors = <VISITORS>;
close(VISITORS);
$visitorlist = "@visitors";
$hitcount = "@data";


if ($visitorlist =~ /$usr_addr/i)
{
   &beenhere;
} else
{
  $hitcount = $hitcount + 1;
  open(IN, ">$counterdata");
  print IN $hitcount;
  close(IN);

  open(IN, ">$users");
  print IN $usr_addr;
  close(IN);

  print "Content-type: text/html\n\n";
  print "$usr_addr";
  print "$hitcount";
}

sub beenhere {
print "Content-type: text/html\n\n";
print "$hitcount<br>";
# print "You've been here already, thanks for coming back!";
}





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

Date: 17 May 2000 00:26:10 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: crypt() question
Message-Id: <slrn8i3poq.bi8.efflandt@efflandt.xnet.com>

On Tue, 16 May 2000 15:28:58 -0400, NagaPutih <s0218327@unix1.cc.ysu.edu> wrote:
>
>how do i manipulate password file to be used with
>.htaccess in perl? the password file is typically
>manipulated using an provided executable (htpasswd).

Create a colon separated list.  Anything after a second colon in the
line is ignored:

username:crypted_passwd
username2:crypted_passwd2:this colon & anything after it ignored

>what salt value should i use in crypt()-ing password
>so that the encrypted password could be understood
>by the httpd daemon?

Preferably 2 random characters of the following:  a-zA-Z0-9./

However, if verifying a plain text password later, use the entire
previously crypted password as salt (NOT a substring).

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Tue, 16 May 2000 22:36:07 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: How to COPY a website
Message-Id: <3921cd56$0$227@nntp1.ba.best.com>

In article <2xjU4.497$Wh6.16302@news.uswest.net>, jerome@activeindexing.com (Jerome O'Neil) wrote:

>They are two different animals.  If someone is distributing
>your work without your authorization, that is something completely
>different than if they download and consume at different times.

True. OTOH, most bots that attempt to download entire sites that
I'm involved with are clearly NOT legitimate. The overwhelming
majority are simply mailto harvesters operated by spammers. Most
of us that pay per-hit and/or bandwidth charges tend to get a
little miffed having to pay good money for the privelege of being
spammed.

-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar           "The more I practice, the luckier I get". |
| malch@malch.com                                     Gary Player. |
| http://www.malch.com/               Shpx gur PQN.                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Tue, 16 May 2000 22:33:19 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: How to COPY a website
Message-Id: <FuoBzJ.zJ@news.boeing.com>

In article <B5463AE1.400E%elaine@chaos.wustl.edu>,
Elaine Ashton  <elaine@chaos.wustl.edu> wrote:
>in article FuMt43.ECH@news.boeing.com, Charles DeRykus at
>ced@bcstec.ca.boeing.com quoth:
> 
>> which could be easily adapted to your needs.
>
>uh..no.
>
>rsync, rdist, or mirror.
>


Uh.. there was only mention of getting static html pages 
from websites. I agree a full fledged mirror such as wget 
may well be preferable in some cases although if WWW::Robot 
is already installed, you'd only need a couple of additional 
lines in poacher to pull html.    

But rsync or rdist would require privilege and therefore 
be much less useful as a general purpose tool.

--
Charles DeRykus


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

Date: Tue, 16 May 2000 19:05:37 -0700
From: Cure <cure@texas.net>
Subject: I want to split on more than one word 
Message-Id: <3921FE71.28A86B63@texas.net>

 $cure = "substr hi there";


 I want to split on more than one word
i want to bealbe to split on substr and hi and there
is that possible?



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

Date: Tue, 16 May 2000 17:56:27 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: I want to split on more than one word
Message-Id: <MPG.138b8e19949360fe98aa8e@nntp.hpl.hp.com>

In article <3921FE71.28A86B63@texas.net> on Tue, 16 May 2000 19:05:37 -
0700, Cure <cure@texas.net> says...
>  $cure = "substr hi there";
> 
> 
>  I want to split on more than one word
> i want to bealbe to split on substr and hi and there
> is that possible?

What did you try?

Which part of `perldoc -f split` didn't you understand?

Why are you not doing even the minimal amount of work needed to answer 
this question?

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


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

Date: Tue, 16 May 2000 16:36:14 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Inheritance -- what am I doing wrong?
Message-Id: <stevel-1605001636140001@192.168.100.2>

Here's an example.  I have a Base class in a module like this:

#
# Base.pm
#
package Base;

sub new {
    print "I'm Base\n";
}

1;


And I have a derived class in a module like this:

#
# Derived.pm
#
package Derived;
@ISA = ("Base");

1;


Now I have a little test program:

#!/usr/local/bin/perl

#use Base;   # <---------
use Derived;

$b = new Derived();  # Works only if "use Base" is uncommented


With "use Base" commented out, Perl throws a "can't find method" exception
on new Derived().  However with "use Base" not commented out, the program
works.  This can't be right!   How can the program be expected to "use"
every base class?  I suppose I could put "use Base" in the Derived class,
but none of the examples I've seen do this.

Can someone throw me a clue?  I'm using 5.005_03 on FreeBSD.

Thanks,

Steve L
stevel@coastside.net


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

Date: 17 May 2000 00:04:32 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Inheritance -- what am I doing wrong?
Message-Id: <8fsnmg$3l3$1@newsflash.concordia.ca>

In article <stevel-1605001636140001@192.168.100.2>,
Steve Leibel <stevel@coastside.net> wrote:

>With "use Base" commented out, Perl throws a "can't find method" exception
>on new Derived().  However with "use Base" not commented out, the program
>works.  This can't be right!   How can the program be expected to "use"
>every base class?  I suppose I could put "use Base" in the Derived class,
>but none of the examples I've seen do this.

I'm not a Perl object wizard, but absolutely all the examples I could
find *do* use the Base module (or 'require' it). As you guessed, usually
you import the Base class in the Derived class.

see man perltoot, perlobj, perlmod, etc.

@ISA is just an array of package names. It won't run out and import the
module's methods for you. Actually, there would be no way for ISA to even
know which module to go out and get. Modules and packages are not the same
thing, in principle the Foo.pm module could contain package Bar, although
it would be silly to write a module like that.

-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: 17 May 2000 00:10:52 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Inheritance -- what am I doing wrong?
Message-Id: <slrn8i3osb.cei.abigail@ucan.foad.org>

On Tue, 16 May 2000 16:36:14 -0700, Steve Leibel <stevel@coastside.net> wrote:
++ Here's an example.  I have a Base class in a module like this:
++ 
++ #
++ # Base.pm
++ #
++ package Base;
++ 
++ sub new {
++     print "I'm Base\n";
++ }
++ 
++ 1;
++ 
++ 
++ And I have a derived class in a module like this:
++ 
++ #
++ # Derived.pm
++ #
++ package Derived;
++ @ISA = ("Base");
++ 
++ 1;
++ 
++ 
++ Now I have a little test program:
++ 
++ #!/usr/local/bin/perl
++ 
++ #use Base;   # <---------
++ use Derived;
++ 
++ $b = new Derived();  # Works only if "use Base" is uncommented
++ 
++ 
++ With "use Base" commented out, Perl throws a "can't find method" exception
++ on new Derived().  However with "use Base" not commented out, the program
++ works.  This can't be right!   How can the program be expected to "use"
++ every base class?  I suppose I could put "use Base" in the Derived class,
++ but none of the examples I've seen do this.
++ 
++ Can someone throw me a clue?  I'm using 5.005_03 on FreeBSD.

That's because "use" hasn't *anything* to do with classes. Nothing.
Nada. Zilch. "use" only has something to do with filenames. [1]
It compiles the code found in the file (after a possible translation).

@ISA, on the other hand, has nothing to do with filenames. It only 
deals with package names.

That's all quite simple. However, to make things interesting, people
often use a relation between file names and package names. Like
putting the code of package 'Foo' in the file 'Foo.pm'. And that's
where things get messy. Because sometimes people put code of more
than one package in the same file. Or spread the code of one package
out over more than one file. 

So, the bottom line is simple. If the code for the Base package is in
a separate file, you need the 'use Base;' line. If it's not, you don't.
Hence, in normal code, you would use the 'use Base;' line. But because
examples are awkward when the code is split over multiple files, you
won't use 'use Base;' in examples. 

Confused? Watch next weeks episode of PERL!


[1] This being Perl, that's a lie. Behind your back, use does something
    with packages. It translates the filename to a package name, and
    calls 'import' in said package. But that's totally unrelated to the
    actual content of the file. It's one of those cases where Perl is
    super flexible, but does something totally weird if you do anything
    else than what everyone does anyway.



Abigail


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

Date: Tue, 16 May 2000 15:39:59 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Is my Perl 5.005_03 Compiler broken?
Message-Id: <Pine.GSO.4.10.10005161535190.25459-100000@user2.teleport.com>

On Tue, 16 May 2000, it was written:

> This compiler is misbehaving I believe.. 

You may be right, but we don't even know for sure what perl will do when
you give it valid code. If you give it erroneous input, anything can
happen! :-)

> And misbehaving in a very bad way, as the missing ()'s were very
> difficult to find (in the middle of the 600-odd lines of code), with
> no compiler warning or even an informative run-time message.

Got a patch?

> I want a stable, behaving compiler.

Then why are you using perl? :-)

> What I don't understand is, if I read my Programming Perl correctly
> (pp 532), the expression MUST be surrounded by ()'s, so this should
> have generated a syntax error in the <if> production.

Not necessarily. You can make a mistake in any normal programming language
and end up with a syntactically-valid program which doesn't do what you
want. In this case, what you got was de-facto valid, even if it's syntax
that's not supported by the docs. That's why I asked whether you had a
patch; if you can find a way for perl to detect this mistake, maybe we can
keep this from happening again.

But no matter what we do, perl will never be able to catch all of your
errors for you - that's why we programmers get paid, after all!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 16 May 2000 23:06:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Is my Perl 5.005_03 Compiler broken?
Message-Id: <8fsk9u$951$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to webqueen, queen of the web 
<webqueen@my-deja.com>],
who wrote in article <8fs7pg$sa3$1@nnrp1.deja.com>:
> Besides, if the line above WAS missing a ; then then the
> 
>      if defined ($s{$_})
> 
> should have been terminated with it's own ; to end the statement above.

Not necessarily:

  > perl -wle "1 if defined ($foo{1}){123}"
  Can't use subscript on defined operator at -e line 1, near "123}"

As you see, the failure mode is different from what you expected.

But I think I saw similar problems with 5.005_03.  Please check how
5.6.0 behaves.

Ilya


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

Date: Tue, 16 May 2000 15:18:10 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: Link Extractor
Message-Id: <0bf0cde4.e686cf9b@usw-ex0104-087.remarq.com>

For some security purpose, they may not allow calling any *.pm
or *.pl files..

And if my data is located on the server, I may not need to go
via HTTP stuff.. I just need the link extractor..

* 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: Tue, 16 May 2000 18:57:54 -0400
From: "Keith Soares" <ksoares@beancreative.com>
Subject: NDBM
Message-Id: <si3ketg9rj0184@corp.supernews.com>

OK, I usually work on NT, so I am familiar with ODBC but I am not familiar
with NDBM...

I have been given a couple of Perl scripts from another server that use
NDBM. They came with database files (one file each named with  .pag and
 .dir) which worked on the old server, but don't seem to work on the new
machine.

I have run the Perl scripts on the new machine and they will run, but none
of the data appears. [The new machine is running Netscape Enterprise v3.51
and is hosted with IBM.]

Can anyone please give me an overview of NDBM and how I might get these .pag
and .dir files functioning? Or send me to appropriate information online or
in a book...I've looked and can't find much

Thanks
K.



---
Keith Soares
Creative Director
B e a n  C r e a t i v e  Funktional Web Design
703 684 5945
fx 703 684 5068
http://www.beancreative.com
ksoares@beancreative.com

---




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

Date: Tue, 16 May 2000 18:02:35 -0400
From: glasser@iname.com (David Glasser)
Subject: Re: Now serving 15? (How can I setup a small server in perl?)
Message-Id: <1eap3nx.iwmrfv1s7c1wmN%glasser@iname.com>

Makarand Kulkarni <makarand_kulkarni@My-Deja.com> wrote:

> Perl MUD stuff is available.
> http://www.boutell.com/perlmud/
> Do not invent your own unless really necessary.

Admittedly PerlMUD is very ugly and requires addition of many standard
MUD features.

On the other hand, it's pretty easy to add to it, though over time it
tends to get a bit bloated.

-- 
David Glasser | glasser@iname.com | http://www.davidglasser.net/
rec.arts.int-fiction FAQ: http://www.davidglasser.net/raiffaq/
"So, is that superior artistry, or the easy way out?"
 --TenthStone on white canvases as art, on rec.arts.int-fiction


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

Date: Tue, 16 May 2000 16:28:14 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Odd behaviour, I think its my use of map()?
Message-Id: <3921BD6E.8C30F9B7@home.com>

Drew Simonis wrote:
> Tony Curtis wrote:
> > You do know that DATA is a special handle in perl don't you?
> 
> I do now.  I didn't. I changed it to STATE but it didn't help
> matters.

<tangent>
It wouldn't. You can use DATA to open() a file. I actually pull a little
trick and do this in one script which takes an optional config file so
that I don't have to check the return status of my open():

open(DATA, $file);
while(<DATA>) {
    # ...
}

Should open() fail, it reads from __DATA__ by default.
</tangent>

> > Do you have any special settings for $/ in your code
> 
> none.

Hrm. Are you reading a DOS format file from *nix, or vice-versa? Wait,
never mind, you said in your original post that you are creating the
file yourself. It *does* look like something is tampering with $/
though. (Any modules loaded?) Try forcibly resetting it in the block
that reads the file:

(Borrowing from an earlier post)
if (-e $filename){
    local $/ = "\n";
    open (DATA, "< $filename") or die "can't open $filename: $!"; 
    chomp(@page_array = <DATA>); 
    close DATA;

    $val_page =  shift @page_array;
    print $val_page , "\n";
}

-mjc


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

Date: Tue, 16 May 2000 17:50:14 -0700
From: dreon <famouswizardNOfaSPAM@yahoo.com.invalid>
Subject: Re: perl auto post to web form
Message-Id: <00df3e90.6fdfd2d6@usw-ex0101-006.remarq.com>

Forget it - doesn't work! All time gives me error that the
request is "bad". I do get a web page on the request, but it says
that there is something wrong with my headers. Tried anything -
just dosn't work.
Giving up ...

* 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: Tue, 16 May 2000 22:04:45 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: Re: Perl code editors?
Message-Id: <8fsgli$6ks$1@nnrp1.deja.com>

In article <8fpnqj$d9e@drn.newsguy.com>,
  Sue Spence <sue@pennine.com> wrote:
 ...
> I know you said to forget it, but I would like to know what editor you
> decided to use.  I'm a hopeless old vi-ctim, and have used vim on
> various unixen and lemmy ($20) on windoze.  Lemmy does decent syntax
> coloring for C/perl/java/html files.  Emacs is another excellent
> programming editor but I was never able to make friends with it
> somehow.

My choice is Emacs, which has two major modes for Perl.  The standard
Perl mode is helpful, but fails miserably on Perl oddities like $#array
doesn't start a comment and m!'! or s'a'b' doesn't start a string, but
q( does.  The alternative CPerl mode has an almost excellent grip on
these though!  That gives you neat syntactical highlighting with various
text attributes and correct indentation.

My iPerl minor mode mode for editing bits of Perl dispersed in any
document (see signature below) gives you the choice of these two modes.

Daniel

--
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: Wed, 17 May 2000 00:44:33 GMT
From: "Mike" <mike@globalnetr.com>
Subject: pre-ipo hitech oppty - UNIX admin WANTED
Message-Id: <RXlU4.317$%P.8876@typhoon.nyroc.rr.com>


I'll make this quick.
WANTED  :  UNIX administrator for a very well funded, hi-tech, start-up
telecom company in the MA area.

equity stock, relocation, + a very nice salary


Interested or curious call me......toll free  877.523.4354


--
Mike DeLaney            716.223.5110
GNR - Global Network Recruiting, LLC
mike@globalnetr.com






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

Date: Tue, 16 May 2000 16:57:08 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Problem or normal??
Message-Id: <3921C434.BF027C1C@walgreens.com>

"Andrew N. McGuire" wrote:

[ snip ]

>     &read_x_values("$_");

I know, superfluous quotes, sorry.

[ snip ]

Regards,

anm
-- 
/*-------------------------------------------------------.
| Andrew N. McGuire                                      |
| andrew.mcguire@walgreens.com                           |
`-------------------------------------------------------*/


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

Date: Tue, 16 May 2000 17:29:45 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Problem or normal??
Message-Id: <3921CBD9.77DE66AB@home.com>

"Andrew N. McGuire" wrote:
> 
> If you comment out the 'print while <INFILE>;' it works
> just fine.  There is something here that I too am missing. :-)

Which is that for() and foreach() set the loop variable ($_ here, by
default) to an alias for the data in the original list. So if you change
$_, you also change its value in the @filelist array, which is what is
happening here: $_ is being clobbered by the while(). I suppose the
print() is actually spitting out EOF chars in place of the original
filenames. Try inserting 'local $_' at the beginning of the sub and
you'll have better results.

-mjc


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

Date: Tue, 16 May 2000 19:11:37 -0500
From: "Andrew N. McGuire" <anmcguire@ce.mediaone.net>
Subject: Re: Problem or normal??
Message-Id: <3921E3B9.F88615E6@ce.mediaone.net>

Michael Carman wrote:
> 
> "Andrew N. McGuire" wrote:
> >
> > If you comment out the 'print while <INFILE>;' it works
> > just fine.  There is something here that I too am missing. :-)
> 
> Which is that for() and foreach() set the loop variable ($_ here, by
> default) to an alias for the data in the original list. So if you change
> $_, you also change its value in the @filelist array, which is what is
> happening here: $_ is being clobbered by the while(). I suppose the
> print() is actually spitting out EOF chars in place of the original
> filenames. Try inserting 'local $_' at the beginning of the sub and
> you'll have better results.

Thank you, I still have much to learn, and now a little less.

Regards,

anm
-- 
/*-------------------------------------------------------.
| Andrew N. McGuire                                      |
| anmcguire@ce.mediaone.net                              |
`-------------------------------------------------------*/


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

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


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