[10168] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3761 Volume: 8

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

Date: Sat, 19 Sep 98 16:00:20 -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: 3761

Today's topics:
    Re: "use lib" usage <merlyn@stonehenge.com>
        C Struct -> Perl <rapruitt@inetconn.net>
    Re: Can GD.pm make 200 dpi gifs? <merlyn@stonehenge.com>
        copy a file? <eva-lena@mailcity.com>
    Re: copy a file? <jeffp@crusoe.net>
    Re: copy a file? <J.D.Gilbey@qmw.ac.uk>
    Re: copy a file? <gellyfish@gellyfish.btinternet.com>
    Re: Enumerating Properties and Methods <JayGuerette@pobox.com>
    Re: Enumerating Properties and Methods <gellyfish@gellyfish.btinternet.com>
    Re: Enumerating Properties and Methods <JayGuerette@pobox.com>
        Help Configuring IIS 4.0 <bgresset@online.no>
    Re: Help Configuring IIS 4.0 <samwang@freewwweb.com>
    Re: Help Configuring IIS 4.0 <gellyfish@gellyfish.btinternet.com>
    Re: Help Configuring IIS 4.0 <gellyfish@gellyfish.btinternet.com>
    Re: Help with file test operator problem (Larry Rosler)
    Re: Help With Perl Beautification <merlyn@stonehenge.com>
    Re: Help With Perl Beautification (brian d foy)
    Re: How to check a file is already open (PERL 4) ? <merlyn@stonehenge.com>
    Re: How to check a file is already open (PERL 4) ? <gellyfish@gellyfish.btinternet.com>
    Re: making GIF images <efinch@cais.com>
    Re: open2 question (Asher)
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses birgitt@my-dejanews.com
    Re: script: scriptMangle! <eashton@bbnplanet.com>
    Re: Shell-scripts and #! ( big dilemma ) ! <J.D.Gilbey@qmw.ac.uk>
        Using templates... <phraktyl@home.com>
    Re: Which modules needed for httpd POST FORM ? <merlyn@stonehenge.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 19 Sep 1998 21:33:12 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: "use lib" usage
Message-Id: <8caf3veqkb.fsf@gadget.cscaper.com>

>>>>> "Bruce" == Bruce Hodo <bruceh@interaccess.com> writes:

Bruce> #!/export/home/cmagic/bin/eperl
Bruce> <?
Bruce> use lib '/export/home/cmagic/perllib/lib/site_perl/DBI'; # tell perl
Bruce> where to find DBI
Bruce> use DBI;

Do you really have a file named
/export/home/cmagic/perllib/lib/site_perl/DBI/DBI.pm ?

Bruce> use lib '/export/home/cmagic/mysql-3.21.33/perl/Mysql-modules/lib'; #
Bruce> tell perl where to find Mysql.pm

Bruce>  my $dbh = DBI->connect('DBI:mysql:CVN:localhost', '','',
Bruce>  { PrintError =>0}) || die $DBI::errstr;
Bruce> !>//
Bruce> ------

Bruce> The DBI.pm module is located in
Bruce> /export/home/cmagic/perllib/lib/site_perl.

Well, apparently not then. :)

Bruce> The DBD.pm module is located in
Bruce> /export/home/cmagic/perllib/lib/site_perl/DBI.

Bruce> What am I doing wrong, or what do I need to do?

The path in 'use lib' is the path to the directory, not to the file.
The file will be located within that directory, or below it, depending
on how many double-colons there are in the library name.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sat, 19 Sep 1998 15:44:48 -0400
From: "Andy" <rapruitt@inetconn.net>
Subject: C Struct -> Perl
Message-Id: <6u11tk$2gt$1@news.dn.net>

I'm trying to replicate a C struct  in Perl and I'm having a bad time of it.
I'm on NT4sp3.
I know that I need to use a 4 bit word boundary, and that the byte order has
to be big-endian.
Does join preserve the byte order and word boundaries?  Is specifying the
null bytes in my pack sufficient?
Are these snippets equivalent?

