[13763] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1173 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 21:12:25 1999

Date: Wed, 27 Oct 1999 18:12:01 -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: <941073121-v9-i1173@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 27 Oct 1999     Volume: 9 Number: 1173

Today's topics:
        About multi line comments. <smadathi@cisco.com>
    Re: About multi line comments. (Greg Bacon)
    Re: About multi line comments. <slanning@bu.edu>
    Re: About multi line comments. (Brett W. McCoy)
    Re: About multi line comments. (Abigail)
    Re: About multi line comments. <bezecourt@globeid.com>
    Re: About multi line comments. <slanning@bu.edu>
    Re: About multi line comments. <rra@stanford.edu>
    Re: About multi line comments. <lr@hpl.hp.com>
    Re: accepting and sending cookies to servers (Acting li <enemyNO-SPAM@yahoo.com>
    Re: accepting and sending cookies to servers <enemyNO-SPAM@yahoo.com>
    Re: accepting and sending cookies to servers <jtribbeck@argogroup.com>
        Accessing GZIP/TAR to uncompress/untar files <lee@webconexion.com>
    Re: Accessing GZIP/TAR to uncompress/untar files <gellyfish@gellyfish.com>
    Re: Accessing GZIP/TAR to uncompress/untar files (Matthew Bafford)
    Re: Accessing GZIP/TAR to uncompress/untar files (Brett W. McCoy)
        Accessing passwords via a perl script... <jjyooi@dcs.qmw.ac.uk>
    Re: Accessing passwords via a perl script... <rootbeer@redcat.com>
        Announce: BBDB.pm module nadine.and.henry@pobox.com
    Re: Announce: BBDB.pm module <rootbeer@redcat.com>
        ANNOUNCE: Mailing list for Perl trainers (Kirrily 'Skud' Robert)
        announcement: Mathematica in Perl: Mathematica.pm <xah@best.com>
        Anomymiser <affixit@usa.net>
    Re: Anomymiser <gellyfish@gellyfish.com>
    Re: Anomymiser <rootbeer@redcat.com>
        Anyone using PLS - or CPL search engine with Perl? (Bill Moseley)
        Apology <bz9t@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 26 Oct 1999 10:46:15 +0530
From: Sudheer Madathil <smadathi@cisco.com>
Subject: About multi line comments.
Message-Id: <3815391F.D171F13B@cisco.com>

Is there any way to do multi line comment in Perl.

Like /*   ........... */ in C language.


Thanks in Advance.


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

Date: 26 Oct 1999 19:17:56 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: About multi line comments.
Message-Id: <7v4up4$121$6@info2.uah.edu>

In article <7v40he$p7d$1@nnrp1.deja.com>,
	Thierry Bezecourt <bezecourt@globeid.com> writes:

: Warning :
: 
:   if(0){
:     BEGIN { print "This line is executed\n"; }
:   }

 ...or

    if (0) {
        my code will do some cool stuff here!
    }

Lazy parsing, anyone? :-)

Greg
-- 
When a man is more right than his neighbor, that constitutes a majority of
one.
    -- Thoreau


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

Date: 26 Oct 1999 09:22:22 -0400
From: Scott Lanning <slanning@bu.edu>
Subject: Re: About multi line comments.
Message-Id: <kus3duyp88h.fsf@strange.bu.edu>

Russ Allbery <rra@stanford.edu> writes:
> =for comment
> 
> ....
> 
> =cut

Thanks for the correction. I swear I'll learn pod one of these days.

-- 
"If lightning is the anger of the gods, the gods are concerned mostly
with trees." --Lao Tse


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

Date: Tue, 26 Oct 1999 13:32:09 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: About multi line comments.
Message-Id: <slrn81bbjp.3ef.bmccoy@moebius.foiservices.com>

Also Sprach Sudheer Madathil <smadathi@cisco.com>:

>Is there any way to do multi line comment in Perl.
>
>Like /*   ........... */ in C language.

Try something like this:

=comment
#stuff to comment out
=cut

