[13511] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 921 Volume: 9

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

Date: Mon, 27 Sep 1999 12:05:16 -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: <938459115-v9-i921@ruby.oce.orst.edu>
Content-Type: text

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

Today's topics:
    Re: <> = new line? (Abigail)
    Re: a question of buttons (Abigail)
    Re: can I do this easier? <r28629@email.sps.mot.com>
    Re: CGI/Perl programmer needed for NT <ehpoole@ingress.com>
    Re: CGI/Perl programmer needed for NT (Eric Bohlman)
        Creating a reusable Perl archive <new@cfmu.eurocontrol.be>
    Re: Help with perl on NT4.0 (Jenda Krynicky)
        Help! How do I set a date field to empty via ODBC? <lparkh1@ix.netcom.com>
    Re: HTML to ASCII (Abigail)
    Re: libraries "die"ing (Eric Bohlman)
        Logfile analyzer <jester@dork.com>
    Re: New posters to comp.lang.perl.misc (Philip 'Yes, that's my address' Newton)
    Re: New posters to comp.lang.perl.misc (Greg Bacon)
    Re: PH 6.0 Perl problem <zigouras@mail.med.upenn.edu>
    Re: Printing Hash of Lists (Larry Rosler)
        Question About the last command reedjd@bitsmart.com
    Re: Randomize array..... <hks3@usa.net>
    Re: remove the html tag in the file <kbandes@home.com>
    Re: remove the html tag in the file (Abigail)
    Re: remove the html tag in the file <dan@tuatha.sidhe.org>
    Re: script hangs after reading certain amount of data <aqumsieh@matrox.com>
        Slice in scalar context <kimball@stsci.edu>
    Re: toLowercase?? (Abigail)
        Unable to open sound device from perl/CGI script <yngwie@home.com>
    Re: Validating unsafe code? <newspost@coppit.orgDIESPAM>
    Re: Validating unsafe code? <newspost@coppit.orgDIESPAM>
        Writing Time Monitoring scripts, (help) <blackfrdNOblSPAM@hotmail.com.invalid>
        You assume much when you know so little. <Webmaster@copscorp.com>
    Re: You assume much when you know so little. <dthusma@home.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 27 Sep 1999 13:46:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: <> = new line?
Message-Id: <slrn7uvfbj.901.abigail@alexandra.delanet.com>

Christoph Wernli (cw@dwc.ch) wrote on MMCCXVIII September MCMXCIII in
<URL:news:37EFA5CB.16F1C6A0@dwc.ch>:
!! Ran Shoham wrote:
!! > 
!! > I'm just wondering, if <> operator allows me to get the "next line" from
!! > input,  is there a similar way for me to get the "next word"?
!! 
!! Play around with the input separator, i.e:
!! 
!! $/ = " ";

That's unlikely to work. If you have a text like this:

    foo bar baz
    qux quux

You would get "foo", "bar", "baz\nqux" and "quux". That's not what you want.

But what you could do is:

    while (<>) {
        while (/(\S+)/g) {
            $next = $1;
            ...
        }
    }


Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";


  -----------== 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: 27 Sep 1999 13:19:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: a question of buttons
Message-Id: <slrn7uvdnu.901.abigail@alexandra.delanet.com>

David P. Schwartz (davids@desertigloo.com) wrote on MMCCXVIII September
MCMXCIII in <URL:news:37EF34E2.9448A457@desertigloo.com>:
== Abigail wrote:
== 
== > That's not a Perl question, is it?
== >
== 
== Gee, I'm truly sorry to distract so many of you experts from your efforts to 
== with ever more complex and subtle "Just another Perl Hacker" scripts with suc
== issues...
== 
== The HTML part is simple.  I don't have a question about that.  Ok?  Is that c
== 
== If I put three buttons on an HTML form, with different names and values, what
== up in my Perl script when it runs is ...  three buttons with different names 
== values.  Duh.  So, which one was pressed?  I don't know where to find this.  
== know if this is a Perl question or not.


You don't know, but I do. I told you it isn't a Perl question. Why don't
you take your more-than-80 char lines and just bugger off?



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: Mon, 27 Sep 1999 12:55:15 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: nileshnimkar@my-deja.com
Subject: Re: can I do this easier?
Message-Id: <37EFAF83.88CC2D32@email.sps.mot.com>

[posted to c.l.p.m and copy cc]

nileshnimkar@my-deja.com wrote:
> 
> In article <7sh2ju$bo1$1@paxfeed.eni.net>,
>   "Cipo Fuzo" <cipofuzo@hotmail.com> wrote:
> > hello,
> >
> > I would  like to load in 8 line cunks from a text file. Is there an
> > easier/nicer way, than this:
> >
> > while (($chunk[0]=<INPUT>) && ($chunk[1]=<INPUT>) &&
> ($chunk[2]=<INPUT>) &&
> > ($chunk[3]=<INPUT>) && ($chunk[4]=<INPUT>) && ($chunk[5]=<INPUT>) &&
> > ($chunk[6]=<INPUT>) && ($chunk[7]=<INPUT>))
> > {
> >     ...
> > }
> 
> Of course you can !!. Instead of loading each line seperately, load the
> whole file at once in an array.
> 
> @chunk = <INPUT> ; # loads whole file. Each line a element.
> $#chunk = 8 ; # trunkates your array to only 8 elements. Now you
> have                           # your firsr 8 lines !!
                                   ^^^^^^^^^^^^^^^^^^^
I think he wanted to read the file in 8-line chunks, not first eight
lines.

-TK


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

Date: Mon, 27 Sep 1999 13:14:07 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: CGI/Perl programmer needed for NT
Message-Id: <37EFA5DF.E7EF6F8C@ingress.com>

Eric Seiler wrote:
> 
> Hello, I am designing a business site that requires more then what I can get
> out of pre-written scripts.  The sort of scripting I need is pretty
> advanced, and only those familar with user management, and ecommerce
> scripting need apply.  Pay would be dependent on the net profitability of
> the website.

You just ruled out all of the experienced programmers.  

Experienced programmers seldom ever choose to bear another party's risks
-- it almost never makes any financial sense unless there is a real chance
that the business is going to become the next MS (which is unlikely and
even then they would demand shares).  The success of a venture depends at
least as much on the competence of the Sales and Marketing people and the
product or service.  The programmer can develop the best e-commerce
solution the world has ever seen and it will likely go *nowhere* if nobody
knows about the product/service or if the product/service is inferior. 
These are variables beyond the programmers control, assuming the risk is
like voluntarily shooting oneself in the foot.

If I were a client of yours I would be rather concerned if I knew your
e-commerce solution was devised by a programmer with limited to no
experience in the field simply because you wanted to save a few dollars.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: 27 Sep 1999 18:38:35 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: CGI/Perl programmer needed for NT
Message-Id: <7sodjb$960@dfw-ixnews7.ix.netcom.com>

[comp.lang.perl.tk removed from followups]

Ethan H. Poole (ehpoole@ingress.com) wrote:
: Eric Seiler wrote:
: > 
: > Hello, I am designing a business site that requires more then what I can get
: > out of pre-written scripts.  The sort of scripting I need is pretty
: > advanced, and only those familar with user management, and ecommerce
: > scripting need apply.  Pay would be dependent on the net profitability of
: > the website.
: 
: You just ruled out all of the experienced programmers.  
: 
: Experienced programmers seldom ever choose to bear another party's risks
: -- it almost never makes any financial sense unless there is a real chance
: that the business is going to become the next MS (which is unlikely and
: even then they would demand shares).  The success of a venture depends at

Furthermore, most new business ventures *never* turn a profit (if the 
people who did the programming for Amazon or Yahoo had done it on the 
terms Mr. Seiler is offering, they wouldn't have seen a penny yet).  
Second, most successful business ventures don't report any profit for the 
first few years of their existence, even if they're actually making 
money, because of the use of (entirely legitimate) accounting techniques 
intended to save on taxes.  IIRC, the only Web sites actually currently 
turning a profit are porn sites.

Thus someone who does "spec work" in return for a percentage of the
profits is unlikely to *ever* get paid.  If he does get paid, he's
unlikely to see anything for several years.  The only thing dumber than
agreeing to work for a percentage of the profits is agreeing to work for a
fixed sum or hourly rate to be paid out of the profits.  That amounts to
giving somebody an interest-free non-recourse loan.  Spec work only makes
sense if the potential payment is open-ended, and even then it's rare in
practice that the equivalent hourly rate you make on it is better than you
could make asking customers if they want fries with that.  If you're
foolish enough to do spec work for an hourly rate, you need to quote a
rate based on dividing your normal hourly rate by the probability of
getting paid the full amount.  For "paid out of profits" that probability
is going to be about 2% (it would be higher, but still quite low, if you
were talking about payment out of gross revenues instead), so if your
normal hourly rate was $75/hr (pretty much the absolute low end for the
kind of skills Mr. Seiler needs), you'd need a rate of $3750/hr! 

As you alluded to, those who *have* made substantial amounts of money from
spec work did so by taking equity positions (shares of ownership in the
company) in return for work, and then cashed in their shares when the
company went public.  But there are signs that the stock market is losing 
its automatic infatuation with anything that has a .com in it, and that 
in the near future the only Internet ventures that will provide 
spectacular returns on going public are going to be those that establish 
a solid business track record while privately owned.

To look at it another way, spec work is the equivalent of investing the 
amount of money that you'd normally bill for the time you spent.  You 
need to evaluate such propositions the same way you would any other 
investment.  Most offers of spec work represent extremely poor investments.



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

Date: Mon, 27 Sep 1999 17:33:36 +0200
From: Dennis Newport <new@cfmu.eurocontrol.be>
Subject: Creating a reusable Perl archive
Message-Id: <37EF8E50.CA3AA31F@cfmu.eurocontrol.be>

I have successfully installed Perl 5.005_03 on a couple of our HP-UX
10.20 servers in our development environment, along with some additional
modules. That all works fine. Now I have to create an installable tar
archive because I don't have access to our target operational servers so
I can't install Perl in a "common place". Therein lies the problem.

I have read the sections in the INSTALL file concerning "Changing the
installation directory" and "Creating an installable tar archive" but
its not exactly want I need. I want to be able to configure and install
perl in a temporary area and then allow the users to come along and run
a script against the temporary perl configuration/installation that
takes the target installation location as a parameter and produces a tar
file that they can simply un-tar on the target in the relevant
directory.

The problem with the procedure specified in INSTALL is that you have to
run the configure and makes steps with the target location specified as
the "prefix". But I want to offer this perl distribution to many groups
and allow each of them to state where they want to install perl (please
don't ask me why - it's a management thing). So therefore I want to do
the majority of the configuration and building for them (with all the
various options and with the various additional modules) and then tell
them that they will get nice tar file to dump on the target by simply
running a script with a target location as the parameter.

Do you see what I mean ?

Can anyone offer me advice on this.

Thanks in advance for any help.


-- 
Dennis Newport                         Eurocontrol
e-mail: new@cfmu.eurocontrol.be        Raketstraat 96
tel:    +32 2 729 96 21                B-1130 Brussels
fax:    +32 2 729 90 22                Belgium


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

Date: Mon, 27 Sep 1999 18:38:55 GMT
From: Jenda@Krynicky.cz (Jenda Krynicky)
Subject: Re: Help with perl on NT4.0
Message-Id: <1103_938457535@prague_main>

On Thu, 23 Sep 1999 21:23:27 GMT, Rick <rick@lowcountry.net> wrote:
> I am trying to get the following file to work on a windows NT machine, I
> have used this file successfully on Linux and HPUX machines in the past.
> 
> I get no errors reported in the event viewer, auditing is turned on.
> I get no errors in the web server error log.
> I get successful accesses in the web server access log.
> 
> It seems to be doing everything but writing the file, any help would be
> greatly appreciated.
> 
> I am using NT4.0 and activeperl build 519

You forgot the name and version of your webserver!
 
> The code is pasted below.
> 
> Thanks
> Rick
> 
> ...
> 
> open (OUTFILE,">c:\mailfile\$file2");

How come you are not checking the result of open()? Oh, oh, oh ;-)

You'll probably find out the user your script is running under doesn't have enough permissions
to create a file in that directory.

HTH, Jenda
http://Jenda.Krynicky.cz



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

Date: Mon, 27 Sep 1999 10:39:57 -0700
From: "Lin Parkh" <lparkh1@ix.netcom.com>
Subject: Help! How do I set a date field to empty via ODBC?
Message-Id: <7soa5b$ai5@dfw-ixnews10.ix.netcom.com>

I'm using MS Access and wish to set a date field to empty (or null).  I've
done a lot of SQL/ODB/Perl so probably my basic syntax is correct. I can
also insert proper dates no problem.  The problem seems to be in how to
express a null insert value. I've tried the following variants:
  ''
 ""
 '##'
0
and none of these make ODBC driver/Access happy.

I've searched through Deja on these two newsgroups as well as Access Online
help, and have had no luck. Humbly I ask for enlightenment,
   Thanks,
     Lin

Here's an example failing call:

   SET Table1.DateField = ""
       WHERE (((Table1.Field1)='28436')And((Table1.field2)='foobar'))

I either get data type mismatches (presumably because views this update as
text while the field is a date field) or syntax errors.




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

Date: 27 Sep 1999 13:21:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HTML to ASCII
Message-Id: <slrn7uvdr7.901.abigail@alexandra.delanet.com>

Anonymous (help@casinofantasy.com) wrote on MMCCXVIII September MCMXCIII
in <URL:news:37EF2B05.1CA826F8@casinofantasy.com>:
// what is RTFDTD? hope your not gonna shoot me now are ya?


Read The Fucking Document Type Definition.



Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== 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: 27 Sep 1999 18:44:54 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: libraries "die"ing
Message-Id: <7sodv6$960@dfw-ixnews7.ix.netcom.com>

rdosser@my-deja.com wrote:
: I find myself increasingly annoyed by library subroutines that take the
: liberty of "die"ing for me instead of setting an error code/message and
: returning undef.
: 
: Is there a way to prevent this - other than wrapping everything in an
: eval, which seems expensive.

Wrapping them in an eval {block} is not expensive at all, and is in fact 
the standard try {} catch {} mechanism in Perl.  What's expensive is 
eval(string), which is *not* what you want to do here.

: Shouldn't there be a standard for libraries not to engage in this
: sort of behavior?

No.



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

Date: Mon, 27 Sep 1999 19:37:00 +0200
From: "JeSTeR!" <jester@dork.com>
Subject: Logfile analyzer
Message-Id: <7so9vv$mb6$1@dinkel.civ.utwente.nl>

Has anybody got (or knows where to find) a logfile analyzer written in Perl?

I would like to make my own stats-page of my WarFTPd-server, but I would
like to see some examples first...

I would appreciate it, if you also answer to this message straight to
W.J.Huls@student.utwente.nl , because I don't check this newsgroup so
often...

--
GRTZ,

Wilbert Huls
E-MAIL :W.J.Huls@student.utwente.nl

Go straight to the docs.  Do not pass GO.  Do not collect
$200!







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

Date: Mon, 27 Sep 1999 18:35:55 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: New posters to comp.lang.perl.misc
Message-Id: <37efb5c8.96150609@news.nikoma.de>

On 27 Sep 1999 13:52:37 GMT, Greg Bacon <gbacon@cs.uah.edu> wrote:

>Following is a summary of articles from new posters spanning a 7 day
>period, beginning at 20 Sep 1999 15:00:44 GMT and ending at
>27 Sep 1999 07:49:31 GMT.
>
>    5     6.7 (  4.3/  2.4/  1.2)  Ala Qumsieh <qumsieh@sympatico.ca>

What's the definition of "new poster"? Surely, Ala doesn't qualify as
one, does s?he ?

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.net>


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

Date: 27 Sep 1999 19:03:02 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: New posters to comp.lang.perl.misc
Message-Id: <7sof16$5ee$2@info2.uah.edu>

In article <37efb5c8.96150609@news.nikoma.de>,
	nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton) writes:

