[18512] in Perl-Users-Digest
Perl-Users Digest, Issue: 680 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 11 21:06:34 2001
Date: Wed, 11 Apr 2001 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: <987037513-v10-i680@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 11 Apr 2001 Volume: 10 Number: 680
Today's topics:
Re: A CGI question <moiraine@qwest.net>
Re: A CGI question <comdog@panix.com>
ANNOUNCE: DDL::Oracle v1.08 <rvsutherland@yahoo.com>
changing @INC permenently <kimmfc@mydeja.com>
Re: changing @INC permenently (Damian James)
Re: changing @INC permenently (Mark Jason Dominus)
Re: changing @INC permenently (Damian James)
Re: changing @INC permenently (Damian James)
Re: complaint about moderation of this group (Martien Verbruggen)
Re: complaint about moderation of this group <joe+usenet@sunstarsys.com>
Re: Copying a ColdFusion site <gtoomey@usa.net>
Re: Empty Parenthesis Evaluting to True -- WHY? <rick.delaney@home.com>
Re: Empty Parenthesis Evaluting to True -- WHY? (Randal L. Schwartz)
Re: Empty Parenthesis Evaluting to True -- WHY? (Mark Jason Dominus)
Re: Executing Perl script from C or C++ program. (Gwyn Judd)
Re: Executing Perl script from C or C++ program. bob_waltenspiel@agilent.com
Re: GD newbie <chrisw+usenet@dynamite.com.au>
How can I use a variable variable name? <nospam@cfl.rr.com>
Re: How can I use a variable variable name? (Jay Tilton)
Re: How can I use a variable variable name? (Damian James)
Re: inheritance within one file? (John McNamara)
Re: LWP - HTTPS <ng@fnmail.com>
online editing of a text form <simonNOSPAM@swbh.net>
Re: We have 'use strict' and 'my', and now 'our', but n (Abigail)
Re: Why does DynaLoader fail? (Abigail)
Re: Why Perl? (GrapeApe)
Re: Why Perl? <xris@dont.send.spam>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 11 Apr 2001 17:23:57 -0700
From: A_Geekette <moiraine@qwest.net>
Subject: Re: A CGI question
Message-Id: <3AD4F59D.BD331DFF@qwest.net>
nobull@mail.com wrote:
> Simon Stiefel <SiStie@nuclear-network.com> writes:
> Probably more efficient to change that to:
>
> Every checkbox has the name "entry". The value is X if it is checked
> where X is the number beginning with 1.
Not realy. Fetching and manipulating values becomes a touch more difficult. It
is much simpler to use a hash. If you have multiple values of the same name you
can't use the simplified hash where the key is the name of the field. His
method is a good one.
> > How can I fetch them in variables??
Get CGI Programming with Perl by Guelich, Gundavaram and Birznieks, published by
O'Reilly. On page 81 there is an example of how to parse form data. Or
$_ = <STDIN>;
chomp;
#print "$_\n";
@list = split /\&/;
#print "$list[0]<br>\n";
foreach (@list) {
($key, $value) = split /\=/;
$hash{$key} = $value;
# print "$value<br>\n";
}
Assuming you're printing to a web page, use standard html printing procedures.
This is a very simplistic version. As you can see I've commented out certain
printing lines. This is to print values to see what data is in them, making
sure the data is going where you want it to. Also, there is no proper error
checking and variables aren't declared. This is just a very simplified example
of the procedure of assigning values from a form to a hash. CGI.pm is a touch
more efficient. Also, the data will be in HTML context and not human text.
--
Geekette
"Try Not. Do or do not. There is no try."
-If you don't know who said this,
I don't want to talk to you. ;-)
"Nothing is impossible, no matter how improbable."
-Anonymous
"RBTL before replying to my posts."
-Me 4/10/1
------------------------------
Date: Wed, 11 Apr 2001 21:00:20 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: A CGI question
Message-Id: <comdog-0671FE.21002011042001@news.panix.com>
In article <3AD4F59D.BD331DFF@qwest.net>, A_Geekette
<moiraine@qwest.net> wrote:
> nobull@mail.com wrote:
> > Simon Stiefel <SiStie@nuclear-network.com> writes:
> > Probably more efficient to change that to:
> >
> > Every checkbox has the name "entry". The value is X if it is checked
> > where X is the number beginning with 1.
> Not realy. Fetching and manipulating values becomes a touch more difficult. It
> is much simpler to use a hash.
it isn't easier to use a hash. it's very easy to use CGI.pm.
use CGI;
my $query = CGI->new();
my @entries = $query->param('entry');
that's it. you are done and you have all of the values for the widget
name 'entry' in @entries. there is nothing more to do and it is not
broken.
> If you have multiple values of the same name you
> can't use the simplified hash where the key is the name of the field.
and that's why it's more difficult to use a hash.
> > > How can I fetch them in variables??
>
> Get CGI Programming with Perl by Guelich, Gundavaram and Birznieks, published by
say yourself $30 and use CGI.pm which comes free with Perl. it's quite
easy and doesn't need a book to be used (although Lincoln did write one
for it).
> O'Reilly. On page 81 there is an example of how to parse form data. Or
please stop answering questions until you can provide a CGI parser
that isn't horribly broken in the same way that all the other newbie
CGI parsers are horribly broken.
--
brian d foy <comdog@panix.com>
------------------------------
Date: Tue, 10 Apr 2001 19:55:03 -0400
From: "Richard Sutherland" <rvsutherland@yahoo.com>
Subject: ANNOUNCE: DDL::Oracle v1.08
Message-Id: <td9pkghvisqn2e@corp.supernews.com>
===========================================================================
Release of DDL::Oracle, Version 1.08
===========================================================================
CHANGES
Fixed bug #412795 submitted by Henrik Johnson, wherein COMMENTs were
misplaced in the CREATE TABLE for partitioned IOTs. THANKS, Henrik!
Fixed bug #412878 also submitted by Henrik Johnson, wherein the
'create' method for type 'table family' was redundantly creating
the Primary Key index and constraint. THANKS again, Henrik!
Fixed bug #413996 again submitted by Henrik Johnson, wherein partitioned
IOTs might use incorrect attributes in the CREATE TABLE if a secondary
index exists on the table. THANKS yet again, Henrik! [Henrik is now
designated the "Official IOT Dude" of DDL::Oracle.]
Upgraded CREATE PROFILE to be functional for Oracle7. This bug was
reported by Leon Stern. THANKS, Leon!
SYNOPSIS
use DBI;
use DDL::Oracle;
my $dbh = DBI->connect(
"dbi:Oracle:dbname",
"username",
"password",
{
PrintError => 0,
RaiseError => 1,
}
);
# Use default resize and schema options.
# query default DBA_xxx tables (could use USER_xxx for non-DBA types)
::Oracle->configure(
dbh => $dbh,
);
# Create a list of one or more objects
my $sth = $dbh->prepare(
"SELECT
owner
, table_name
FROM
dba_tables
WHERE
tablespace_name = 'MY_TBLSP' -- your mileage may vary
"
);
$sth->execute;
my $list = $sth->fetchall_arrayref;
my $obj = DDL::Oracle->new(
type => 'table',
list => $list, );
);
my $ddl = $obj->create; # or $obj->resize; or $obj->drop; etc.
print $ddl; # Use STDOUT so user can redirect to desired file.
# Here's another example, this time for type 'components'. This type
# differs from the norm, because it has no owner and no name.
my $obj = DDL::Oracle->new(
type => 'components',
list => [[ 'no owner','no name' ]]
);
my $ddl = $obj->create;
print $ddl;
AUTHOR
Richard V. Sutherland
rvsutherland@yahoo.com
COPYRIGHT
Copyright (c) 2000, 2001 Richard V. Sutherland. All rights reserved.
This module is free software. It may be used, redistributed, and/or
modified under the same terms as Perl itself. See:
http://www.perl.com/perl/misc/Artistic.html
===========================================================================
AVAILABILITY
===========================================================================
DDL::Oracle is available from the CPAN, and from:
http://sourceforge.net/projects/ddl-oracle/
------------------------------
Date: Wed, 11 Apr 2001 22:52:12 GMT
From: Kim C <kimmfc@mydeja.com>
Subject: changing @INC permenently
Message-Id: <vvm9dtshn7rc07ruk6klsfrlrbc7t3cj9i@4ax.com>
Hi,
Is there a way to permanently add a path to @INC so that all my
scripts don't have to begin with
BEGIN{ push @INC , '/some/path/' }
where '/some/path/' is the location of modules that must stay put? I
don't want to copy the modules to the several machines that use them
as the modules are modified frequently.
I'm running ActivePerl 5.6 on w2k.
Thanks,
Kim.
------------------------------
Date: 11 Apr 2001 23:19:30 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: changing @INC permenently
Message-Id: <slrn9d9php.f1l.damian@puma.qimr.edu.au>
Kim C chose Wed, 11 Apr 2001 22:52:12 GMT to say this:
>...
>Is there a way to permanently add a path to @INC so that all my
>scripts don't have to begin with
>
> BEGIN{ push @INC , '/some/path/' }
>
See:
perldoc lib
or the FAQ:
perldoc -q library
"How do I keep my own module/library directory?"
NB, with the above, 'perldoc' is a command line program the should have
been installed with perl.
In brief:
use lib '/some/path';
HTH,
Cheers,
Damian
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;){;(
$:=rand$;+$|)==$;&&next;@;[$;,$:]=@;[$:,$;]}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3 -- a JAPH in progress, I guess...
------------------------------
Date: Thu, 12 Apr 2001 00:19:54 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: changing @INC permenently
Message-Id: <3ad4f4a9.561$2c9@news.op.net>
Kim C chose Wed, 11 Apr 2001 22:52:12 GMT to say this:
>...
>Is there a way to permanently add a path to @INC so that all my
>scripts don't have to begin with
>
> BEGIN{ push @INC , '/some/path/' }
>
In article <slrn9d9php.f1l.damian@puma.qimr.edu.au>,
Damian James <damian@qimr.edu.au> wrote:
> use lib '/some/path';
That's probably one of the most unhelpful answers I've seen this year.
>HTH,
Oh, the irony.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 12 Apr 2001 00:51:51 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: changing @INC permenently
Message-Id: <slrn9d9uut.f1l.damian@puma.qimr.edu.au>
Mark Jason Dominus chose Thu, 12 Apr 2001 00:19:54 GMT to say this:
>Kim C chose Wed, 11 Apr 2001 22:52:12 GMT to say this:
>>...
>>Is there a way to permanently add a path to @INC so that all my
>>scripts don't have to begin with
>>
>> BEGIN{ push @INC , '/some/path/' }
>>
>
>In article <slrn9d9php.f1l.damian@puma.qimr.edu.au>,
>Damian James <damian@qimr.edu.au> wrote:
>> use lib '/some/path';
>
>That's probably one of the most unhelpful answers I've seen this year.
>
>>HTH,
>
>Oh, the irony.
>
Damn, I don't know what I was thinking. I completely misread the question.
Unreserved apologies to Kim C -- I thought it was such a simple question I
didn't bother to read it properly.
A correct answer would be to suggest you put the path in the PERL5LIB
environment variable. This is also covered in:
perldoc -q library
'How do I keep my own module/library directory?'
to which I referred previously.
Apologies to everyone else for wasting the group's time.
Cheers,
Damian
[ slinks off back to cave, hissing and clawing at the air ]
[ oh, the shame ]
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;){;(
$:=rand$;+$|)==$;&&next;@;[$;,$:]=@;[$:,$;]}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3 -- a JAPH in progress, I guess...
------------------------------
Date: 12 Apr 2001 01:02:58 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: changing @INC permenently
Message-Id: <slrn9d9vjp.l35.damian@puma.qimr.edu.au>
Damian James chose 12 Apr 2001 00:51:51 GMT to say this:
>...
>A correct answer would be to suggest you put the path in the PERL5LIB
>environment variable. This is also covered in:
>
> perldoc -q library
> 'How do I keep my own module/library directory?'
>
>to which I referred previously.
>
Forgot to mention -- this environment variable probably won't already exist.
You have to create it. ISTR that Win2k does this a bit differently (don't
have a box to check that on), but on NT you'd set it in the System
control panel, under the Environment tag. You get to choose whether it
should apply to all users (ie, System) or just the current user.
HTH,
Cheers,
Damian
------------------------------
Date: Thu, 12 Apr 2001 08:57:06 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: complaint about moderation of this group
Message-Id: <slrn9d9oa1.fqd.mgjv@martien.heliotrope.home>
On Wed, 11 Apr 2001 18:38:02 GMT,
---Pete--- <bogus@erol.com> wrote:
> On 11 Apr 2001 10:47:08 GMT, Ilmari Karonen <iltzu@sci.invalid> wrote:
[snip of reasons why people new to Perl and CGI don't know why they're
not the same]
> I was reading the CAMEL 3rd edition book today and saw this..
> Quote.. "Perl folks are, frankly, some of the most helpful folks
> on earth. If there's a religious quality to the Perl movement,
> then this is the heart of it. Larry wanted the Perl community to
> function like a little bit of heaven, and by and large he seems
> to have gotten his wish so far. Please do your part to keep it
> that way."
This quote is interesting for historical reasons, but for no other. You
may have noticed that Larry Wall doesn't post here. He used to. I'll
leave it up to you to guess the reason why he doesn't participate in
this newsgroup anymore. There is another quote from him, I believe in
this thread somewhere, that states something about the problems he
perceived with this newsgroup.
If you read all the posts on this group, and compare them to posts on
other technical groups that have a history that started before the large
flood of people that the WWW revolution caused to appear on Usenet,
you'll note that the quality of response on this group is still very
high.
One of the reasons it still is a readable group is, IMO, that it hasn't
made concessions to what it expects new posters to know, and to be able
to figure out on its own. I've been here for long enough to have seen
all the approaches that are advocated and used. The friendly one,
explaining exactly why the post is irrelevant, and where to go. The
absolutely nasty one that doesn't explain a thing, and just tells the
poster to FO. And many shades in between.
The one extreme is fast, but invites crap like this. However, the other
extreme takes enormous amounts of investment of time and patience, and
still regularly results in abuse from the people addressed. It is easy
to say things like: We should all be more friendly and explain to each
single new poster why they should lurk and read before posting, and make
a serious attempt to read documentation, and to make sure they're
on-topic. It sounds easy, but ask anyone who's tried this for a few
weeks or even months how much time they lose, and whether they still
have the time to read any other threads, and actually get some quality
out of the time they spend on this group. I suspect the answer will be
no.
No one here is paid to be here. No one here can afford to spend all
their time educating people about the world of Usenet, programming in
general and Perl. So we concentrate on Perl, and expect people to _know_
about the other ones. If that scares off some people, that's too bad. It
is the only practical way that a newsgroup with the amount of traffic
that this one receives can be managed.
This thread has centered around posts that are about CGI or other web
issues, but those aren't the only ones that occur frequently. There are
many questions that ask things like "I've got this application in Perl,
what arguments does it take?", or "I want to call system utility foo,
what option do I use to get it to grubble?", or "I've got this modem
here, which commands do I send it to dial my ISP?", or "I need to figure
out how to do this mathematical task, which algorithm do I use?", or
"I'm trying to compile this library that I need for a Perl module, but
I'm getting these errors.", or "I don't like the colour of my garden
furniture. Where do I get a paintbrush to change it?".
Creating a separate group for CGI issues will maybe catch a quarter of
the offtopic posts. Judging by what I've seen in the past, these people
will most likely post their question here as well anyway, not even
crossposting. That leaves a still large number of offtopic posts to deal
with. A small number of these posts could be dealt with by sending them
a standard message, explaining some things. A large number needs special
attention to educate. Who is going to spend their time doing this?
While your intentions are good, there is practicality to take into
account. The whole argument in this thread, including all the viewpoints
seen, has been alive in the past. Many times. It is NOT going to be
resolved or changed. The main reason for that is that it can only be
changed if some people are willing to invest a large amount of time over
a long period in doing the dirty work. And they have to be willing to
accpet that as soon as they stop, the old problem re-appears, because
the new posters then won't have read the old responses.
> To me the solution seems simple.. Educate and Redirect.
>
> 1.) Use this as the 1st line of defense:
> http://www.augustmail.com/~tadmc/clpmisc_guide/clpmisc_guidelines.text
Everybody probably agrees that it will be a good thing if this post gets
autoposted here regularly. But we already have autoposted stuff. The
people who cause the problem are not people who are likely to read
anything in the newsgroup before posting. We're not talking about you,
or the people we never see here because they were wise enough to read
before posting. We're talking about those that didn't read, and
therefore became visible here with offtopic questions. Once they post,
it's too late.
> 2.) Develop a brief educational CGI/PERL message that
> politely and clearly explains difference between CGI and PERL,
> reasons why it was made separate from this group, along with
> some helpful advise as to how the person will benefit with better
> responses and answers by going to:
> comp.infosystems.www.authoring.cgi
What about all the other 'differences' that need to be explained to all
the people that post offtopic questions that have nothing to do with
CGI?
> 3.) Place the "rubber stamp" msg on the web and make a reference
> to it from the clpmisc_guidelines.text document.
>
> Then simply use the auto-post thing to post the basic rules
> and use a cut-n-paste operation to reply to any CGI topic
> you feel if truly off-topic; kind of like a rubber stamp.
WHO is going to police the offtopic posts, and keep track of all the
things they're supposed to tell the person about, and make sure that the
document quoted actually covers enough?
> Now you 's done your part in the true spirit of Larry's wish.
That sounds like an obituary.
Larry isn't here anymore. The reason he isn't is the subject of this
thread. I doubt that Larry has read this group in the last two years.
I'm perfectly happy to help people. I'm absolutely unwilling to spend
more time holding the hands of each new person making the switch from
AOL to the real Internet. I've been there, done that, and there is just
nothing attractive to it. You get the same amount of shit, abuse and
protest as you do by the short statement:
"Your question is offtopic. Please post to comp.infosystems.www.* or
comp.unix.admin."
Larry's wish isn't what drives this group, or the people on it.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: 11 Apr 2001 20:14:43 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: complaint about moderation of this group
Message-Id: <m3vgob3rf0.fsf@mumonkan.sunstarsys.com>
mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> > Now you 's done your part in the true spirit of Larry's wish.
>
> That sounds like an obituary.
>
> Larry isn't here anymore. The reason he isn't is the subject of this
> thread. I doubt that Larry has read this group in the last two years.
> I'm perfectly happy to help people. I'm absolutely unwilling to spend
> more time holding the hands of each new person making the switch from
> AOL to the real Internet. I've been there, done that, and there is just
> nothing attractive to it. You get the same amount of shit, abuse and
> protest as you do by the short statement:
>
> "Your question is offtopic. Please post to comp.infosystems.www.* or
> comp.unix.admin."
"and if not for your own sake, but out of respect for everyone else in
this newsgroup, PLEASE DON'T WHINE ABOUT IT."
--
Joe Schaefer "Two things are infinite: the universe and human stupidity; and
I'm not sure about the universe."
--Albert Einstein
------------------------------
Date: Thu, 12 Apr 2001 10:49:58 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Copying a ColdFusion site
Message-Id: <jM6B6.1313$482.6996@newsfeeds.bigpond.com>
Well, if you were copying to a Unix site, just use ftp.
Most likely you are using a Windows variant (Cold Fusion is availble for
Linux ... consider upgrading).
A simple solution is to use Cuteftp to copy the "from" site to a local PC,
and then from the local PC to the "to" site. Cuteftp can copy directory
trees.
You did build everything under a single directory for this purpose, didn't
you?
What this has to do with Perl I don't know.
gtoomey
--------------
"Ilmari Karonen" <iltzu@sci.invalid> wrote in message
news:987016160.22480@itz.pp.sci.fi...
> In article <3AD48FEB.F7FABE09@vitesse.com>, Rob Root wrote:
> >
> >I need to copy a site (ours) built with ColdFusion to regular HTML. Is
> >there a perl module to help?
------------------------------
Date: Wed, 11 Apr 2001 22:47:07 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Empty Parenthesis Evaluting to True -- WHY?
Message-Id: <3AD4E223.D0CAC2F7@home.com>
"Randal L. Schwartz" wrote:
>
> >>>>> "Jay" == Jay Tilton <tiltonj@erols.com> writes:
>
> >> What I don't understand is why "()" evaluates to true.
>
> Jay> I would instead wonder why somebody would intentionally use this
> Jay> misfeature. It takes only one extra keystroke to type 'while(1)'.
>
> I don't recall when it was blessed, but it's been blessed for a long
> time.
I seem to recall it being a side effect of equivalence to
for (;;) { }
which C programmers would expect to loop indefinately.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 11 Apr 2001 16:03:45 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Empty Parenthesis Evaluting to True -- WHY?
Message-Id: <m14rvvxcmm.fsf@halfdome.holdit.com>
>>>>> "Rick" == Rick Delaney <rick.delaney@home.com> writes:
Rick> I seem to recall it being a side effect of equivalence to
Rick> for (;;) { }
Rick> which C programmers would expect to loop indefinately.
Ahh, and yes, that is specifically tested in t/cmd/for.t, so it's
a definite feature.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 12 Apr 2001 01:00:55 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Empty Parenthesis Evaluting to True -- WHY?
Message-Id: <3ad4fe4f.66b$de@news.op.net>
In article <m1g0ffxg3k.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>I don't recall when it was blessed, but it's been blessed for a long
>time.
It's in perl1.
:)
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Wed, 11 Apr 2001 22:42:33 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Executing Perl script from C or C++ program.
Message-Id: <slrn9d9nem.h90.tjla@thislove.dyndns.org>
I was shocked! How could Jurgen Boerboom <zonnebloem@zonnet.nl>
say such a terrible thing:
><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
><html>
>I´m struggling creating a C program that executes a perl script from
>a file. I have gone through the Perl docs several times, tried several
>things, but can get the grip on it. (See my posting of Thu, 01 Mar
>2001 16:00:46)
><p>Can any body tell if it has been done before and maybe provide me with
>a coding example.
This isn't really a Perl question. You might have better luck posting to
a C/C++ newsgroup. Given that, you probably want to use the system(3) or
exec(3) functions. And please post in plain text next time.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
When life hands you a lemon, it rarely offers a glass.
------------------------------
Date: Wed, 11 Apr 2001 20:39:38 +0000 (UTC)
From: bob_waltenspiel@agilent.com
Subject: Re: Executing Perl script from C or C++ program.
Message-Id: <987030578.885481@cswreg.cos.agilent.com>
Jurgen Boerboom <zonnebloem@zonnet.nl> wrote:
> I'm struggling creating a C program that executes a perl script from
> a file. I have gone through the Perl docs several times, tried
> several things, but can get the grip on it. (See my posting of
> Thu, 01 Mar 2001 16:00:46)
> Can any body tell if it has been done before and maybe provide me
> with a coding example.
I did something similar recently. Have a look at chapter 19 in the
book "Advanced Perl Programming" by Sriram Srinivasan, published by
O'Reilly. Download the example files from the O'Reilly website as
documented in the book.
Also see perlembed of the standard perl documentation.
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
> And please post in plain text next time.
Yes, please use only plain text when posting to newsgroups.
-Bob
--
Bob Waltenspiel
Agilent Technologies | e-mail: bob_waltenspiel@agilent.com
Santa Rosa, California USA | phone: (707) 577-3091
------------------------------
Date: Thu, 12 Apr 2001 09:15:08 +1000
From: "Chris W" <chrisw+usenet@dynamite.com.au>
Subject: Re: GD newbie
Message-Id: <FB5B6.3$qt4.158757@news.interact.net.au>
"Bosko Mirkic" <bosko.mirkic@zg.tel.hr> wrote in message
news:9b11f3$domh$1@as121.tel.hr...
> use GD under win32 distribution of ActivePerl but I don't know how to do
> this. Can somebody tell me what to do (please in plain English "copy to
dir,
> install to, configure this, etc").
Read the ActivePerl documentation on PPM (Perl Package Manager)
Use PPM to fetch and install GD
Read GD documentation which is installed into ActivePerl documentation with
GD.
Don't forget binmode().
------------------------------
Date: Wed, 11 Apr 2001 22:36:20 GMT
From: tuxy <nospam@cfl.rr.com>
Subject: How can I use a variable variable name?
Message-Id: <3AD496F5.480BA82C@cfl.rr.com>
I think I've managed to get this to work before but I can't seem to get
it working now. I want to access various hashes- something like:
my (%A,%B,%C);
my $x='A';
$A{cat}=qq(dog);
my $y=${$x}{cat}; # or just $$x{cat}
print "val is $y\n";
which doesn't work since I cannot use $x as a hashref (its not
interpolating?).
I read perlref again today but I didn't see this in there, but I may
have missed it as its very long.
Thank-You.
------------------------------
Date: Wed, 11 Apr 2001 23:03:48 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: How can I use a variable variable name?
Message-Id: <3ad4e0f9.202855020@news.erols.com>
On Wed, 11 Apr 2001 22:36:20 GMT, tuxy <nospam@cfl.rr.com> wrote:
> my (%A,%B,%C);
> my $x='A';
> $A{cat}=qq(dog);
> my $y=${$x}{cat}; # or just $$x{cat}
> print "val is $y\n";
>
>which doesn't work since I cannot use $x as a hashref (its not
>interpolating?).
You cannot use symbolic references on lexicals.
It will work if you don't declare 'my %A'.
[Include standard recommendations against using symrefs.]
perldoc -q "How can I use a variable as a variable name?"
------------------------------
Date: 11 Apr 2001 23:14:18 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: How can I use a variable variable name?
Message-Id: <slrn9d9p80.f1l.damian@puma.qimr.edu.au>
tuxy chose Wed, 11 Apr 2001 22:36:20 GMT to say this:
>I think I've managed to get this to work before but I can't seem to get
>it working now. I want to access various hashes- something like:
>
> my (%A,%B,%C);
> my $x='A';
my $x = \%A;
> $A{cat}=qq(dog);
> my $y=${$x}{cat}; # or just $$x{cat}
> print "val is $y\n";
>
>which doesn't work since I cannot use $x as a hashref (its not
>interpolating?).
>
Yeah, you were trying to use a symbolic reference (the spawn of satan),
instead of an explicit one (the way, the the truth and the light).
>I read perlref again today but I didn't see this in there, but I may
>have missed it as its very long.
>
You might be interested to look at MJD's discussion on this at:
http://perl.plover.com/varvarname.html
http://perl.plover.com/varvarname2.html
http://perl.plover.com/varvarname3.html
HTH,
Cheers,
Damian
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;){;(
$:=rand$;+$|)==$;&&next;@;[$;,$:]=@;[$:,$;]}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3 -- a JAPH in progress, I guess...
------------------------------
Date: Wed, 11 Apr 2001 22:42:07 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: Re: inheritance within one file?
Message-Id: <3ad4dc48.2375957@news1.eircom.net>
Ar Tue, 10 Apr 2001 10:37:05 GMT, do scriobh Bart Lateur:
>Didn't you ever wonder how comes the common syntax is "require
>Exporter;", not "use Exporter;"?
Perhaps because this is what h2xs gives you in the skeleton module. Is
there a reason that h2xs favours "require" over "use"?
John.
--
------------------------------
Date: Wed, 11 Apr 2001 17:06:41 -0500
From: "Enrico Ng" <ng@fnmail.com>
Subject: Re: LWP - HTTPS
Message-Id: <9b2klj$615$1@newsx.cc.uic.edu>
sorry. I spend some time searching at www.perl.com and didn't find
anything.
I have written many perl scripts but I dont really know that much about the
libs and modules in perl.
I figured that it would be a simple question.
--
Enrico Ng <ng@fnmail.com>
"Peter Scott" <peter@PSDT.com> wrote in message
news:JR%A6.60265$V6.400175@news1.gvcl1.bc.home.com...
> In article <9b0p7n$cqg$1@newsx.cc.uic.edu>,
> "Enrico Ng" <ng@fnmail.com> writes:
> >I want to use LWP to get a https page.
> >when I use get, I get nothing, I am assuming this is because of https
> >does anyone know what option I need to use to get it to work?
>
> Check out the lwpcook file that came with LWP, the cook book:
>
> URLs with https scheme are accessed in exactly the same way as
> with http scheme, provided that an SSL interface module for
> LWP has been properly installed (see the README.SSL file
> found in the libwww-perl distribution for more details). If no SSL
> interface is installed for LWP to use, then you will get ``501
> Protocol scheme 'https' is not supported'' errors when accessing
> such URLs.
>
> README.SSL says:
>
> Encryption support is obtained through the use of Crypt::SSLeay or
> IO::Socket::SSL, which can both be found from CPAN. While libwww-perl
> has "plug-and-play" support for both of these modules (as of v5.45),
> the recommended module to use is Crypt::SSLeay. In addition to
> bringing SSL support to the LWP package, IO::Socket::SSL can be used
> as an object oriented interface to SSL encrypted network sockets.
>
> Any time you want to do something that many other people will also have
> wanted to do, it's likely to have been documented already.
>
> --
> Peter Scott
------------------------------
Date: Thu, 12 Apr 2001 00:41:01 +0100
From: "Simon Whittaker" <simonNOSPAM@swbh.net>
Subject: online editing of a text form
Message-Id: <HL5B6.5043$Ow3.1086021@news2-win.server.ntlworld.com>
I would like to be able to edit a file that is stored on my server through a
www interface. I can only run cgi files from my cgi-bin and therefore cannot
use backpage.cgi because I want to access a directory higher up than the
cgi-bin. Is there another way around this?
Any help would be gratefully received.
Cheers
Simon
Sorry I haven't explained myself clearly - any questions email me
simon@swbh.net
------------------------------
Date: Wed, 11 Apr 2001 22:14:44 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: We have 'use strict' and 'my', and now 'our', but no 'use local-scope' - why?
Message-Id: <slrn9d9lqk.jvh.abigail@tsathoggua.rlyeh.net>
Ian Phillipps (dont.reply@myself.com) wrote on MMDCCLXXX September
MCMXCIII in <URL:news:3AD41B11.ED30BD56@myself.com>:
"" Mark Jason Dominus wrote:
""
"" > In article <3AD2864E.68F8FBCF@nowhere.com>,
"" > Phil Voris <pvoris@nekophile.com> wrote:
"" > >I've long been baffled that there is no pragma to automatically declare
"" > >all variables as default locally-scoped.
"" >
"" > Because nobody knows what that would mean.
"" >
"" > >This way, rather than typing 'my' everywhere, one could just type the
"" > >ocassional 'our' and assume everything else is local (er, my'd).
""
"" > But local to what? The file? The innermost block in which it appears?
"" > Neither of those are sensible.
""
"" If the pragma is the equivalent of inserting an implicit "my" at the
"" first appearance of each variable name which is not 'local' or given an
"" explicit package), then I'd vote it as fairly sensible.
Really? Then what's the point of using strict? You'd lose allmost all
the benefits of strict 'vars'. Typos in variables are no longer errors,
but silently accepted - and worse, they won't trigger then the "used
only once" message as they aren't package vars.
Also, where should the implicite 'my $var' be located?
if (raining ()) {
$cows = 'wet'
}
else {
$cows = 'dry'
}
One or two variables?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Wed, 11 Apr 2001 22:17:52 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Why does DynaLoader fail?
Message-Id: <slrn9d9m0g.jvh.abigail@tsathoggua.rlyeh.net>
Steve K. Brown (skbrown@vcd.hp.com) wrote on MMDCCLXXX September MCMXCIII
in <URL:news:9b2gkb$ibc$1@news.vcd.hp.com>:
^^
^^ I am sorry I posted an off topic article. I was tring to install this
^^ module and got the same error. I have fixed the problem by changing the
^^ permissions on the offending files. I had assumed that CPAN would take
^^ care of these things during the install. Was I wrong?
Yes, you are assuming CPAN knows what your policy is. CPAN isn't
overruling your umask when copying files; it's assuming you know best.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 11 Apr 2001 23:41:01 GMT
From: grapeape@aol.comjunk (GrapeApe)
Subject: Re: Why Perl?
Message-Id: <20010411194101.03854.00002948@ng-fg1.aol.com>
>You could subscribe to the (main) MacPerl mailing list. Roughly 50
>messages a week, and extremely friendly folks. They don't even mind an
>off-topic question once in a while. At least *some* of them know how to
>integrate BBEdit with MacPerl, as, for example, one of the main
>developers of BBEdit is on the list.
I'm on BBEdits mail list, but am on too many to read at the moment (Heck
cleaning up the junk on most mail lists is what I use grep for, BBEdits list is
naturally pretty good about staying in ascii rather than autoposting MIME from
Hell) Applescript is easy enough to fold in, and I know macperl is easily
accessible, I just havent figured how yet.
I imagine the lists archives are at
http://www.its.unimelb.edu.au/hma/pub/macperl/
I will peruse those before I sub. Don't see a sub form there anyway.
>
>[About the ST:]
>>Actually yes, that looks handy, from reading some Perlmonk discussion.
>
>It's very handy indeed. For example, here's how you can sort lines of
>text, sorting an incorporated integer numerically:
>
> @sorted = map $_->[0],
> sort { $a->[1] cmp $b->[1] || $a->[2] <=> $b->[2] ||
> $a->[3] cmp $b->[3] }
> map { [ $_, split /(\d+)/ ] } @unsorted;
>
>This will, for example, sort "figure 99" in front of "figure 101" and
>behind "figure 10".
My initial question that probably got a "use perl" response was my wanting to
sort word lists by length, at one point I had an applescript, now lost, that
merely went through the grep searches for me in a cascade of dimiishing
wildcards ^...........$ to ^...$ or so.
Thanks for the tips.
------------------------------
Date: Wed, 11 Apr 2001 18:46:41 -0500
From: xris <xris@dont.send.spam>
Subject: Re: Why Perl?
Message-Id: <xris-22CF3A.18463811042001@news.evergo.net>
In article <5nb8dtgnig1ggg025fgiidsirev8n4sb4j@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
> I think it's possible to create filters in Perl for use within BBEdit,
> but I don't know how myself. You might need a commercial version of
> BBEdit.
it's extremely easy to do this... just need to drop the script into the
perl scripts folder in BBEdit (I'm pretty sure it requires the
commercial version).. BBEdit sends the file you're working with to
STDIN, and then replaces it with whatever your script sends to STDOUT.
Doesn't require anything specific to macperl, either - just straight
text manipulation for the most part (though I'm sure you could make
something fancier, I just don't see why you'd necessarily need to).
saves me a TON of time cleaning up code in my html pages (fixing case to
my preference, adding "" around values, etc).
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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 V10 Issue 680
**************************************