[16958] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4370 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 19 00:05:34 2000

Date: Mon, 18 Sep 2000 21: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: <969336310-v9-i4370@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 18 Sep 2000     Volume: 9 Number: 4370

Today's topics:
        $0 not working under Solaris 2.7 <stickthestick@my-deja.com>
    Re: $0 not working under Solaris 2.7 <tony_curtis32@yahoo.com>
    Re: 2 Questions <no.junk.please.ber@attcanada.net>
    Re: 2 Questions <uri@sysarch.com>
    Re: Aritifical Intelligence... (Abigail)
    Re: Aritifical Intelligence... <uri@sysarch.com>
    Re: Aritifical Intelligence... <jcraaryy@tzh.rqh>
    Re: Aritifical Intelligence... (Tony L. Svanstrom)
    Re: dir list of unique items <lr@hpl.hp.com>
    Re: dir list of unique items <syarbrou@nospam.enteract.com>
        Email.pm and file attachments <hugo@fractalgraphics.com.au>
        How to parse HTML, extract stuff based on rules and spi cpraber@yahoo.com
    Re: How to parse HTML, extract stuff based on rules and cpraber@yahoo.com
        How To? Setting External Subroutine as Method of Perl M <design@raincloud-studios.com>
    Re: inet_ntoa() (Martien Verbruggen)
    Re: Is this terribly inefficient? (Martien Verbruggen)
        Join our team <joegetty@mediaone.net>
    Re: Join our team (Abigail)
        newbie having problem with system command <ssilv@rochester.rr.com>
        Prasing a patch file <snakeming@hotmail.com>
    Re: Range operator with "... /^$/" (Keith Calvert Ivey)
    Re: Range operator with "... /^$/" <jeffp@crusoe.net>
    Re: Rant: Re: An identd faking ident. (Tony L. Svanstrom)
    Re: Rant: Re: An identd faking ident. (Abigail)
    Re: Rant: Re: An identd faking ident. (Tony L. Svanstrom)
    Re: Req.: The perfect Perl Editor? <mzardoz@worldnet.att.net>
    Re: Splitting data from a text file (Martien Verbruggen)
    Re: The %b format specifier doesn't work? (Martien Verbruggen)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 19 Sep 2000 00:55:51 GMT
From: Stick <stickthestick@my-deja.com>
Subject: $0 not working under Solaris 2.7
Message-Id: <8q6die$tpa$1@nnrp1.deja.com>

Does anyone know of a reason why setting $0 to a string would not work
under solaris 2.7?

The exact same script works fine under linux but under solaris the ps
list shows the initial string not the changed string.


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


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

Date: 18 Sep 2000 20:31:33 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: $0 not working under Solaris 2.7
Message-Id: <87g0mxxj4a.fsf@limey.hpcc.uh.edu>

>> On Tue, 19 Sep 2000 00:55:51 GMT,
>> Stick <stickthestick@my-deja.com> said:

> Does anyone know of a reason why setting $0 to a string
> would not work under solaris 2.7?

> The exact same script works fine under linux but under
> solaris the ps list shows the initial string not the
> changed string.