: On 27 Sep 1999 13:52:37 GMT, Greg Bacon <gbacon@cs.uah.edu> wrote:
: 
: >Following is a summary of articles from new posters spanning a 7 day
: >period, beginning at 20 Sep 1999 15:00:44 GMT and ending at
: >27 Sep 1999 07:49:31 GMT.
: >
: >    5     6.7 (  4.3/  2.4/  1.2)  Ala Qumsieh <qumsieh@sympatico.ca>
: 
: What's the definition of "new poster"? Surely, Ala doesn't qualify as
: one, does s?he ?

Someone is a new poster iff his email address does not belong to the
set of previously seen email addresses.  I would guess that Ala hasn't
posted from that address before.

BTW for those who post from multiple addresses, to have the scanner
realize that all your posts are from the same author, put a Reply-To:
header in your posts with a common email address.

Greg
-- 
Let me guess: you're a Windows ``programmer'', aren't you?  Do you
know why Unix programmers make more money than Windows ``programmers''?
Because we Unix people know how to read the manual -- and you don't.
    -- Tom Christiansen


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

Date: Mon, 27 Sep 1999 14:30:20 -0400
From: Nico Zigouras <zigouras@mail.med.upenn.edu>
To: "Justin R. Smith" <jsmith@mcs.drexel.edu>
Subject: Re: PH 6.0 Perl problem
Message-Id: <Pine.OSF.4.05.9909271429340.20562-100000@mail.med.upenn.edu>

