[13508] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 918 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 27 07:07:19 1999

Date: Mon, 27 Sep 1999 04:05:10 -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: <938430309-v9-i918@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 27 Sep 1999     Volume: 9 Number: 918

Today's topics:
    Re: **Perl tutorials!** <gellyfish@gellyfish.com>
    Re: a question of buttons <davids@desertigloo.com>
    Re: a question of buttons <davids@desertigloo.com>
    Re: applications of perl ?? <vishx@mailcity.com>
        CGI or JDBC <tehaenel@cyllene.uwa.edu.au>
        CGI Session? <m.scheferhoff@gmx.de>
    Re: Command Line CGI Script <admin@gatewaysolutions.net>
        Displaying an image <scott@salmon.ltd.uk>
    Re: finding number of items in an array <moshez@math.huji.ac.il>
    Re: how to "use" my variables in modules (Ilya Zakharevich)
    Re: how to "use" my variables in modules (Ilya Zakharevich)
    Re: How to create files from CGI script? <davids@desertigloo.com>
    Re: How to play a wave file from another app (Abigail)
    Re: HTML to ASCII <help@casinofantasy.com>
    Re: I just want to remove a file! Help! <WiseGuy_73@go.com>
        logging func has stopped logging <kevin.porter@fast.no>
    Re: logging func has stopped logging <espen@nextel.no>
        Looking for Downloadscript <bendersk@in.tum.de>
    Re: New trolling strategy ? c_j_marshall@my-deja.com
        Problems with Win32::OLE <Christian.Habermehl@fhtw-berlin.de>
    Re: remove the html tag in the file <skilchen@swissonline.ch>
    Re: Replacement "CD" for win32 systems <simon.plant@citrix.com>
    Re: Replacement "CD" for win32 systems <simon.plant@citrix.com>
        Socket module <tjudd@teleport.com>
        Sorting Associative arrays then matching one field to a <Nick@ucecom.com>
    Re: toLowercase?? <Reiner_Buehl@hp.com>
    Re: Why does my code NOT work? <rusenet@bigfoot.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 27 Sep 1999 09:27:36 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: **Perl tutorials!**
Message-Id: <37ef2a78_1@newsread3.dircon.co.uk>

David Cassell <cassell@mail.cor.epa.gov> wrote:
> IlIIIIIIII wrote:
>> 
>> I found a bunch at http://devlibrary.tsx.org/ !
> 
> Well, if it isn't our ol' pal IlIIIIIIII drumming up more fake
> hype for his site.  Let's see.  He hasn't pestered this NG with
> this very same line for more than a month now, has he?
> 

I'm sure that I mailed abuse@aol.com with this before ...

/J\
-- 
"If I was going to wear a wig I'd choose something a lot better than this"
- Barry Norman


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

Date: Mon, 27 Sep 1999 02:12:02 -0700
From: "David P. Schwartz" <davids@desertigloo.com>
Subject: Re: a question of buttons
Message-Id: <37EF34E2.9448A457@desertigloo.com>

Abigail wrote:

> David P. Schwartz (davids@desertigloo.com) wrote on MMCCXVII September
> MCMXCIII in <URL:news:37EDBDE6.C7FD9254@desertigloo.com>:
> %% How is it possible (if at all) to use multiple buttons on an HTML form?
>
> That's not a Perl question, is it?
>
> Abigail
> --
> sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
> "$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
> *_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
> _::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
>
>   -----------== 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 ==-----

Gee, I'm truly sorry to distract so many of you experts from your efforts to come up
with ever more complex and subtle "Just another Perl Hacker" scripts with such petty
issues...

The HTML part is simple.  I don't have a question about that.  Ok?  Is that clear?

If I put three buttons on an HTML form, with different names and values, what shows
up in my Perl script when it runs is ...  three buttons with different names and
values.  Duh.  So, which one was pressed?  I don't know where to find this.  I don't
know if this is a Perl question or not.

-David





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