$ perldoc perlvar

       $0      Contains the name of the program being executed.
               On some operating systems assigning to `$0'
               modifies the argument area that the ps program
               sees.

"On *some* operating systems".

Solaris obviously ain't one of 'em.

hth
t
-- 
Woo!  A trillion dollar bill.  That's a spicy meatball!
                                         -- Homer Simpson


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

Date: Mon, 18 Sep 2000 22:40:46 -0400
From: "Bruce Roberts" <no.junk.please.ber@attcanada.net>
Subject: Re: 2 Questions
Message-Id: <PhAx5.7196$YG5.15816@tor-nn1.netcom.ca>

The $2600 they wanted from you was probably to pay for the lunch :).

For those who aren't aware of it there are three editions of Delphi.
Standard sells for around $99USD but doesn't include any database support
components (lots of 3rd party stuff available, some of it freeware).
Professional sells for around $800USD ($300 competitive upg). It includes
database and other useful components as well as the source code for the
Visual Component Library. The Enterprise edition is the pricey one and has
all the bells & whistles, or so I'm told.

Borland also has the habit of letting magazines include older versions of
the Standard edition in inserts with "private use only" licenses. A search
of some of the Delphi NG should turn up details on these publications.

In addition to Delphi there are also a number of free Pascal compilers
generally available, including I believe an edition of Borland's Turbo
Pascal.





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

Date: Tue, 19 Sep 2000 02:53:12 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: 2 Questions
Message-Id: <x7itrtdrfe.fsf@home.sysarch.com>


please don't followup to c.l.perl.misc. there is no perl content in this
thread.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 19 Sep 2000 01:21:11 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Aritifical Intelligence...
Message-Id: <slrn8sdfq2.5fq.abigail@alexandra.foad.org>

D Borland (d.borland@ntlworld.com) wrote on MMDLXXVI September MCMXCIII
in <URL:news:QJyx5.9705$6T1.140506@news2-win.server.ntlworld.com>:
<> Sorry for the post here, but i don't know where else to put it, and plus, i
<> am doing this project in Perl... ?
<> 
<> Just gathering other people's opinions, for a project...
<> 
<> So the questions are...
<> 
<> When talking/ using, one of these programs.  What is it, that you dislike,
<> about them.... ?
<> 
<> Lastly, are the any feature, or changes, that you would want to see, in
<> these types of programs... ?

"These types of programs"? Could you define what you mean by "these types
of programs"? (And no, just saying AI won't do. Everyone and his donkey
has its own idea of what AI is.)

But wasn't AI declared dead and buried in the mid-80s?


Abigail
-- 
A world where AI is feasable doesn't allow for strong public key encryption.
                                                       // Peter vanEmdeBoas.



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

Date: Tue, 19 Sep 2000 01:44:10 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Aritifical Intelligence...
Message-Id: <x7og1ldul0.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@foad.org> writes:

  A> But wasn't AI declared dead and buried in the mid-80s?

yeah, but its rotten fetid corpse was ressurected and is trolling here
under the name of moronzilla.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Mon, 18 Sep 2000 23:22:14 -0400
From: Will Pennell <jcraaryy@tzh.rqh>
Subject: Re: Aritifical Intelligence...
Message-Id: <39C6DBE2.9B7FFEEA@tzh.rqh>



D Borland wrote:
> 
> Sorry for the post here, but i don't know where else to put it, and plus, i
> am doing this project in Perl... ?

hmm... any of the comp.ai.* groups would probably be more appropiate at
this phase of your design, or the AI mailing list for perl

<snip feature questions>

> The rapid, swing of conversation subjects, and the inabilitly to answer a
> straight, question, without, replying, with another question... !
> 
> Less attempt, at trying to cram them with knowledge, and get them to
> understand use of language better... Add features, of links, into the
> knowledge database of the Bot, that would be relevant to the current subject
> of discussion, or question...

Ok, this was really difficult to parse, but I will try my best to help.

I am going on the assumption that you want to write some sort of "Bot"
(IRC?) That would use a better natural language recoginition / knowledge
representation algorithm than those that are currently out there,
possiably in a web context.  

AFAIK, (read: quick scan through the cpan archives) Perl is not a
strongly supported language for AI, though I could be wrong as I haven't
really looked through perl's AI mailing list. The closest modules that I
found in the CPAN archive are a few on Artificial Neural Nets, which
probably doesn't help you much.  

My best advice would be, do some background research on natural language
processing / knowledge repersentation and find out what the current
limits of the algorithms are, and then see if you can start to design
this bot.

Good Luck, HTH

Will

P.S. Abigail: AI is still alive and kicking.


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

Date: Tue, 19 Sep 2000 05:35:00 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Aritifical Intelligence...
Message-Id: <1eh6xxd.v1lua22r8gkwN%tony@svanstrom.com>

Abigail <abigail@foad.org> wrote:

> But wasn't AI declared dead and buried in the mid-80s?

Kind of, in a more realistic view it never died but the field changed to
something that actually works. No more evil robots going to take over
the world after being built on parts from evil thinking robots from the
future, but smarter foes for the ones playing videogames. A lot of it
prolly leaked into the whole fuzzy world of patternrecognition.


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Mon, 18 Sep 2000 18:18:14 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: dir list of unique items
Message-Id: <MPG.14305eb575eea30998ad8d@nntp.hpl.hp.com>

In article <55cdss4u99ohg6jnndcebaibq29snf342c@4ax.com>, 
syarbrou@nospam.enteract.com says...
> Thanks Larry.  That works great.  Can you explan what the d{8} part
> does?  Thanks.

Read perlre or any reasonable Perl tutorial.

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


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

Date: Mon, 18 Sep 2000 20:48:34 -0500
From: Steve . <syarbrou@nospam.enteract.com>
Subject: Re: dir list of unique items
Message-Id: <adhdssc1krd91vq8jngb7cu4pd183fcih0@4ax.com>

Thanks guys.  I'm about to start reading the perlre man pages right
now.

Steve

On Tue, 19 Sep 2000 11:20:04 +1100, jason <elephant@squirrelgroup.com>
wrote:

>Steve . <syarbrou@nospam.enteract.com> wrote ..
>>I usually get a list of filenames without their extensions by doing
>>something like:
>>
>>sub backwards { $b cmp $a; }
>>opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
>>@dots = grep ! /^\.\.?$/, readdir(DIR);
>>closedir DIR;
>>
>>I now have a bunch of files in a directory, of type html and gif, say
>>like:
>>
>>20000806.html
>>2000080600.gif
>>2000080601.gif
>>2000080602.gif
>>2000080603.gif
>>20000806_01_b.html
>>20000806_02_b.html
>>20000806_03_b.html
>>20000806_04_b.html
>>20000806_05_b.html
>>20000806_06_b.html
>>20000806_07_b.html
>>20000806_t.html
>>20000813.html
>>2000081300.gif
>>2000081301.gif
>>2000081302.gif
>>2000081303.gif
>>2000081304.gif
>>20000813_01_b.html
>>20000813_02_b.html
>>20000813_03_b.html
>>20000813_04_b.html
>>20000813_05_b.html
>>20000813_06_b.html
>>20000813_07_b.html
>>20000813_t.html
>>
>>How would I get into @dots, just the following, 20000806.html and
>>2000813.html and all other unique like it as time goes by?  Thanks.
>
>change your grep to also leave out anything that doesn't conform to the 
>'yyyymmdd.extension' format .. see the perlre section of the 
>documentation for more information on regular expressions
>
>  perldoc perlre



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

Date: Tue, 19 Sep 2000 10:14:33 +0800
From: Hugo Bouckaert <hugo@fractalgraphics.com.au>
Subject: Email.pm and file attachments
Message-Id: <39C6CC09.231980E6@fractalgraphics.com.au>

Hi 

I am trying to use the perl Email.pm module to enable me to upload files
from a html page, then send it as an attachment to a specified email
address. However, no matter what I try I can't get it to work. 

I amended a script that previously used the sendmail command to send the
contents of forms to an email recipient, and substituted it with the
Email::send procedure in order to make it possible to have attachments
as well. What I would like to do is: 

Have a html page with form fields (textfields, textareas etc) and an
upload file button. This html page uses a perl script to send the
contents of these form fields plus the uploaded file as an email
attachment to an email recipient.  

The amended code is pasted in here. If anyone knows what is wrong with
it and is able so suggest corrections, that would be great.
Alternatively, if someone has some code that is better, that would be
most welcome also. 
Note that one of the problems I haven't been able to resolve also is how
to put the content starting with <<MESSAGE_TO_USER (which consists of
the form fields) in the body of the email when using the email::send
procedure. I am new to this, so any help will be most appreciated.

Thanks

Hugo 

#!/usr/sbin/perl

#----------------------------------------------------------------------------
# User variables
#----------------------------------------------------------------------------


$emailaddress='hugo@fractalgraphics.com.au';
$thankyoupage='http://www.fractalgraphics.com.au/fracviewer/thanks.html';


#----------------------------------------------------------------------------
# ReadParse
# Reads in GET or POST data, converts it to unescaped text, and puts
# one key=value in each member of the list "@in"
# Also creates key/value pairs in %in, using '\0' to separate multiple
# selections
#
# If a variable-glob parameter (e.g., *cgi_input) is passed to
ReadParse,
# information is stored there, rather than in $in, @in, and %in.
#----------------------------------------------------------------------------

use Email;

sub ReadParse {
  if (@_) {
    local (*in) = @_;
  }

  local ($i, $loc, $key, $val);

  # Read in text
  if ($ENV{'REQUEST_METHOD'} eq "GET") {
    $in = $ENV{'QUERY_STRING'};
  } elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
    for ($i = 0; $i < $ENV{'CONTENT_LENGTH'}; $i++) {
      $in .= getc;
    }
  } 

  @in = split(/&/,$in);

  foreach $i (0 .. $#in) {
    # Convert plus's to spaces
    $in[$i] =~ s/\+/ /g;

    # Convert %XX from hex numbers to alphanumeric
    $in[$i] =~ s/%(..)/pack("c",hex($1))/ge;

    # Split into key and value.
    $loc = index($in[$i],"=");
    $key = substr($in[$i],0,$loc);
    $val = substr($in[$i],$loc+1);
    $in{$key} .= '\0' if (defined($in{$key})); # \0 is the multiple
separator
    $in{$key} .= $val;
  }

  return 1; # just for fun
}


#----------------------------------------------------------------------------
#
# Main procedure
#

 MAIN:
{
    &ReadParse(*in); 
    &ProcessForm;
}

sub ProcessForm
{

#----------------------------------------------------------------------------
#
# Email response to someone
#
use Email;
Email::send( To=>'"Hugo Bouckaert" <hugo@fractalgraphics.com.au>',
                  From=>'"FracWeb Script" <>',
                  Subject=>"File Upload",
                  Body=>"Here is the file");
                  Attachment=>["$in{'somefile'}"]);

#open (MAIL, "| /usr/lib/sendmail -bm $emailaddress" );
#print MAIL <<MESSAGE_TO_USER;
#From: FracWeb Script
#Subject: [Fracviewer Info Request]
#Reply-to: $in{'Email'} ($in{'Name'})


----------------------------------------------------------------------
          These details were submitted using the WWW Form
            on the Fractal Graphics FracViewer webpage
----------------------------------------------------------------------

Please send information about the requested product to the client's
email address:

File:          $in{'somefile'}	
Product:       $in{'Product'}	
Name:          $in{'Name'}
Company:       $in{'Company'}
Address:       $in{'Address'}
Phone:         $in{'Phone'}
Email:         $in{'Email'}

The following information was also obtained from the web browser:

Remote Host: 	$ENV{'REMOTE_HOST'}
Remote Address: $ENV{'REMOTE_ADDR'}

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

MESSAGE_TO_USER
close MAIL;

#----------------------------------------------------------------------------
#
# Generate reply for user
#

# Send the thankyou page to the submitter ...

print "Location: $thankyoupage\n\n";

}





-- 
Dr Hugo Bouckaert
R&D Support Engineer, Fractal Graphics 
39 Fairway, Nedlands Western Australia 6009
Tel: 9284 8442
Email:hugo@fractalgraphics.com.au
Web: http://www.fractalgraphics.com.au


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

Date: Tue, 19 Sep 2000 01:29:54 GMT
From: cpraber@yahoo.com
Subject: How to parse HTML, extract stuff based on rules and spit out reformatted HTML?
Message-Id: <8q6fht$2u$1@nnrp1.deja.com>

Oh Wise Ones,

* Warning: Newbie alert *

This is probably way too ambitious for this newbie to consider taking
on, but I would like to build a utility that would parse and extract
data from HTML documents and spit out newly formed HTML based
on "rules". Don't ask me what these rules look like yet, I haven;t the
foggiest!

The idea: this utility would operate in "real-time" for morphing
existing HTML and re-purposing it for delivery to diffent browsers than
were intended by the design of the original HTML (e.g. going from
browser rendering to WAP/WML, etc).

I have read some of the posts on this forum about HTML Parsing, but I
am wondering what are the existing perl modules or techniques I should
study with this goal in mind? Or, if there is work out there along
these lines already underway, I would appreciate a pointer on where to
furher my inquiry.

TIA,

-Chris.



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


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

Date: Tue, 19 Sep 2000 03:02:00 GMT
From: cpraber@yahoo.com
Subject: Re: How to parse HTML, extract stuff based on rules and spit out reformatted HTML?
Message-Id: <8q6kuv$63l$1@nnrp1.deja.com>

Ok, here are some initial ideas:

- Turn the incoming document into a data structure representative of
the document (i.e. DOM).

- Allow "rules" to be expressed in terms of the DOM representation,
from input document to output document, e.g.:

outputDoc.title = inputDoc.title;
 ...

Some other thoughts:

- Allow assignments of sub-trees or atoms per rule. It would be neat if
you could assign a target object some filtered part of a source
document object. For example, copy an input field, but don't copy
certain attributes like font.

- Allow application of style sheets to the output document to filter
out html terrorism from the input document.

Does this make sense? Show me the flaws in my thinking, if you are so
inclined, and so generous.

Regards,

-Chris.

In article <8q6fht$2u$1@nnrp1.deja.com>,
  cpraber@yahoo.com wrote:
> Oh Wise Ones,
>
> * Warning: Newbie alert *
>
> This is probably way too ambitious for this newbie to consider taking
> on, but I would like to build a utility that would parse and extract
> data from HTML documents and spit out newly formed HTML based
> on "rules". Don't ask me what these rules look like yet, I haven;t the
> foggiest!
>
> The idea: this utility would operate in "real-time" for morphing
> existing HTML and re-purposing it for delivery to diffent browsers
than
> were intended by the design of the original HTML (e.g. going from
> browser rendering to WAP/WML, etc).
>
> I have read some of the posts on this forum about HTML Parsing, but I
> am wondering what are the existing perl modules or techniques I should
> study with this goal in mind? Or, if there is work out there along
> these lines already underway, I would appreciate a pointer on where to
> furher my inquiry.
>
> TIA,
>
> -Chris.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

Date: Mon, 18 Sep 2000 23:18:17 -0400
From: "RainCloud Studios" <design@raincloud-studios.com>
Subject: How To? Setting External Subroutine as Method of Perl Module and passing arguments
Message-Id: <UVAx5.4129$Ao3.25493@news1.atl>

For CGI-related scripts I will usually code a module with errors returned to
the calling script and if a failure is encountered, route the error to a
custom HTML output routine. What I'd like to attempt, mainly just to satisfy
my sense of curiousity, is passing a subroutine to a module and then call
that subroutine including passed arguments from -within- the module whenever
errors occur.

Basically I'm looking to 'raise the error' from inside the module to an
external subroutine in the main CGI Perl script. I know a few will raise
eyebrows over the idea of not checking a return but humor me momentarily. :)
The implementation would work somewhat like:

# in my calling script
sub error_handler{
  my $error = shift;
  &print_header;
  &print_custom_html_header;
  print $error;
  &print_custom_html_footer;
  exit;
}

Now.. in the script I call my module.

use THINGY::MYTHING;
my $newthingy = MYTHING->new();
$newthingy->error_handler(\&error_handler);
$newthingy->dosomething();

Ok.. if an error occurs in &dosomething I would now like to send the error
message to error_handler from within the module, thus revealing an error
page and exiting the script. I'm totally lost. The farthest I've travelled
that even resembles this is working with anonymous subs in a hash structure
and nothing I've done there seems to relate. The one thing that really has
my noodle cooked is how the arguments would get passed once ->error_handler
is set.

Thanks for any input,
CC's welcome as an alert ( I will respond on list),

Charles R. Thompson
RainCloud Studios
design@raincloud-studios.com





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

Date: Tue, 19 Sep 2000 02:41:48 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: inet_ntoa()
Message-Id: <slrn8sdkir.2cp.mgjv@verbruggen.comdyn.com.au>

On Mon, 18 Sep 2000 17:45:07 -0600,
	Weiguang Shi <wgshi@cs.ualberta.ca> wrote:
> Hi, there
> 
> I am wondering how the "inet_ntoa()" works. Here is my 5-line test script:
> 	-------------------------------------
> 	#! /usr/bin/perl
> 
> 	use Socket;
> 	$ip = 100663296;
> 	print "ip = ", inet_ntoa($ip), "\n";
> 	-------------------------------------
> However, I couldn't get it work. The reason was:
> 
> 	Bad arg length for Socket::inet_ntoa, length is 5, should be 4 at ./a.pl line 5.
> 
> What's happening here?

You're missing a pack. 

$ perldoc Socket

#!/usr/local/bin/perl -w
use strict;
use Socket;

my $ipn = unpack N => inet_aton('172.18.240.55');
my $ipa = inet_ntoa(pack N => 2886922295);

print "172.18.240.55 -> $ipn\n2886922295    -> $ipa\n";

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.   | Gates?
NSW, Australia                  | 


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

Date: Tue, 19 Sep 2000 01:15:08 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Is this terribly inefficient?
Message-Id: <slrn8sdfgb.2cp.mgjv@verbruggen.comdyn.com.au>

On Mon, 18 Sep 2000 15:45:22 -0700,
	Larry Rosler <lr@hpl.hp.com> wrote:
> In article <x7vgvtejag.fsf@home.sysarch.com> on Mon, 18 Sep 2000 
> 16:50:31 GMT, Uri Guttman <uri@sysarch.com> says...
> > >>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
> > 
> >   BL> To be honest, I don't understand the GRT preference to turn everything
> >   BL> into binary strings. What is wrong with plain and simple preformatted
> >   BL> text strings?
> > 
> >   BL> 	sprintf "%04d%02d%02d", $year, $month, $day
> > 
> > it is a preference of the R in GRT. i initially prefered strings and
> > sprintf. the paper shows how to do both and you can even mix and match
> > them. pack generates shorter compare keys and therefore is somewhat
> > faster. sprintf generates printable keys and can be easier to debug.
> 
> String comparison is O(N) in the length of the strings being compared, 
> which becomes a multiplicative factor in the O(N log N) comparisons.  So 
> the shorter the sortkey, the better.
> 
> All the benchmarks posted in this thread are fundamentally flawed, 
> because the data set of only five elements deemphasizes the sorting time 
> relative to the time required to compute the sortkeys and extract the 
> sorted records.  With so few data, any method of sorting is likely to be 
> acceptable.

As noted when the benchmarks were posted. The first post also had an
entry for a benchmark with more keys. Code was included, so anyone can
run the same benchmark on a data set that is more appropriate for
their particular data set.

Apart from the low number of elements to sort, the length of the
strings to sort (from which to extract the data) also plays a role.
rather than post 128 different benchmarks with slightly different sets
of items to sort, I figured I'd leave it up to whomever felt they
wanted to apply it to their particular data, and post just an
indicative benchmark. besides that, I simply didn't feel like
generating large amounts of what I could only guess would be
approximately real life data.

Apart from that, the spread of the actual dates would probably also
have a considerable effect on the comparative sort speeds. At least,
the ST methods would perfomr better if each element of the sort set
would fall in a different year, and worse if they all fall in the same
year and month. The GRT methods would probably be less sensitive to
that.  I didn't include a data set for that eventuality either.

It's not a paper, just a post to Usenet :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.   | accept as reality - Calvin
NSW, Australia                  | 


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

Date: Tue, 19 Sep 2000 02:19:33 GMT
From: Joe Getty <joegetty@mediaone.net>
Subject: Join our team
Message-Id: <9vhdss4g1ptpvfcvtkscemab0f9ssvacph@4ax.com>

Looking for an individual that is familiar with unix and has a good
understanding of HTML.  Knowledge of regular expressions is preferred.
You will be in charge of creating and testing configuration files that
are compatible with our proprietary software.   Work may be done
offsite at your own hours.  Compensation package consists of wages and
equity in a promising internet startup.

Please e-mail me your resume in either MS Word, HTML, or ASCII format.

Joe Getty.
joegetty@mediaone.net



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

Date: 19 Sep 2000 02:58:02 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Join our team
Message-Id: <slrn8sdlfl.5fq.abigail@alexandra.foad.org>

Joe Getty (joegetty@mediaone.net) wrote on MMDLXXVI September MCMXCIII in
<URL:news:9vhdss4g1ptpvfcvtkscemab0f9ssvacph@4ax.com>:
^^ Looking for an individual that is familiar with unix and has a good
                                                   ^^^^
^^ understanding of HTML.  Knowledge of regular expressions is preferred.
^^ You will be in charge of creating and testing configuration files that
^^ are compatible with our proprietary software.   Work may be done
^^ offsite at your own hours.  Compensation package consists of wages and
^^ equity in a promising internet startup.
^^ 
^^ Please e-mail me your resume in either MS Word, HTML, or ASCII format.
                                          ^^^^^^^


Hmmmm.

Anyway, cue dha.


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
#    A pair of wolves beside
#    a dam. Ryonen dying.
#    An eagle flying.


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

Date: Tue, 19 Sep 2000 01:46:25 GMT
From: "orassilv" <ssilv@rochester.rr.com>
Subject: newbie having problem with system command
Message-Id: <Rzzx5.10708$%h6.2705164@typhoon.nyroc.rr.com>

I am trying to run a script to shut down an Oracle database.

When I try to run a batch file or a .cmd file using system, it fails.
   $ret = system("dbdown.cmd");  # does NOT work but I CAN run the .cmd file
from command line

 ... but when I try to use the system command as folows, it works fine.
   $ret = system("del /Q sqldown.sql");  # this works - deletes a .sql file

Any ideas why I can't run a batch file using the system command?


Thanks,
orassilv





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

Date: Tue, 19 Sep 2000 09:50:45 +0800
From: snake ming <snakeming@hotmail.com>
Subject: Prasing a patch file
Message-Id: <39C6C675.761FF990@hotmail.com>

Have anyone try to use perl to merge the patch file (the one generated
by diff) and source file?
Quite similar to the "patch" utility. But I want to highlight the
changes, deletion and addition to the source for analysis the patch!

Cliff




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

Date: Tue, 19 Sep 2000 00:16:17 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Range operator with "... /^$/"
Message-Id: <39c6af7e.1080807@news.newsguy.com>

Brendon Caligari <bcaligari@my-deja.com> wrote:

>m/^$/ matches an empty line
>
>a 'just read' line will probably contain a newline

    print "That's not the problem" if "\n" =~ /^$/;

Because of just this sort of situation, $ matches an ending
newline as well as the end.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Mon, 18 Sep 2000 22:43:32 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Range operator with "... /^$/"
Message-Id: <Pine.GSO.4.21.0009182237230.29488-100000@crusoe.crusoe.net>

On Sep 19, Keith Calvert Ivey said:

>Brendon Caligari <bcaligari@my-deja.com> wrote:
>
>>m/^$/ matches an empty line
>
>    print "That's not the problem" if "\n" =~ /^$/;
>
>Because of just this sort of situation, $ matches an ending
>newline as well as the end.

The \z anchor matches at the ABSOLUTE end of a string.

The \Z anchor matches at an optional \n before \z.

The $ anchor matches like \Z, unless the /m modifier is on, in which case
it matches before any \n, and where \Z would match.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



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

Date: Tue, 19 Sep 2000 04:05:37 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Rant: Re: An identd faking ident.
Message-Id: <1eh6trg.fi72ac1bir3omN%tony@svanstrom.com>

Alan J. Flavell <flavell@mail.cern.ch> wrote:

> On 18 Sep 2000 nobull@mail.com wrote:
> 
> > Servers that log ident info on requests do so in order to _help_ the
> > admins of the client sites track abusive users.  If your site has only
> > one user at a time and you know who that is then there's no reason to
> > respond to ident requests.
> 
> Crypted identd (a la "pidentd") seems a neat idea.

I was working on a PGP-version of ident a cpl of years ago, but no one
really seemed interested; people just seemed to think that ident was
something old an useless.


     /Tony... sorry for the noice...
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: 19 Sep 2000 02:56:14 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Rant: Re: An identd faking ident.
Message-Id: <slrn8sdlc8.5fq.abigail@alexandra.foad.org>

Tony L. Svanstrom (tony@svanstrom.com) wrote on MMDLXXVI September
MCMXCIII in <URL:news:1eh6trg.fi72ac1bir3omN%tony@svanstrom.com>:
;; Alan J. Flavell <flavell@mail.cern.ch> wrote:
;; 
;; > On 18 Sep 2000 nobull@mail.com wrote:
;; > 
;; > > Servers that log ident info on requests do so in order to _help_ the
;; > > admins of the client sites track abusive users.  If your site has only
;; > > one user at a time and you know who that is then there's no reason to
;; > > respond to ident requests.
;; > 
;; > Crypted identd (a la "pidentd") seems a neat idea.
;; 
;; I was working on a PGP-version of ident a cpl of years ago, but no one
;; really seemed interested; people just seemed to think that ident was
;; something old an useless.


This thread is making me wonder. How would you write an RFC compliant
cross-platform identd in Perl?



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'


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

Date: Tue, 19 Sep 2000 05:11:16 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Rant: Re: An identd faking ident.
Message-Id: <1eh6wsn.4vhn1y1xf9ynaN%tony@svanstrom.com>

Abigail <abigail@foad.org> wrote:

> Tony L. Svanstrom (tony@svanstrom.com) wrote on MMDLXXVI September
> MCMXCIII in <URL:news:1eh6trg.fi72ac1bir3omN%tony@svanstrom.com>:
> ;; Alan J. Flavell <flavell@mail.cern.ch> wrote:
> ;; 
> ;; > On 18 Sep 2000 nobull@mail.com wrote:
> ;; > 
> ;; > > Servers that log ident info on requests do so in order to _help_
> ;; > > the admins of the client sites track abusive users.  If your site
> ;; > > has only one user at a time and you know who that is then there's
> ;; > > no reason to respond to ident requests.
> ;; > 
> ;; > Crypted identd (a la "pidentd") seems a neat idea.
> ;; 
> ;; I was working on a PGP-version of ident a cpl of years ago, but no one
> ;; really seemed interested; people just seemed to think that ident was
> ;; something old an useless.
> 
> This thread is making me wonder. How would you write an RFC compliant
> cross-platform identd in Perl?

I was simply testing to see if it would work within the limitations of
the RFC, so I wasn't making it x-platform nor was I using Perl. It was
quite easy actually, and being reminded about it like this I feel almost
like writing an RFC about it. *L*


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Tue, 19 Sep 2000 02:30:03 -0000
From: Marshall Neill <mzardoz@worldnet.att.net>
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <ssdjtbimf25i4f@corp.supernews.com>

Gentlemen;
I've just started programming in Perl and found that TextPad 4 is quite 
useful.  It has highlighting, auto indenting, etc.  Perhaps you would 
check that one out.  $27 for the Single-User version.
I've been to more sites UltraEdit, SynEdit,Vim, visiPerl, etc.  All the 
editors just don't seem to come up to TextPad 4.
Apologies to Unix/Linux users, I believe this is Windows only.
Anyway that's my 2 cents worth to this discussion.
Tim Hammerquist wrote:
> 
> 
> Abigail <abigail@foad.org> wrote:
> > Tim Hammerquist (tim@degree.ath.cx) wrote
> > ][ I'll tell you what I use in order of preference:
> > ][ 
> > ][ Unix/Linux:
> > ][ vim( http://www.vim.org )
> > ][ nvi, vile, or vanilla vi
> > ][ pico
> > ][ emacs
> > ][ On Win32:
> > ][ Win32 port of vim( http://www.vim.org )
> > ][ UltraEdit-32( http://www.ultraedit.com ; ~US$30 )
> > ][ Homesite 4.x( http://www.allaire.com ; ~US$90 )
> > ][ Notepad
> > 
> > That's quite a range of editors! My use is far more limited:
> > 
> > Unix:   vile
> >         vi
> >         ed
> > 
> > Wind32: I don't do Windows. ;-)
> 
> Well, I had to use something before my life was greatly improved by
> linux.  And when I do get stuck on Windows (clients' putas, usually), I
> like to use something.
> 
> Plus, I like to try everything at least once.  Those are just the
> editors in which I program effectively, not necessarily that I use on a
> regular basis.
> 
> -- 
> -Tim Hammerquist <timmy@cpan.org>
> The great tragedy of Science -- the slaying
> of a beautiful hypothesis by an ugly fact.
> -- Thomas Henry Huxley


--
Posted via CNET Help.com
http://www.help.com/


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

Date: Tue, 19 Sep 2000 02:21:01 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Splitting data from a text file
Message-Id: <slrn8sdjbs.2cp.mgjv@verbruggen.comdyn.com.au>

On Mon, 18 Sep 2000 16:44:41 -0700,
	Larry Rosler <lr@hpl.hp.com> wrote:
> 
> I have argued several times for a warning if the first argument to 
> split() is a literal string (other than "", of course).  Others have 
> argues that that would induce warnings in legacy code.

or ' '.

Martien
-- 
Martien Verbruggen              | My friend has a baby. I'm writing
Interactive Media Division      | down all the noises the baby makes so
Commercial Dynamics Pty. Ltd.   | later I can ask him what he meant -
NSW, Australia                  | Steven Wright


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

Date: Tue, 19 Sep 2000 02:50:43 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: The %b format specifier doesn't work?
Message-Id: <slrn8sdl3i.2cp.mgjv@verbruggen.comdyn.com.au>

On 18 Sep 2000 23:44:00 GMT,
	James T. Dennis <jadestar@idiom.com> wrote:
> 
>  I'm trying to print some simple scalar values (from 0 through
>  63) as bit patterns using something like: 
> 
> 	for $i (0..63) { printf ("%b\n", $i);  };
[snip]
>  I'm using perl, version 5.005_03 built for i386-linux
>  (as installed by Debian Potato).
> 
>  So, is this an error in the book, an error in my binary,
>  or is the feature from a new version of PERL (or was it
>  deprecated and removed).

Yes.

That is, yes, it is a feature in a newer Perl, 5.6.0.

>  Am I really going to have to use something like:
>  
> 
> 	for $i (0..63) { print unpack("b6", chr($i)), "\n";  };

Maybe this:

print unpack b6 => pack C => $_ for (0..63);

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I took an IQ test and the results
Commercial Dynamics Pty. Ltd.   | were negative.
NSW, Australia                  | 


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

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


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