-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: 26 Oct 1999 03:26:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: About multi line comments.
Message-Id: <slrn81apdo.fji.abigail@alexandra.delanet.com>

Sudheer Madathil (smadathi@cisco.com) wrote on MMCCXLVII September
MCMXCIII in <URL:news:3815391F.D171F13B@cisco.com>:
 .. Is there any way to do multi line comment in Perl.


FAQ


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]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 26 Oct 1999 10:41:50 GMT
From: Thierry Bezecourt <bezecourt@globeid.com>
Subject: Re: About multi line comments.
Message-Id: <7v40he$p7d$1@nnrp1.deja.com>

In article <kus4sfehdmb.fsf@strange.bu.edu>,
  Scott Lanning <slanning@bu.edu> wrote:
> Sudheer Madathil <smadathi@cisco.com> writes:
> > Is there any way to do multi line comment in Perl.
>
> if (0) {
>
> ....
>
> }

Warning :

  if(0){
    BEGIN { print "This line is executed\n"; }
  }


--
Thierry Bézecourt


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


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

Date: 26 Oct 1999 01:53:16 -0400
From: Scott Lanning <slanning@bu.edu>
Subject: Re: About multi line comments.
Message-Id: <kus4sfehdmb.fsf@strange.bu.edu>

Sudheer Madathil <smadathi@cisco.com> writes:
> Is there any way to do multi line comment in Perl.
> 
> Like /*   ........... */ in C language.

Smartass answer:

#
#  ....
#
#

Another answer:

if (0) {

 ....

}

That would be more like #if 0 comment in that
syntax should be correct inside comment.

Another answer:

Pipe through a pre-processor script, like "undef $/; s!/\*.*\*/!!"
(probably have to tweak it).

-- 
"It showed a lady, with a fur cap on and a fur stole, sitting upright
and holding out to the spectator a huge fur muff into which the whole
of her forearm had vanished!" --From Franz Kafka's Metamorphosis


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

Date: 25 Oct 1999 22:55:46 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: About multi line comments.
Message-Id: <yl904q7jj1.fsf@windlord.stanford.edu>

Scott Lanning <slanning@bu.edu> writes:

> if (0) {

> ....

> }

> That would be more like #if 0 comment in that
> syntax should be correct inside comment.

=for comment

 ....

=cut

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Mon, 25 Oct 1999 23:21:18 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: About multi line comments.
Message-Id: <MPG.127ee8314be6d1ff98a129@nntp.hpl.hp.com>

In article <3815391F.D171F13B@cisco.com> on Tue, 26 Oct 1999 10:46:15 
+0530, Sudheer Madathil <smadathi@cisco.com> says...
> Is there any way to do multi line comment in Perl.
> 
> Like /*   ........... */ in C language.

That is a Frequently Asked Question.

perlfaq7: "How can I comment out a large block of perl code?" 

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


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

Date: Tue, 26 Oct 1999 15:35:11 GMT
From: "KJS" <enemyNO-SPAM@yahoo.com>
Subject: Re: accepting and sending cookies to servers (Acting like a browser)
Message-Id: <PSjR3.3671$1n5.25813@news.rdc1.wa.home.com>

Ok.  I am still not sucessful with this task.  It seems like it should work
but I'm not having any luck.  I simply want to "fool" the server into
thinking it is talking to a browser and store a cookie(s) that is sent.  I
then want to return the cookie(s) with the next request -- like a web
browser does.

I read up on HTTP::Cookies and tried the following:

$ua = new LWP::UserAgent;
$cookie_jar = new HTTP::Cookies;

#Make first request and store cookie(s) in cookie jar
$res = $ua->request(GET 'http://somesite.com');
$cookie_jar->extract_cookies($res);

#Send stored cookie(s) in second request
$request = new HTTP::Request GET => 'http://somesite.com/cookie_wanted.pl';
$cookie_jar->add_cookie_header($request);
print $ua->request($request)->as_string;

This is not working for me -- is their something I am overlooking???

Thanks Again!!