Date: Mon, 27 Sep 1999 02:14:06 -0700
From: "David P. Schwartz" <davids@desertigloo.com>
Subject: Re: a question of buttons
Message-Id: <37EF355E.924D42DA@desertigloo.com>

jlsimms@hotmail.com wrote:

> Unfortunately, using multiple buttons on a form isn't as easy as many
> would like it to be.  You are correct - most people handle the
> situation with a scriptiing language.  The problem is easy if you just
> wanted, say, a submit button and a cancel button (not simply a reset
> button), but any more than that is trickier.  For some examples of how
> to handle this, the question should probably taken to
> comp.infosystems.www.authoring.cgi, or somewhere similar.
>
> Jason Simms
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Thanks for the pointer.



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

Date: Mon, 27 Sep 1999 14:07:20 +0530
From: S Vishwanath <vishx@mailcity.com>
Subject: Re: applications of perl ??
Message-Id: <37EF2CBF.CE60A30E@mailcity.com>

Ala Qumsieh wrote:

> [posted and CCed]
>
> S Vishwanath <vishx@mailcity.com> writes:
>
> > can some body help me by elaborating the exact nature of use of perl
> > (especially in vlsi design) .
>
> What exactly do you want to know? Perl's use is exactly equivalent to
> C's use (or any other language for that matter). Perl is just a
> programming language.
>
> (I hope you are not confusing it with Pearl, which is a proprietary
> program by Cadence that does static timing analysis. The two are of
> course totally unrelated)
>
> I happen to be in the area of VLSI design, and I happen to use Perl a
> lot in my work because I have to occasionally analyze and modify huge
> text files (DEF, LEF, verilog, vhdl files which can easily be a few
> hundred MBs large). In this respect, I find Perl very convenient and
> fast (both to code and run) and have already developped many useful
> tools in it to the extent that my manager (who doesn't know Perl) asks
> any newly hired employees to learn Perl if they don't know it already.
>
> Did you have anything more specific in mind?
>
> HTH,
> --Ala

thnx
now im geting a faint idea why we were taught perl during our training



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

Date: Mon, 27 Sep 1999 16:14:07 +0800
From: Thomas Haenel <tehaenel@cyllene.uwa.edu.au>
Subject: CGI or JDBC
Message-Id: <37EF274C.51B53576@cyllene.uwa.edu.au>

Hi

what are the pros and cons of using one technology over another ? I
don't really want to have to learn PErl but it seems cheaper than paying
for a good JDBC driver like the one from IDS software. Will CGI continue
to be used in the future ?

Thanks, TOm.



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

Date: Mon, 27 Sep 1999 11:16:12 +0200
From: Michael Scheferhoff <m.scheferhoff@gmx.de>
Subject: CGI Session?
Message-Id: <37EF35DC.387FDE85@gmx.de>

Hello,

I have a problem, I think it's based on a CGI problem, but I don't know.

On my local intranet I installed the INN newsserver. I wrote a script
with the help of functions that the modules CGI and NNTP are giving.
With my script you can for example add postings to my newsgroups. If I
open one browser this is no problem and the posting arrives and is
displayed. But when I start a second browser, or if I try from another
PC the posting seems to be sent, but it never arrives. What I then
tought is that there perhaps exists something like a CGI session or so.
With the next step I change all my global variables to local variables
preceding "my" to tell then to be local, but this didn't solve my
problem.

Does anybody have an idea, what's the problem?

Thanks for your help,

Michael



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

Date: Mon, 27 Sep 1999 06:00:21 -0500
From: "Scott Beck" <admin@gatewaysolutions.net>
Subject: Re: Command Line CGI Script
Message-Id: <ruujd0qk3i536@corp.supernews.com>


Scott Beck wrote:
> While running a script from the command line
> I understand that the script takes on the UID of the user
> running the script.
> Tell me if this is wrong. If it is the rest of this question is moot.
> I need to create a directory as the standard User Nobody or what ever on
> that server is the equivalent to what CGIs run as.
> I thought about chown but it is not a very portable solution since not all
> servers support this from non-root users.
>
> Does someone know how I can do this from a script that has to be ran on
the
> command line?

Dan wrote:
>>Ok, so I'm missing something. Why do you care about user 'nobody' (usually
>>owned by the web server), if you're only running from the command line.

