[15615] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3028 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 12 14:08:57 2000

Date: Fri, 12 May 2000 11: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: <958154714-v9-i3028@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 12 May 2000     Volume: 9 Number: 3028

Today's topics:
    Re: #How to parse and strip perl comments? <bernie@fantasyfarm.com>
        A couple of quick questions <ke77le@my-deja.com>
    Re: A couple of quick questions nobull@mail.com
    Re: Accidental Creation of Static Variable (Abigail)
    Re: Activestate Perl 5.6 crashes <scott@sabami.seaslug.org>
    Re: Beginner: 8bit-regexp <ocromm@icsd4.tj.chiba-u.ac.jp>
    Re: CGI::Carp - Non fatal errors (Jerome O'Neil)
    Re: Difficuly psting to a web site. Maybe a Port issue! <mkhan@crosscom.com>
    Re: Extending URI::URL <rootbeer@redcat.com>
        Gtk Perl <jens@irs-net.com>
        Help With code Snippet <skpurcell@hotmail.com>
    Re: Help With code Snippet <Frederic.Aussedat@Alcatel.fr>
    Re: How do you create a module and pass variables into  (Lou Hevly)
    Re: Ideas on how to automatically fill out and send for <tony_curtis32@yahoo.com>
    Re: Is this new language possible in perl? <thunderbear@bigfoot.com>
    Re: Is this new language possible in perl? <Frederic.Aussedat@Alcatel.fr>
    Re: MacPerl: access to floppy and harddisk? <rootbeer@redcat.com>
    Re: Need to make UNIX autoresponder <bruce@conde-dev.com>
    Re: PERL exe? <rootbeer@redcat.com>
        Perl question <chj005@email.mot.com>
    Re: PerlIS and IIS5 on Windows 2000 rls@one.net
        ppm hotfix <waldo700NOwaSPAM@aol.com.invalid>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 12 May 2000 11:50:12 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: #How to parse and strip perl comments?
Message-Id: <n0aohs80f6nj1g00e4omjanu7q5onvge1g@news.supernews.com>

Peter Hill <phill@modulus.com.au> wrote:

} Abigail wrote:
} > 
} > In article <390E2796.3D1E@modulus.com.au>, Peter Hill wrote:
} > >
} > >No. My code is sufficiently obscure as it is, and needs no help in that
} > >direction - I'm just production prepping some heavily (indeed
} > >excessively) commented code.
} > 
} > That begs the question, why can't production code have comments?

} No reason, indeed. But nor does it beg the question. I want to strip the
} existing comments which are excessive,
} inappropriate and in some cases just plain wrong, since they were
} written at the level of "the next line does 'blah'". I'll then replace
} them with appropriate notes for any particular choices which may not be
} self evident from the code, which would seem to be better commenting
} practice than writing pseudo-code which *may* or *may not* reflect what
} the following code actually does in perl.

Well, been there, done that, and IMO you're going about it wrong.  Two
things: when I've had to do this in the past, I've had better results going
over the old code section-by-section, and just deleting the old comments
[or rewriting them] by hand.  It seems that starting with a 'naked'
uncommented program could get you in trouble if you miss some trickery or
the like.

Moreover, I've found that in general, folk who comment this way are
-usually- not-so-good coders.  It may well not be true in your case, but
again, in my experience, I've found that in a lot of cases what I've ended
up doing is not just deleting the _comments_, but deleting the *code*
too... once you puzzle it out and "oh THAT'S what this is doing..." often a
rethinking of the code will get you a better program AND better comments...


As for comments-on-commenting style, I'll just mention that what I teach
[and mentor the folks who work for me] is that programs are for *PEOPLE* to
read.  Programmers who think that the 'code' is for the computer and the
comments are for people just don't have it right.  And so as you write your
code, before you put in a lot of comments you should *FIRST* be looking at
your code _itself_ and asking "is the execution structure perfectly clear?"
"is it obvious what's going on" "will the next programmer who has to look
at this be able to easily apprehend what's happening".  THEN, when you've
made the code as lucid and clean as you can make it, _only_then_ you put in
a *few* comments to highlight things that a code-reader might miss...