Jason P Tribbeck wrote in message <38143D00.ADE26C31@argogroup.com>...
>
>Try perldoc HTTP::Cookies for some answers...
>
>--
>Jason Tribbeck                                     Argo Interactive ltd
>Senior Design Engineer                        7 Dukes Court, Chichester
>                                                  West Sussex, PO19 2FX
>Tel: +44 1243 815 815 Fax: +44 1243 815 805                     England
>KJS wrote:
>>
>> Hello!
>>
>> I'm trying to get my perl code to act like a web browser in that it will
>> accept a cookie from a web server and send it with a request.  I
currently
>> retrieve the document like this:
>>
>>   $ua = LWP::UserAgent->new();
>>   my $req = POST 'http://www.somedomain.com/cgi-bin/form_script.cgi,
>>       [ NAME => 'Bob', TOWN => 'anytown' ];
>>   $content = $ua->request($req)->as_string;
>>
>> I'd like to know:
>> 1. If it is possible to send a "stored" cookie in this request.
>> 2. How to store a cookie that is returned by this request.






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

Date: Tue, 26 Oct 1999 05:06:44 GMT
From: "KJS" <enemyNO-SPAM@yahoo.com>
Subject: Re: accepting and sending cookies to servers
Message-Id: <EFaR3.3297$1n5.24194@news.rdc1.wa.home.com>

Ok.  I read up on HTTP::Cookies and tried the following:

$ua = new LWP::UserAgent;
$cookie_jar = new HTTP::Cookies;

$res = $ua->request(GET 'http://somesite.com');
$cookie_jar->extract_cookies($res);

$request = new HTTP::Request GET => 'http://somesite.com/cookie_wanted.pl';
$cookie_jar->add_cookie_header($request);
print $ua->request($request)->as_string;

This is not working for me -- is their something I am overlooking???

Thanks Again!!


Jason P Tribbeck wrote in message <38143D00.ADE26C31@argogroup.com>...
>
>Try perldoc HTTP::Cookies for some answers...
>
>--
>Jason Tribbeck                                     Argo Interactive ltd
>Senior Design Engineer                        7 Dukes Court, Chichester
>                                                  West Sussex, PO19 2FX
>Tel: +44 1243 815 815 Fax: +44 1243 815 805                     England
>KJS wrote:
>>
>> Hello!
>>
>> I'm trying to get my perl code to act like a web browser in that it will
>> accept a cookie from a web server and send it with a request.  I
currently
>> retrieve the document like this:
>>
>>   $ua = LWP::UserAgent->new();
>>   my $req = POST 'http://www.somedomain.com/cgi-bin/form_script.cgi,
>>       [ NAME => 'Bob', TOWN => 'anytown' ];
>>   $content = $ua->request($req)->as_string;
>>
>> I'd like to know:
>> 1. If it is possible to send a "stored" cookie in this request.
>> 2. How to store a cookie that is returned by this request.




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

Date: Mon, 25 Oct 1999 12:20:32 +0100
From: Jason P Tribbeck <jtribbeck@argogroup.com>
Subject: Re: accepting and sending cookies to servers
Message-Id: <38143D00.ADE26C31@argogroup.com>

KJS wrote:
> 
> Hello!
> 
> I'm trying to get my perl code to act like a web browser in that it will
> accept a cookie from a web server and send it with a request.  I currently
> retrieve the document like this:
> 
>   $ua = LWP::UserAgent->new();
>   my $req = POST 'http://www.somedomain.com/cgi-bin/form_script.cgi,
>       [ NAME => 'Bob', TOWN => 'anytown' ];
>   $content = $ua->request($req)->as_string;
> 
> I'd like to know:
> 1. If it is possible to send a "stored" cookie in this request.
> 2. How to store a cookie that is returned by this request.

Try perldoc HTTP::Cookies for some answers...

-- 
Jason Tribbeck                                     Argo Interactive ltd
Senior Design Engineer                        7 Dukes Court, Chichester
                                                  West Sussex, PO19 2FX
Tel: +44 1243 815 815 Fax: +44 1243 815 805                     England


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

