[10169] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3762 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 19 21:07:50 1998

Date: Sat, 19 Sep 98 18:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 19 Sep 1998     Volume: 8 Number: 3762

Today's topics:
    Re: any way to encrypt my script? bitnut1@my-dejanews.com
    Re: Can GD.pm make 200 *ppi* gifs? (N.A.F. McNelly)
    Re: Can GD.pm make 200 *ppi* gifs? <dean2@mail.biol.sc.edu>
    Re: copy a file? (Mark-Jason Dominus)
        downloading a file using perl... <adtech@aros.net>
    Re: Efficency Experiments (Larry Rosler)
    Re: Enumerating Properties and Methods (Mark-Jason Dominus)
    Re: Enumerating Properties and Methods (Mark-Jason Dominus)
    Re: Enumerating Properties and Methods <gellyfish@btinternet.com>
        even/odd numbers (Scott Stark)
    Re: even/odd numbers <tchrist@mox.perl.com>
    Re: even/odd numbers (brian d foy)
    Re: even/odd numbers (Alastair)
    Re: even/odd numbers (Scott Stark)
    Re: even/odd numbers (Mark-Jason Dominus)
    Re: Help with file test operator problem (Larry Rosler)
    Re: Help With Perl Beautification <*@qz.to>
    Re: Help With Perl Beautification (Steven M. O'Neill)
    Re: Perl & Java - differences and uses <uri@sysarch.com>
    Re: Perl & Java - differences and uses (Larry Wall)
    Re: Regex strange behavior (Charles DeRykus)
    Re: script: scriptMangle! (Craig Berry)
    Re: splitting by certain spaces (Charles DeRykus)
    Re: Using templates... (Mark-Jason Dominus)
    Re: Using templates... <phraktyl@home.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 20 Sep 1998 00:16:46 GMT
From: bitnut1@my-dejanews.com
Subject: Re: any way to encrypt my script?
Message-Id: <6u1hhe$ldi$1@nnrp1.dejanews.com>


>-------------------------------------------------------
>  tchrist@mox.perl.com (Tom Christiansen):
>  [courtesy cc of this posting sent to cited author via email]
> ...
>-------------------------------------------------------

"A spam by any other name stinks equally bad."
So, refrain from your "courtesy" spamming in the future.

You obviously badly need the classes I recommended previously.
Additional classes required: "Manners 101", "Psychics 101".

Now go back to your cave.
And stay there until you complete the prerequisites.
Don't worry, noone here will miss your moronic comments
disguised as rude arrogance.

B.N.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Sat, 19 Sep 1998 19:13:50 -0500
From: nmcnelly@bu.edu (N.A.F. McNelly)
Subject: Re: Can GD.pm make 200 *ppi* gifs?
Message-Id: <nmcnelly-1909981913510001@ppp-85-1.bu.edu>

In article <8cd88reqnt.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:

> >>>>> "Tom" == Tom Mornini <tmornini@netcom.com> writes:
> 
> Tom> I don't believe that GIF's have resolution information stored inside.
> 
> Tom> I'm pretty sure they're just pixels, and that it is either standard, or
> Tom> generally agreed upon, that they are 72 dpi.
> 
> I'm pretty sure the GIF standard says nothing about DPI.  So I'm pretty
> sure you're right.
>
> So a "200 DPI GIF" doesn't grok.

Ooops!  Let me reword that to 200 pixels/inch.  I know the gif
format can store info about pixels/in - I can create a gif at
72, 100, 200 ppi, and when the gif is opened with another graphics
program, it retains its original ppi.  I have a friend who keeps
100 ppi gif on his website, and when they're dowhnloaded they retain
their original density.

So my question really is:  is there anyway I can force GD.pm to
output combined gifs at their origial ppi rather than cutting them
down to 72 ppi?

 ......................................................................
Nancy McNelly
http://halfmoon.org   Rabbit in the Moon: Mayan Glyphs and Architecture
http://halfmoon.org/borden/   Virtual Lizzie Borden House


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

Date: 19 Sep 1998 20:19:29 -0400
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
Subject: Re: Can GD.pm make 200 *ppi* gifs?
Message-Id: <m3d88r3ab2.fsf@mail.biol.sc.edu>

nmcnelly@bu.edu (N.A.F. McNelly) writes:
> In article <8cd88reqnt.fsf@gadget.cscaper.com>, Randal Schwartz
> <merlyn@stonehenge.com> wrote:
> > >>>>> "Tom" == Tom Mornini <tmornini@netcom.com> writes:
> > Tom> I don't believe that GIF's have resolution information stored inside.
> > Tom> I'm pretty sure they're just pixels, and that it is either standard, or
> > Tom> generally agreed upon, that they are 72 dpi.
> > I'm pretty sure the GIF standard says nothing about DPI.  So I'm pretty
> > sure you're right.
> > So a "200 DPI GIF" doesn't grok.
> Ooops!  Let me reword that to 200 pixels/inch.  I know the gif
> format can store info about pixels/in - I can create a gif at
> 72, 100, 200 ppi, and when the gif is opened with another graphics
> program, it retains its original ppi.  I have a friend who keeps
> 100 ppi gif on his website, and when they're dowhnloaded they retain
> their original density.

Umm... I don't think so.  I just looked at the code in Tom Boutell's
gd.c program.  The code that writes out the GIF file never writes any
information regarding dpi (or ppi, for that matter).  This applies for
both the GIF89a and GIF87a formats.  

Let me suggest that your impression of being able to create GIFs with
different ppi specifications is an artifact of the way Photoshop lets
you format images.  (Note that I'm winging a guess that you're using
Photoshop, or something similar.)  When you're specify pixels/inch in
Photoshop, what the program "really" does is to use that number, in
combination with the image size you set (in inches or cm) to decide
how many pixels wide and high to make the bitmap.  When Photoshop
barfs out the GIF file, it just pops out a file with that many pixels
across and high; there is no information in the GIF file that can
specify pixels per inch.

If, however, you save the image in Photoshop's native format, it
helpfully holds onto all your image size settings for you.  Note that
those settings are useful only to Photoshop - it doesn't affect your
GIF output in any way.  


> So my question really is:  is there anyway I can force GD.pm to
> output combined gifs at their origial ppi rather than cutting them
> down to 72 ppi?

So the answer to this question is (to be mildly perverse about it)
yes: display the output of GD.pm on a 300 dpi (or ppi, whatever) laser
printer.  Then you'll get 300 dpi output.  Display it on a standard
video screen, and you'll get about 72 dpi.  Project it in a
lecture-hall multimedia system and you'll get 5 dpi...

-Dean
-- 
N. Dean Pentcheff                                          <pentcheff@acm.org>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)


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

