[10224] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3817 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 24 19:07:21 1998

Date: Thu, 24 Sep 98 16:00:27 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 24 Sep 1998     Volume: 8 Number: 3817

Today's topics:
        64K Limit on @Lines=<FILEIN> for Perl NT? <caitlin@nospam.intranet.ca>
    Re: 64K Limit on @Lines=<FILEIN> for Perl NT? <evonzee@tritechnet.com>
        ^@ problem <dahnmich@egr.msu.edu>
        ANNOUNCE: CNET Builder.com Live! New Orleans '98 (CNET Builder.com Live!)
    Re: any way to encrypt my script? bitnut1@my-dejanews.com
        Bug in Net::FTP for ActivePerl? <pan@part.net>
    Re: Getting dialup dynamic IP (David Hawker)
        getting open(FH, "| tee $filenameVar"); to work (won't  <ngrossman@searchathome.com>
    Re: getting open(FH, "| tee $filenameVar"); to work (wo <uri@camel.fastserv.com>
        Help with uuencoding for MSMail <95ncp@eng.cam.ac.uk>
    Re: Help with uuencoding for MSMail <95ncp@eng.cam.ac.uk>
    Re: Help with uuencoding for MSMail (Mads Toftum)
        Many processes communication - How To? <sergio@mail.pt>
        New mailing list: perl-announce@perl.org <gnat@frii.com>
        newbie array question <jgdean@columbus.rr.com>
    Re: newbie array question (Sean McAfee)
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl debugging in windows.... <evonzee@tritechnet.com>
    Re: Perl GMTIME?? (Craig Berry)
    Re: Poll: How Did You Learn Perl? <rkoehler@osmre.gov>
    Re: Poll: How Did You Learn Perl? birgitt@my-dejanews.com
    Re: portable open() <jdf@pobox.com>
    Re: Quick question about perl (Craig Berry)
    Re: Retrieve cgi results to file rather than to display (David D. Wertman)
        Run CGI as Root using Perl <glahea@wwdsi.com>
    Re: Simple, efficient way of checking whether $VAR is a <doug@weboneinc.com>
        Undefined subroutine &main::read_and_parse_form_data ca <silk_stockings@mailexcite.com>
    Re: Where to put cgi-lib.pl <evonzee@tritechnet.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 24 Sep 1998 21:22:20 GMT
From: "Caitlin" <caitlin@nospam.intranet.ca>
Subject: 64K Limit on @Lines=<FILEIN> for Perl NT?
Message-Id: <gKyO1.6586$I72.2313373@news.rdc1.on.wave.home.com>

Is there a limit on how much data can be read from a text file
using a statement similar to the following:

@Lines = <FILEIN>;

I'm running Perl for NT Version 5.003, Build 316

Any clues would be appreciated.

Caitlin




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

Date: Thu, 24 Sep 1998 16:31:34 -0500
From: Eric Von Zee <evonzee@tritechnet.com>
Subject: Re: 64K Limit on @Lines=<FILEIN> for Perl NT?
Message-Id: <360ABA36.744433E3@tritechnet.com>

Hi Caitlin...

I don't _think_ there is a 64k limit...

I read in a 650k flat file database (ugh...) in a shopping cart script
in exactly that manner, and never had a problem.

Maybe something to do with the machine perl runs on?

HTH,

-Eric

Caitlin wrote:

> Is there a limit on how much data can be read from a text file
> using a statement similar to the following:
>
> @Lines = <FILEIN>;
>
> I'm running Perl for NT Version 5.003, Build 316
>
> Any clues would be appreciated.
>
> Caitlin

--
Best Regards,
Tritech Marketing Inc.

Eric Von Zee
Webmaster




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

Date: Thu, 24 Sep 1998 17:24:05 -0400
From: dahnmich <dahnmich@egr.msu.edu>
Subject: ^@ problem
Message-Id: <Pine.GSO.4.03.9809241715110.9861-100000@recs>

[If this has been posted to the wrong newsgroup, my apologies]

I am using a Perl script for Win32 (NT) and having a problem with one
aspect of it.  I am using the line 
$EventList[$eventsfound] =("\t$recordnumber $twritten 
                            $source $id $strings \n");
to concatenate strings and add them sa one big string to a hash table.
Then I use the SMTP module (from Activestate) to mail the contents of the
hash table to me using:
foreach(@EventList) { $smtp->datasend("$_"); }

Only problem is that I am getting a "^@" added to the end of each line (or
each element of the hash table".  I have tried using:
$EventList[$eventsfound] =~ s/\^@//g; to remove it.  But I think that the
^@ is some sort of control character.  Has anyone ever experienced this
before?  

Thanks,
Mike
-----
Write in Perl! 



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

Date: Thu, 24 Sep 1998 15:31:26 -0700
From: builderlive@cnet.com (CNET Builder.com Live!)
Subject: ANNOUNCE: CNET Builder.com Live! New Orleans '98
Message-Id: <builderlive-2409981531260001@10.10.64.97>


ANNOUNCING:    CNET Builder.com Live! New Orleans '98
               December 7 to 9
               http://www.builder.com/live

The center of the Web universe moves to New Orleans when CNET Builder.com
Live! blows into town this December. Created by Web professionals for Web
professionals, this unique conference is your chance to learn from the
experts who are changing the world through the Web. You'll score insider
technical information you won't find anywhere else. You'll meet interesting
people who share your goals and challenges. You'll sharpen your edge. And
you'll do it all in New Orleans.

Visit the online conference brochure for complete information and to
register.  http://www.builder.com/live


NEW AND IMPROVED!
Check out these exciting changes that will make CNET Builder.com Live! an
even better place to learn the best techniques and strategies for building
successful Web sites.

* Conference tracks devoted to your specific needs: Designer, Developer,
and Producer.

* Optional tutorials on NetObjects Fusion, Allaire ColdFusion, Macromedia
Dreamweaver, Adobe Photoshop and ImageReady, XML, JavaScript, DHTML, and
ASP.

* Special one-day Bring Your Boss conference-within-a-conference.  It's
a strategic brain upgrade to executives making the difficult business,
technology, and resource decisions.

* Parallel People peer networking service to connect you with attendees
who share your job, industry, or technical interest.

* Exciting activities and parties with a unique New Orleans flavor.

* A new name! CNET Builder.com Live! reflects the high quality information
you expect from Builder.com, the leading independent site for site builders.


REGISTER NOW--SAVE MONEY
Sign up by October 23 and save $200 off onsite registration.  For complete
information and to register, visit our online conference brochure at
http://www.builder.com/live


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

Date: Thu, 24 Sep 1998 21:52:22 GMT
From: bitnut1@my-dejanews.com
Subject: Re: any way to encrypt my script?
Message-Id: <6ueeum$6cs$1@nnrp1.dejanews.com>



A "shc" created executable works fine from command line
but fails when run as a CGI script (with the infamous
"500" error; it does not carp out any message).

B.N.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 24 Sep 1998 15:38:22 -0600
From: "Eric Pan" <pan@part.net>
Subject: Bug in Net::FTP for ActivePerl?
Message-Id: <360abb72.0@news.slc.bfp.net>

I have wrote a simple code:

use Net::FTP;

$ftp = Net::FTP->new("ftp.microsoft.com",Debug=>1) or die "1. $!\n";
$ftp->login("anonymous","user\@abc.com") or die "2. $!\n";
print "pwd = " , $ftp->pwd(), "\n";
print "ls = " , join("\n",$ftp->dir()), "\n";
$ftp->get("dirmap.txt","dirmap.txt") or die "4. $!\n";
$ftp->quit;

and run it in WinNT 4.0 SP 3 Perl5001 Build 501 and I get the following
results:

Net::FTP: Net::FTP(2.33)
Net::FTP:   Exporter
Net::FTP:   Net::Cmd(2.11)
Net::FTP:   IO::Socket::INET
Net::FTP:     IO::Socket(1.1603)
Net::FTP:       IO::Handle(1.1505)

Net::FTP=GLOB(0xcb6d40)<<< 220 ftp Microsoft FTP Service (Version 3.0).
Net::FTP=GLOB(0xcb6d40)>>> user anonymous

Net::FTP=GLOB(0xcb6d40)<<< 331 Anonymous access allowed, send identity
(e-mail name) as password.
Net::FTP=GLOB(0xcb6d40)>>> PASS ....
Net::FTP=GLOB(0xcb6d40)<<< 230-This is FTP.MICROSOFT.COM
Net::FTP=GLOB(0xcb6d40)<<<  230-Please see the dirmap.txt file for
Net::FTP=GLOB(0xcb6d40)<<<  230-more information. An alternate
Net::FTP=GLOB(0xcb6d40)<<<  230-location for Windows NT Service
Net::FTP=GLOB(0xcb6d40)<<<  230-Packs is located at:
Net::FTP=GLOB(0xcb6d40)<<<  230-ftp://198.105.232.37/fixes/
Net::FTP=GLOB(0xcb6d40)<<< 230 Anonymous user logged in.
Net::FTP=GLOB(0xcb6d40)>>> PWD

Net::FTP=GLOB(0xcb6d40)<<< 257 "/" is current directory.
Net::FTP=GLOB(0xcb6d40)>>> PORT 10,0,1,137,0,0

Net::FTP=GLOB(0xcb6d40)<<< 500 Invalid PORT Command.
Net::FTP=GLOB(0xcb6d40)>>> PORT 10,0,1,137,0,0

Net::FTP=GLOB(0xcb6d40)<<< 500 Invalid PORT Command.
4.
pwd = /
ls =
Net::FTP=GLOB(0xcb6d40)>>> QUIT

Net::FTP=GLOB(0xcb6d40)<<< 221 Thank you for using FTP.MICROSOFT.COM!


The code works fine on UNIX but no on WinNT. Please help. Thanks.

--
-- Eric Pan




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

Date: Thu, 24 Sep 1998 22:24:10 +0100
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Getting dialup dynamic IP
Message-Id: <360cb671.1506054@localhost>

I just discovered if you leave the local hostname undef, you can access
both 'localhost' and Internet domains. And to get the local port, IP and
hostname, you can use getsockname() on the connected socket. (This is in
perl5_32 version 5.004_02, dunno if it'll work in earlier or 16-bit
versions)

Here's some example code:

use Socket;
$sockpat = 'S n a4 x8';
$proto = (getprotobyname('tcp'))[2];
$thisaddr = (gethostbyname(''))[4];
$this = pack($sockpat,AF_INET,0,$thisaddr);
$thataddr = (gethostbyname('ftp.areti.co.uk'))[4];
$that = pack($sockpat,AF_INET,21,$thataddr);
unless (socket(S,AF_INET,SOCK_STREAM,$proto)) {print "Unable to create
socket: $!";  exit}
unless (bind(S,$this)) {print "Unable to bind socket: $!";  exit}
if (connect(S,$that)) {print "Connected\n"}
else {print "Can't connect: $!\n"; exit}
$sockaddr = getsockname(S);
($port, $myaddr) = unpack_sockaddr_in($sockaddr);
($a,$b,$c,$d) = unpack("C4",$myaddr);
print "Port = $port, IP = $a.$b.$c.$d\n";
$name = gethostbyaddr($myaddr,AF_INET);
print "Hostname = $name\n";
exit;


On Sat, 22 Aug 1998 14:24:47 GMT, dhawker@bigfoot.com (David Hawker) felt
the need to post:

>Is there any way I can get my perl script to automatically obtain my
>dynamic IP address whenever I dialup? Perhaps a winsock call? I'm running
>Windows 95 and perl 5.004_02 for DOS.
>
>Currently I'm using a cgi script to send me the $ENV{REMOTE_HOST} data
>which I then paste into the local perl script as my hostname.


--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org


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

Date: Fri, 25 Sep 1998 16:31:53 -0400
From: Nick Grossman <ngrossman@searchathome.com>
Subject: getting open(FH, "| tee $filenameVar"); to work (won't convert var name)
Message-Id: <360BFDB9.3693FDE2@searchathome.com>

I'm trying to set up a tee to a dynamic file name (can't hard-code the
file name). I've read the man 
perlfaq5 section of writing to multiple files at the same time, and it
suggests using tee in this maner. 
However, it doesn't convert the variable name, it tries to write a file
called "$filenameVar". Is there 
any way to force Perl to conver the file name as it would with a
non-teed open()? 

this is what I've tried:

    $filemaneVar=$input{'MyVar'}; 
    open (FH1, "|tee $filenameVar") or die("Can't open file
$filenameVar");

I've also tried single quotes, double quotes, and a bunch of other stuff
that doesn't work.

Does anyone know of a work-around or remedy to this?

Thanks!!

Nick Grossman


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

Date: 24 Sep 1998 17:06:00 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: Nick Grossman <ngrossman@searchathome.com>
Subject: Re: getting open(FH, "| tee $filenameVar"); to work (won't convert var name)
Message-Id: <saru31xw79j.fsf@camel.fastserv.com>

>>>>> "NG" == Nick Grossman <ngrossman@searchathome.com> writes:

if this is real code then you have a spelling problem

  NG>     $filemaneVar=$input{'MyVar'}; open (FH1, "|tee $filenameVar")
               ^ ^
  NG> or die("Can't open file $filenameVar");

otherwise it should work fine with "".

hth,

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Thu, 24 Sep 1998 22:24:37 +0100
From: Nigel Parker <95ncp@eng.cam.ac.uk>
Subject: Help with uuencoding for MSMail
Message-Id: <Pine.HPP.3.96L.980924222013.17940A-100000@club.eng.cam.ac.uk>


I have the following routine for uuencoding a file for an email to be read
in MSMail (ie crappy mail program):

sub uu_encode {
      my ($in) = @_;
      pos($in)=0;
      @in = ($in =~ m/.{1,45}/gs);
      return join("", "begin 644 rfp.html\n", pack("u", @in), "end\n");
}

Does anyone know why this doesn't work?  Is the "644" uucode number wrong
(this is the default I believe)?  Is there some MSMail peculiarity which
is making this appear garbled in MSMail?

Any help would be much appreciated.

Cheers.


Nigel
-- 
Girton College, Cambridge, England, CB3 0JG.             Tel: 0411 384803

http://welcome.to/nigels                             nigel.parker@iee.org



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

Date: Thu, 24 Sep 1998 22:46:01 +0100
From: Nigel Parker <95ncp@eng.cam.ac.uk>
Subject: Re: Help with uuencoding for MSMail
Message-Id: <Pine.HPP.3.96L.980924224245.17940B-100000@club.eng.cam.ac.uk>

On Thu, 24 Sep 1998, Nigel Parker wrote:

: sub uu_encode {
:       my ($in) = @_;
:       pos($in)=0;
:       @in = ($in =~ m/.{1,45}/gs);
:       return join("", "begin 644 rfp.html\n", pack("u", @in), "end\n");
: }

I've just discovered that this is doing only the first 45 characters, so
I'm getting close!  I thought using "g" (global match) returns a list of
matching strings?  Does it need "\G" in there as well?

Cheers.


Nigel
-- 
Girton College, Cambridge, England, CB3 0JG.             Tel: 0411 384803

http://welcome.to/nigels                             nigel.parker@iee.org



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

Date: Thu, 24 Sep 1998 21:52:01 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: Help with uuencoding for MSMail
Message-Id: <360fbe7d.9061313@news.inet.tele.dk>

Grab MIME-tools from CPAN and save yourself the trouble of having to
do all the work yourself.




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

Date: Thu, 24 Sep 1998 22:56:37 -0300
From: Sergio Bernardo <sergio@mail.pt>
Subject: Many processes communication - How To?
Message-Id: <360AF855.AE7B710@mail.pt>

Hi all,

I'm relatively new to Perl programming, but have already 
done some interesting things whith it! ;-)
Now I'm trying to do someting whitch must run as fast as
it can :)

The program has a big initial processment, and must load
a lot o data into memory to make the right choices at the
right time, at the fastest speed...

So... my idea was to make some kind of a daemon, always
in memory, and small clients to ask the questions very
quickly.

Also, all the clients must be serialised, it cannot be
2 or more clients asking a question to the daemon at a time!

I've read perlipc man page, and tryed to use named pipes:

DEAMON read from pipe_A, process, write to pipe_B
CLIENTS write to pipe_A, read from pipe_B

I thowgth the pipes automaticaly serialize que clients...

Well... it is not working... perhaps i'm not using the
open() and close() correctly... perhaps the pipes are
not the solution... 

Any other solutions?

Thanks in advance!

Sergio Bernardo
sergio@mail.pt


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

Date: 24 Sep 1998 15:49:25 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: New mailing list: perl-announce@perl.org
Message-Id: <5qg1dhgp0a.fsf@prometheus.frii.com>

The Perl Institute is proud to offer a low-volume mailing list for
people who only want announcements of new stable versions of Perl.  To
join, send mail to:
	majordomo@perl.org
with the body of your message reading:
	subscribe perl-announce

The only people permitted to send mail to list subscribers are the
pumpkings.

Any problems or questions, please contact your friendly Perl Institute
at <tpi@perl.org>.

Cheers;

Nat


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

Date: Thu, 24 Sep 1998 18:03:24 -0400
From: James Dean <jgdean@columbus.rr.com>
Subject: newbie array question
Message-Id: <360AC1AC.EE19DE3@columbus.rr.com>

I have a very simple app built in Javascript that assigns three
different variables to each element of an array. Example :

     group[0].reg == "east"
     group[0].name == "Martha"
     group[0].email == "Martha@m.com"

    group[1].reg == "west"
   etc.,

What is the perl equivalent? How do I assign (and reference) multiple
values to each array element? I've been searching through documentation
but haven't quite found the answer.
Is it just a more complicated hash list?
Excuse my ignorance.

Thanks,
JD
jgdean@columbus.rr.com
"Watch me now I'm 'onna eat the label"    - fz



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

Date: Thu, 24 Sep 1998 22:39:23 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: newbie array question
Message-Id: <vSzO1.4625$F7.17119217@news.itd.umich.edu>

In article <360AC1AC.EE19DE3@columbus.rr.com>,
James Dean  <jgdean@columbus.rr.com> wrote:
>I have a very simple app built in Javascript that assigns three
>different variables to each element of an array. Example :

>     group[0].reg == "east"
>     group[0].name == "Martha"
>     group[0].email == "Martha@m.com"
>    group[1].reg == "west"
>   etc.,

>What is the perl equivalent? How do I assign (and reference) multiple
>values to each array element? I've been searching through documentation
>but haven't quite found the answer.

You'll want to read the perlref and perldsc manual pages.

There's More Than One Way To Do It:

$group[0]{reg}   = 'east';
$group[0]{name}  = 'Martha';
$group[0]{email} = 'Martha@m.com';
$group[1]{reg}   = 'west';

Or:

@{$group[0]}{reg, name, email} = qw(east Martha Martha@m.com);
@{$group[1]}{reg, name, email} = qw(west Crow   Crow@sol.net);

Or:

@group = (
	{ reg => 'east', name => 'Martha', email => 'Martha@m.com' },
	{ reg => 'west', name => 'Crow',   email => 'Crow@sol.net' },
	# ...
);

Or:

sub newhash { my %hash; @hash{reg, name, email} = @_; \%hash }

@group = (
	newhash(qw/east Martha Martha@m.com/),
	newhash(qw/west Crow   Crow@sol.net/),
	# ...
);

 ...Or many other ways besides.

>Is it just a more complicated hash list?

It can be as much or as little complicated as you want it to be.

>Excuse my ignorance.

No problem.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Thu, 24 Sep 1998 17:34:23 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360ABADF.F9113B07@min.net>

George Reese wrote:
> 
> In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
> : If (hypothetically) Java supported some mechanisms which are, by
> : definition, functional in nature, would you advise Java programmers
> : not to make use of them, being as how they are not OO features?
> : Or, possibly, would you recommend that OO practitioners consider
> : a different language, one which doesn't dilute the purity of OO?
> 
> : If you have a hard time relating this question to Java per se,
> : think of a hypothetical language which is better than Java in
> : all OO respects, but with the addition of the aforementioned
> : functional features.
> 
> If there were one and only one functional feature in the language?  I
> would advise people not to use the feature.  If the language became
> polluted with functional constructs, I would advise the abandonment of
> the language.

Okay!  Thanks.


> :> Method pointers/closures/functionals etc are not inherently
> :> functional.
> 
> : I can only assume from this that you don't know Lisp.
> 
> I know lisp.  Because their appearance in Lisp is purely functional,
> why is it that their appearance in another language must also be so?

Um, I don't agree with you that a feature can be functional in one
language and not functional in another.  A functional feature is
functional, by definition.

-- 
John "Many Jars" Porter


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

Date: Thu, 24 Sep 1998 17:42:52 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360ABCDC.4839F8A2@min.net>

Larry Rosler wrote:
> 
> Xavier Cousin <cousin@ensam.inra.fr> says...
> > WWW questions : Isn't this slowing the net ?
> 
> See the "Tragedy of the Commons" (Garret Hardin, 1968).  Individuals
> behave to optimize their own perceived benefit, without regard to the
> global impact of their behavior.

Shoot, I was thinking you were going to say
"The Tragedy of the Commons: the increasingly widespread notion
that all protocols layered on top of IP can be collectively
refered to as 'WWW'".

-- 
John "Many Jars" Porter


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

Date: Thu, 24 Sep 1998 17:50:55 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360ABEBF.6CC21A10@min.net>

Zenin wrote:
> 
> George Reese <borg@imaginary.com> wrote:
> : No behaviour, no objects.  There is nothing a language can do to
> : enforce that.
> 
> You now offer proof that regardless of the language, "enforcement"
> of one paradigm or another is impossible?  If so, we agree.

I don't agree.

I believe that it is possible, in principle at least, for a
language to "enforce" OOP.  Whether or not such a language
exists is, to me, a less interesting question.


> Now by this statement, can we infer that it is acceptable for a
> language to not "enforce" one paradigm or another, based on the
> above proof that it simply can not be done?
> 
> Following this line, Perl can not be bad simply because it does not
> enforce a paradigm.

Right, not "simply" for that reason.

But shifting from Enforcing to Supporting, it can easily be
argued that 
	( Better-OO-Support(X) => Better-Language(X) ) 
		=> Worse-Language(Perl)

-- 
John "Many Jars" Porter


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

Date: 24 Sep 98 22:17:06 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906675662.588683@thrush.omix.com>

Joseph Allen Dane <jdane@hawaii.edu> wrote:
: Zenin <zenin@bawdycaste.org> writes:
:  [ closure stuff ]
: > 
: > 	Java can not do this.  Not with interfaces, inner classes, or
: > 	anything else (well, except for JPL <evil grin>).
:
: Are you sure about this?

	Yes.

: Look at the following and tell me what makes it different from what you are
: talking about above.

	You are passing by value data to be held later in an object.  You
	can not for instance, create an int foo and pass it to c.closureMaker()
	to be held in the same scope.

: Admittedly, the syntax required above is nasty, but unless I'm missing
: something it does what you say can't be done in Java.

	It can not hold a copy of the real run time environment, only a
	copy of it.

	The difference is that an object is data that "knows" how to
	work on itself, where a closure is the work that "knows" what
	data to work on.

: In fact, the interactions between the OO system and the lexical name
: resolution required for the closures above to work are partly to blame
: for the heinous syntax, from what I gather.

	But it is not a closure, that's part of the problem.  You can not
	for instance, do:

		int foo = 10;
		closure c = new closure();
		printer p10 = c.closureMaker(foo);
		foo = 20;
		p10.print();

	And have it print 20.  The context and scope of foo is not
	maintained.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 24 Sep 98 22:26:54 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906676248.988185@thrush.omix.com>

George Reese <borg@imaginary.com> wrote:
: In comp.lang.java.programmer Zenin <zenin@bawdycaste.org> wrote:
: : George Reese <borg@imaginary.com> wrote:
: : : Inner classes should be avoided like the plague for the most part.
: :
: : 	IYO, of course.
: :
: : 	Please be carful not to phrase your opinions as declarations,
: : 	at least without sighting proof.
:
: You are such a prick.  I cite proof.

	I never said you didn't.

: I stated that they open up your
: private fields to external classes that would not otherwise have such
: access.  What about that is not proof?

	Nothing.  It's perfect proof.  	I never said it wasn't.

	Your comments, true or false, with or without proof are still your
	opinions as well.  I only asked you to to "phrase your opinions as
	declarations, at least without sighting proof", I never made any
	mention that you have not provided proof for this particular
	statement.

	Am I playing semantic games?  Hell yes.  That's my real point.  Can
	you now see why we distain your use of similar semantic games?

	-If that wasn't clear enough, here's the short form.  I made that
	comment to get a rise out of you for the sole purpose of showing
	you what it feels like when someone plays semantic games.  I think
	I proved my point. :-)

	>snip<
: : 	In the functional programming paradigm this is considered a
: : 	feature.  Beyond that, it is a form of encapsulation.  Not object
: : 	based encapsulation of course, but encapsulation none the less.
:
: Well, Java does not support the functional programming paradigm.  Only
: a tiny small part of inner classes are designed even to work as event
: handlers. 

	Now, in your opinion do inner classes lean more to the paradigm
	of OO or more to that of functional programming?

	And yes, this is a loaded question. ;-)

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 24 Sep 1998 22:43:55 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906676977.463820@thrush.omix.com>

John Porter <jdporter@min.net> wrote:
	>snip<
: But shifting from Enforcing to Supporting, it can easily be
: argued that 
: 	( Better-OO-Support(X) => Better-Language(X) ) 
: 		=> Worse-Language(Perl)

	Which now brings us full circle and re-asks the question, what
	is missing from Perl's OO support (current perl, not < 5.005)
	that other languages with "better" OO support have?

	The primary arguments so far have been about encapsulation, which
	as of 5.005 is now mute.  Any

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 24 Sep 1998 22:52:25 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906677486.935785@thrush.omix.com>

Zenin <zenin@bawdycaste.org> wrote:
: John Porter <jdporter@min.net> wrote:
: 	>snip<
: : But shifting from Enforcing to Supporting, it can easily be
: : argued that 
: : 	( Better-OO-Support(X) => Better-Language(X) ) 
: : 		=> Worse-Language(Perl)
:
: 	Which now brings us full circle and re-asks the question, what
: 	is missing from Perl's OO support (current perl, not < 5.005)
: 	that other languages with "better" OO support have?
:
: 	The primary arguments so far have been about encapsulation, which
: 	as of 5.005 is now mute.  Any

	Damn buggy tin newsreader...

	Anyway, to finish what I was saying, I would like to challenge
	that the current OO support set of Perl rivals most other
	common OO languages such as Python and Java.

	Anyone like to actually challenge Perl's OO support?  So far, no
	one has doen so in this thread and it could be interesting.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 24 Sep 1998 16:27:28 -0500
From: Eric Von Zee <evonzee@tritechnet.com>
To: shellymargolis@erols.com
Subject: Re: Perl debugging in windows....
Message-Id: <360AB93F.70484DA5@tritechnet.com>

Hiya Greg,

Why dontcha download perl onto your local HD?  That's what I did before I
had access to a decent telnet shell..

Visit: http://www.perl.com/pace/pub/perldocs/latest.html

HTH,

-Eric

Greg Feingold wrote:

> I am new to programming in Perl and am hoping someone can help me with a
> problem...
>
> When I create a Perl script (as a text file) and upload it to my ISP and
> then run the program from my browser by putting in the URL, I either get
> the output I desire or the infamous
> "Internal Server Error" message....is there ANYWAY to get some sort of
> debugging program, module, or code to give me the errors when the Perl
> script compiles?
>
> The problem is our ISP does not allow us to Telnet into their system so
> I could just do a simple perl -d debugging execution.
>
> I would really appreciate help asap.
>
> Thanks,
>
> Greg Feingold

--
Best Regards,
Tritech Marketing Inc.

Eric Von Zee
Webmaster




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

Date: 24 Sep 1998 22:37:03 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl GMTIME??
Message-Id: <6uehif$bn5$2@marina.cinenet.net>

thief (marlboro9@hknet.com) wrote:
: I'm use matt's guestbook,How Can I put a script into the gbook.pl to get
: the GMTime??

Dear *god*.  Did you try searching the perlfunc man page (html page,
perldoc output stream, clay tablet, or whatever) for the string 'gmtime'?
Why ask on Usenet, accepting an hours-long delay for answers which might
not be accurate, when all the data you need is *right there on your
system*, and in this case the most brain-damaged search tool, and least
capable search tool user, could find it in five seconds?

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Thu, 24 Sep 1998 21:17:27 GMT
From: "Rick Koehler" <rkoehler@osmre.gov>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <Ezt4FM.H63@igsrsparc2.er.usgs.gov>

As if, my intro came by way of perldocs (v. 4, circa 1992).
It was, for me, a time of baby steps, and I didn't walk very far
for a long time (needed to learn other things?).
Still feel like I'm a toddler (need more hubris, I guess).

Depend largely on Camel v.2, supplemented by
feeble reasoning combined with trial and error;
Gecko v.1 for those days when I'm a'feelin' aNTsy,
various tutorials and code snippets discovered here and there,
perldocs, comp.lang.perl.misc, certain other unmentionable texts,
and hope to snag the Perl Cookbook asap.

Gecko good for lots of stuff, but Camel is best when I need
to extract the "one, true answer" ... it just can be difficult
digging out the kernels one needs from the vastness.
The latter statement reminds me of: "stupid TV, be more funny!"

--
from the Land of         antmen ...
Rick K.
"Let's go around the table and introduce ourselves" - Buddha




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

Date: Thu, 24 Sep 1998 21:28:56 GMT
From: birgitt@my-dejanews.com
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6uedio$530$1@nnrp1.dejanews.com>

In article <360923EC.8E9919D0@min.net>,
  John Porter <jdporter@min.net> wrote:
>
> From what resource(s) did you learn Perl?
>
> . Llama v.1
> . Llama v.2
>  . Camel v.1
> X. Camel v.2
> X  Other book (give name) - too many - Regular Expressions, some German
Perl                                            books
> X. Docs included in the distribution
> X. Something on the WWW
> X. Studying existing code
> . Class/tutor
>

started learning Perl.

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 25 Sep 1998 00:00:09 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: Joe Spinney <jspin@csd.sgi.com>
Subject: Re: portable open()
Message-Id: <m37lytkw7q.fsf@joshua.panix.com>

Joe Spinney <jspin@csd.sgi.com> writes:

> To make it portable, I was wondering the Windows equivalent to the
> following:
> 
> open(FILE, "< file_name");    # read

That would be

  open(FILE, "< file_name");

I.e., there is no difference. If you plan to read and write binary
data, make sure you use the binmode() builtin.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 24 Sep 1998 22:33:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Quick question about perl
Message-Id: <6uehc8$bn5$1@marina.cinenet.net>

Yogish Baliga (baliga@synopsys.com) wrote:
:    You can use backquotes ( ` ) to execute a system command. If you are
: working on any UNIX platform use,
: 
:   $date_variable = `date`;

You certainly *can* do that, but why limit yourself to platforms with a
unixish date command, and pay the price for spawning a shell command, when

  $date_variable = localtime;

does the same thing platform-independently and with less overhead?

Do be very careful about using localtime in printing things out, though.
This function acts very differently in scalar and list context (perldoc
-f localtime for details), so doing

  print "The time now is ", localtime, "\n";

will surprise the heck out of you unless you understand the difference.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Thu, 24 Sep 1998 22:00:03 GMT
From: David@WebChamps.com (David D. Wertman)
Subject: Re: Retrieve cgi results to file rather than to display
Message-Id: <360bc0b4.28938381@204.210.223.20>

On 24 Sep 1998 18:38:23 GMT, "Sean Scannell" <dundee@dnai.com> wrote:

>I want to run a script using crontab to periodically send form data to a
>cgi.  Then I want to retrieve those results to file rather than display so
>I can perform text searching.  How do I do this?  

Just code it pretty much as you described the process. 
And that should about do it.

David




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

Date: Thu, 24 Sep 1998 17:39:58 -0400
From: "Aaron Glahe" <glahea@wwdsi.com>
Subject: Run CGI as Root using Perl
Message-Id: <6uee9r$sp4$1@callisto.clark.net>

Sorry, I am new to Perl.  I was wondering how I have a perl
script (script.pl) run as root & not as the web server user.group
I have set the "s bit"

chmod u+s  script.pl
chmod g+s script.pl

In the script.pl file I have the two lines
$< = $>;
$( = $);
which I was told does the same thing as seteuid() & setuid().  I am also
running using the -U option.

What I am doing is creating a command line using the perl script, then
I am passing it to "batch" to run the commands (to keep the load down).
However, when batch gets the command line it runs as the
web server uid and gid.

I quess I have two questions:

1.  I have Slakware 3.5, which came with perl 5.0004 right out of the box.
Do I need to recompile perl to allow me to do this.  In RedHat, I
did not have to do anythnig.  Out of the box I could run as root.

2.  Am I missing something with in my code.  Are those two lines the
same as seteuid() & setuid().

Thanks in advanced.




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

Date: Thu, 24 Sep 1998 17:02:39 -0400
From: Douglas Clifton <doug@weboneinc.com>
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <360AB36F.531AE252@weboneinc.com>

Uri Guttman wrote:
[bitch, whine, make myself look important]

The original poster wanted a simple built-in to test whether a string is a
member of a list. We all know `exists' is the easiest way to test for a
defined key in a hash. Sure, using grep is not particularly suitable for
anything other than a short list, but it is simple/understandable solution.

-- 
Douglas Clifton
Unix/C/Perl/CGI/HTML Programmer
doug@weboneinc.com


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

Date: Thu, 24 Sep 1998 18:05:11 -0400
From: APH <silk_stockings@mailexcite.com>
Subject: Undefined subroutine &main::read_and_parse_form_data called at web_store.cgi lin
Message-Id: <360AC216.EE54186E@mailexcite.com>

Undefined subroutine &main::read_and_parse_form_data called at
web_store.cgi lin

where would i look to fix this and how?



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

Date: Thu, 24 Sep 1998 16:23:48 -0500
From: Eric Von Zee <evonzee@tritechnet.com>
Subject: Re: Where to put cgi-lib.pl
Message-Id: <360AB864.28D78901@tritechnet.com>

> Oh go on! You STRANGE have a sure way of doing things!

Strange has a sure way of doing things?  All-righty-then....

>Where does this 'BEGIN' block go? Oh, you mean in his *CGI* script, which he

> has placed in the *cgi*-bin (or where ever the web server is configured to
> look for *CGI* scripts)? I assumed he could put cgi-lib.pl in the same
> place, since he has access to it for his *CGI* script. But, I guess you know
> where you can put it!

Looks  to me like s/CGI/Perl/gm works here just peachy...


> Of course, this has NOTHING to do with Perl!

Is that a fact?  So, by virtue of being used on the Web, do Perl scripts somehow
lose their 'Perlness'?

Have a nice day.

--
Best Regards,
Tritech Marketing Inc.

Eric Von Zee
Webmaster




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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 V8 Issue 3817
**************************************

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