Date: Mon, 25 Oct 1999 15:42:23 +0100
From: "Lee" <lee@webconexion.com>
Subject: Accessing GZIP/TAR to uncompress/untar files
Message-Id: <7v1ppq$225p$1@quince.news.easynet.net>

Hi,

I want to use a CGI PERL script to ungzip and untar a file. Ive tried the
following:

print `tar xvf filename`

but this does not seem to work. Any ideas for alternative methods?

Cheers




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

Date: 25 Oct 1999 15:54:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Accessing GZIP/TAR to uncompress/untar files
Message-Id: <38146f09_2@newsread3.dircon.co.uk>

Lee <lee@webconexion.com> wrote:
> Hi,
> 
> I want to use a CGI PERL script to ungzip and untar a file. Ive tried the
> following:
> 
> print `tar xvf filename`
> 
> but this does not seem to work. Any ideas for alternative methods?
> 

 You can use the modules Archive::Tar and Compress::Zlib from CPAN -
I would however be interested to know in what way running tar like that
doesnt work ...

/J\
-- 
"While they're pumping, you're soaking them" - Speed Loader TV Advert


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

Date: Mon, 25 Oct 1999 15:02:24 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Accessing GZIP/TAR to uncompress/untar files
Message-Id: <slrn818s8a.2cq.*@dragons.duesouth.net>

Lee" <lee@webconexion.com>, thinking with his hands, posted the
following to comp.lang.perl.misc: 
: I want to use a CGI PERL script to ungzip and untar a file. Ive tried the
: following:

It's Perl for the language, perl for the program.

The script follows the CGI, it isn't a CGI.  As Abigail pointed out, the
CGI is written in English, not a programming language.
 
: print `tar xvf filename`
: 
: but this does not seem to work. Any ideas for alternative methods?

What does not work?

What does it print?

Even more importantly, what does tar print?

You said you need to ungzip the file; you do realize that tar doesn't do
that unless asked, don't you?
 
Perhaps there's a module on CPAN that will do what you want, perhaps one
with the word 'tar' or 'gzip' in it.
 
: Cheers

HTH, HAND,

--Matthew


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

Date: Mon, 25 Oct 1999 14:55:29 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Accessing GZIP/TAR to uncompress/untar files
Message-Id: <slrn818s40.u3d.bmccoy@moebius.foiservices.com>

Also Sprach Lee <lee@webconexion.com>:

>I want to use a CGI PERL script to ungzip and untar a file. Ive tried the
>following:
>
>print `tar xvf filename`
>
>but this does not seem to work. Any ideas for alternative methods?

No, that's not going to work.  You'd want something like:

system("tar xvf $filename") #assuming you have the filename stuffed into a 
                            #variable

or even using backticks this way:

$result = `tar xvf $filename`; #run the command and stuff output into
                               #$result

If you're doing this with CGI, be very very careful.  Running system calls
under a CGI program can be a big security hole.  What if somehow (perhaps
through user input) the file name got changed to "file.tgz; rm -fr"?  
That'd be a big problem!  Are you using taint checks (put -T in the
shebang line)?

--
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: Mon, 25 Oct 1999 12:28:14 +0100
From: Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk>
Subject: Accessing passwords via a perl script...
Message-Id: <38143ECE.2293B85C@dcs.qmw.ac.uk>

I have a password file (passwords.dat) which has a list of the passwords
for the system. I also have a list of users (users.dat.) I'd like to
know if it's possible to access the passwords.dat file via a perl script
to see and/or update the users passwords. The passwords.dat file has the
passwords encrypted with the MD5 encryption because my apache server is
running in Windows. I've downloaded the Digest-MD5-2.09.tar.gz from CPAN
but I don't know if that's going to be any help. Can anyone advise me? I
can't seem to get any info out of the Perl FAQ either. The crypt
function doesn't help -- it generates strings completely differently.
I'm trying not to pull my hair out. Can anybody help meeeeeeee?