Date: 19 Sep 1998 20:07:41 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: copy a file?
Message-Id: <6u1h0d$qpb$1@monet.op.net>

In article <6u1ac9$i3t$3@uranium.btinternet.com>,
Jonathan Stowe Gellyfish Gill Nunns  <gellyfish@btinternet.com> wrote:
>What was that phrase about YCJMSUAEITW or something like that ? 

Your version is much more polite than what I wrote originally, which
is too rude to repeat in a context where it might be taken personally.

It's at <URL:http://www.plover.com/~mjd/perl/Questions4.html>, in
green type, if you really care to know.


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

Date: Sat, 19 Sep 1998 18:11:12 -0600
From: Mark Hulka <adtech@aros.net>
Subject: downloading a file using perl...
Message-Id: <36044820.87CEF0AB@aros.net>

Here's my problem. I have some files that I want people to be able to
download from my web site. They are binary files, but when I download
one of the files using Netscape it comes across as plain text, making
the file unusable.

Here's my question, I can use a PERL script to allow users to download
the files fine. But when the file is downloaded the filename is set to
the name of the PERL script. Does anyone know of a way to set the
filename?

Here's my code:

 open (FILE,"test.foo") || die "Can't Open test.foo: $!\n";
 @CONTENTS=<FILE>;
 close(FILE);

 print "Content-type: application/octet-stream\n\n";
 print @CONTENTS;