The script I am running is an install script for a program.
The program will not run from the command line but from the browser.
It will need read, write, and create privileges on the directories that are
created
with the install script.
The only way to do this is set the directories permissions to 0777 or have
them owned
by the script.
The first option is a security risk and should not be done.

Thanks
Scott Beck



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

Date: Mon, 27 Sep 1999 12:00:02 +0100
From: "Scott Pritchett" <scott@salmon.ltd.uk>
Subject: Displaying an image
Message-Id: <7snipv$ean$1@lure.pipex.net>

I am having trouble with this code (it's a bit complicated:)) :-

#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
print header,
start_html,
img({-src=>'d:\apache\cgi-bin\aw.gif'}),
end_html;
exit;


which generates :-

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>Untitled Document</TITLE>
</HEAD><BODY><IMG SRC="d:\apache\cgi-bin\aw.gif"></BODY></HTML>

This works fine in ActivePerl but on the Unix box the picture just will not
display, the only change is the file name of the image.

Code on Unix is :-

#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
print header,
start_html,
img({-src=>'/usr/local/apache/images/aw.gif'}),
end_html;
exit;

It seems not to be able to find the picture, when I look at the properties
of the icon (where the picture is meant to be) it says the protocol is HTTP,
type GIF Image, and the address
http://awaaaaaa:8080/usr/local/apache/images/aw.gif

Any help appreciated it's driving me mad.






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

Date: Mon, 27 Sep 1999 10:21:48 +0200
From: Moshe Zadka <moshez@math.huji.ac.il>
Subject: Re: finding number of items in an array
Message-Id: <Pine.SOL.3.96.990927101940.16383C-100000@sundial>

On 25 Sep 1999, Abigail wrote:

> ,, What would be the easisest way to find out how many items I have in an
> ,, array?
> 
> If you know some math, and especially some tricks related to logarithms,
> it's incredibly easy!
> 
>      my  $i = 1;
>      my ($nr_of_items) = reverse map {$i <<= 1} @array;
>          $nr_of_items  = log ($nr_of_items or 1) / log (2 or $nr_of_items);

Ummm...precision problems?
I'd use the Math::BigInt module if I were you ;-)
--
Moshe Zadka <mzadka@geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.



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

Date: 27 Sep 1999 07:59:45 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: how to "use" my variables in modules
Message-Id: <7sn85h$9o3$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@delanet.com>],
who wrote in article <slrn7uu5ht.8gi.abigail@alexandra.delanet.com>:
> && Don't all global variables bind at runtime?
> 
> I don't know what you mean by that. Bind to what?

The question was put absolutely correct.  "Names" bind to addresses of
chunks of memory which keep the relevant info.  In other words, to SV*.

And NO, name resolution happens at compile time.  There is a couple of
dereferences at run time to allow for dynamic 
   local $var;
and
   local *$var;
but nevertheless in practice globals are as quick as lexicals.

Ilya


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

Date: 27 Sep 1999 08:01:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: how to "use" my variables in modules
Message-Id: <7sn88r$9ol$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@delanet.com>],
who wrote in article <slrn7uu5a8.8gi.abigail@alexandra.delanet.com>:
> A my variable will not be visible in a different file, unless you use
> eval tricks.

No tricks are necessary.  Just export the guys.

  sub import {
    *caller's::var_name = \$my_name;
  }

Ilya


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

Date: Mon, 27 Sep 1999 02:23:05 -0700
From: "David P. Schwartz" <davids@desertigloo.com>
Subject: Re: How to create files from CGI script?
Message-Id: <37EF3779.53E87E10@desertigloo.com>