**Perl**
$rc = pack "n2 x4", '23'; # A fixed length 2 byte field
$slength = pack "n5 x4", '425'; # A fixed length 5 byte field
$head = join '', 'start', $rc, $slength;

** C **
#pragma pack(4)
struct CUST
{
char start_code[5];
int rc;
int slength;
}

------
andy pruitt





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

Date: Sat, 19 Sep 1998 21:31:06 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Can GD.pm make 200 dpi gifs?
Message-Id: <8cd88reqnt.fsf@gadget.cscaper.com>

>>>>> "Tom" == Tom Mornini <tmornini@netcom.com> writes:

Tom> N.A.F. McNelly (nmcnelly@bu.edu) wrote:
Tom> : I have written a script which uses GD to combine a number of pre-existing 
Tom> : gifs into a single image.  It works well, but now I need to create 200 dpi
Tom> : output gifs.

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.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 19 Sep 1998 19:55:32 GMT
From: "Eva-Lena" <eva-lena@mailcity.com>
Subject: copy a file?
Message-Id: <01bde407$d1f8f620$8f5c64c3@win95.algonet.se>

Hi!

I have been looking for how to copy a file in a perl 5.0 script, but
haven't successed. Have tried to guess some commands like

copy("$existingfile", "$newfile");
copy $existingfile $newfile; or
cp  $existingfile $newfile;

etc, but it doesn't work and I can't find out the proper one. Maybe one
can't do this? (I want to use a standard file (existing one) and write into
its copy when it has been created)

Thanks a lot in advance for some tips! :=)
Eva-Lena, eva-lena@geocities.com


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

Date: Sat, 19 Sep 1998 16:26:58 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: copy a file?
Message-Id: <Pine.GSO.3.96.980919162604.25824A-100000@crusoe.crusoe.net>

> I have been looking for how to copy a file in a perl 5.0 script, but
> haven't successed. Have tried to guess some commands like
> 
> copy("$existingfile", "$newfile");
> copy $existingfile $newfile; or
> cp  $existingfile $newfile;
> 
> etc, but it doesn't work and I can't find out the proper one. Maybe one
> can't do this? (I want to use a standard file (existing one) and write into
> its copy when it has been created)

If you read perldoc perlfunc, you'll find:
rename(EXPR, EXPR);

that's usually what you'll want.  unless filesystems come into play.  oh
my.  not that.

--
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp

Crusoe Communications, Inc.
973-882-1022
www.crusoe.net



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

Date: Sat, 19 Sep 1998 23:13:04 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: copy a file?
Message-Id: <36042C70.241AFE49@qmw.ac.uk>

Eva-Lena wrote:
> 
> Hi!
> 
> I have been looking for how to copy a file in a perl 5.0 script, but
> haven't successed. Have tried to guess some commands like

Try the File::Copy module.

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

            Julian Gilbey             Email: J.D.Gilbey@qmw.ac.uk
       Dept of Mathematical Sciences, Queen Mary & Westfield College,
                  Mile End Road, London E1 4NS, ENGLAND
      -*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-


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

Date: 19 Sep 1998 22:14:33 GMT
From: Jonathan Stowe Gellyfish Gill Nunns <gellyfish@gellyfish.btinternet.com>
Subject: Re: copy a file?
Message-Id: <6u1ac9$i3t$3@uranium.btinternet.com>

On 19 Sep 1998 19:55:32 GMT in Message <01bde407$d1f8f620$8f5c64c3@win95.algonet.se> Eva-Lena <eva-lena@mailcity.com> wrote:
> Hi!

> I have been looking for how to copy a file in a perl 5.0 script, but
> haven't successed. Have tried to guess some commands like

> copy("$existingfile", "$newfile");
> copy $existingfile $newfile; or
> cp  $existingfile $newfile;