-- 
Johnny Ooi. Aliases: Loopy, Tuxedo Mask, Quote Master.....
E-Mail		: jjyooi@dcs.qmw.ac.uk or jjyooi@yahoo.com
WWW		: http://www.dcs.qmw.ac.uk/~jjyooi/ or
http://members.xoom.com/Tuxedo_Loopy
ICQ No          : 6155774

"Stay sane guys!"

===============================================================


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

Date: Mon, 25 Oct 1999 13:49:53 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Accessing passwords via a perl script...
Message-Id: <Pine.GSO.4.10.9910251346360.29843-100000@user2.teleport.com>

On Mon, 25 Oct 1999, Johnny 'Loopy' Ooi wrote:

> I have a password file (passwords.dat) which has a list of the
> passwords for the system. I also have a list of users (users.dat.) I'd
> like to know if it's possible to access the passwords.dat file via a
> perl script to see and/or update the users passwords.

The fact that the data are passwords doesn't affect this one way or
another. A perl program can, in general, update a file. So, yes, this
should be possible.

> The passwords.dat file has the passwords encrypted with the MD5
> encryption because my apache server is running in Windows.

Then you'll want to use the same encryption method that the server uses.

> I've downloaded the Digest-MD5-2.09.tar.gz from CPAN
> but I don't know if that's going to be any help. 

Probably not, if you're running on Windows. I think that MD5 should be
available precompiled for you from ActiveState, though.

    http://www.activestate.com/

If you need help on details of the file format or encryption method,
search for docs, FAQs, and newsgroups related to those things. Cheers!

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



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

Date: Tue, 26 Oct 1999 23:48:44 GMT
From: nadine.and.henry@pobox.com
Subject: Announce: BBDB.pm module
Message-Id: <7v5eks$s0t$1@nnrp1.deja.com>

All you insidious users out there, you know who you are.  Here is
a new PERL module I wrote that makes it relatively easy to read
and write Big Brother DataBase files.  If you're interested, go to

http://www.maztravel.com/perl/

and get your own copy.  Enjoy.

Best wishes,
Henry Laxen


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


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

Date: Tue, 26 Oct 1999 20:28:52 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Announce: BBDB.pm module
Message-Id: <Pine.GSO.4.10.9910262028260.29843-100000@user2.teleport.com>

On Tue, 26 Oct 1999 nadine.and.henry@pobox.com wrote:

> All you insidious users out there, you know who you are.  Here is
> a new PERL module I wrote that makes it relatively easy to read
> and write Big Brother DataBase files.  If you're interested, go to
> 
> http://www.maztravel.com/perl/
> 
> and get your own copy.

Why aren't you putting it on CPAN as well?

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



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

Date: 26 Oct 1999 02:20:09 GMT
From: skud+usenet@netizen.com.au (Kirrily 'Skud' Robert)
Subject: ANNOUNCE: Mailing list for Perl trainers
Message-Id: <slrn81a3un.i88.skud+usenet@hiro.netizen.com.au>

Well, Nat Torkington tells me that he set up a list for this purpose at
perl.org but never publicised it, and offered that address to run it 
from.  Since perl.org is a more central place than Netizen, I figured it
was a good idea.

So.  To subscribe to the list, send email to 
perl-trainers-subscribe@perl.org (you don't need to put anything
special in your message).

The list FAQ/policy/etc is as I posted the other day to clpmod:

>Scope of conversation and sample topics:
>- Methods and techniques for teaching Perl
>- Course materials, development of course notes
>- Logistics - organising courses, venues, bookings, publicity
>- Dealing with problems in training - difficult students, etc
>- Other perl-training-related discussion
>
>List subscription policy:
>Open (confirmation required); anyone can join and contribute, as long
>as they're on topic.
>
>If you are a professional Perl trainer, or a hobbyist Perl trainer,
>or are thinking of becoming a Perl trainer, and think you'd be interested
>in subscribing, please email me and let me know.  If I get half a dozen
>email replies I'll go ahead with it.

I've had about twenty expressions of interest already, so I think this 
will turn out to be a very worthwhile mailing list.

K.