Yes I have had problems with NDBM_File and the handling of Perl db files
by RedHat 6.0 has been documented.  I had to go back to 5.2 because I
couldn't run a lot of my Perl programs on 6.0.


On Mon, 27 Sep 1999, Justin R. Smith wrote:

> Date: Mon, 27 Sep 1999 12:20:36 -0400
> From: Justin R. Smith <jsmith@mcs.drexel.edu>
> Newsgroups: comp.lang.perl.misc
> Followup-To: comp.lang.perl.misc
> Subject: PH 6.0 Perl problem
> 
> Has anyone solved this yet? I'm referring to the problem (apparently unique to
> Redhat systems) that prevents AnyDB from working properly.
> 
> I have several projects that desparatly need the ability to use AnyDB and am on
> the verge of switching to a different version of  Linux...
> 
> Thank you!
> 
> 



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

Date: Mon, 27 Sep 1999 11:38:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Printing Hash of Lists
Message-Id: <MPG.125959795d29b2e9989fe3@nntp.hpl.hp.com>

In article <37ef8ee0_3@news1.prserv.net> on Mon, 27 Sep 1999 10:36:08 -
0500, Campos <nospam@thankyou.com> says...
> Oops, sorry.  Figured it out.
> 
> should be @{ $hol{$family}}\n"; instead of (()).
> 
> Thanks though ; )