> etc, but it doesn't work and I can't find out the proper one. Maybe one
> can't do this? (I want to use a standard file (existing one) and write into
> its copy when it has been created)

What was that phrase about YCJMSUAEITW or something like that ? 

I thing you will probably find the File::Copy to do what you want.  

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


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

Date: Sat, 19 Sep 1998 16:50:46 -0400
From: "Jay Guerette" <JayGuerette@pobox.com>
Subject: Re: Enumerating Properties and Methods
Message-Id: <6u15ic$ifu@news-central.tiac.net>

>>how could I get a list of the methods and properties available to me from
>>this class?
>
>In all seriousness:  You read the documentation.


Yes.

>Perhaps you meant `how can my program get such a list?'  But that's
>useless, because even if your program had a list of methods, it
>wouldn't know what the methods were for, so what good would the list
>be?


I can guess from the purpose of the class what the methods will do. If
that's the best I can do, I'm willing to go that route.

>>or access a property like this:
>>
>>$foo->bar->{'prop'}="gnu";
>
>Here there is a solution, which I will not tell you, because I suspect
>that whatever you are really trying to accomplish, this isn't going to
>help very much.  I urge you to explain what you are really trying to
>accomplish; there is probably a better solution available.


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.








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

Date: 19 Sep 1998 22:09:10 GMT
From: Jonathan Stowe Gellyfish Gill Nunns <gellyfish@gellyfish.btinternet.com>
Subject: Re: Enumerating Properties and Methods
Message-Id: <6u1a26$i3t$2@uranium.btinternet.com>

On Sat, 19 Sep 1998 16:50:46 -0400 in Message <6u15ic$ifu@news-central.tiac.net> Jay Guerette <JayGuerette@pobox.com> wrote:
>>>how could I get a list of the methods and properties available to me from
>>>this class?

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

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


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

Date: Sat, 19 Sep 1998 18:31:24 -0400
From: "Jay Guerette" <JayGuerette@pobox.com>
Subject: Re: Enumerating Properties and Methods
Message-Id: <6u1bec$mc8@news-central.tiac.net>

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












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

Date: Sat, 19 Sep 1998 22:29:05 +0200
From: "Bjxrn Inge Gresseth" <bgresset@online.no>
Subject: Help Configuring IIS 4.0
Message-Id: <6u1453$rpv$1@readme.online.no>

Hi.

I have some problems when I tried to implement cgi-scripts in my web-server.
I use the Active State Win32-packadge.

When I try to open the cgi-scripts in a browser, I get an error-message like
this:
************************************************************
CGI Error

The Specified CGI application misbehaved by not returning a complete set of
HTTP-headers. The headers it did return are:

Can't open perl script  "????????????????????????????????": Invalid argument
************************************************************

I have followed the instruction on how to configure the perl-scripts on my
server, added the extensions, but I just can't get it to work. I am a newbee
in perl-scripting, but I really hope someone has a solution to this problem.

regards,

Bjoern.

mail: bgresset@online.no





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

Date: Sat, 19 Sep 1998 15:48:45 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: Help Configuring IIS 4.0
Message-Id: <360418AC.B76B3D32@freewwweb.com>

just what exactly was the code that you used?
also, if you use the activestate binary, you don't need to specify the
pound-bang line (the #! in other words)

"Bjxrn Inge Gresseth" wrote:

> Hi.
>
> I have some problems when I tried to implement cgi-scripts in my web-server.
> I use the Active State Win32-packadge.
>
> When I try to open the cgi-scripts in a browser, I get an error-message like
> this:
> ************************************************************
> CGI Error
>
> The Specified CGI application misbehaved by not returning a complete set of
> HTTP-headers. The headers it did return are:
>
> Can't open perl script  "????????????????????????????????": Invalid argument
> ************************************************************
>
> I have followed the instruction on how to configure the perl-scripts on my
> server, added the extensions, but I just can't get it to work. I am a newbee
> in perl-scripting, but I really hope someone has a solution to this problem.
>
> regards,
>
> Bjoern.
>
> mail: bgresset@online.no



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

Date: 19 Sep 1998 22:19:32 GMT
From: Jonathan Stowe Gellyfish Gill Nunns <gellyfish@gellyfish.btinternet.com>
Subject: Re: Help Configuring IIS 4.0
Message-Id: <6u1alk$i3t$4@uranium.btinternet.com>

On Sat, 19 Sep 1998 22:29:05 +0200 in Message <6u1453$rpv$1@readme.online.no> Bjxrn Inge Gresseth <bgresset@online.no> wrote:
> Hi.

> I have some problems when I tried to implement cgi-scripts in my web-server.
> I use the Active State Win32-packadge.

> When I try to open the cgi-scripts in a browser, I get an error-message like
> this:
> ************************************************************
> CGI Error

> The Specified CGI application misbehaved by not returning a complete set of
> HTTP-headers. The headers it did return are:

> Can't open perl script  "????????????????????????????????": Invalid argument
> ************************************************************

> I have followed the instruction on how to configure the perl-scripts on my
> server, added the extensions, but I just can't get it to work. I am a newbee
> in perl-scripting, but I really hope someone has a solution to this problem.

It appears that you have an error in your script or most probably in the
configuration of the server.  It seems very likely that you have an error
in the script-map registry entry - but this is a question for another
group I would suggest. [Hint check the case of the %s ].

/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:21:53 GMT
From: Jonathan Stowe Gellyfish Gill Nunns <gellyfish@gellyfish.btinternet.com>
Subject: Re: Help Configuring IIS 4.0
Message-Id: <6u1aq1$i3t$5@uranium.btinternet.com>

On Sat, 19 Sep 1998 15:48:45 -0500 in Message <360418AC.B76B3D32@freewwweb.com> Sam Wang <samwang@freewwweb.com> wrote:
> just what exactly was the code that you used?
> also, if you use the activestate binary, you don't need to specify the
> pound-bang line (the #! in other words)

Actually you probably do want to use the shebang line if you want use
a flag with you script (such as -w or -T) - Perl will use these if they 
present.

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


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

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

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

In article <3603D600.50025DE8@freewwweb.com> on Sat, 19 Sep 1998 11:04:16 
-0500, Sam Wang <samwang@freewwweb.com> says...
> from the looks of your c: you're on a windoze box. i strongly doubt that win32
> perl will support file testing. i suppose you're trying to see if it's a
> "shortcut" or not. you can do the same thing by testing if it's extension is
> *.lnk

What purpose do you expect to serve by flaunting your ignorance and your 
prejudices on an international, supposedly professional, forum?

Fortunately, this reasonable question has already been answered several 
times by people who are neither ignorant nor prejudiced.

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


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

Date: Sat, 19 Sep 1998 21:27:51 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Help With Perl Beautification
Message-Id: <8clnnfeqt8.fsf@gadget.cscaper.com>

>>>>> "Yogish" == Yogish Baliga <baliga@synopsys.com> writes:

Yogish>    Does anybody know where to find the perl beautifiers?

Perl resists all attempts to be beautified. :)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sat, 19 Sep 1998 18:16:04 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help With Perl Beautification
Message-Id: <comdog-ya02408000R1909981816040001@news.panix.com>
Keywords: from just another new york perl hacker

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

>>>>>> "Yogish" == Yogish Baliga <baliga@synopsys.com> writes:
>
>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... ;)

-- 
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 21:35:59 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: How to check a file is already open (PERL 4) ?
Message-Id: <8c67ejeqfo.fsf@gadget.cscaper.com>

>>>>> "titi" == titi  <tibiweb@chez.com> writes:

titi> I planed to run a batch deamon under Unix 10.10 wtitten in PERL 4.

Please stop using perl4.  It's long dead.  *Long* dead.

titi> The rule of this deamon is to scan a directory awaiting files.
titi> If a file matches it runs specific application depending the file name.

titi> My question :

titi> How can I test if the incomming file (it's FTP from a distant server)
titi> is already closed ?

titi> I try -t file test operator, but it don't work.

You can't.  If you have a cooperating process, you can use flock(), but
I'm pretty sure ftpd doesn't use flock.

titi> Tnx for your help.

Yr Wlcme.

titi> eMail : tblind@icfonline.com

Then why isn't that in the news header? <sigh>

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 19 Sep 1998 21:59:23 GMT
From: Jonathan Stowe Gellyfish Gill Nunns <gellyfish@gellyfish.btinternet.com>
Subject: Re: How to check a file is already open (PERL 4) ?
Message-Id: <6u19fr$i3t$1@uranium.btinternet.com>

On Thu, 17 Sep 1998 11:14:42 +0200 in Message <6tqjrg$44l$1@ubnnews.unisource.ch> titi <tibiweb@chez.com> wrote:
> I planed to run a batch deamon under Unix 10.10 wtitten in PERL 4.
> The rule of this deamon is to scan a directory awaiting files.
> If a file matches it runs specific application depending the file name.

> My question :

> How can I test if the incomming file (it's FTP from a distant server)
> is already closed ?

You will probably want to use the fuser command if it is available 
on your system. 

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


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

Date: Sat, 19 Sep 1998 17:23:35 -0400
From: Ed Finch <efinch@cais.com>
Subject: Re: making GIF images
Message-Id: <360420D7.7BD6FA08@cais.com>

Matthew Bafford wrote:
> 
> In article <6tur1v$jd6$1@news.monmouth.com> on Fri, 18 Sep 1998
> 19:31:31 -0400, Matt (splinter@monmouth.com) pounded in the
> following text:
> => Hi,
> =>
> => Anyone like to point out a place to learn how to make GIF images with PERL?
> =>
> => Please don't point me to perldoc on UNIX...its a pain in the ass to navigate
> => through my crap telnet.

Two of my tools, ClGraph and Sarge, do it with the GD module.

See http://www.vais.net/~efinch for source code.

Ed


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

Date: 19 Sep 1998 21:21:08 GMT
From: asher@magicnet.net (Asher)
Subject: Re: open2 question
Message-Id: <slrn7087l5.3l0.asher@localhost.localdomain>

The following code works:
#!/usr/bin/perl
require 'open2.pl';
&open2(RDR,WTR,"bc");
print WTR "2+2\nquit\n";
while(<RDR>) {
 print;
}

If you do it this way, you have to re-open the pipe for each calculation,
which may not be acceptable.

On 19 Sep 1998 15:49:46 GMT, Eric M Yeh <emy457@merle.acns.nwu.edu> wrote:
>Hi, I'm having trouble with the open2 command.  I need to have my perl
>program write and read from a command such as 'bc'.  I tried this code but
>the program never stops...
>
>use IPC::Open2;
>use Symbol;
>
>$WTR = gensym();
>$RDR = gensym();
>$pid = open2($RDR, $WTR, 'bc');
>print $WTR "2+2";
>$line = <$RDR>
>
>
>then I try to print $line ...
>
>anyhelp is appreciated...
>thanks
>


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

Date: Sat, 19 Sep 1998 21:05:25 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <p0VM1.895$Ge.2387899@ptah.visi.com>

In comp.lang.java.programmer Patricia Shanahan <pats@acm.org> wrote:
: George Reese wrote:
:> 
:> In comp.lang.java.programmer Larry Wall <larry@kiev.wall.org> wrote:
:> : In article <bOPM1.856$Ge.2187567@ptah.visi.com>,
:> : George Reese  <borg@imaginary.com> wrote:
:> :>I have already stated that freedom has no place in programming.  Now
:> :>you may disagree with it, and I have certainly provided support for
:> :>that assertion.  It therefore makes no sense to come back with freedom
:> :>to counter that argument.  You may want to try explaining why a
:> :>programmer should have freedom.
:> 
:> : Because the programmer knows what he or she wants to optimize for, and
:> : the language designer doesn't.  Plus, it's more fun.
:> 
:> Vanishingly few programmers actually have the skill to know what they want to
:> optimize for in a manner inconsistent with structured language
:> design.  I certainly cannot think of a meaningful exception.

: How about when I'm doing performance testing, and want to make a
: processor do EXACTLY the memory accesses I want to measure? The
: wrappings for processing parameters, measuring time, and reporting
: results can be structured and written in e.g. C++. The guts have to be
: assembly language, or C that is so close to assembly language that I
: can predict exactly what the compiler will do with it, and cannot
: contain procedure calls or be at risk of losing time to garbage
: collection.

None of this is the type of freedom perl is talking about.  This is
programming that requires a tool different from Java and python (and
perl).

:> More to the point, "programmer freedom", while it may be fun for the
:> programmer, is the freedom to escape application design constraints
:> MUCH MORE SO than it is to optimize beyond the foresight of the
:> language designers.  On large scale, multi-developer projects, such
:> freedom is dangerous.

: At another level, I often need to write very simple text processing
: programs that will be used once for ad-hoc analysis of a text file and
: then thrown away. For this type of program the ability to do simple
: text processing quickly and simply, with good regular expression
: handling, is far more important than program structure.

: The needs of large scale, multi-developer projects are critical when
: one is writing code that is part of a large scale multi-developer
: project. They are irrelevant when writing a 30 line single-writer
: single-use program.

: When it comes to programming language selection I believe in keeping a
: good stable and picking the horse for the course.

Where have I argued contrary to this?  The point goes back to perl v
python.  When you have that in your bag of tricks in a structured
language, why bother with a second that does just the same thing?

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Sat, 19 Sep 1998 21:12:11 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <L6VM1.896$Ge.2387899@ptah.visi.com>

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

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

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

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

: think about what you are saying. you use your programming freedom with
: every design and coding decision you make. programming is as much art as
: science or engineering. there is freedom in naming things (vars, subs,
: files, etc), freedom in formatting (at least in perl :-), freedom in
: choosing an idiom in the language, freedom in algorithm and system
: architecture and design.

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

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

Formatting is a function of standard programming practices, or, better
yet, a well structured language like python.

Algorithms should be the result of proven design patterns.

Otherwise, you are just talking voodoo.

: if you think programming needs no freedom, then all programs can be
: generated automatically. use you fantastic insight, write the
: autoprogramming program we all want and put u$hit out of business.

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

[ mindless blather about the problem of a program that generates
programs deleted ]

: so don't say you don't need freedom when you must have it, you use it and
: you don't even know it.

You don't even know what freedom is.

: get a clue about what programming really is. you obviously think you
: know it but you don't. it is not following some fixed set of rules to
: solve each problem the same way (no freedom, remember!).

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

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Sat, 19 Sep 1998 21:13:49 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <h8VM1.897$Ge.2387899@ptah.visi.com>

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.

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Sat, 19 Sep 1998 21:59:27 GMT
From: birgitt@my-dejanews.com
Subject: Re: Perl & Java - differences and uses
Message-Id: <6u19fv$dfs$1@nnrp1.dejanews.com>

In article <7ARM1.876$Ge.2267862@ptah.visi.com>,
  George Reese <borg@imaginary.com> wrote:

> : George Reese  <borg@imaginary.com> wrote:
> :>I have already stated that freedom has no place in programming.

No ?

[snip]

> : You may want to try explaining why a
> :>programmer should have freedom.
>

No !

[snip]

> Vanishingly few programmers actually have the skill to know what they want to
> optimize for in a manner inconsistent with structured language
> design.  I certainly cannot think of a meaningful exception.

A No-No !

Vive la liberte.

Birgitt Funk

-----== 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:58:54 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: script: scriptMangle!
Message-Id: <36040A98.237067AA@bbnplanet.com>

Craig Berry wrote:

> OK, let me ask you, as I have Tom:  Do you lock your front door at home?

Sometimes. Thats where the 135 pound St. Bernard comes in. :) 

e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Sat, 19 Sep 1998 23:07:13 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: Shell-scripts and #! ( big dilemma ) !
Message-Id: <36042B11.462D0C2A@qmw.ac.uk>

Serge Noiraud wrote:
> 
> I have one big dilemma !
> 
> I have an environment variable called PREFIX which is in my HOME directory.
> This variable is defined like this :
> $HOME/local/$SYSTEM$VERSION
> 
> So I have the following directories :
> $HOME/local/IRIX4/( bin, lib, ... )
> $HOME/local/IRIX5/...
> $HOME/local/IRIX6/...
> $HOME/local/AIX32/...
> $HOME/local/AIX41/...
> $HOME/local/AIX42/...
> $HOME/local/AIX43/...
> ...
> 
> My HOME directory is mounted by NFS.
> I choose the good bin directory depending the system I work on.
> 
> All work fine ( the PATH is correct ).
> 
> The problem is :
> I have shell-scripts with the #! magic number.
> I can't use #!perl even if my PATH is correct.
> I can't use #! $HOME/local/IRIX5/bin because this shellscript won't work on an AIX system.
> I can't use #! $PREFIX/bin/perl
> 
> Do you have any Idea ? Is there one solution ?
> 
> I don't want to put my local on /usr/local because the systems are
> often broken, reinitialized, ... They are test machines.

Presuming that you choose your PATH automatically in some script
when you log on (you wouldn't do it by hand, would you?), you could
create a symlink $HOME/localdir -> local/$SYSTEM$VERSION during
the execution of that same script.  So on your IRIX5, $HOME/bin
would actually be $HOME/local/IRIX5/bin, etc.  And then your PATH
could simply contain $HOME/localdir/bin, and you could use
#!/$HOME/localdir/bin/perl

HTH,

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

            Julian Gilbey             Email: J.D.Gilbey@qmw.ac.uk
       Dept of Mathematical Sciences, Queen Mary & Westfield College,
                  Mile End Road, London E1 4NS, ENGLAND
      -*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-


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

Date: Sat, 19 Sep 1998 22:10:42 GMT
From: Wyatt Draggoo <phraktyl@home.com>
Subject: Using templates...
Message-Id: <36042362.15DE@home.com>

I know there are several CGI modules out there, but I don't like using a
module until I know what is going on inside of it.  That said, here is
my question:

If I read a line from a file, say:

You are using: <$ENV{'HTTP_USER_AGENT'}>

and put it in $temp, how do I evaluate $temp to replace the <$...> tags
with the contents of the variable?

I think I am close with:

$temp =~ s/<(\$[^>]*)>/$1/eeg

But it returns a 'Use of unitialized variable' error even though I know
that the variable exists - I send it to STDERR and looked at the logs.

Any ideas?

Thanks,
Wyatt


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

Date: Sat, 19 Sep 1998 21:29:27 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Which modules needed for httpd POST FORM ?
Message-Id: <8chfy3eqql.fsf@gadget.cscaper.com>

>>>>> "Larry" == Larry Hunter <lhunter@acm.org> writes:

Larry> In article 
Larry> <ptr4su5v1be.fsf@olkikukka.i-have-a-misconfigured-system-so-shoot-me>, 
Larry> jari.aalto@poboxes.com says...
>> I'd like to connect to HTTPD daemon and fill out a form and 
Larry> submit
>> it the WWW server. like I would if I used Netscape browser 
>> and filled it by hand.

Larry> All you need is in  CGI.pm . It is part of the Perl distribution.

Errr, no.

See the other response in this thread.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

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

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