Any ideas would be greatly appreciated,

Mark



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

Date: Sat, 19 Sep 1998 16:03:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Efficency Experiments
Message-Id: <MPG.106dd838cb401a79989874@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <3603B367.7D917CA@earthlink.net> on Sat, 19 Sep 1998 06:36:39 
-0700, Mooneer Salem <mooneer@earthlink.net> says...
> I'm trying to make a program that I'm writing faster. The program I'm
> writing will take an HTML file, take Perl code located between <perl>
> and </perl>, and execute it. The hard part's already done; I just have
> to make my code faster and add some error handling to it. I was thinking
> that variable interpolization might be the bottleneck, so I tried to do
> as little of it as possible by using join statements whenever I needed
> to insert the contents of a variable into a string of printed text, and
> using single quotes in print statements when I don't need to insert
> contents of variables.
> 
> My code's below; can anyone see any other ways to make the code faster?

You have gone to a lot of trouble to optimize things that won't make a 
bit of difference in the execution time of the program -- the gathering 
of the text for the 'eval STRING' statement.  Though there are some 
further opportunities, I won't discuss them because they really aren't 
worth the trouble.  Some of your choices actually slow things down, not 
that you would ever notice, and certainly clutter things up:

$http_header = join("\n", 'HTTP/1.0 200 OK', 'Content-type: text/html',
"\n");
print $http_header;

should be:

print "HTTP/1.0 200 OK\nContent-type: text/html\n\n";


The basic principle of what you are trying to accomplish is to *measure* 
to locate the bottleneck, before doing any optimization.  Here is a 
simple way to measure within a program, without installing a module such 
as Devel::DProf.  Put the following statements at the beginning:

my $t0 = (times)[0];

just before the 'eval STRING':

my $t1 = (times)[0];

just after the 'eval STRING':

my $t2 = (times)[0];

just before the exit:

my $t3 = (times)[0];
printf "before: %.2f; eval: %.2f; after: %.2f\n",
    $t1 - $t0, $t2 - $t1, $t3 - $t2;

I'll wager that you will find that "all" the time is spent compiling and 
executing the 'eval STRING'.  As that is the guts of the algorithm you 
are trying to implement, the only way to speed it up is to run on a 
faster computer.

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


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

Date: 19 Sep 1998 19:52:05 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Enumerating Properties and Methods
Message-Id: <6u1g35$qlh$1@monet.op.net>

In article <6u15ic$ifu@news-central.tiac.net>,
Jay Guerette <JayGuerette@pobox.com> wrote:
>I can guess from the purpose of the class what the methods will do. 

If you say so.

	#!/usr/bin/perl
	# print_functions:  dump out all the functions
	# defined by the package(s) specified on the command line.
	# -p option: `private' functions too.

	if ($ARGV[0] eq '-p') {
	  $Private = 1;
	  shift;
	}
	
	unless (@ARGV) {
	  die "Usage: $0 [-p] packagename...\n";
	}
	
	foreach $pack (@ARGV) {
	  my $file = $pack;
	  $file =~ s-::-/-g;
	  $file .= '.pm';
	  eval {require $file};
	  if ($@) {
	    warn "Couldn't load $pack: $@\n";
	    next;
	  }
	  my $stab = \%{$pack . '::'};
	  my ($n, $g);
	  while (($n => $g) = each %$stab) {
	    next if $n =~ /^_/ && ! $Private;
	    if (defined *{$g}{CODE}) {
	      my $proto = prototype *{$g}{CODE};
	      $proto = defined $proto ? " ($proto)" : '';
	      print $pack, "::$n\t$proto\n";
	    }
	  }
	}
	