Had you run your program with '-w', you would have discovered that you 
were using the value of an uninitialized variable on that line.  Had you 
run your program with 'use strict;', it wouln't have compiled, because 
the scalar variable $hol was not declared.

There shold be a strong lesson in that for you, and for others who 
venture out into the ocean without their lifejackets on.

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


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

Date: Mon, 27 Sep 1999 18:32:33 GMT
From: reedjd@bitsmart.com
Subject: Question About the last command
Message-Id: <7sod82$mpo$1@nnrp1.deja.com>

I've been QAing a script someone wrote and they're using a syntax with
the last command I've never seen before, and I'm a little confused how
it works.  So here's a quick example:

TEST: {
  $LET = "A",
    last TEST if $HOSTNAME eq "http://www.yahoo.com";
  $LET = "B",
    last TEST if $HOSTNAME eq "http://www.excite.com";
}

  So my question about this is... are the assign statements being run
before the last statement, or after?
  In the script there are about 100 of these total, and I'm wondering
if we're doing a whole bunch of unneeded assign statements in here or
not.


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


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

Date: Tue, 28 Sep 1999 01:23:30 +0800
From: "HKS" <hks3@usa.net>
Subject: Re: Randomize array.....
Message-Id: <37efa8ba.0@news.highway1.com.au>

ok, thx, even though i'm not quite understand some of the code and concept..
:?