Kragen Sitaker wrote:

> In article <37EDAEFC.C929A798@desertigloo.com>,
> David P. Schwartz <davids@desertigloo.com> wrote:
> >This strikes me as very unusual and unexpected behavior.  Is there some
> >chance that
> >directories named "protected" are set to behave differently than normal?
> >Or perhaps
> >even subdirs beneath tmp (it's possible, but unlikely)?
>
> No.  What part of it strikes you as unusual and unexpected?  That I
> couldn't rm or mv the file?
> --

Well, that too. You had read+write perms on the dir.  So it looks like you couldn't
read or write from/to it.  What am I missing here?



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

Date: 27 Sep 1999 02:07:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to play a wave file from another app
Message-Id: <slrn7uu6ch.8gi.abigail@alexandra.delanet.com>

David (yngwie@home.com) wrote on MMCCXVIII September MCMXCIII in
<URL:news:37EEB57C.EAC53B81@home.com>:
~~ I need to send a wave file to x11amp from a cgi/perl script. I have the
~~ wave name in a variable. How do I call another application to play the
~~ wave?

That's a question that get asked about 150 times a year.

system, open, qx and exec.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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: Mon, 27 Sep 1999 18:29:58 +1000
From: Anonymous <help@casinofantasy.com>
Subject: Re: HTML to ASCII
Message-Id: <37EF2B05.1CA826F8@casinofantasy.com>

what is RTFDTD? hope your not gonna shoot me now are ya?


Jonathan Stowe wrote:

> In comp.lang.perl.misc Abigail <abigail@delanet.com> wrote:
> >
> > Let's shoot people who don't RTFDTD.
> >
>
> Thats a *little* harsh wouldnt you say ?  I would suggest flogging
> it least it gives them an opportunity to recant.
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> <http://www.gellyfish.com>
> Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>



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

Date: Mon, 27 Sep 1999 08:57:21 GMT
From: Wise Guy <WiseGuy_73@go.com>
Subject: Re: I just want to remove a file! Help!
Message-Id: <7snbhf$vau$1@nnrp1.deja.com>

bonobo <bonoboNOhkSPAM@webtv.net> wrote:
> I'm trying to remove a file via a setuid perl script:
>
> #!/usr/bin/perl -T
> for (@ARGV) {
>     if ($_ =~ /^([-\@\w.]+)$/) {
>         $data = $1;                     # $data is untainted
>     } else {
>         die "Bad data in $data";        # log this somewhere
>     }
>     unlink $data;
> }
>
> The file will be something like: /var/spool/mail/test
> I am having no luck at all finding the right regular
> expression to clean this data.  Please send suggestions to:
> jward@cmg.net if you can help me.

Use quotemeta before using the name of the file to take care of the "/".


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


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

Date: Mon, 27 Sep 1999 11:14:53 +0100
From: kev <kevin.porter@fast.no>
Subject: logging func has stopped logging
Message-Id: <37EF439D.959AD06F@fast.no>

Hi,

I have a function that I can call in my program to send output to a log
file. I have always been able to do a 'tail -f baldrick.log' so that I
can see exactly what is going on for debugging purposes. Here's the
logging function:

sub baldricklog
{
        open( LOG, ">>$basedir/baldrick.log" );
        print LOG time, "\t@_\n";
        close( LOG );
}

Today, however, it has stopped writing to the file baldrick.log. It is
just a zero-length file with nothing ever being written to it, even
though I still have all my baldricklog() calls still in the program.
Can anyone tell me what is going on here? I guess there may be some sort
of a flushing problem (please tell me how to flush output, if needed),
but why would it work fine for months and then suddenly refuse to write
anmything to the file?

TIA<

- Kev



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

Date: Mon, 27 Sep 1999 12:36:28 +0200
From: Espen Myrland <espen@nextel.no>
Subject: Re: logging func has stopped logging
Message-Id: <37EF48AC.EDB8BAC3@nextel.no>

kev wrote:

> Hi,
>
> I have a function that I can call in my program to send output to a log
> file. I have always been able to do a 'tail -f baldrick.log' so that I
> can see exactly what is going on for debugging purposes. Here's the
> logging function:
>
> sub baldricklog
> {
>         open( LOG, ">>$basedir/baldrick.log" );
>         print LOG time, "\t@_\n";
>         close( LOG );
> }
>

Alway test the result from system calls!

open (LOG, ">> $basdir/baldric.log") or die "cannot open baldrik $!\n";

espen



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

Date: Mon, 27 Sep 1999 10:10:54 +0200
From: Ilia Benderski <bendersk@in.tum.de>
Subject: Looking for Downloadscript
Message-Id: <37EF268E.E2991560@in.tum.de>

Help!
I"m lookink for download script.
I want, that script downloads files from Internet to my Computer
(Linux).

Thanks,
                Ilia.



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

Date: Mon, 27 Sep 1999 08:03:23 GMT
From: c_j_marshall@my-deja.com
Subject: Re: New trolling strategy ?
Message-Id: <7sn8c6$tfr$1@nnrp1.deja.com>

In article <37EBDBC2.1AAB1E66@mail.cor.epa.gov>,
  David Cassell <cassell@mail.cor.epa.gov> wrote:
> c_j_marshall@my-deja.com wrote:
>
> > "Nothings so foolproof that there isn't a fool foolish enough to
fool
> > it". Or something.
>
> "You can't make anything foolproof, because they make fools
> better and better every year."
>
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> Hey, I like this Deja slogan a lot better than that "Share what
> is wrong.  Unlearn what is right." slogan.
>

Or: "Share inane, offtopic posts. Learn to rebuke inane, offtopic
posters"

Perhaps there could be an ISO 9000 rating: "Certified proof against fool
v7.4001" so you could tell exactly what level of fool you were proof
against.

Or maybe that's just silly ?


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


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

Date: Mon, 27 Sep 1999 11:56:00 +0100
From: Christian Habermehl <Christian.Habermehl@fhtw-berlin.de>
Subject: Problems with Win32::OLE
Message-Id: <37EF4D40.DD0D3114@fhtw-berlin.de>

Hi

I have some problems with the ActivePerl Win32::OLE module. Sometimes my
program doesn't
work, sometimes it does. 
I don't change a parameter. If i call the program twice it's possible
that it works
fine at the first time and crashes the second time with the
error-message:

Can't call method "Fields" on an undefined value at C:\SCRIPTE\test.pl
line 55.

Do you know this problem and how can I fix it?


My program should do a Category-List with dependant Categories.
e.g. Table Category

Category	Reference	Description
1		 		a
2		1		b
3		1		c
4		2		d

(For the following Code the List should be "4 d 2 b 1 a")

And here is the Code:

    use Win32::OLE;
    my $Connection      = Win32::OLE->new("ADODB.Connection");
    my $KategorieRecord = Win32::OLE->new("ADODB.Recordset");

    $Connection->Open("DSN=TestDB; UID=test; PWD=test");

    $CategoryNumber = 4;
    while ($CategoryNumber)
      {
        my QueryString = "";
        push @CategoryList,$CategoryNumber;

        QueryString = "$QueryString SELECT Reference, Description "
        QueryString = "$QueryString   FROM Category
        QueryString = "$QueryString  WHERE CategoryNumber =
$CategoryNumber"

        $CategoryRecord = $Connection->Execute(QueryString);
           $CategoryNumber =
$CategoryRecord->Fields('Reference')->values;
           $Description    =
$CategoryRecord->Fields('Description')->values;
        $CategoryRecord->Close;

        push @CategoryList,$Description;
      }
    $Connection->Close;


Thank you

Christian


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

Date: Mon, 27 Sep 1999 07:10:46 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: remove the html tag in the file
Message-Id: <WLEH3.19214$m4.76429951@news.magma.ca>

Abigail <abigail@delanet.com> wrote in:
news:slrn7ut2ht.88i.abigail@alexandra.delanet.com...
> Samuel Kilchenmann (skilchen@swissonline.ch) wrote on MMCCXVII
> MCMXCIII in <URL:news:o5vH3.19039$m4.76036799@news.magma.ca>:
> @@ Abigail <abigail@delanet.com> wrote in:
> @@ news:slrn7urr3l.hh.abigail@alexandra.delanet.com...
> @@ > Samuel Kilchenmann (skilchen@swissonline.ch) wrote on MMCCXV
> @@ > MCMXCIII in <URL:news:EVRG3.18678$m4.75164111@news.magma.ca>:
> @@ > == turboman <turboman34@hotmail.com> wrote in:
> @@ > == news:7sgfib$t84$1@winter.news.rcn.net
> @@ > ==
> @@ > == > Is anyone know how can I use perl to remove all the HTML
> @@ > == > TAGs in the html file. Thanks.
> @@ > == >
> @@
> @@ == You may want to use a more appropriate tool than Perl for things
> @@ == like that
> @@
> @@ [silly REBOL example snipped]
> @@
> @@ Everybody is able to see, that i posted a silly example. But
> @@ somebody may be able to get my point, that REBOL provides a nice
> @@ and powerful infrastructure to write correct solutions for this
> @@ kind of parsing problems.
>
> Sorry. No. I cannot see for your incorrect solution how good Rebol is
> in making correct solutions.
>
Ok, i am sorry. Maybe it was a mistake to post the pointer to REBOL.

>
> Does Rebol have a DTD build in?
>
No, but a powerful general purpose parser.

> @@ > Well, duh, I can write the equivalent Perl code in half a line.
> @@ >
> @@ Please show me, how you do this in half a line of Perl:
> @@ - read a page from a http URL
> @@ - accumulate all tags in a list
> @@ - accumulate all text in a string
>
> I never said I could do all three in half a line, but I can do all
> three in a single line:
>
> Printing the tags first, then the text:
> perl -MLWP::Simple -e '$_ = get ("URL"); print /<([^>*])>/,
> />([^<]*)</'
>
Is this a joke? It surely doesn't do what i was looking for. (Does it
anything at all? Certainly no accumulation in a list and in a string.
And how many thousand lines of library code are you importing? Once
more: the size of the REBOL executable is < 200K and you don't need to
import anything.)