Try for example

	print_functions CGI
	print_functions Getopt::Long

There is a weak convention in Perl that function names that begin with
`_' are supposed to be private, and may change without warning from
one version to the next.  Normally, this program does not include such
functions in its list.  the `-p' option displays all functions.

Note that this program also mentions functions that were imported from
elsewhere.  For example, if package A looks like this:

	package A;
	use Carp;

then `print_functions' will mention the functions A::carp and
A::croak.  Attempting to access these as methods is sure to cause some
sort of bizarre disaster.

Note also that there is no way to distinguish between a class method,
an instance method, and a conventional non-method function.  However,
if the function was defined with a prototype, this program will
display the prototype.

>>>$foo->bar->{'prop'}="gnu";

$foo->bar here is a reference to a hash; you can access it just like
any other hash.  For example:

	my $hashref = $foo->bar;
	foreach $k (sort keys %$hashref) {
	  print "$k => $hashref->{$k}\n";
	}

>There is NO documentation for client-side PerlScript.

I would very, very strongly recommend that you ignore this article,
and instead pay attention to the article in this thread that suggests
you get the documentation from the Microsoft web site.  You are almost
certainly about to do something foolish.


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

Date: 19 Sep 1998 19:59:21 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Enumerating Properties and Methods
Message-Id: <6u1ggp$qn8$1@monet.op.net>

In article <6u1g35$qlh$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>[List of caveats and bugs.]

Also, it will not locate autoloaded or dynamically loaded functions.

>if the function was defined with a prototype, this program will
>display the prototype.

Try IO::File for an example.


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

Date: 20 Sep 1998 00:09:37 GMT
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Enumerating Properties and Methods
Message-Id: <6u1h41$kfs$1@uranium.btinternet.com>

On Sat, 19 Sep 1998 18:31:24 -0400 Jay Guerette <JayGuerette@pobox.com> wrote:

>>> This _is_ what I'm really trying to accomplish. I could tell you that I'm
>>> trying to find out what methods and properties are available from
>>> '$window->document' under PerlScript, but I hesitate to do that because
>>> everybody says: "Well, that's PerlSCRIPT and not PERL; we can't help
> you."
>>> Of course, people don't understand that PerlScript is simply a wrapper
> for
>>> Perl; and for that reason IS Perl. There is NO documentation for
> client-side
>>> PerlScript.
>>
>>The documentation for the Client side scripting object model is available
>>from the MS website.  The methods and properties are largely the same for
>>Javascript, VBScript and perlScript - Of course the access syntax may
> differ.
>>
>>What you are asking is NOT a Perl question - It is question about the MS
>>object model that is exposed to Perlscript by the scripting engine.


> See what I mean?  I am NOT asking anybody to explain the MS DOM. I am NOT
> asking a question about PerlScript. I am asking how to expose the methods
> and properties of a class that you know nothing about. That's it. I don't
> understand why people AUTOMATICALLY refuse help to anybody who is using
> PerlScript. It IS Perl. This IS a PERL question. Some day I hope your auto
> mechanic REFUSES to fix your car because he doesn't like HOW you use it!


Please. There is documentation for client-side PerlScript. There is
documentation for the Objects that PerlScript has access to. There
is documentation for Perl.  No-one is refusing to help you here - quite
the opposite. The questions you are asking however do not have an ideal
Perl solution.   If a class or module is so poorly documented that you have
to discover its methods for your self then it is a bad module - that is the
Perl way in my opinion. 

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: 19 Sep 1998 22:53:19 GMT
From: sstark@informix.com (Scott Stark)
Subject: even/odd numbers
Message-Id: <6u1ckv$re21@webint.na.informix.com>

Hi, does anyone know a way for perl to determine if a number is even or odd?

thanks

Scott Stark
sstark@informix.com



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

Date: 19 Sep 1998 23:15:26 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: even/odd numbers
Message-Id: <6u1due$2qu$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, sstark@informix.com (Scott Stark) writes:
:Hi, does anyone know a way for perl to determine if a number is even or odd?

The same way one does in mathematics, of course.

I really don't think I'll ever understand this question.  It's right up
there with asking how to check whether a number if positive or negative.


--tom
-- 
"Espousing the eponymous /cgi-bin/perl.exe?FMH.pl execution model is like 
reading a suicide note -- three days too late."
	    --Tom Christiansen <tchrist@mox.perl.com>


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

Date: Sat, 19 Sep 1998 19:45:22 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: even/odd numbers
Message-Id: <comdog-ya02408000R1909981945220001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6u1ckv$re21@webint.na.informix.com>, sstark@informix.com (Scott Stark) posted:

>Hi, does anyone know a way for perl to determine if a number is even or odd?

see if any of these work for you...

####exhaustive method
%parity = qw(
            1 odd
            2 even
            3 odd
            ...
            );

$parity = $parity{$number};

####modified exhaustive method
%parity = qw(
            0 even
            1 odd
            2 even
            3 odd
            ...
            9 odd
            );

$parity = $parity{$number % 10};

####division method
$parity = ($number / 2 == int( $number / 2 ) ) ? "even" : "odd";

####modulus method
$parity = $number % 2 ? "odd" : "even";

####decomposition method (see also the memoization module)
$number = $number > 0 ? $number : -1 * $number;
while( $number - 2 >= 0 )
   {
   $number = $number - 2;
   }

$parity = $number ? "odd" : "even";

####bit mask method
$parity = $number & 1 ? "odd" : "even";

####iteration method
$count  = 0;
$parity = undef;

while( $count <= $number )
   {
   if( $count == $number )
      {
      $parity = 'even';
      last
      }
   $count += 2
   }

$parity = defined $parity ? $parity : "odd";

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Sat, 19 Sep 1998 23:40:52 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: even/odd numbers
Message-Id: <slrn708jva.52.alastair@calliope.demon.co.uk>

Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, sstark@informix.com (Scott Stark) writes:
>:Hi, does anyone know a way for perl to determine if a number is even or odd?
>
>The same way one does in mathematics, of course.
>
>I really don't think I'll ever understand this question.  It's right up
>there with asking how to check whether a number if positive or negative.

You're right. It's strange isn't it? I blame the fact that people are allowed to
use calculators in school ;)

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 19 Sep 1998 23:40:31 GMT
From: sstark@informix.com (Scott Stark)
Subject: Re: even/odd numbers
Message-Id: <6u1fdf$re22@webint.na.informix.com>

In article <6u1due$2qu$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com says...
>
>:Hi, does anyone know a way for perl to determine if a number is even or odd?
>
>The same way one does in mathematics, of course.
>
>I really don't think I'll ever understand this question.  It's right up
>there with asking how to check whether a number if positive or negative.

WELL, obviously if I want to determine if a number is positive or negative I 
can just say

	if($num > 0) { $num is positive }
or
	if($num < 0) { $num is negative }

BUT, call me stupid, yes *I KNOW* that if a number is divisible by 2 it's even, 
but how do I say that in perl? If $num divided by 2 contains the string ".5" 
it's odd, else it's even? Is there some math function in perl to determine if 
the result of division is a whole number?

I'm sorry if I'm too much of a newcomer to programming perl to always post 
complex, intelligent questions to this newsgroup, but I don't know how else to 
learn.

Scott Stark
sstark@informix.com



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

Date: 19 Sep 1998 20:30:08 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: even/odd numbers
Message-Id: <6u1iag$qs0$1@monet.op.net>
Keywords: from just another new york perl hacker

In article <comdog-ya02408000R1909981945220001@news.panix.com>,
brian d foy <comdog@computerdog.com> wrote:
>####decomposition method (see also the memoization module)

Mmmm. 

sub Z   {[]}
sub i2n {$_[0]?S(i2n($_[0]-1)):Z()}
sub Zp  {@{$_[0]}==0}
sub P   {$_[0][0]}
sub S   {[$_[0]]}
sub Mi  {Zp($_[0])?Z():Zp($_[1])?$_[0]:Mi(P($_[0]),P($_[1]))}
sub Pl  {Zp($_[1])?$_[0]:Pl(S($_[0]),P($_[1]))}
sub Ep  {Zp($_[0])?1:Zp(P($_[0]))?0:Ep(Mi($_[0], S(S(Z()))))}

foreach $n (@ARGV) {
  print "$n is ", (Ep(i2n($n)) ? '' : 'not '), "even\n";
}


These might memoize OK, but I rather doubt it.  Well, i2p would be all
right. 



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

Date: Sat, 19 Sep 1998 16:02:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help with file test operator problem
Message-Id: <MPG.106dd7f5bd1be16b989872@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6u0fcs$4bp$1@juliana.sprynet.com> on Sat, 19 Sep 1998 
07:32:32 -0700, Knight <843943n34@knight_storm> says...
> ... I think there is something wrong with the file test operator...

> $Dirname = ("C:/Daniel~1/song_b~1"); 
 ...
>     if (-f $file)

Your supposition is correct.  Change this to

      if (-f "$Dirname/$file")

and all will be well.  (As you wrote it, the name of the file is relative 
to the current directory, whatever that is.  You need to use an absolute 
filename, as I have shown, or to chdir to the directory you have 
searched, which involves an extra system call.)

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


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

Date: 19 Sep 1998 23:18:30 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Help With Perl Beautification
Message-Id: <eli$9809191910a@qz.little-neck.ny.us>
Keywords: from just another new york perl hacker

In alt.fan.e-t-b, brian d foy <comdog@computerdog.com> wrote:
> Randal Schwartz <merlyn@stonehenge.com> posted:
> >Yogish>    Does anybody know where to find the perl beautifiers?
> >Perl resists all attempts to be beautified. :)
> not that people like Randal or Eli help any... ;)

Beauty is in the eye of the beholder.

Elijah
------
s e(b\eho)(ld\er)e'E'.$1.'Y'.$2.'E'ee;


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

Date: 20 Sep 1998 00:21:13 GMT
From: steveo@panix.com (Steven M. O'Neill)
Subject: Re: Help With Perl Beautification
Message-Id: <6u1hpp$n10@news1.panix.com>
Keywords: from just another new york perl hacker

panix7:~>cat ee
s e(b\eho)(ld\er)e'E'.$1.'Y'.$2.'E'ee;
panix7:~>perl5 ee
panix7:~>
-- 
Steven O'Neill                                            steveo@panix.com


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

Date: 19 Sep 1998 19:20:31 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <x7r9x7wuyo.fsf@sysarch.com>

>>>>> "GR" == George Reese <borg@imaginary.com> writes:

  GR> In comp.lang.java.programmer Uri Guttman <uri@sysarch.com> wrote:
  GR> :>>>>> "GR" == George Reese <borg@imaginary.com> writes:

  GR> :   GR> I have already stated that freedom has no place in programming.
  GR> :   GR> Now you may disagree with it, and I have certainly provided
  GR> :   GR> support for that assertion.  It therefore makes no sense to come
  GR> :   GR> back with freedom to counter that argument.  You may want to try
  GR> :   GR> explaining why a programmer should have freedom.

  GR> : ok, then use just cobol for all you programs. and only insertion
  GR> : sorts. no regexes since you can write parsers by hand. no hashes since
  GR> : you can do linear lookups. this is what no freedom in programming is
  GR> : about.

  GR> This is plain stupid.  Functionality and freedom are not synonymous.
  GR> Get that equivalence out of your head.

functionality give the programmer the freedom and artistic license to
choose which function to use to solve a coding problem. i was just
pointing out your mistaken assumption about limiting freedom of
programmers. 

  GR> The freedom you talk about is why software engineering is such a
  GR> voodoo practice that results in gobs of absolute crap being produced.

let's compare creative programmers with freedom and your hive of drones
coding to fixed format and corporate specifications. i have seen the
results and it is the crap you speak of. a smaller team of creatuve
programmers with freedom will beat their pants off easily in both
quality and quantity of code.

  GR> Design and naming things should be the result of a repeatable and
  GR> structured process.  That is what OO methodologies are.

bullshit. selecting a name is the most human ascpect of programming. the
machine doesn't give a crap about the name of something. a name is purely
a human attribute that is totally akin to writing anything in a natural
language. you have the freedom to create a word, phrase or some wierd
combo that carries meaning to another human being. this is NOT a repeatable
process for any person of group of persons. it cannot be structured of
methodologized of OO'd or anything. a better programmer will pick better
names no matter what the underlying programming language or
methodology. it is pure freedom and you can't remove it. 

  GR> Algorithms should be the result of proven design patterns.

which algorithm you dolt! how many search and sort algorithms are there?
how many have you programmed? do you use the same one for EVERY program?
then i surely won't hire you nor will any intelligent manager. pointy
haired boss likes you since he can automate you! "use a linear search
for the database, since it is company policy to do things linearly".

sounds like choosing an algorith has a fair amount of programming
freedom.

  GR> You have a real problem with identity of things.  No freedom is not
  GR> the same thing as being automatically generatable.

you talk as if the methodology is the answer. methodologies are
structured. structured designs are repeatable. sounds like automation
somewhere around here. OO theories say you design like this. well a
moron could follow those rules and generate crap since he didn't
understand the freedoms he was given and should exercise. independent
thought is always better than groupspeak.

  GR> You don't even know what freedom is.

i am free to laugh at your religious stance behind the OO shield. OO is
no better than anything before since the average OO programmer still
doesn't think about the important things, like names. and designing an
OO project is no more than designing an API and look how many bad public
API's there are. so OO will not make things more reusable. reusable code
make more things reusable. the API is what is reused, object or no object.

  GR> You need to go back and learn what a structured process is. 

funny, my first programming course was "structured programming in
PL/I". and i don't like structures, they are too structured. :-)



-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 19 Sep 1998 16:19:01 -0700
From: larry@kiev.wall.org (Larry Wall)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6u1e55$k5g@kiev.wall.org>

In article <h8VM1.897$Ge.2387899@ptah.visi.com>,
George Reese  <borg@imaginary.com> wrote:
>In comp.lang.java.programmer Larry Wall <larry@kiev.wall.org> wrote:
>: In article <7ARM1.876$Ge.2267862@ptah.visi.com>,
>: George Reese  <borg@imaginary.com> wrote:
>:>I certainly cannot think of a meaningful exception.
>
>: You really shouldn't give people straight lines like that.  It's just
>: too tempting to swat it out of the park.
>
>Why?  Only an idiot would take the fact that I cannot think of a
>meaningful exception as proof that there are no suggestions.  The
>sentence simply says what it says: "*I* certainly cannot think of a
>meaningful exception."
>
>I hope people are smart enough to realize that the force of my
>argument has nothing to do with whether such examples exist or not.

That's better.

Larry


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

Date: Sun, 20 Sep 1998 00:18:41 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Regex strange behavior
Message-Id: <EzK3J6.KA2@news.boeing.com>

In article <6tnfqg$rhi$1@nnrp1.dejanews.com>,
 <filippomorelli@my-dejanews.com> wrote:
>I'm trying to match tags in a document and am having no luck:
>
>For example, say you want to match <FOO_*> in a line that contains
><FOO_BAR></FOO_BAR>
>
>$tag = '<FOO';
>$line = '<FOO_BAR></FOO_BAR>junk';
>
>$line =~ /($tag.*)>/;
>print "Found [$1]\n";
>
>This will print out, [<FOO_BAR></FOO_BAR]. What I want is [<FOO_BAR]. It
>seems that .* matches all the characters up until the last occurance of the
>remaining expression (which is the above case, is simply a greater than
>character '>').
>
>I can not finding any explanation in Larry Wall's book or on the newsgroup of
>how to match n or more non-whitespace up until the first instance (rather than
>the last) of a specific character. The above results, IMHO, are counter
>intuitive.
>
>
perldoc perlre and look for the discussion of minimal matching.

hth,
--
Charles DeRykus




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

Date: 19 Sep 1998 23:41:11 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: script: scriptMangle!
Message-Id: <6u1feo$shi$1@marina.cinenet.net>

Tom Christiansen (tchrist@mox.perl.com) wrote:
:  [courtesy cc of this posting sent to cited author via email]

"Courtesy" in this context caused me to grin.

: In comp.lang.perl.misc, 
:     cberry@cinenet.net (Craig Berry) writes:
: :Or shroud the source, or compile it, or...  All these techniques are real,
: :practical solutions to real-world problems.
: 
: Evil is as evil does.

I'm still awaiting word on just why this is 'evil', as opposed to one of a
range of possible technical and business strategies.

: :OK, let me ask you, as I have Tom:  Do you lock your front door at home?
: 
: I don't usually do this, but here you go: I never want to read
: anything from you again.  
: 
: *PLONK*

Ah, well.  The ultimate response when rational discussion fails.  Fellow
citizens of clpm, take note that I've done nothing but ask Tom to clarify
his moral, ethical, and philosophical position on the free software
question, in the face of his vicious attacks on all other options.
Apparently, he doesn't want to play that game.  So it goes...

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Sun, 20 Sep 1998 00:28:57 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: splitting by certain spaces
Message-Id: <EzK409.L2L@news.boeing.com>

In article <36002547.2164860@news.ais.net>, Steve . <syarbrou@ais.net> wrote:
>I have a file that has input in the following format:
>
>filename    23434        02-06-98   this is a file that does bla bla.
>
>There are various spaces above, the least amount being two between the
>selected fields so I do a :
>
>@data = split(/  +/,$line);
>
>The above split has two spaces and a +
>
>Works fine.  The problem is occasionally the description field has two
>spaces in it between words rather than one and the array gets an extra
>field of data which screws everything up.  
>
>Basically I need to split the first three fields, as I do with the
>split above, and then say the rest of this line put in here.  How
>would I do this?  Thanks.  
>

perldoc -f split and look for 'LIMIT'.

hth,
--
Charles DeRykus


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

Date: 19 Sep 1998 19:16:09 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Using templates...
Message-Id: <6u1dvp$qhu$1@monet.op.net>

In article <36042362.15DE@home.com>, Wyatt Draggoo  <phraktyl@home.com> wrote:
>I don't like using a module until I know what is going on inside of it.
><$ENV{'HTTP_USER_AGENT'}>
>how do I evaluate $temp to replace the <$...> tags
>with the contents of the variable?


Why don't you look inside one of those modules and see how it is done?

That will tell you what is going on inside the module, and it will
also answer your question of how it can be done.


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

Date: Sat, 19 Sep 1998 23:30:16 GMT
From: Wyatt Draggoo <phraktyl@home.com>
Subject: Re: Using templates...
Message-Id: <36043608.42A@home.com>

Mark-Jason Dominus wrote:
> Why don't you look inside one of those modules and see how it is done?
> 
> That will tell you what is going on inside the module, and it will
> also answer your question of how it can be done.

Easier said than done - I've already tried it.  There were very few - if
any - comments in the modules I looked at, and they were done with a lot
of Perl-ish oddities.  The first one I looked at used about a 9 line
regex with a lot of code inbetween that wasn't intuitive at all, and the
others weren't much better.

I know I could just use the code, but if I did that I might as well
blindly use the module.

Wyatt


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3762
**************************************

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