[17452] in Perl-Users-Digest
Perl-Users Digest, Issue: 4872 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 12 06:05:28 2000
Date: Sun, 12 Nov 2000 03:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974027106-v9-i4872@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 12 Nov 2000 Volume: 9 Number: 4872
Today's topics:
FS: "Learning Perl" (David)
FS: "Object Oriented Perl" (David)
FS: "Perl Cookbook" (David)
FS: "Programming Perl" (David)
FS: "Programming the Perl DBI" (David)
Re: How to call sub routines from a CGI made Form <thectrain@hotmail.com>
Re: How to force MSDOS window to stay open after perl? (Homer Simpson)
mailform attachable file <leslies@santaland.com>
Re: Native float translation (Gwyn Judd)
Re: Native float translation (Martien Verbruggen)
Re: PERL AND JPGS AND SHOPPING CART <dale@emmons.dontspamme.com>
Re: PERL AND JPGS AND SHOPPING CART (Gwyn Judd)
Re: PERL AND JPGS AND SHOPPING CART (Martien Verbruggen)
Re: Phone dialing module? <nward@nfmail.com>
Re: Pushing a hash on to a stack... (Martien Verbruggen)
Re: Pushing a hash on to a stack... (Christopher Burke)
Re: Pushing a hash on to a stack... (Martien Verbruggen)
Re: Self-modifying code in Perl (Ilya Zakharevich)
Re: Self-modifying code in Perl (Martien Verbruggen)
Re: Self-modifying code in Perl (Ilya Zakharevich)
Re: Self-modifying code in Perl (Martien Verbruggen)
Re: which zip to use <sbinla@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Nov 2000 06:40:59 GMT
From: qx11@cornell.edu (David)
Subject: FS: "Learning Perl"
Message-Id: <8FE9EE133qx11cornelledu@132.236.56.8>
"Learning Perl"
by Randal L. Schwartz, Tom Christiansen, Larry Wall (Foreword)
Paperback - 302 pages 2nd edition (July 1997)
O'Reilly & Associates; ISBN: 1565922840
Brand New Condition, Asking $15
------------------------------
Date: 12 Nov 2000 06:39:56 GMT
From: qx11@cornell.edu (David)
Subject: FS: "Object Oriented Perl"
Message-Id: <8FE9EF726qx11cornelledu@132.236.56.8>
"Object Oriented Perl"
by Damian Conway, Randal L. Schwartz (Foreword)
Paperback - 490 pages (August 1999)
Manning Publications Company; ISBN: 1884777791
Brand New Condition, Asking $30
------------------------------
Date: 12 Nov 2000 06:40:23 GMT
From: qx11@cornell.edu (David)
Subject: FS: "Perl Cookbook"
Message-Id: <8FE9E6C71qx11cornelledu@132.236.56.8>
"Perl Cookbook"
by Tom Christiansen, Nathan Torkington, Larry Wall
Paperback - 794 pages 1 Ed edition (August 1998)
O'Reilly & Associates; ISBN: 1565922433
Brand New Condition, Asking $25
------------------------------
Date: 12 Nov 2000 06:40:42 GMT
From: qx11@cornell.edu (David)
Subject: FS: "Programming Perl"
Message-Id: <8FE9E6250qx11cornelledu@132.236.56.8>
"Programming Perl"
by Larry Wall, Tom Christiansen, Randal L. Schwartz, Stephen Potter
Paperback - 645 pages 2nd edition (October 1996)
O'Reilly & Associates; ISBN: 1565921496
Brand New Condition, Asking $25
------------------------------
Date: 12 Nov 2000 06:39:05 GMT
From: qx11@cornell.edu (David)
Subject: FS: "Programming the Perl DBI"
Message-Id: <8FE9EED1Fqx11cornelledu@132.236.56.8>
"Programming the Perl DBI"
by Alligator Descartes, Tim Bunce
Paperback - 346 pages (February 2000)
O'Reilly & Associates; ISBN: 1565926994
Brand New Condition, Asking $25
------------------------------
Date: Sun, 12 Nov 2000 07:01:46 GMT
From: "Matt Perzel" <thectrain@hotmail.com>
Subject: Re: How to call sub routines from a CGI made Form
Message-Id: <ufrP5.6989$24.511848@news0.telusplanet.net>
I tried using this code and it gives me a server error. Maybe it is a
brand new thing for perl. I am running version 5.00503 for linix on apache.
Or maybe its something I'm doing.
Thanks for reply anyway.
> I know this is more a cgi question but I am using perl so I guess it
applies
> here. Anyway I am making a form parsing script, in perl, that displays the
> data and then has a button that when you click it sends it to a text file.
I
> can do all of the above except get the button to write the data. Is there
a
> way to call the routine from a form action?
>
> This is what I am thinking but it doesn't seem to work
>
> print "<FORM name=\"FORM1\" action=&writeData>";
>
> Thanks
>
>
>
>
------------------------------
Date: 12 Nov 2000 09:34:21 GMT
From: homer.simpson@springfield.nul (Homer Simpson)
Subject: Re: How to force MSDOS window to stay open after perl?
Message-Id: <8ulo6t$19q$0@216.39.130.72>
>In article <8emm0t88nr6c1sebl0vrm1k5kfaq34dv31@4ax.com>,
> Stephen <st@nospam.prnet.hhrnet.jp> wrote:
> I am runnig ActiveState Perl on Win98. When I click on a perl file
> (*.plx), it would execute the script in a popup msdos window. But as
> soon as it finishes, the msdos window would close, making it too fast
> for me to read the output. How do you tell msdos window to stay open
> after executing the Perl script?
print "Press [Space bar] to close this window.\n";
system('pause > nul');
my @a=qw(10 21 19 20 0 1 14 15 20 8 5 18 0 16 5 18 12 0 8 1 3 11 5 18);
my @b=split(//," abcdefghiJklmnoPqrstuvwxyz");
foreach $a(@a){print $b[$a];};print ",\n";
------------------------------
Date: Sun, 12 Nov 2000 07:50:15 GMT
From: "leslie" <leslies@santaland.com>
Subject: mailform attachable file
Message-Id: <XYrP5.28443$25.5874512@news1.rdc1.ne.home.com>
I am trying to make it so i can attach a file and send it with sendmail. I
have the following code in there. But it doesnt seem to attach the file when
it sends. Anyone have any ideas?
$Mail_Body .= "\n";
open (TEXT, "uuencode $FORM{'XX-file_attached'} $FORM{'XX-attach_file_name'}
|");
while (<TEXT>) {
$Mail_Body .= $_;
}
close TEXT;
#saves sendmail as the sendmail directory
$SENDMAIL = '/usr/lib/sendmail/';
open (MAIL, "|$SENDMAIL -t -oi -oem");
print MAIL"To: leslies\@santaland.com \n";
print MAIL"From: $FORM{'XX-email'}\n";
print MAIL"Subject: $FORM{'XX-subject'}\n\n";
print MAIL "$Mail_Body";
close (MAIL);
}
------------------------------
Date: Sun, 12 Nov 2000 06:10:17 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Native float translation
Message-Id: <slrn90sd27.m2o.tjla@thislove.dyndns.org>
I was shocked! How could kj0 <kj0@mailcity.com>
say such a terrible thing:
>Hi!
>
>I have a (binary) file containing double precision (32-bit) floats in
>native Linux format that I need to translate to native SGI Irix
>doubles. How is this done?
(Probably) using pack and unpack. It would almost certainly better to
store the numbers as ascii and then you can convert them using sprintf.
This should more or less completely eliminate any issues about
converting between different number systems (except for a possible loss
of precision).
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
It is better to be defeated on principle than to win on lies.
-- Arthur Calwell, 1968
------------------------------
Date: Sun, 12 Nov 2000 17:46:29 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Native float translation
Message-Id: <slrn90sf65.gs3.mgjv@martien.heliotrope.home>
On 11 Nov 2000 23:00:58 -0500,
kj0 <kj0@mailcity.com> wrote:
>
> I have a (binary) file containing double precision (32-bit) floats in
> native Linux format that I need to translate to native SGI Irix
> doubles. How is this done?
Easiest way:
Use unpack on a Linux box. Write the numbers in a text format. Read the
text on an IRIX machine. Transporting data between machines in text is
also the easiest way for C, Fortran, Algol, and INTERCAL programs.
Harder:
Read the documentation for your linux compiler, and for your irix
compiler, and figure out how the bytes and bits are packed, and what
they all mean. read the numbers byte by byte, and shift stuff around.
You'd be better off doing this in C.
Transporting floats from one machine to another is probably the hardest
thing. It's no longer just a case of big or little endianness.
Martien
--
Martien Verbruggen |
Interactive Media Division | You can't have everything, where
Commercial Dynamics Pty. Ltd. | would you put it?
NSW, Australia |
------------------------------
Date: Sat, 11 Nov 2000 23:55:27 -0600
From: "Dale Emmons" <dale@emmons.dontspamme.com>
Subject: Re: PERL AND JPGS AND SHOPPING CART
Message-Id: <t0scge51k0th38@corp.supernews.com>
"alan feiler" <ppdc@home.com> wrote in message
news:T6pP5.92673$hD4.22114187@news1.rdc1.mi.home.com...
> I had a program originally written in Dreamweaver.
> The webmaster who inserted the jpgs did it in perl5 since this is a
shopping
> cart.
> Recently when a word which is linked to a jpg is clicked, a script default
> comes up with "image not available"
> Can anyone out there comeup with a fix for this problem.
> The shopping cart is kind of a hybrid written thing and doesnt follow any
> scripting defaults for shopping cart code.
> If anyone can help please let me know.
> Thanks in advance.
> ALAN
>
Alan,
You need to give a LOT more information than you did here. Right now, I have
no idea what in the world you're talking about.
-Dale
--
-----------------------------------------------------
Dale Emmons, freelance web developer specializing
in dynamic site creation using Perl and MySQL.
dale@emmons.com
http://www.dale-emmons.com
-----------------------------------------------------
------------------------------
Date: Sun, 12 Nov 2000 06:13:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: PERL AND JPGS AND SHOPPING CART
Message-Id: <slrn90sd83.m2o.tjla@thislove.dyndns.org>
I was shocked! How could alan feiler <ppdc@home.com>
say such a terrible thing:
>I had a program originally written in Dreamweaver.
>The webmaster who inserted the jpgs did it in perl5 since this is a shopping
>cart.
>Recently when a word which is linked to a jpg is clicked, a script default
>comes up with "image not available"
>Can anyone out there comeup with a fix for this problem.
>The shopping cart is kind of a hybrid written thing and doesnt follow any
>scripting defaults for shopping cart code.
>If anyone can help please let me know.
This is a common problem with hybrid kind of things originally written
in Dreamweaver with no defaults and then converted to perl5 since
naturally it's a shopping cart kind of thing. You have a bug in line 17.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
I'd like some JUNK FOOD ... and then I want to be ALONE --
------------------------------
Date: Sun, 12 Nov 2000 17:53:51 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: PERL AND JPGS AND SHOPPING CART
Message-Id: <slrn90sfjv.gs3.mgjv@martien.heliotrope.home>
On Sun, 12 Nov 2000 04:36:03 GMT,
alan feiler <ppdc@home.com> wrote:
> I had a program originally written in Dreamweaver.
> The webmaster who inserted the jpgs did it in perl5 since this is a
> shopping cart.
Yes.. I can understand that. Everyone knows you can't write CGI programs
in C when you have a shopping cart.
> Recently when a word which is linked to a jpg is clicked, a script default
> comes up with "image not available"
Then put the images on your server. Or whatever you need to do to avoid
that 'script default'.
> Can anyone out there comeup with a fix for this problem.
See above.
> The shopping cart is kind of a hybrid written thing and doesnt follow any
> scripting defaults for shopping cart code.
Well, then how do you expect us to help? Are we supposed to psychically
extract the code from the sky, and fix it?
What would be defaults for shopping cart code be anyway? Wait, don't
answer that!
> If anyone can help please let me know.
You could always pay someone, if you can't do it yourself.
Martien
--
Martien Verbruggen |
Interactive Media Division | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Sun, 12 Nov 2000 18:12:42 +1300
From: "Nathan Ward" <nward@nfmail.com>
Subject: Re: Phone dialing module?
Message-Id: <gPpP5.1198$gVqd.30015658@news.xtra.co.nz>
> Is there a Perl module or routine I can use to dial an arbitrary number
> using my modem?
> My database program uses the default Phone Dialer that comes with Windows
> 2000, and it's the most dreadful piece of software I've seen in a long
time.
> I'd like to write a Perl routine to engage the phone line, dial a string
> (including Star, Hash and pause), then get out of the way so I can pick up
> the phone and talk.
i dont know if this can be done as i dont use perl under windows, but you
should be able to send the control information to the com port it is
attatched to, to make it dial and hang up when needed:
the phone number can include hashes star and pauses (represented by ',' -
comma)
dial:
atdt <phnumber> (tone dialing)
atdp <phnumber> (pulse dialing)
hang up:
ath or +++
------------------------------
Date: Sun, 12 Nov 2000 17:50:38 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Pushing a hash on to a stack...
Message-Id: <slrn90sfdu.gs3.mgjv@martien.heliotrope.home>
On Sun, 12 Nov 2000 03:30:26 GMT,
Christopher Burke <craznar@hotmail.com> wrote:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in <8uktvt$87q$1
> @lublin.zrz.tu-berlin.de>:
>
>>You could have achieved the same effect using
>>
>> push @fulldata, { x => 4, y => 5};
>
> Cannot - in the eventual code, the push is separated from the data entry
> and data retrieval.
Did you have a look at the push_hash and pop_hash subroutines I
suggested? With thos subs in scope, you could do:
push_hash @fulldata, %hash;
and depending on how the sub is written it would push a copy of that
hash, or a reference to that hash onto the end of @fulldata.
If I was 100% certain I wouldn't offend anyone, I would at this point in
time sling some pretty expressive expletives in your general direction.
are you doing this on purpose? Are you trolling?
Martien
--
Martien Verbruggen |
Interactive Media Division | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Sun, 12 Nov 2000 07:41:11 GMT
From: craznar@hotmail.com (Christopher Burke)
Subject: Re: Pushing a hash on to a stack...
Message-Id: <8FEAB110FCraznar@24.192.1.17>
mgjv@tradingpost.com.au (Martien Verbruggen) wrote in
<slrn90sfdu.gs3.mgjv@martien.heliotrope.home>:
>On Sun, 12 Nov 2000 03:30:26 GMT,
> Christopher Burke <craznar@hotmail.com> wrote:
>> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in <8uktvt$87q$1
>> @lublin.zrz.tu-berlin.de>:
>>
>>>You could have achieved the same effect using
>>>
>>> push @fulldata, { x => 4, y => 5};
>>
>> Cannot - in the eventual code, the push is separated from the data
>> entry and data retrieval.
>
>Did you have a look at the push_hash and pop_hash subroutines I
>suggested? With thos subs in scope, you could do:
>
>push_hash @fulldata, %hash;
>
>and depending on how the sub is written it would push a copy of that
>hash, or a reference to that hash onto the end of @fulldata.
>
>If I was 100% certain I wouldn't offend anyone, I would at this point in
>time sling some pretty expressive expletives in your general direction.
>are you doing this on purpose? Are you trolling?
No not trolling, I have already solved the problem without using push -
what I simply asked is if a specific line of code could be done with a
push. The rest has been blown out of all proportion. If you have a look at
the original post (apart from a couple of typos) it had a very specific
question - I never asked for a solution to a problem (the code is already
operational).
--
---
/* Christopher Burke - Spam Mail to craznar@hotmail.com
|* www.craznar.com - International Internet Writing Experiment
\* Real mail to cburke(at)craznar(dot)com
------------------------------
Date: Sun, 12 Nov 2000 18:43:54 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Pushing a hash on to a stack...
Message-Id: <slrn90sihq.gs3.mgjv@martien.heliotrope.home>
On Sun, 12 Nov 2000 07:41:11 GMT,
Christopher Burke <craznar@hotmail.com> wrote:
> mgjv@tradingpost.com.au (Martien Verbruggen) wrote in
><slrn90sfdu.gs3.mgjv@martien.heliotrope.home>:
>
>>On Sun, 12 Nov 2000 03:30:26 GMT,
>> Christopher Burke <craznar@hotmail.com> wrote:
>>> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in <8uktvt$87q$1
>>> @lublin.zrz.tu-berlin.de>:
>>>
>>>>You could have achieved the same effect using
>>>>
>>>> push @fulldata, { x => 4, y => 5};
>>>
>>> Cannot - in the eventual code, the push is separated from the data
>>> entry and data retrieval.
>>
>>Did you have a look at the push_hash and pop_hash subroutines I
>>suggested? With thos subs in scope, you could do:
>>
>>push_hash @fulldata, %hash;
>>
>>and depending on how the sub is written it would push a copy of that
>>hash, or a reference to that hash onto the end of @fulldata.
>>
>>If I was 100% certain I wouldn't offend anyone, I would at this point in
>>time sling some pretty expressive expletives in your general direction.
>>are you doing this on purpose? Are you trolling?
>
> No not trolling, I have already solved the problem without using push -
> what I simply asked is if a specific line of code could be done with a
> push. The rest has been blown out of all proportion. If you have a look at
and the answer was, yes, you can do it, using references. if you want to
hide the fact that there are references, you use a function with a
prototype that forces the reference, so that your code doesn't show
explicit references. Or you do something like you suggested, although I
would not use the word push anymore, and I would in the future avoid
saying that there are no references. There are. they just are not
explicitly mentioned, because that isn't necessary in Perl.
Can we no assume that the question has been answered?
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia |
------------------------------
Date: 12 Nov 2000 05:40:30 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Self-modifying code in Perl
Message-Id: <8ulage$s31$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was NOT sent to Martien Verbruggen
<mgjv@tradingpost.com.au>],
who wrote in article <slrn90s3j9.gs3.mgjv@martien.heliotrope.home>:
> > I still do not understand your claim. Do you say that there are
> > systems with ISO C where Perl will not build given proper config.h?
>
> Euhm, no.
Then Perl is more portable than ISO C.
> Perl needs a lot more than ISO C
Perl needs much less than ISO C.
> > croak("%s() not implemented", "flock");
>
> Then all C libraries make sense on all platforms.
>
> fprintf(stderr, "%s not implemented\n", f_name);
> exit(EXIT_FAILURE);
exit() is in no way equivalent to croak().
Ilya
------------------------------
Date: Sun, 12 Nov 2000 18:11:43 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Self-modifying code in Perl
Message-Id: <slrn90sglf.gs3.mgjv@martien.heliotrope.home>
On 12 Nov 2000 05:40:30 GMT,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was NOT sent to Martien Verbruggen
><mgjv@tradingpost.com.au>],
> who wrote in article <slrn90s3j9.gs3.mgjv@martien.heliotrope.home>:
>> > I still do not understand your claim. Do you say that there are
>> > systems with ISO C where Perl will not build given proper config.h?
>>
>> Euhm, no.
>
> Then Perl is more portable than ISO C.
What are you talking about? I was not saying that there are systems with
ISO C where perl doesn't build, because I don't know. I do know that
there are many systems out there that have ISO C compilers, for which
Perl has never been built (think embedded, for example). I just don't
know whether it would be _possible_, given the proper configuration, to
build Perl there. I would doubt that many of the Perl builtins would
operate at all, but we'll come back to that in a second.
>> Perl needs a lot more than ISO C
>
> Perl needs much less than ISO C.
Only if you accept that all builtins that are direct translations of
Unix system calls cause your program to die. I do not call that
portable. I don't call a program that dies on me, simply because I call
a well-documented builtin function of the language, a valid Perl
program. What you have is a crippled perl, which will run a subset of
Perl. To call that portable is a very large stretch of the meaning of
the word.
The fact that Perl compiles it isn't enough, you know. Otherwise I could
write a full perl interpreter right now.
#include <stdio.h>
int main(void)
{
fprintf(stderr, "Nothing implemented. Come back later\n");
return 0;
}
There. I've written a perfectly fine and totally portable perl. If you
are on a system that won't compile that C program, I can provide you
with alternatives in other languages.
>> > croak("%s() not implemented", "flock");
>>
>> Then all C libraries make sense on all platforms.
>>
>> fprintf(stderr, "%s not implemented\n", f_name);
>> exit(EXIT_FAILURE);
>
> exit() is in no way equivalent to croak().
Same difference. What happens is that a call to a non-implemented
function makes the program die. How exactly that happens is moot. Oh,
you're talkign about being able to catch the exception with eval?
If you want something slightly more equivalent, return an error value,
so that the user can decide whether she wants to die on it, or
continue. You can quibble as much as you want, but the simple point
stays: Perl is not more portable than C, unless you start alowing Perl
to just not implement anything it doesn't want to, and require that a C
compiler implement everything (Weren't you the one who made that remark
about a lot fo the C library not making sense on many platforms?)
Martien
--
Martien Verbruggen |
Interactive Media Division | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd. | make up 3/4 of the population.
NSW, Australia |
------------------------------
Date: 12 Nov 2000 08:12:03 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Self-modifying code in Perl
Message-Id: <8uljcj$feb$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was NOT sent to Martien Verbruggen
<mgjv@tradingpost.com.au>],
who wrote in article <slrn90sglf.gs3.mgjv@martien.heliotrope.home>:
> Perl has never been built (think embedded, for example). I just don't
> know whether it would be _possible_, given the proper configuration, to
> build Perl there. I would doubt that many of the Perl builtins would
> operate at all, but we'll come back to that in a second.
There is no environment where all the Perl builtins operate. This is
not a requirement for a Perl port.
> > exit() is in no way equivalent to croak().
>
> Same difference. What happens is that a call to a non-implemented
> function makes the program die.
croak() does not make your program die.
Ilya
------------------------------
Date: Sun, 12 Nov 2000 21:04:34 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Self-modifying code in Perl
Message-Id: <slrn90sqph.gs3.mgjv@martien.heliotrope.home>
On 12 Nov 2000 08:12:03 GMT,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was NOT sent to Martien Verbruggen
><mgjv@tradingpost.com.au>],
> who wrote in article <slrn90sglf.gs3.mgjv@martien.heliotrope.home>:
>> Perl has never been built (think embedded, for example). I just don't
>> know whether it would be _possible_, given the proper configuration, to
>> build Perl there. I would doubt that many of the Perl builtins would
>> operate at all, but we'll come back to that in a second.
>
> There is no environment where all the Perl builtins operate. This is
> not a requirement for a Perl port.
Oh, come on. This is another cop-out. They don't work, because they
can't, or because no one bothered writing code for it.
perlfunc documents a whole swag of Unix-specific functions.
it does not document any Windows, Mac, OS/2 or VMS specific stuff.
perlfunc defines the builtins *of the language*. Not of the particular
interpreter that you are running, but of the language, Perl.
The fact that a large number of them don't work on certain platforms,
and some of them never will work there, doesn't mean that we should just
ignore them, and disregard everything that is inconvenient to port as
'not a requirement for a perl port'. Why was so much work done to make
fork() work on Win32 platforms, if this is the case? Making the Thread
stuff more workable would have been a better investment, especially with
the caveats that fork has on systems that don't natively implement them.
If you had said: "The language Perl is finally to be standardised, and
all those legacy functions will disappear, and become an extension
library', then I would have applauded that. And I wouldn't be arguing.
As it stands, perl is the definition of Perl. and perl is not fully
portable. Take those Unix-specific commands out, and dump them in a
module, and you have more of a case.
This is why I did mention ISO C. They did go through this in the
eighties, to create a language that was a portable as practically
possible, and as clean as necessary to achieve that goal. They didn't
succeed 100%, and they had to sacrifice some functionality from the
language that is present on almost all systems (directory structures
being a big one). This is why it is mostly portable (there are still
problems with hardcoded pathnames, and stuff like that). Now, you won't
find many real programs that are a pure ISO C program. It's when they
deviate from the standards, that they become unportable. system calls,
calls to system specific libraries, and assumptions programmers make,
make the code unportable, not the language. Not the standard features
and libraries of C.
Now, I am not saying that Perl should follow that path. Not at all. Perl
should stay what it is. But it should also be recognised for what it is:
A largely unportable Unix specific toolset, which is on the way of being
made more usable on other platforms. This is not a bad thing. I am not
criticising. This is just what Perl is. Pretending it is more is just
silly.
Most of perl is very usable on all platforms it runs on. Not everything
is.
Writing fully portable code is impossible in Perl, as soon as you hit
one of those legacy functions. Even if you use paths, you run that risk.
Even if you read text files, or need to relate their size to internal
representations, you are unportable (which is where this started).
Writing portable code is hard. People have full-time jobs porting code
to various platforms.
Why the denial about this? it's not as if it's bad or something. It's
just a fact of life. Accept it, and continue to use it.
>> > exit() is in no way equivalent to croak().
>>
>> Same difference. What happens is that a call to a non-implemented
>> function makes the program die.
>
> croak() does not make your program die.
copy from /opt/perl/lib/5.6.0/Carp.pm
sub croak { die shortmess @_ }
unless you catch the exception raised by die, your program is gone. Am I
missing something subtle in your statement?
Martien
--
Martien Verbruggen |
Interactive Media Division | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: Sun, 12 Nov 2000 05:54:45 GMT
From: SB <sbinla@my-deja.com>
Subject: Re: which zip to use
Message-Id: <8ulbb5$8bn$1@nnrp1.deja.com>
Nevermind - I forgot that I could use the system command. I just shell
out in the middle of the program and call pkzip, and come right back.
duh, hah?
--------------------------------------
The Kingdom of Heaven is within you.
Luke 17:21
In article <8uhc2m$a5v$1@nnrp1.deja.com>,
SB <sbinla@my-deja.com> wrote:
> Hello,
> I grew so tired of dealing with the limitations of dos batch to
> control my regular backups to my diskette drive (120 mb superdisk -
> great device)
>
> So I want to use Perl, but I've been using command line version of
> pkzip to zip stuff up.
>
> Does anyone know how to just simply zip some files up in a single
> directory with perl? (using nt 4.0).
>
> PerlZip by Amine something, is 50 bucks! Forget it - I'm sure it's
> worth it, but this isn't work-related and the company ain't footin the
> bill
>
> Ned Konz wrote the ZIP:Archive, but I don't understand blocks and
> members. I just want to zip some files up. Anyone know how to use that
> in the most simplest way?
>
> Thanks, Steve
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4872
**************************************