Yanick Champoux ¼¶¼g©ó¤å³¹ ...
>In article <37ee628a.0@news.highway1.com.au>,
> "HKS" <hks3@usa.net> writes:
>> [..] say i
>> created an array "@num", which contains "1,2,3,4,5,6" and i want to
>> randomize these numbers and put it into another array, say "@result"
which
>> will contain the randomized numbers(e.g "2,3,4,1,5,6").
>
>Easy:
>
>#! /usr/bin/perl
>
>srand;
>
>my @num = ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
>
>@result = sort By_Random @array;
>sub By_Random
>{
>  return (-1,1)[rand(2)];  # return -1 or 1 at random
>}
>
>print join ' ', @result, "\n";
>
>__END__
>
>Joy,
>Yanick
>




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

Date: Mon, 27 Sep 1999 13:35:12 -0400
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: remove the html tag in the file
Message-Id: <37EFAAD0.826F33E1@home.com>

Samuel Kilchenmann wrote:
> > @@ 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.

I'm strictly multicultural when it comes to languages, and altogether
a reluctant language warrior, but there's something askew here.  In
the supplied REBOL example, (from which comes this excerpt):

> comment:   ["<!" to "--" some ["--" thru "--" any whitespace] thru ">"]
> tag:       ["<" ["/" | none]
>             [alpha any alnum]
>             any [[some whitespace attribute] | comment]
>             any whitespace ">"

aren't these regexs, albeit wordy and nonstandard ones?  It seems
to me that "any" = "*", "some" = "+", "|" = "|", etc.

Parsing tools (lex & yacc, JavaCC, etc.) provide some combination of 
lexical analysis and grammatical analysis, the former nearly always
involving regular expressions.  It's hard to get away from and
this language does not appear to get away from it.

I suppose it's a matter of personal preference whether 
"any whitespace" is better than "\s*".  The substitution of words
for symbols is not inherently an improvement, especially if the
common-sense meanings or normal usages of the words diverge from
their usage in the programming language (as they nearly always do).

I don't see a major theoretical advantage, here, at any rate, and I 
don't see how this saves you from learning regexs.

Ken Bandes


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

Date: 27 Sep 1999 13:36:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: remove the html tag in the file
Message-Id: <slrn7uveo9.901.abigail@alexandra.delanet.com>

Samuel Kilchenmann (skilchen@swissonline.ch) wrote on MMCCXVIII September
MCMXCIII in <URL:news:WLEH3.19214$m4.76429951@news.magma.ca>:
`` Abigail <abigail@delanet.com> wrote in:
`` news:slrn7ut2ht.88i.abigail@alexandra.delanet.com...
`` 
`` >
`` > Does Rebol have a DTD build in?
`` >
`` No, but a powerful general purpose parser.

More powerful than Perl regexes?

`` 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

This makes me puke. You really need to preallocate some random amounts
of memory? That's the last thing I want to do in a high level language.

`` ; character classes
`` alpha:      charset [ #"A" - #"Z" #"a" - #"z"]

Oh, I see. That's so much clearer than [A-Za-z]. Those #'s make a lot
of sense!

`` digits:     charset [ #"0" - #"9" ]

That isn't buildin? Perl gives you \d.

`` alnum:      union alpha digits
`` whitespace: charset [ #" " #"^-" #"^/" #"^L"]

What are ^- and ^/ ? This is simpler than \s ? With \s, I never have
to remember what is whitespace, I do know there are more than 4 whitespace
characters though.




Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== 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:49:58 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: remove the html tag in the file
Message-Id: <q%OH3.1845$Af7.35818@news.rdc1.ct.home.com>

Abigail <abigail@delanet.com> wrote:
> Samuel Kilchenmann (skilchen@swissonline.ch) wrote on MMCCXVIII September
> MCMXCIII in <URL:news:WLEH3.19214$m4.76429951@news.magma.ca>:
> `` Abigail <abigail@delanet.com> wrote in:
> `` news:slrn7ut2ht.88i.abigail@alexandra.delanet.com...
> `` 
> `` >
> `` > Does Rebol have a DTD build in?
> `` >
> `` No, but a powerful general purpose parser.

> More powerful than Perl regexes?

That'd be kinda tough at this point. Perl's regexes are Turing-complete,
after all. (Anyone care to rewrite GCC as a regex? :)

					Dan


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

Date: Mon, 27 Sep 1999 11:53:50 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: script hangs after reading certain amount of data
Message-Id: <x3yn1u8uz8x.fsf@tigre.matrox.com>


jason@generationterrorists.com (Jason Q.) writes:

> open (DATA, "database.txt") || die "cannot open: $!";
> while (<DATA>)
> 	{
> 	($field1, $field2, $field3) = split(/\	/, $_);
                                            ^^^^^
                                            ^^^^^
What exactly are you trying to split on? What you show splits on the
occurrence of two spaces (or is it a problem with my newsreader?)

> 	if ($field2 =~ /$keyword/i)

What does $keyword contain?

> 		{
> 		print "$_<P>";
> 		}
> 	}
> close (DATA);

> It hangs at exactly the same place (record) each time it runs. I

It depends. Show us the record. Show us the value of $keyword. You
might be doing a really slow match there (if $keyword contains too
many *'s for example) and you *think* that your program hangs. What do
you mean by "hangs" anyway?

> Does
> 
> 	($field1, $field2, $field3) = split(/\	/, $_);
> 	if ($product_name =~ /$keyword/i)
> 		{
> 		print "$_<P>";
> 		$count++;
> 		}
> 
> have any effect on memory requirments? Because it seems the script
> dies after reading a certain amount of data, and only if there are any
> references to $_.

What OS are you on? 50MB of data isn't that much anyway, and any OS
is supposed to handle that easily. I parse 300+ MB files all the time
with no problems. Show us the values of your variables, and we might
be able to better serve you.

HTH,
--Ala



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

Date: Mon, 27 Sep 1999 13:05:35 -0400
From: Tim Kimball <kimball@stsci.edu>
Subject: Slice in scalar context
Message-Id: <37EFA3DF.1DDC1744@stsci.edu>

Can someone tell me why, in

	$right =3D ("fred","barney","wilma")[0,1,2];

$right gets wilma? I would have thought it would
have got the number of elements in the slice.
--
Tim Kimball =B7 Data Systems Division =A6 kimball@stsci.edu =B7 410-338-4=
417
Space Telescope Science Institute   =A6 http://www.stsci.edu/~kimball/
3700 San Martin Drive               =A6 http://archive.stsci.edu/
Baltimore MD 21218 USA              =A6 http://faxafloi.stsci.edu:4547/


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

Date: 27 Sep 1999 13:37:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: toLowercase??
Message-Id: <slrn7uveqb.901.abigail@alexandra.delanet.com>

Reiner Buehl (Reiner_Buehl@hp.com) wrote on MMCCXVIII September MCMXCIII
in <URL:news: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?


That would be cheating. Besides, what do you do if your lc function breaks,
on a late Saturday evening, and everything is closed?



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== 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:06:35 GMT
From: David <yngwie@home.com>
Subject: Unable to open sound device from perl/CGI script
Message-Id: <37EFB1A1.351DF02@home.com>

I have a cgi script that will send the name of a wave file to play on
the Apache server machine. I'm not trying to play sound through the
browser.  I get an error message in the error_log that says "Unable to
open sound device" but when I execute the perl script from the command
line it works fine.  What am I doing wrong? I am using a program called
splay to play the wave file from the console.  I also tried using mpg123
to play an mp3 which works from the console but doesn't work from CGI
form page.  I don't get a error message when using mpg123 but there is
also no sound.  

What is the proper way to execute programs on the server machine and
output on the server machine using PERL/CGI? I am using the system
function to call an external program and play a wave file.

Not sure if this is a web server issue, or CGI/Perl issue?

I use Apache 1.3.6 with Linux


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

Date: Mon, 27 Sep 1999 14:16:48 -0400
From: David Coppit <newspost@coppit.orgDIESPAM>
Subject: Re: Validating unsafe code?
Message-Id: <Pine.GSO.4.10.9909271404330.905-100000@mamba.cs.Virginia.EDU>

> > exec() `` (backticks) <*> (globbing) glob() s///e (eval an expression)
> > open("|")
>  
> There may be more dangerous possibilities. Anything that causes open to
> invoke a shell.
>  
> You probably should also include open2, open3, The FileHandle and IO::Handle
> stuff. although I am not sure that the latter two actually can invoke
> danger. Careful inspection of the modules will show :) 
>  
> You know that taint mode will warn for many of this stuff, right? 

Well, I want to rule out something like
  unlink('../.profile');
  unlink('../../.profile');
  unlink('../../../.profile');
  unlink('../../../../.profile')
which wouldn't be caught by taint.

> > unlink()
>  
> Not sure that this is dangerous, unless it tries to unlink something stupid,
> like /etc/passwd. Don't run it as root, and you will know. 

The trick is that I'd like to eventually let less knowledgeable people use the
submitted code, and I can't guarantee that they're smart enough to run it
correctly.

> > chmod() chown() link() mkdir() rename() rmdir()
>  
> Not inherently dangerous. Like the above, these can only be inspected for
> danger by inspecting the actual values that get passed to them.. 

I should have stated that the submitted code isn't any general piece of code
-- it's code that's designed to work with an API I provide. I'm basically
trying to limit the code to just my API, and a few "safe" operations. *Any*
use of chmod (or any file operation) is highly suspect, so I'd rather flag
these as errors rather than warnings. (i.e. allowing them to use link() might
allow them to do symlink attacks.)

> > kill() fork() (fork bomb) flock() (denial of service?)
> > 
> > Is there an easy way to check for such dangerous commands?  "$code =~
> > s/#[^\n]\bbadcommand\b/s" seems too naive.
>  
> I don't think that I would recommend anyone using automated tools to do this
> sort of checking. It's much too easy to fool those. Besides that, most of
> the danger arrives in the actual values of the variable being passed to
> these things (which is where taint mode comes in), not in the command
> itself. Anything automatic will give you so many false positive danger
> flags, that you might as well just have read the whole code yourself.

I'm sure you're right. I guess my strategy will be to always review the code
by hand, and maybe use these measures to help me spot problems. "There appears
to be a fork() on line 52"...

> > It seems like I remember hearing that newer Perls let you look at the
> > parse tree, which would probably be the best way to identify most of these
> > functions.
>  
> Yes. You could do something like that, but again, unless you 'untaint' all
> the variables, which is probably impossible in a general case for all of the
> things above, you won't be certain.

Do you know where I can go for details on viewing the parse tree? Is it
available for 5.004?

Thanks!
David

--
Remove the capital letters in my address to reply via email. Sorry, but most
of my junkmail comes from addresses harvested from the newsgroups.

I'm also considerate enough to read replies on news. :)



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

Date: Mon, 27 Sep 1999 14:37:05 -0400
From: David Coppit <newspost@coppit.orgDIESPAM>
Subject: Re: Validating unsafe code?
Message-Id: <Pine.GSO.4.10.9909271431360.905-100000@mamba.cs.Virginia.EDU>


> Probably doing this thoroughly requires going over perlfunc and perlop with
> a fine-toothed comb.  I suspect Andre Merzky has already done this for
> Penguin.  Unfortunately, Penguin appears to be two years out of date
> (according to http://www.cpan.org/modules/by-module/Penguin/ anyway).
 
Hey! Thanks for the citation! I went to Penguin, which pointed me to Malcolm
Beattie's "Safe" module. Safe seems to do exactly what I want:

  Safe - Compile and execute code in restricted compartments
  ...
  The "root" of the namespace (i.e. "main::") is changed to a different
  package and code evaluated in the compartment cannot refer to variables
  outside this namespace, even with run-time glob lookups and other tricks.
  ...
  Each compartment has an associated "operator mask". ...  Attempting to
  evaulate code in a compartment which contains a masked operator will cause
  the compilation to fail with an error.  The code will not be executed.

Leave it to a Perl compiler guru to develop exactly what I need. :)

David

--
Remove the capital letters in my address to reply via email. Sorry, but most
of my junkmail comes from addresses harvested from the newsgroups.

I'm also considerate enough to read replies on news. :)



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

Date: Mon, 27 Sep 1999 12:02:20 -0700
From: blackfrd <blackfrdNOblSPAM@hotmail.com.invalid>
Subject: Writing Time Monitoring scripts, (help)
Message-Id: <07ad677c.48cb951d@usw-ex0102-009.remarq.com>

I am trying to write a script that will monitor the time it
takes for a Process to send messaging queries to a Legacy
system.

The unix system collects valid data from an oracle database
and sends it to the mainframe.

Any suggestions... I am very much a newbie.

Cheers

Cole

Blackfrd@hotmail.com


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Mon, 27 Sep 1999 14:12:33 -0400
From: "Eric Seiler" <Webmaster@copscorp.com>
Subject: You assume much when you know so little.
Message-Id: <6tOH3.147$AH1.180759@news.abs.net>

I never said that I was doing this project for another person, and I agree -
I would not arrange such an agreement if that were the case.  I am however
starting this website up as a project of my own company's and I plan to
build a long term relationship with the programer(s) that are involved.

We may eventually just hire someone to to the job, however paying someone
80+ dollars  an hour up front would quickly put me seriously in debt, which
is what I am trying to avoid in the first place.  I realize that many people
here would not be interested in working under such a pay system, but it can
work provided that the project is a success.  Granted, if the website does
not take off - there will be no pay.  However, I am not looking for
'established' programmers, but 'experienced' programmers.  There are a lot
of students not even out of college that have a great deal of experience
with programming, but they are not yet established.

This is just an opportunity like any other, and one that will go places -
unless I bankrupt my company, which I won't do.

What do applicants stand to gain:

1. Experience working on a advanced ecommerce solution, without the pressure
of a demanding client/customer beating down your door wondering when his or
her program will be done.

2. The chance to be part of something that has the potential to be huge -
from the beginning.

3. A chance to make a lot of money. I emphasize 'chance' because I won't
sugarcoat anything and say you 'will' make money. There are many MLM
companies who operate in a similar fashion, but I can gauruntee you this -
we are not an MLM, and oppose the tactics used by many such companies.

What you stand to lose:

1. Time.  That is the only risk someone puts into this project. We don't ask
anyone to buy anything, or invest money in this venture.

I believe in being totally honest with anyone who applies, but I didn't
realize that by saying 'based on the net profitability' of the website it
would offend anyone.

Quite frankly, I don't have a huge budget to work from, and I will look for
places to save money where ever I can. WHEN this venture takes off, I do
plan to hire full time programmers on salary, and the people who are on the
ground floor will be first in line.

If you mean to tell me 'you have to spend gobs of money to make money' then
you are probably right, BUT all of that money doesn't have to be upfront.

Eric Seiler
Cops, Inc.


Ethan H. Poole wrote in message <37EFA5DF.E7EF6F8C@ingress.com>...
>Eric Seiler wrote:
>>
>> Hello, I am designing a business site that requires more then what I can
get
>> out of pre-written scripts.  The sort of scripting I need is pretty
>> advanced, and only those familar with user management, and ecommerce
>> scripting need apply.  Pay would be dependent on the net profitability of
>> the website.
>
>You just ruled out all of the experienced programmers.
>
>Experienced programmers seldom ever choose to bear another party's risks
>-- it almost never makes any financial sense unless there is a real chance
>that the business is going to become the next MS (which is unlikely and
>even then they would demand shares).  The success of a venture depends at
>least as much on the competence of the Sales and Marketing people and the
>product or service.  The programmer can develop the best e-commerce
>solution the world has ever seen and it will likely go *nowhere* if nobody
>knows about the product/service or if the product/service is inferior.
>These are variables beyond the programmers control, assuming the risk is
>like voluntarily shooting oneself in the foot.
>
>If I were a client of yours I would be rather concerned if I knew your
>e-commerce solution was devised by a programmer with limited to no
>experience in the field simply because you wanted to save a few dollars.
>
>--
>Ethan H. Poole           ****   BUSINESS   ****
>ehpoole@ingress.com      ==Interact2Day, Inc.==
>(personal)               http://www.interact2day.com/




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

Date: Mon, 27 Sep 1999 18:21:11 GMT
From: Darrin H <dthusma@home.com>
Subject: Re: You assume much when you know so little.
Message-Id: <37EFB90B.E41139F3@home.com>

Eric Seiler wrote:

> I never said that I was doing this project for another person, and I agree -
> I would not arrange such an agreement if that were the case.  I am however
> starting this website up as a project of my own company's and I plan to
> build a long term relationship with the programer(s) that are involved.
>
> We may eventually just hire someone to to the job, however paying someone
> 80+ dollars  an hour up front would quickly put me seriously in debt, which
> is what I am trying to avoid in the first place.  I realize that many people
> here would not be interested in working under such a pay system, but it can
> work provided that the project is a success.  Granted, if the website does
> not take off - there will be no pay.  However, I am not looking for
> 'established' programmers, but 'experienced' programmers.  There are a lot
> of students not even out of college that have a great deal of experience
> with programming, but they are not yet established.
>
> This is just an opportunity like any other, and one that will go places -
> unless I bankrupt my company, which I won't do.
>
> What do applicants stand to gain:
>
> 1. Experience working on a advanced ecommerce solution, without the pressure
> of a demanding client/customer beating down your door wondering when his or
> her program will be done.
>
> 2. The chance to be part of something that has the potential to be huge -
> from the beginning.
>
> 3. A chance to make a lot of money. I emphasize 'chance' because I won't
> sugarcoat anything and say you 'will' make money. There are many MLM
> companies who operate in a similar fashion, but I can gauruntee you this -
> we are not an MLM, and oppose the tactics used by many such companies.
>
> What you stand to lose:
>
> 1. Time.  That is the only risk someone puts into this project. We don't ask
> anyone to buy anything, or invest money in this venture.
>
> I believe in being totally honest with anyone who applies, but I didn't
> realize that by saying 'based on the net profitability' of the website it
> would offend anyone.
>
> Quite frankly, I don't have a huge budget to work from, and I will look for
> places to save money where ever I can. WHEN this venture takes off, I do
> plan to hire full time programmers on salary, and the people who are on the
> ground floor will be first in line.
>
> If you mean to tell me 'you have to spend gobs of money to make money' then
> you are probably right, BUT all of that money doesn't have to be upfront.
>
> Eric Seiler
> Cops, Inc.
>
> Ethan H. Poole wrote in message <37EFA5DF.E7EF6F8C@ingress.com>...
> >Eric Seiler wrote:
> >>
> >> Hello, I am designing a business site that requires more then what I can
> get
> >> out of pre-written scripts.  The sort of scripting I need is pretty
> >> advanced, and only those familar with user management, and ecommerce
> >> scripting need apply.  Pay would be dependent on the net profitability of
> >> the website.
> >
> >You just ruled out all of the experienced programmers.
> >
> >Experienced programmers seldom ever choose to bear another party's risks
> >-- it almost never makes any financial sense unless there is a real chance
> >that the business is going to become the next MS (which is unlikely and
> >even then they would demand shares).  The success of a venture depends at
> >least as much on the competence of the Sales and Marketing people and the
> >product or service.  The programmer can develop the best e-commerce
> >solution the world has ever seen and it will likely go *nowhere* if nobody
> >knows about the product/service or if the product/service is inferior.
> >These are variables beyond the programmers control, assuming the risk is
> >like voluntarily shooting oneself in the foot.
> >
> >If I were a client of yours I would be rather concerned if I knew your
> >e-commerce solution was devised by a programmer with limited to no
> >experience in the field simply because you wanted to save a few dollars.
> >
> >--
> >Ethan H. Poole           ****   BUSINESS   ****
> >ehpoole@ingress.com      ==Interact2Day, Inc.==
> >(personal)               http://www.interact2day.com/

Eric,

I hafta agree with you.  it seems that much (myself included many times) of the
time people blessed (hard working enough) to have perl skill sets assume that
we then deserve massive IPO-levels of $$ without any additional risk.  In
computers, as in life, this is not the case.  How does that old saying go...the
world is full of unrewarded genius, but the prize belongs to those with the
tenacity and courage to challenge the outside world.  On the comment about
saving a few $$ for a project...thats called reality....its kinda funny that we
feel that a company (or you Eric) should spend infinite amounts of money to
make a perfect product, then distribute it as freeware...

Insofar as you using comp.lang.perl.* to look for people...well, I personally
kinda find it flattering to us , and a sign of good sense from you.

So, good luck with your company, hope it does well.  Just remember to tithe a
few decimal places of those riches to the open-systems support groups that made
it possible.

(gosh, I love free enterprise and free speech!)



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

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


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