-- 
Kirrily Robert <skud@netizen.com.au>
http://netizen.com.au/ - Internet and Open Source development and consulting
Level 10, 99 Queen St, Melbourne VIC 3000
Phone: +61 3 9602 2452   Fax: +61 3 9642 4955


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

Date: Mon, 25 Oct 1999 04:49:28 -0700
From: Xah <xah@best.com>
Subject: announcement: Mathematica in Perl: Mathematica.pm
Message-Id: <B43991D8.3DC3%xah@best.com>

Last year I've been developing a Perl module that emulate the whole set of
Mathematica's tree processing functions.

Unfortunately, I've never finished the project. However, the module contain
most of the hard functions. I'm now putting it on the web so that it may
spur further development by me or any person interested. The module is
licensed under GPL.

It is at

 http://www.best.com/~xah/PerlMathematica_dir/perlMathematica.html

Below my signature is part of the documentation.

 Xah
 xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 The three principle virtues of Perl programers: mundaneness, sloppiness,
 and fatuousness.  -- Larry Wall, from antimatter universe


NAME
    Mathematica - A Perl package for expression structure based
    functional programing.

SYNOPSIS
     # importing all functions. Recommended.
     use Tree::Mathematica;

     # importing a selection of functions.
     use Tree::Mathematica ('functionName1', 'functionName2', ...);

DESCRIPTION
    This package provides about 30 functions for creating and
    manipulating trees. (tree as nested lists) These functions
    include tree constructors, selectors, mutators, structure
    transformers and a set of functions usually found in functional
    programing languages. Together they form a consistent way of
    functional programing on trees -- a paradigm often used in Lisp
    programing. These functions are modeled after the Mathematica
    language.

    Perl provides nested lists using references. Familiarity with
    Perl references is necessary in using this module. See the "See
    Also" section at the bottom for helpful references.

    In this documentation, a tree will mean a nested lists of the
    form [[...],...]. In other words, when you read "...f(tree) does
    xxx.", it means the argument to f is a reference to a list.
    Anything in the tree that is not an array reference is
    considered an atom. Atoms should be either numbers or strings.
    Other data types such as hash, tie, typeglob, handle, reference
    to anything other than array, are not expected.

    The following is a list of functions that can be exported,
    followed by detailed documentation.

    Tree constructors
        Range, Table

    Tree measurers
        Depth, LeafCount, NonleafCount, NodeCount, Dimensions

    Branchs and Nodes Extractors
        Part, Level

        Possible Addition: Extract, Take, Drop, Rest, First, Last,
        Cases, DeleteCases.

    Structure Transformation
        Transpose, FlattenAt

        Unimplemented: Distribute, Thread, Operate, Flatten,
        Sequence.

    Functions on Flat Lists
        RotateLeft

        Unimplemented: Union, Intersection, Complement, Append,
        Prepend, Join, Partition, Split

    Funtional Programing Tools
        Function

    Function on Trees
        Map

        Unimplemented: Apply, MapIndexed, MapAll, MapThread, Nest,
        NestList, FixedPoint, FixedPointList, Fold, FoldList, Outer,
        Inner, Cross.

    Tree Index Set Utilities
        RandomIndexSet, LeavesIndexSet, NonleavesIndexSet,
        MinimumIndexSet, CompleteIndexSet, IndexSetSort,
        TreeToIndexSet, IndexSetToTree

    Miscellaneous Functions
        UniqueString, RandomInteger, RandomReal

    Internal Functions
        _iteratorFullForm, _lengthOfIterator, _rangeSequence,
        _postIncrement, _equalNumericalArrayQ, _nonleafQ,
        _inferableIndexQ,

        _rangeFullArgsWithErrorCheck, _rangeWithGoodArgs,

        _randomIndexSetFullArguments, _indexOrdering,

        _indexSetSortFullArguments



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

Date: Wed, 27 Oct 1999 10:22:23 +0200
From: "Laurent" <affixit@usa.net>
Subject: Anomymiser
Message-Id: <7v6cp1$9kj$1@front5.grolier.fr>