This is where Perl's "TMTOWTDI" aspect either shines [for the really good
programmers] or is a curse [for the losers]: with a LOT of choice of how
you'll do things, you have the ability either to pick-well and make your
code beautiful and robust and easy to maintain and understand... or you
have the ability to virtually-encrypt what you've done.

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Fri, 12 May 2000 15:43:24 GMT
From: Kostis <ke77le@my-deja.com>
Subject: A couple of quick questions
Message-Id: <8fh8qq$507$1@nnrp1.deja.com>

Hi all.
Does anyone know if the anonymous subroutine passed to a map function
constitute a closure if it appears within the implementation of a
subroutine?
I'm developing for mod_perl and would like to make sure that:
sub someSub {
return map {someOthersub($_)} @array;
}
won't cause a leak.
(Obviously assuming that someOtherSub doesn't leak...)

Another thing...
Consider the example code below:

my $object = SomeModule->new;
$object->{'.hidden'}{'anotherObject'} = SomeOtherModule->new;

Will Perl's garbage collection mechanism take care of freeing the
memory occupied by $object->{'.hidden'}{'anotherObject'} if I undef
$object but don't explicitly undef $object->{'.hidden'}
{'anotherObject'} beforehand?

Many thanks,
Kostis


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


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

Date: 12 May 2000 17:35:57 +0100
From: nobull@mail.com
Subject: Re: A couple of quick questions
Message-Id: <u93dnnraj6.fsf@wcl-l.bham.ac.uk>

Kostis <ke77le@my-deja.com> writes:

> Does anyone know if the anonymous subroutine passed to a map function
> constitute a closure if it appears within the implementation of a
> subroutine?

Yes, no, take your pick.  I cannot see any observable properties that
would be different if it does constitute a closure or if it does not.
The question therefore is meaningless.

> Consider the example code below:
> 
> my $object = SomeModule->new;
> $object->{'.hidden'}{'anotherObject'} = SomeOtherModule->new;
> 
> Will Perl's garbage collection mechanism take care of freeing the
> memory occupied by $object->{'.hidden'}{'anotherObject'} if I undef
> $object but don't explicitly undef $object->{'.hidden'}
> {'anotherObject'} beforehand?

Yes.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 12 May 2000 17:31:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Accidental Creation of Static Variable
Message-Id: <slrn8hofvr.bgd.abigail@ucan.foad.org>

On 12 May 2000 10:28:26 +0100, nobull@mail.com <nobull@mail.com> wrote:
++ abigail@foad.org (Abigail) writes:
++ 
++ > On 11 May 2000 19:14:27 +0100, nobull@mail.com <nobull@mail.com> wrote:
++ >
++ > ++ Well _I_ would expect an error as you get if you try to put a if
++ > ++ qualifier on use() in 5.5 and as happens if you write the analagous
++ > ++ code in C++.
++ > 
++ > my() isn't 'use', and Perl isn't C++.
++ 
++ No, but where correct behaviour is not formally defined an intelegent
++ being will infer the the correct behaviour from related experiences.
++ 
++ my() isn't use() but both are statements that have compile-time effects.

So what? $arr [2] = 3; *also* has a compile time effect, but I'm not
inferring any behaviour of my() based on that. Just because my() and
use() have compile time effects doesn't mean their behaviour should
have anything in common.

++ Perl isn't C++ but both are programming languages.

So what? There are hundreds of other programming languages. They are
different for a reason.

++ > ++ Failing that I'd expect it to do:
++ > ++ 
++ > ++   my $foo; $foo = 3 if $bar == 16
++ > 
++ > Really? 'my $foo = 3 if $bar == 16' contains one statement that does
++ > an assignment to $foo, while 'my $foo; $foo = 3 if $bar == 16'
++ > contain 2. I would not call that at all reasonable.
++ 
++ So is the actual behaviour any more reasonable?  Using equally bogus
++ analysis it contains two assignments the first time it is encountered
++ and one thereafter!

Huh? That I don't understand. Does the code change second time you look
at it?

++ > ++   variables declared with C<my> are totally hidden from the outside
++ > ++   world, including any called subroutines.  This is true if it's the
++ > ++   same subroutine called from itself or elsewhere--every call gets
++ > ++   its own copy.
++ 
++ > ++ It is a bug.  Code bug or documention bug - take your pick.
++ 
++ > Where's the bug?
++ 
++ See the original example at the beginning of this thread and the
++ documentation extract quoted above.
++ 
++ > Could you show an example where 'my $foo = 3 if $bar == 16'
++ > causes $foo to be visible outside of the block? 
++ 
++ No, of course I can't show you that.  This is, however, irrelevant.

Then please explain to me where the bug is. If you think parts aren't 
explained in your quote, you are right. But that's just because you
didn't quote all of it.

++ > From the documentation:
++ >      A `my' has both a compile-time and a run-time effect.  At
++ >      compile time, the compiler takes notice of it.  The
++ >      principle usefulness of this is to quiet `use strict
++ >      'vars'', but it is also essential for generation of closures
++ >      as detailed in the perlref manpage.  Actual initialization
++ >      is delayed until run time, though, so it gets executed at
++ >      the appropriate time, such as each time through a loop, for
++ >      example.
++ > 
++ > And that, for me, explains *exactly* what 'my $foo = 3 if $bar == 16'
++ > does. 
++ 
++ The "for me" is very significant here.  You are inferring information
++ that isn't actually there based, as I said above, on your previous
++ experiences of how programming languages act.

Oh, really? Could you please tell me in which language I had similar
experience with the construct under discussion, as I certainly don't
know such a language.

++                                                Your experiences are
++ not the same as mine so your inferrences are not the same as mine.

I'm not interfering anything at all.

++                                                                     If
++ your experiences include lots of digging in the guts of Perl then it
++ is, of course, likely that your inferrences will be more accurate -
++ this is however irrelevant.

It's certainly irrelevant as I've never `digged' the guts of Perl.

++ > Once you understand the above paragraph, it's clear as crystal.
++ 
++ That's the crux of the matter.  "understand" in this context means
++ "correctly infer the missing information".

There's no information missing.

++                                             Of course if the above
++ paragraph were disambiguated so that the current behaviour was
++ explicity defined then you'd have two contaditary statements in the
++ documentation.
++ 
++ > No bug - not in the code, and not in de documentation either.
++ 
++ I have shown you a categorical statement in the documentation and a
++ behaviour that violates that categorical statement.  You can't simply
++ pick another bit of the documentation and say "the behaviour doesn't
++ also violate this statement so there is no bug".

Huh? Your quote of the documentation says my() variables are totally
hidden from the outside. You claim that means there's a bug. I ask
if you could make a code fragment showing the bug, and you say you
can't. Now you say it contradicts another piece of documentation - 
which doesn't say anything about variables being hidden. 

Where _is_ the bug?

++ BTW: can you present a logical argument as to how the semantics that I
++ would consider intuative are in conflict with the documentation you
++ quote?


You consider it intuitive that the following are equivalent:

    my $foo = 3 if $bar == 16;

and

    my $foo;
    $foo = 3 if $bar == 16;


The compile time effects are the same (the compiler takes notice), but the
runtime effects are different. In the former case, nothing happens at
runtime (assuming $bar != 16), while in the latter case, all the runtime
effects of the first statement (my $foo;) will happen. And the runtime
effect is setting $foo to 'undef'.



Abigail


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

Date: 12 May 2000 09:31:52 -0700
From: Scott Blachowicz <scott@sabami.seaslug.org>
Subject: Re: Activestate Perl 5.6 crashes
Message-Id: <877lczlog7.fsf@sabmail.rresearch.com>

>>>>> "Bart" == Bart Lateur <bart.lateur@skynet.be>
 Bart> Now, see 

 Bart> 	<http://www.activestate.com/ActivePerl/download.htm>

 Bart> Do you see ANY link offer a download for 5.005_03? I don't.

 Bart> So 5.6.0 is the only ActivePerl that you can download, and XML::Parser
 Bart> 2.28 is the new XML module. Since there isn't a mention of any
 Bart> incompatibilities at all, I assumed that those were ment to work
 Bart> together. I believe that is a fair assumption. 

FYI...there's a link to the old build 522 in there somewhere...that's what
I've got installed on my win2k system and it's based on 5.005_03.  I
grabbed it after discovering that PerlScript from the latest build doesn't
work on win2k.
-- 
Scott Blachowicz


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

Date: Fri, 12 May 2000 16:59:06 +0900
From: "Oliver Cromm" <ocromm@icsd4.tj.chiba-u.ac.jp>
Subject: Re: Beginner: 8bit-regexp
Message-Id: <8fgdkj$66s$1@pine.cix.chiba-u.ac.jp>


"Tom Phoenix" <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.10005110647040.16364-100000@user2.teleport.com...
> On Wed, 10 May 2000 ocromm@my-deja.com wrote:
>
> > I'm using regexps to find similar strings in a dictionary (to describe
> > it easily), but they're all in German, and perl doesn't like my
> > non-7bit-characters in regexps (fine with strings, though).
>
> I don't see why it would. Could you make a small example which should

Thanks to you, and to Christian Kirsch.

Actually the non-ASCII-characters didn't matter. The problem was that I
messed up the encoding at some points.
I had to correct a few small errors in some of the files, and I did so with
mule, which garbled some of my characters, probably because I disn't specify
the code upon loading, and mule's auto-recognition failed.

You can't imagine how many time I spend with errors stemming from that kind
of code-problems. Try using sources from Japanese Windows (SJIS) and
Mac-coded German, incompletely exported into Windows format, and then use
these under UNIX...

Oliver




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

Date: Fri, 12 May 2000 15:59:26 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: CGI::Carp - Non fatal errors
Message-Id: <yTVS4.941$zI5.9421@news.uswest.net>

In article <391B5D13.E0E7C5FC@rochester.rr.com>,
	Bob Walton <bwalton@rochester.rr.com> writes:
> Jerome O'Neil wrote:

>> BEGIN{
>>     for({qw{CGI Foo}){
>           ^
> won't compile!!!!!!!!

Whoops.  My typo.  My bad.

>>         if(!eval "require $_"){
>>             print qq{$_ is not installed\n};
>>         }else{
>>             print qq{$_ is installed\n};
>>         }
>>     }
>> }
>> 
>> If I run this under 5.005_03 perl DWIM and outputs:
>> 
>> CGI is installed
>> Foo is not installed
>> 
>> However, if I run it under 5.6, perl carps about being unable to
>> find out about Foo:
>> 
>> Can't locate Foo.pm in @INC ...

> I verify that your program does not generate the error message output
> when run with Perl 5.005_03, and that it does generate the error output
> with 5.6.  

Thanks.  I feel much better that, yes, in fact, it's not just me. :)

>I note that execution is not stopped in either case, and that
> "Foo is not installed" does come out in both versions.  I would suppose
> that the 5.6 behavior is not right.  Anyone else?

I vote for the old behavior.  If this garners more interest, I'll move
it to c.l.p.modules and c.l.p.moderated to see what they have to say on the 
matter.

Thanks for taking the time!

Jerome



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

Date: Fri, 12 May 2000 11:06:47 -0500
From: "Mohammad Khan" <mkhan@crosscom.com>
Subject: Re: Difficuly psting to a web site. Maybe a Port issue!!!!!!!!!!
Message-Id: <391c2b54$0$27874@wodc7nh0.news.uu.net>


Larry Rosler wrote in message ...
>[Please conform to normal human (and Usenet) expectations by putting
>your comments after what you are quoting.  And quote selectively, and
>with proper attribution.  I have rearranged below for legibility.]
>
>In article <391b20c2$0$1091@wodc7nh6.news.uu.net> on Thu, 11 May 2000
>16:09:06 -0500, Mohammad Khan <mkhan@crosscom.com> says...
>> Jeff Zucker wrote...
>> > print $res->message;
>> >
>> >In the place where you had
>> >
>> > &log("Network Down.");
>> >
>> >It should print out the response message.  If it doesn't then the
>> >problem is in your script somewhere, not in the site you are visiting.
>>
>> I did as you mentioned in this email. Can you or somebody help me point
out
>> the errors and as I mentioned in my original email, i can post to other
web
>> sites, only MCI WorldComm has problem.
>>
>>  HTTP::Response=HASH(0x8b7b50)->content
>>  HTTP::Response=HASH(0x8b7b50)->message
>
>Though you don't show the code, my PSI::ESP module tells me that you are
>trying to interpolate a method invocation into a double-quoted string.
>It won't work.
>
>   print "$res->message\n";       # WRONG!
>
>   print $res->message, "\n";     # OK
>
>   print $res->message . "\n";    # OK
>
>   print "@{[$res->message]}\n";  # OK
>
>   print "${\($res->message)}\n"; # OK
>
>--
>(Just Another Larry) Rosler
>Hewlett-Packard Laboratories
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com


Thanks guys, your input really helped. I was able to fix the problem. I was
sending wrong cgi data to URL.






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

Date: Fri, 12 May 2000 09:16:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Extending URI::URL
Message-Id: <Pine.GSO.4.10.10005120915510.16364-100000@user2.teleport.com>

On Fri, 12 May 2000 francesc_guasch@my-deja.com wrote:

> I wonder if someone else has done this before and could help me extend
> this module.

In general, when you want to add something to a module, contact the author
before you start. Perhaps the author (or someone the author knows) is
already working on it, or could give you other valuable advice. 

Cheers!

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



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

Date: Fri, 12 May 2000 19:23:17 +0200
From: Jens Luedicke <jens@irs-net.com>
Subject: Gtk Perl
Message-Id: <391C3E05.6E239482@irs-net.com>

Hi there ...

I have problems bulding the Gtk-Perl Extension / Modules.

I have the newest glib's and gtk's installed and
they compiled without any problems. When I try
to build the Perl Extension it says the it cannot
find "gnome-config". I know that I have some
gnome packages for my Debian System (2.1 Slink) 
installed. If anyone can say me what I need
to build all basic gnome stuff (bin's, lib's, header's),
I would be appreciated :-)



-- 
with friendly regards...

	Jens Luedicke <jens@irs-net.com>
	http://www.irs-net.com/

$a="34t3354s3434u553453J";$b="r324eht37282o34534na";
$c="3345l534r523e55P234234";$d="345r342e345k2314c56a34h";
@beg = ("$a","$b","$c","$d");foreach $p (@beg){	$p =~ 
s/[0-9]//g;$sl=reverse("$p");print"$sl ";}print"\n";

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT/H/P/L d- s: a-- C+++ UL P++ L+++ E---- W++ N+ o? K? w-- O? M(-) V?
PS++ PE Y+ PGP++ t+ 5-- X- R- tv+ b++ DI++++ D- G e h! r-- z?
------END GEEK CODE BLOCK------


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

Date: Fri, 12 May 2000 10:43:54 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Help With code Snippet
Message-Id: <391c26a3$0$4923@wodc7nh1.news.uu.net>

Hello,
I am breaking someone's code down, and ran into a line that I am having
trouble finding the exact answer for.

if ($line = $. == 1 .. /^$/) { # line I need help with

What is going on here with this? Could someone break it down for me? Thanks
Scott




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

Date: Fri, 12 May 2000 18:33:53 +0200
From: Frederic Aussedat <Frederic.Aussedat@Alcatel.fr>
To: spurcell <skpurcell@hotmail.com>
Subject: Re: Help With code Snippet
Message-Id: <391C3271.B2AAD46E@Alcatel.fr>

It's just means :
do it from line 1 till first empty line

just a permissiv perl trick.

Best regards
See exemple bellow 

__________________________________________
while (<DATA>) {
	if ($. == 1 .. /^$/) {
		print "=> $_";
	} else {
		print "-$. skipped\n";
	}
}
__END__
hello
world
end of text printed

not 
printed
text

___________________________________________

spurcell a écrit:
> 
> Hello,
> I am breaking someone's code down, and ran into a line that I am having
> trouble finding the exact answer for.
> 
> if ($line = $. == 1 .. /^$/) { # line I need help with
> 
> What is going on here with this? Could someone break it down for me? Thanks
> Scott


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

Date: Fri, 12 May 2000 17:54:20 GMT
From: lou@visca.com (Lou Hevly)
Subject: Re: How do you create a module and pass variables into and out of it?
Message-Id: <391c5632.22389540@news.wanadoo.es>

"David Shapiro" <david.shapiro@wcom.com> wrote:

>I have seen a brief description of pakcage Some:Module that was posted to
>daily_perl@yoak.com.  But I do not understand it.  I have a bunch of
>functions that are common to many of my programs that I want to put in a
>module that I can use in new programs.  I think you put use package_name in
>the new progrm, but perhaps it is just require package_name.  I have not
>understood the explainations of the differences between require and use.
>After I do this, you can call the functions with
>&package_name::function_name, but it is not clear to me how to allow the
>package_name module to have access to variables that exist in the new
>program and vice-versa.  For example, if you had a function called mailinfo
>that all programs use, I want to be able to do something like
>&package_name::mailinfo($address,$attachment), where $address and
>$attachment are defined in the new program.  I see all kinds of things in
>the packagee Some::Module example I do not understand:  use Exporter ();,
>@ISA, @EXPORT, %EXPORT_TAGS, etc.  Any help on this and direction to good
>reading resources for this would be greatly appreciated.

Mark-Jason Dominus has a good beginner's tutorial; look up 'Hello.pm'
on Google. Other good reading is the new perlboot.pod:
http://search.cpan.org/doc/GSAR/perl-5.6.0/pod/perlboot.pod
and A Tour of References, Modules and Objects 
http://www.speakeasy.org/~cgires/modules/objects/

Here's something to get you started:

# Your module, named SomeModule.pm
package SomeModule;
use strict;
require Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK $basedir %func);
@ISA = qw(Exporter);
@EXPORT_OK = qw($basedir func);

$basedir = '/path/to/basedir';

sub func {
  my $file = shift;
  print STDERR "$file\n";
  open F, $file or die $!;
  read F, my $content, -s F;
  close F or warn $!;
  return $content;
}

1; # This is so the module returns 'true'.

#!/usr/bin/perl -w
use strict;
use lib '/www/visca/cgi-bin/lib/site';
#use lib '/path/to/module/directory';
use SomeModule qw($basedir func);

my $file = "$basedir/file";
my $content = func($file); # Returns the content of the file
print $content;

HTH.
-- 
Lou Hevly
lou@visca.com
http://www.visca.com


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

Date: Thu, 11 May 2000 23:27:11 GMT
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Ideas on how to automatically fill out and send forms
Message-Id: <87em78hdm8.fsf@shleppie.uh.edu>

>> On Thu, 11 May 2000 19:14:06 -0400,
>> Gary Nielson <gnielson@charlotte.infi.net> said:

> At our Web site, the online editors every night have to
> tediously fill out forms to submit to update pages on
> other sites with whom we partner.  This gets old after
> ...
> destination, using cron.  I've been doing some reading
> about the URI characters that need to be encoded,
> etc. when sending a form with the POST method. I am
> thinking that I could call lynx inside a script and send
> the cgi request with all of the names/values beginning
> with "?" and separated by "&" with spaces, question
> marks and other characters converted to their Hex
> equivalents.

Perl has modules for doing all this (but of course! :-)

  perldoc LWP                 libwww-perl overview
  perldoc LWP::UserAgent      for constructing useragents
  perldoc HTTP::Request       GET and POST and so on...
  perldoc URI                 encoding of requests

Use "cpan" ("ppm" for ActiveState perl) to install
Bundle::LWP if necessary.

hth
t


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

Date: Fri, 12 May 2000 17:33:41 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Is this new language possible in perl?
Message-Id: <391C2455.8E01EECF@bigfoot.com>

pohanl@my-deja.com wrote:
> 
> Ok, here are some ideas for the new language...

Yes.  Perl is Turing complete.

Could you write a program in your new language for us to see?  

-- 
  Thorbjørn Ravn Andersen          "... plus .. Tubular Bells!"
  http://www.mip.sdu.dk/~ravn/


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

Date: Fri, 12 May 2000 18:40:57 +0200
From: Frederic Aussedat <Frederic.Aussedat@Alcatel.fr>
Subject: Re: Is this new language possible in perl?
Message-Id: <391C3419.66C907E6@Alcatel.fr>

I think your need is not a new language but a new communication process
with no dedicated destinator.
This process may be implemented over any language (C, C++, Pascal, Perl,
 ...).

Regards

pohanl@my-deja.com a écrit:
> 
> Ok, here are some ideas for the new language...
> 
> The evolution of languages started first with load/store primative
> operations for the CPU.  This led to assembly which was basically a
> labeling system for the actual numbers the cpu understands.  When you
> have labels, people created an abstract macro layer above that so that
> it produced multiple assembly labels to be compiled into machine code.
> This is basically what Basic and Fortran, and Colbol did.  But as the
> languages became longer and longer, people started inventing ways to
> package some of the often used routines, and created the concept of a
> method (java), function (c), procedure (pascal), subroutine (basic and
> perl).  They are basically a way store often used instructions for the
> cpu into nice place (label it), and call it anytime you want.  But
> since these functions usually need information passed into it to work,
> pass by reference and pass by value became the norm, and was
> incorporated into the language.  Usually
> when a function is called, the calling function stores the passed
> values on a stack (a separate place in memory).  The called function
> then take these values from the stack and diddles with them.  When it
> is done, it return usually one value (either a reference or value) by
> placing it back on the stack, and the caller then takes it off of the
> stack.  To make it consistent, and less error prone, some languages
> invented the concept of a prototype, which basically says, this
> function can only take in 4 passed parameters of type integer, and
> return type char, etc etc.  Up to this point you have C and pascal.
> 
> Then someone comes along and says, hey, why not package multiple
> functions
> and data into a structure.  And that is how classes got started (which
> lead to object oriented languages like C++ and java).  Now when you are
> calling a function, instead of eat food, you say "tom, eat food" you
> have to tell which structure/class to do it.  Of course tom would have
> to know how to eat and what food to eat.  That is why Tom needs
> a function inside called eat, and you need to pass him food as a
> parameter.
> 
> Well this is fine, but each time you turn on the computer, the classes
> dissapear (well at least the data stored inside of them).  So people
> invented
> components that sort of made classes a little smarter.  Components are
> basically classes that (usually, not all) contains serialization, and
> function query.  Serialization means it can be stored to harddrive and
> back and keep its data intact.  function query (my own term) means you
> can
> ask a component what functions/methods it supports.  Some people group
> the functions into ports and some group them into interfaces.  These
> are basically another layer above the functions that you use to
> actually execute a function inside a component.  COM, Corba, and
> JavaBeans are like these.  (I did some things on Ports, like smart
> ports, which automatically does introspection(check parameter types) and
> automatically
> link methods between components if they match).  I actually created a
> new component architecture before (well contributed to it), but it
> wasn't truly a new language (you still had to program in java to create
> the component pieces to play with).
> 
> Well, Perl is something new to me.  It has some old vestiges of
> assembly type language structures.  For example, a called function
> manually pops stuff off of the stack (well indirectly), as opposed to
> being defined in variables identified in the function definition.
> It can also return multiple values (interesting).
> 
> Well, if you look at most cells in your body, you notice that they have
> a cell wall, and inside contains the DNA and other goodies. Things are
> passed to the cell through the cell wall.  This is very similar to
> passing variables to a component through an
> interface/function.
> 
> This new language would have components with no constraints on values
> passed to it.
> as for the values, instead of being dedicated to a method in a
> component/class/function, it would be placed on a bloodstream/"bus".
> cells/components would grab it when they have appropriate functions
> that can use it.
> 
> and of course there is the concept of dynamic operators.  operators are
> basically built-up from other components.
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.


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

Date: Fri, 12 May 2000 09:37:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: MacPerl: access to floppy and harddisk?
Message-Id: <Pine.GSO.4.10.10005120933590.16364-100000@user2.teleport.com>

On Thu, 11 May 2000, Mario Gunkel wrote:

> How can I access a floppy-disk on the mac. Is there a routine or
> function built-in in MacPerl that read out the connected devices and
> how can I access them. The MacOS allows it to name the floppy and
> hard-disks at will. How can I access a drive without knowing its name?

Have you seen the manpage you get when you select "Macintosh specific
features" [sic] in the Help menu? I think that answers your questions.

> Some directories have names with a blank within, like "Macintosh HD".
> If I try to read in the contents of such directory, MacPerl can't find
> it. I used the following commands:
> 
> $path="Macintosh HD";
> opendir(DIR, $path) || die "can't opendir $path: $!";

That same manpage should clear up this mystery, too.

Cheers!

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



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

Date: 12 May 2000 12:19:22 -0400
From: Bruce Ingalls <bruce@conde-dev.com>
Subject: Re: Need to make UNIX autoresponder
Message-Id: <wi2snvnoi5x.fsf@mail.conde-dev.com>

http://www.procmail.org/ It's not Perl, but it is the
right tool, which leverages your Perl skills.
It may require something to be installed with root privileges.
-- 
EMacro makes Emacs ftp://ftp.cppsig.org/pub/tools/emacs/


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

Date: Fri, 12 May 2000 09:14:56 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: PERL exe?
Message-Id: <Pine.GSO.4.10.10005120914390.16364-100000@user2.teleport.com>

On Fri, 12 May 2000, Bill wrote:

> I am curious if anyone can point me ot some information about
> compiling PERL scripts to excutables. 

Have you seen the FAQ? Cheers!

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



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

Date: Fri, 12 May 2000 11:36:56 -0500
From: Haifeng <chj005@email.mot.com>
Subject: Perl question
Message-Id: <391C3328.A0671D34@email.mot.com>

Hi there,

I am new to Perl language and have the following question. I'd
appreciate if anyone could help me.

I am reading from a file, setting the contents in a structure and
calling a function with the structure as parameter. Here's the code:
Line 1: open(FH, "/usr/users/haifeng/f1.txt");
Line 2: @data = <FH>;
Line 3: close(FH);

Line 4: my($j) = 0;
Line 5: while($j <= $#data){ $s .= @data[$j++]." "; }
Line 6: print (s);

Line 7: $rec->{'raw'} .= $s;
Line 8: $dbh->setRecord($rec);

For some reason, assigning value to $s in this way doesn't work. The
printout is correct. And I also tried to asisgn like this: $s = "1 2 3 3
4 5 5"; This worked, but is not what I want.

Can anyone shed some lights on this? Please email me.

Haifeng
chj005@lmpsil02.comm.mot.com



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

Date: Fri, 12 May 2000 17:21:58 GMT
From: rls@one.net
Subject: Re: PerlIS and IIS5 on Windows 2000
Message-Id: <391c3c7a.331607336@news.one.net>

I am trying to learn PERL programming and have win2k professional, so
I setup the webserver ( IIS) to use PERL.  

So I just use the .pl extension on my files and everything works from
the browsers perspective.  I even have it talking to a Access Db.  

If what you are trying to do is similiar, I can tell you how I did it.

Rob




On Fri, 12 May 2000 14:49:56 +0100, "new.myratech.net"
<Roland@psychenet.co.uk> wrote:

>Has anyone managed to get PerlIIS up and running with IIS5 on Windows 2000?
>We have an NT4 server that relies heavily on the PerlIS.dll for working with
>web pages hosted on the server.  We have been trialling IIS5 on Win2K and
>can't seem to get it configured to work!
>
>When you try and run a script the server reports that the file cannot be
>found.
>
>All the registry entries for scripting have been made and are correct -
>duplicated from current install that works.
>
>I am aware that on the Activestate website (we're running the latest version
>of Perl from Active State) there is the following bug-report with Win2K:
>
>"PerlScript currently does not function correctly when being run in an ASP
>environment under IIS 5. This appears to be an issue in the `MSVCRT.DLL'
>that ships with Windows 2000. We are working to resolve the problem for a
>future release. "
>
>However, this is referring to Perl script, which I thought was differnet to
>IISAPI Perl, which we were trying to run.  Maybe I'm mistaken?
>
>If anyone could help me out on this, either by confirming that PerlIS and
>Perscript are the same, or by confirming that they have manged to set it up,
>then that would be a big help.
>
>Many thanks in anticipation of your help.
>
>Regards
>
>Roland
>Systems Administrator & Developer
>Psyche Solutions LTD
>
>



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

Date: Fri, 12 May 2000 08:17:38 -0700
From: bjanko <waldo700NOwaSPAM@aol.com.invalid>
Subject: ppm hotfix
Message-Id: <0a83f4fe.f2f69812@usw-ex0102-084.remarq.com>

I got my version of Perl from activestate.com at this address:

http://www.activestate.com/ActivePerl/download.htm

The instructions there say to install the ppm "hotfix" which I
tried to run, but I don't believe it worked since it did not
upgrade to version 1.1.4.

Does anyone know about this?  I could use a little advice here.

Thanks.

* 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: 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 3028
**************************************


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