> @@ The solution doesn't need to be any better than the silly REBOL
> @@ example.
> @@
> @@ > However, what does this have to do with removing HTML tags? Not
> @@ > much, except that in some cases you're lucky and it appears to
> @@ > work.
> @@ Ok, but smart people like you are able to enhance the example to
> @@ work correctly in an understandable way and the amount of time
> @@ needed to do that using REBOL will be very likely much smaller
> @@ than what you invested in learning Perl and regexps.
>
> Really? Prove it. Don't come with stupid examples that don't work.
>
I played with REBOL at most one week. And i remember that after one
week of Perl, I was not able to subclass HTML::Parser.

Probably the refinement will go in this direction:
(Its evidently still quick and dirty, but it should handle the test data
from TOMC's striphtml and it should handle quoted attributes. I know
that the script block rule is not correct, and most of the character
classes are incomplete.)

REBOL []

;preallocate some memory
tags:     make block! 100
comments: make block! 100
scripts:  make block! 10
text:     make string! 8000

; character classes
alpha:      charset [ #"A" - #"Z" #"a" - #"z"]
digits:     charset [ #"0" - #"9" ]
alnum:      union alpha digits
whitespace: charset [ #" " #"^-" #"^/" #"^L"]
quote:      charset [ #"^"" #"'"]
markup:     charset [ #"<" #">"]
quoted:     complement quote
whatever:   complement union quote markup
nonspace:   complement union quote union markup whitespace
notmarkup:  complement markup
anything:   complement charset ""

; parsing rules
attribute: [alpha any alnum "=" [quote any quoted quote] | some
nonspace]
comment:   ["<!" to "--" some ["--" thru "--" any whitespace] thru ">"]
tag:       ["<" ["/" | none]
            [alpha any alnum]
            any [[some whitespace attribute] | comment]
            any whitespace ">"
           ]
script:    ["<script"
             any [[some whitespace attribute] | comment]
             any whitespace ">"
             to "</script>" "</script>"
           ]

html-code: [
    to "<"
    copy scr script (append scripts scr) |
    copy nextcomment comment (append comments nextcomment)|
    copy nexttag tag (append tags nexttag) |
    copy txt to "<" (append text txt )
]

page: read http://host.some.where/file.html
parse/all page [some html-code to end]
foreach tag tags [print tag]
print text







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

Date: Mon, 27 Sep 1999 11:44:17 +0100
From: "Simon Plant" <simon.plant@citrix.com>
Subject: Re: Replacement "CD" for win32 systems
Message-Id: <7snhc6$1ct$1@kite.ansa.co.uk>


Jeff Zucker <jeff@vpservices.com> wrote in message
news:37EC2034.27F26EA1@vpservices.com...
> Simon Plant wrote:
> >
> >    I need a replacement "CD" command for windows nt
> > which will accept the directory to change to with
> > forward slashes in...
> >
> > IE     "cd c:/winnt/system
> >
> There is nothing wrong with that.  It works fine.
> That is what it is supposed to do.
>
> >  :(  Ayy ideas gratefully received.
>
> Try reading the perlfaq8 section called (I kid you not):
>
> I {changed directory, modified my environment} in a perl
> script. How come the change disappeared when I exited the
> script? How do I get my changes to be visible?

Actually, following Netiquette, I had read that artice before posting, but
it was (and still is) decidly
unhelpfull, infact as unhelpful as your response was.

Yes you are right "cd c:/winnt/system" leaves you in the CWD because you are
essentially saying

"cd c:"  with the arguments /winnt  and /system.

I know you know what I was getting at, don't be so arogant..

Cheers
Si





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

Date: Mon, 27 Sep 1999 11:45:53 +0100
From: "Simon Plant" <simon.plant@citrix.com>
Subject: Re: Replacement "CD" for win32 systems
Message-Id: <7snhf6$1d9$1@kite.ansa.co.uk>

Perhaps you ought to read the FAQ

>Try reading the perlfaq8 section called (I kid you not):
>
>I {changed directory, modified my environment} in a perl
>script. How come the change disappeared when I exited the
>script? How do I get my changes to be visible?
"Quote from Jeff Zucker,"

then come back to me with a helpfull response.

Cheers
Si



Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:7silu0$bca$1@gellyfish.btinternet.com...
> On Sat, 25 Sep 1999 01:08:55 +0100 Simon Plant wrote:
> > All,
> >    I need a replacement "CD" command for windows nt
> > which will accept the directory to change to with
> > forward slashes in...
> >
>
> etc ....
>
> perldoc -f chdir
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> <http://www.gellyfish.com>
> Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>




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

Date: Mon, 27 Sep 1999 01:54:38 -0700
From: Tim Judd <tjudd@teleport.com>
Subject: Socket module
Message-Id: <Pine.GSO.4.10.9909270151440.20430-100000@user2.teleport.com>

I'm no expert to perl.  But I do know my way around here and there.

But this is just too weird, and I can't figure it out

using the Socket module..

  inet_aton    gives you the IP address (packed, no doubt) from a hostname

or

  inet_ntoa    gives you the hostname (packed, I think) from an IP address


I can sucessful get the inet_aton to work, but I can *NOT* get the
inet_ntoa to work for me.

Can somebody paste a snippet that gets the inet_ntoa to work?

Thanks.



--T J



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

Date: Mon, 27 Sep 1999 11:14:34 +0100
From: "Nick Liebmann" <Nick@ucecom.com>
Subject: Sorting Associative arrays then matching one field to a database
Message-Id: <7snh7f$bq4$1@nclient7-gui.server.ntli.net>

Hello...

I am currently working a perl script, but have become stuck.

What I am trying to do is to sortan assocative array (%) and then pulling
out one element and matching it to the same element in a DBM file (.csv).
Once it has matched, I then want to pull out two elements from the same line
and display them.

I have tried all of the sorting subs, but can't work out how to pull out
that single field that I require.

Below, is my latest attempt. I think I'm using the wrong solution to the
problem.

Any pointers would be most apprecaited.

Cheers

Nick


sub SORTY_THE_FILE
 {
 dbmopen (%SORTERFILE, $tester, 0644) || die "Error: Can't open $tester!";


 @sortedtime = sort by_number keys (%SORTERFILE);

 sub by_number
  {
   $totaltime{$a} <=> $totaltime{$b};
  }
 foreach (@sortedtime) {
 open(DBFILE,"<$database");

 ($stormins, $storsecs, $storname, $stormail, $totaltime) = split /,/;
 while ($sortedtime =~ m/$email/i)
 print "<tr>";
 print "<td width='54%'>";
 print "<div align='center'>$storname</div>";
 print "</td>";
 print "<td width='24%'>";
 print "<div align='right'>$stormins</div>";
 print "</td>";
 print "<td width='22%'>";;
 print "<div align='left'>$storsecs</div>";
 print "</td>";
 print "</tr>";
   }

 dbmclose(%SCOREY);
 close DBFILE;
 }









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

Date: Mon, 27 Sep 1999 10:04:49 +0200
From: Reiner Buehl <Reiner_Buehl@hp.com>
Subject: Re: toLowercase??
Message-Id: <gCTvNwfGsCQNVpUCfVCL0fqByzLl@4ax.com>

On 25 Sep 1999 01:59:37 -0500, abigail@delanet.com (Abigail) wrote:

>Thomas Fischer (tfischer@deakin.edu.au) wrote on MMCCXIV September
>MCMXCIII in <URL:news:37ea2133.28232656@news.deakin.edu.au>:
>`` How can I convert a mixedcase string to 100% lowercase with perl?
> >   $ perl -l
> >   $_ = "mIxEDcaSe";
> >   @&{A..Z} = a..z;
> >   s/./$&{$&}||$&/ge;
> >   print;
> >   __END__
> >   mixedcase

Why don't you use just the lc() function of perl?

$ perl -l
$mixed = "mIxEDcaSe";
print lc($mixed);
__END__
mixedcase

Regards, Reiner.



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

Date: Mon, 27 Sep 1999 12:06:53 +0200
From: "Rik." <rusenet@bigfoot.com>
Subject: Re: Why does my code NOT work?
Message-Id: <7snf68$tl6$1@voyager.cistron.net>


Martien Verbruggen <mgjv@comdyn.com.au> schreef in berichtnieuws
YZxH3.33$Oy.2276@nsw.nnrp.telstra.net...
> In article <7slv2f$osd$1@voyager.cistron.net>,
> "Rik." <rusenet@bigfoot.com> writes:
>
> > #!/usr/local/bin/perl
>
> no -w
> no use strict
>
> Both will help you to write correct code mor eeasily.
>
> > $buffer = $ENV{'QUERY_STRING'};
> >
> >  @pairs = split(/&/, $buffer);
> >
> >  foreach $pair (@pairs) {
> >  ($name, $value) = split(/=/, $pair);
> >   $value =~ tr/+/ /;
> >  $value =~ s/%(..)/pack("c", hex($1))/eg;
>
> And this is where you go wrong. CGI isn't that trivial. If you insist
> on writing your own code to parse this sort of stuff, you really need
> to do it correctly. If you'd rather use the expertise of other people
> who have done this for you, you use the CGI module that comes with
> perl:
>

Mmmz i copied that part out of someone's source, which in the code did work.

Rik




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

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


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