Hi, has anyone an idea of where I can find an anomymiser script.
The idea get a URL from an input field and rewrite the page with a comment!
Thanks
Laurent




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

Date: 27 Oct 1999 20:40:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Anomymiser
Message-Id: <7v7nvt$jpe$1@gellyfish.btinternet.com>

On Wed, 27 Oct 1999 10:22:23 +0200 Laurent wrote:
> Hi, has anyone an idea of where I can find an anomymiser script.
> The idea get a URL from an input field and rewrite the page with a comment!
> 

The following doesnt do that but is an example of how you might do that
using LWP and HTML::Parser.  This was made for a specific case - of altering
pages move inaccessible through the thoughtless use of the M$ FrontRage 
'Hover Buttons' - any contributions to make it more generally useful
are gratefully accepted :


#!/usr/bin/perl -w

package HBCProxy;

use strict;
use CGI qw(:standard escape);

use vars qw($fp_url $fp_image $fp_text);

@HBCProxy::ISA = qw(HTML::Parser);

require HTML::Parser;
use LWP::UserAgent;

my $base = param('base') || 'http://www.hastings.gov.uk';
my $me = script_name;
my $referer = referer();
my $in_applet;
my $seen_declaration;
my $declare = q%<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">%;

my $ua = new LWP::UserAgent;
$ua->agent("No More Frontpage");

my $xpage;

if ( $xpage = param('page'))
  {
    $xpage = $base . '/' . $xpage;
  }
else
  {
    $xpage = $base;
  }

my $req = new HTTP::Request 'GET' => $xpage;

$req->header('Accept' => 'text/html');

# send request
my $res = $ua->request($req);

print header;

# check the outcome
if ($res->is_success) 
{
   my $parser = new HBCProxy;
   $parser->parse($res->content);
} 
else 
{
   my $style =<<OSTYLE;
BODY {
       Background: white;
     }
H1   {
       Text-align: center;
       font-family: arial,helvetica,sans-serif;
      }
P.Bl  {
       font-family: arial,helvetica,sans-serif;
      }
OSTYLE

   print start_html(-title => 'The HBC Website is not available',
                    -style => $style);

   print <<EOHTML;
<H1>
  It appears the page or site you requested is not available at the moment
</H1>
<H1>
  Please try again soon
</H1>
<P class=B1>
 <A HREF="$referer">
   Back to referring page
 </A>
</P>
<P>
        <A HREF="http://www.gellyfish.com">
      <IMG src="http://www.gellyfish.com/graphics/gell2.gif" 
           width="269" 
           height="78"
           border=0
           alt="Gellyfish Software">
      </A>   
</P>
EOHTML

print end_html;
}


sub declaration
{
  my ($me,$declare) = @_;
  print "<!$declare>";
  $seen_declaration++;
}

sub start
{
  my($self,$tag,$attr,$attrseq,$orig) = @_;

  if($tag =~ /html/i )
    {
      print $declare,"\n" unless $seen_declaration;
    }

   
  $in_applet++ if($tag =~ /applet/);

  if ( $in_applet)
    {
      if($tag =~ /param/)
        {
          $fp_url = $attr->{'value'} if $attr->{'name'} =~ /^url$/i;
          $fp_text = $attr->{'value'} if $attr->{'name'} =~ /^text$/i;
          $fp_image = $attr->{'value'} if $attr->{'name'} =~ /^image$/i;
        }
    }
  else
    {
      my $fulltag = $tag;
      my $fullattr;
      if ($tag eq 'img')
        {
             
          foreach my $attribute ( @{$attrseq} )
            {
              if ($attribute eq 'src' )
                {
                 if ($attr->{src} =~ /^http:/i)
                   {
                      $fullattr =  "SRC=\'"  . $attr->{src} . "\'"; 
                   }
                 else
                   {
                     $fullattr =  "SRC=\'" . $base . '/' . $attr->{src} . "\'"; 
                   }
                }
              else
                {
                 $fullattr = uc($attribute) . "=\'" . $attr->{$attribute} . "\'";
                }
              $fulltag .= " " . $fullattr;
            }
         print "<$fulltag>";
        }
      elsif ($tag eq 'a' || $tag eq 'area')
        {
             
          foreach my $attribute ( @{$attrseq} )
            {
              if ($attribute eq 'href' && $attr->{href} !~ /^http:/i )
                {
                  my $xhref = escape($attr->{href});
                  my $burl = escape($base);
                  $fullattr =  qq%HREF="$me?page=$xhref&base=$burl"%; 
                }
              else
                {
                 $fullattr = uc($attribute) . "=\'" . $attr->{$attribute} . "\'";
                }
              $fulltag .= " " . $fullattr;
            }
         print "<$fulltag>";
        }
      elsif ($tag eq 'body')
        {

          foreach my $attribute ( @{$attrseq} )
            {
              if ($attribute eq 'background' )
                {
                  $fullattr =  "background=\'" . $base . '/' . $attr->{background} . "\'";
                }
              else
                {
                 $fullattr = uc($attribute) . "=\'" . $attr->{$attribute} . "\'"
;
                }
              $fulltag .= " " . $fullattr;
            }
         print "<$fulltag>";
         }
       else
         { 
           print $orig;
         }
    }
             
}

sub text
{
  my ($self,$text) = @_;

  $text =~ s/\cM//g;

  print $text unless $text =~ /^\s+$/;
}

sub end 
{
    my ($self,$tag,$origtext) = @_;

    if ( $in_applet && $tag =~ /applet/i )
      {
       if ($fp_url eq 'value' )
         {
          print qq%<IMG SRC="$base/$fp_image" ALT="$fp_image">\n%;
         }
       elsif( $fp_url !~ /^mailto:/)
         {       
           my $curl = escape($fp_url);
           my $xbaseurl = escape($base);
           print <<EOLINK1;
<A HREF="$me?page=$curl&base=$xbaseurl">
   <IMG SRC="$base/$fp_image"
        ALT="$fp_image">
</A>
EOLINK1
         }
      else 
         {
           print <<EOLINK2;
<A HREF="$fp_url">
<STRONG><FONT COLOR=black>$fp_text</FONT></STRONG>
</A>
EOLINK2
        }
        $in_applet--;
      }
    else
      {
        print $origtext; 
      }        
}
__END__

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Wed, 27 Oct 1999 11:05:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Anomymiser
Message-Id: <Pine.GSO.4.10.9910271102450.29843-100000@user2.teleport.com>

On Wed, 27 Oct 1999, Laurent wrote:

> Hi, has anyone an idea of where I can find an anomymiser script.

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. 

> The idea get a URL from an input field and rewrite the page with a
> comment!

Maybe you want one of the munging proxies out there. There's an example in
Randal's WebTechniques column number 11.

    http://www.stonehenge.com/merlyn/WebTechniques/

Cheers!

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



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

Date: Wed, 27 Oct 1999 07:46:26 -0700
From: moseley@best.com (Bill Moseley)
Subject: Anyone using PLS - or CPL search engine with Perl?
Message-Id: <MPG.1280b0187f9aa9a398981d@nntp1.ba.best.com>

I'm wondering if anyone has built a database front-end in Perl that uses 
Personal Library Software (PLS, now owned by AOL).  Specifically, their 
CPL application.

Thanks,


-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Tue, 26 Oct 1999 21:36:59 -0400
From: "Billy Zhao" <bz9t@yahoo.com>
Subject: Apology
Message-Id: <7v5l0m$18e$1@murdoch.acc.Virginia.EDU>

CLPM,

I'm apologize for any discomfort/problems my post might have caused you.
Upon review, it appears I did not word my original post to reflect what I
had intended to say.  What I had in mind was to have people familiar with
REBOL (with a Perl background) to respond with their perspective on whether
said language lives up to its supposed potential.  I guess what I was
looking for is something similar to Larry Wall's post about the same topic,
but from a more implementation standpoint rather than a design standpoint.

Again, sorry for the trouble.

Billy Zhao




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

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


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