[22781] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5002 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 18 14:06:21 2003

Date: Sun, 18 May 2003 11:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 18 May 2003     Volume: 10 Number: 5002

Today's topics:
        Embed multi-threaded perl into single-threaded C++ app <igor.zubov@za.didata.com>
    Re: full 256 ascii auto string increment? <no.spam@spam.com>
        Looking for manual for perl PLI <motis@lyciumnetworks.com>
    Re: module for mp3 tag handling <bigfoot@nwphenomenon.com>
    Re: multiple sort subroutine <none@none.net>
    Re: multiple sort subroutine (Tad McClellan)
    Re: PHP or Perl ? <tassilo.parseval@rwth-aachen.de>
    Re: PHP or Perl ? <mpapec@yahoo.com>
    Re: PHP or Perl ? <user@example.net>
    Re: PHP or Perl ? <NOSPAMstoianstoian@hotmail.com>
    Re: PHP or Perl ? <seitentaisei@ranmamail.com>
    Re: PHP or Perl ? <seitentaisei@ranmamail.com>
    Re: PHP or Perl ? <sepp00@web.de>
    Re: PHP or Perl ? <dorward@yahoo.com>
    Re: PHP or Perl ? <denshimeiru-sapmctacher@durchnull.ath.cx>
    Re: PHP or Perl ? <spaghetti@aspyre.net>
    Re: PHP or Perl ? <spaghetti@aspyre.net>
    Re: PHP or Perl ? <denshimeiru-sapmctacher@durchnull.ath.cx>
    Re: Process Multiple Files ? <barryk2@SPAM-KILLER.mts.net>
    Re: Why causes the "format error" when using Archive::Z <kalinabears@hdc.com.au>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 18 May 2003 15:14:33 +0200
From: "Igor Zubov" <igor.zubov@za.didata.com>
Subject: Embed multi-threaded perl into single-threaded C++ app
Message-Id: <3ec78691$0$225@hades.is.co.za>

I wrote a library in C++ which embeds perl interpretor to simplify data
transformations.
This library has to be used in a few applications, some of them are
multithreaded, some are single threaded.

The problem I have is: when the library is compiled with multithreaded
version of perl and I try to use it in single-threaded application I start
getting various problems. Most of these problems occur because many standard
functions (e.g. ctime, strerror, etc.) are redefined in perl header files to
be thread safe.

Is there any way I can use a library compiled with multi-threaded version of
perl with a single-threaded application or I will need to have to versions
of my library (and two perl environments)?

Thanks in advance,
Igor




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

Date: Sun, 18 May 2003 10:30:40 -0700
From: "LBX10" <no.spam@spam.com>
Subject: Re: full 256 ascii auto string increment?
Message-Id: <ba8fv9$lir$1@news.astound.net>

"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:ba2cg1$mi6$1@mamenchi.zrz.TU-Berlin.DE...
> LBX10 <no.spam@spam.com> wrote in comp.lang.perl.misc:
> > What is the best way to go about incrementing a string so as to use all
256
> > chars (ASCII) instead of just [A-Za-z0-9] ?
> >
> > So I can cycle al the way from \0x00 all the way to
> > \xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF
> > (that is, those hex values are really characters just not printable ones
but
> > define the full range.)
>
> You will have to do that yourself, the magical string increment keeps
> characters in printing range.  This seems to do it, but needs more
> testing:
>
>     sub inc_str {
>         my $n = length $_[ 0];
>         while ( $n-- ) {
>             last if ++ vec( $_[ 0], $n, 8);
>         }
>         $_[ 0] = chr( 1) . $_[ 0] unless vec( $_[ 0], 0, 8);
>     }
>
> If you need it to be extremely fast, consider Bit::Vector.
>
> Anno

Thanks, but it doesnt seem to grow strings (length wise)after the first or
2nd growth. And how would one make it only use 0-255 characters? Yours goes
a lot furthur then 255.

--
LBX10




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

Date: Sun, 18 May 2003 18:09:26 +0200
From: "Moti Shtrobach" <motis@lyciumnetworks.com>
Subject: Looking for manual for perl PLI
Message-Id: <3ec7a254$1@news.012.net.il>

Hi
I'm looking for a good manual/tutorial for writing PLI to be connected to
Verilog.
I'll be also happy to see good examples.
Thanks
Moti
mailto:motis@lyciumnetworks.com




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

Date: Sun, 18 May 2003 09:48:09 -0400
From: "Ice Demon" <bigfoot@nwphenomenon.com>
Subject: Re: module for mp3 tag handling
Message-Id: <ba82us$pooet$1@ID-184113.news.dfncis.de>


"Paul van der Heu" <pvdh@xs4all.nl> wrote in message
news:Xns937F38103268EpvdhNL@194.134.35.159...
>
> Does anyone know of a module or script which handles V2 ID3 MP3 tags
> (read/modify/write).
>
> tnX

You can do a serach at CPAN ofr a module
http://search.cpan.org/search?query=mp3&mode=all

Ice Demon
http://adult-xxx-newsgroups.com
http://adult-cybergames.com
http://adult-spider.com




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

Date: Sun, 18 May 2003 16:46:25 -0000
From: Dave <none@none.net>
Subject: Re: multiple sort subroutine
Message-Id: <Xns937F636B86486nonenonenet@216.168.3.44>

Thanks for the quick response! Unfortunately, I'm still missing 
something. The subroutine seniority needs to run through each 
iteration. i don't know how to explain it, but this would work if I knew 
which comparision to use:

 sub seniority {
     $a->{$sort1}     <=>  $b->{$sort1}
     or $a->{sort2}     <=>  $b->{$sort2}
     or $a->{$sort3}    cmp  $b->{$sort3}
     or $a->{$sort4}   cmp  $b->{$sort4}
 }


The trouble with the if/then model I built is that I don't know how to 
get it back into this conditional model with the "or".

The subroutine is called in this way. taking an array and passing it 
through sort.

@ranked = sort seniority @data;

I know I'm not explaining this very well. I'm hoping someone will see it 
and understand what I'm trying to say.

TIA

> Dave wrote:
>> I'm working on a multiple sort for content within a flat file db.
>> 
>> Here's where I'm stuck. I have this sub routine that works well 
>> statically. I can set the fields I want to sort by, in descending
>> order of importance, and it works:
>> 
>> sub seniority {
>>     $a->{SALARY}     <=>  $b->{SALARY}
>>     or $a->{AGE}     <=>  $b->{AGE}
>>     or $a->{LAST}    cmp  $b->{LAST}
>>     or $a->{FIRST}   cmp  $b->{FIRST}
>> }
>> 
>> 
>> the problem is, I want to do this dynamically and I don't know
>> whether or not the variable will be a string or number. I have come
>> up with something that looks close to what I need:
>> 
>> if ($sort1 =~ /^\d+$/) {
>>     $a->{"$sort1"}  <=>  $b->{"$sort1"}
>> }else {
>>     $a->{"$sort1"}  cmp  $b->{"$sort1"}
>> }
>> 
>> if ($sort2 =~ /^\d+$/) {
>>     $a->{$sort2}  <=>  $b->{$sort2}
>> }else {
>>     $a->{$sort2}  cmp  $b->{$sort2}
>> }
>> 
>> if ($sort3 =~ /^\d+$/) {
>>     $a->{$sort3}  <=>  $b->{$sort3}
>> }else {
>>     $a->{$sort3}  cmp  $b->{$sort3}
>> }
>> 
>> if ($sort4 =~ /^\d+$/) {
>>     $a->{$sort4}  <=>  $b->{$sort4}
>> }else {
>>     $a->{$sort4}  cmp  $b->{$sort4}
>> }
>> 


> This is untested, however should work, and is fairly clean and
> non-clumsy: 
> 
> sub seniority {
>      my $res;
>      foreach (qw(SALARY AGE LAST FIRST)) {
>           if (/^\d+$/) {
>                $res = $a->{$_} <=> $b->{$_};
>           }
>           else {
>                $res = $a->{$_} cmp $b->{$_};
>           }
>           return $res if $res;
>      }
>      return 0;
> }
> 




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

Date: Sun, 18 May 2003 12:26:33 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: multiple sort subroutine
Message-Id: <slrnbcfgi9.rk3.tadmc@magna.augustmail.com>

Dave <none@none.net> wrote:

> Here's where I'm stuck. I have this sub routine that works well 
> statically. I can set the fields I want to sort by, in descending
> order of importance, and it works:
> 
> sub seniority {
>     $a->{SALARY}     <=>  $b->{SALARY}
>     or $a->{AGE}     <=>  $b->{AGE}
>     or $a->{LAST}    cmp  $b->{LAST}
>     or $a->{FIRST}   cmp  $b->{FIRST}
> }
> 
> 
> the problem is, I want to do this dynamically and I don't know whether 
> or not the variable will be a string or number. I have come up with 
> something that looks close to what I need:
> 
> if ($sort1 =~ /^\d+$/) {


That does not approximate what you need at all.

You are matching against the hash _key_ when you want to be matching
against the hash _value_. None of the keys shown above have _any_
digit characters.


>     $a->{"$sort1"}  <=>  $b->{"$sort1"}


A useless use of double quotes:

   $a->{$sort1}  <=>  $b->{$sort1}


> Unfortunately, I don't know how to get the "or" back into
> equation (see first example above) and sort1-3 are being ignored.
> 
> Can someone please steer me in the right direction?


   # untested, and likely to run very slowly
   sub is_num { $_[0] =~ /^\d+$/ }

   sub seniority {
       (is_num($a->{SALARY}) && is_num($b->{SALARY}))
         ?  $a->{SALARY}     <=>  $b->{SALARY}
         :  $a->{SALARY}     cmp  $b->{SALARY}
       or (is_num($a->{AGE}) && is_num($b->{AGE}))
         ?  $a->{AGE}     <=>  $b->{AGE}
         :  $a->{AGE}     cmp  $b->{AGE}

       ...
   }


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 18 May 2003 13:36:25 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: PHP or Perl ?
Message-Id: <ba828p$i57$1@nets3.rz.RWTH-Aachen.DE>

Also sprach KAH:
> "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in
> news:ba7kt3$6ko$1@nets3.rz.RWTH-Aachen.DE: 
> 
>> The latter is an implication of my statement. As for the first, well,
>> I don't want to go into details why I think this is not true. A simple
>> empirical fact is that PHP is not used as an all-purpose language. If
>> it were, we'd find PHP in different domains including such special
>> affairs like scientific computing and the lot. It's not the question
>> whether a language could theoretically be used for it (and PHP has
>> improved on that lately). It's the question whether it's suitable in
>> practice, whether libraries for this purpose exist and so forth and so
>> on. 
> 
> You're wrong I'm affraid. PHP is being used increasingly in non-web 
> domains, personally I use it for several local maintenance tasks that have 
> nothing to do with any websites.
> 
> It is true that PHP originally was designed for pure web-programming, but 
> especially since PHP 4 the direction is shifting to something more all-
> purpose (but with a strong emphasis on web).
> 
> There are a lot of PHP libraries (extentions) that can do all sorts of non-
> web tasks. I don't see why "perl myscript.pl" is any better than "php 
> myscript.php"...

It's both good as long as myscript.pl and myscript.php do the same
thing. Beyond web-content and local maintenance (which I wouldn't
consider typical domains of all-purpose languages, btw) I was thinking
of something like

    http://bioperl.org

It's a conclusive project insofar as it also includes the need for
GUI-bindings, generic database support, CORBA server- and client-wise
etc. Incidentally, bindings for this bio-informatics project also exist
for Python and Java, in short: other all-purpose languages.

Tassilo
PS: newsgroups trimmed, but f'up ignored
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Sun, 18 May 2003 17:22:30 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: PHP or Perl ?
Message-Id: <a89fcv0vpolbln07l18grl13pepl11vsma@4ax.com>

X-Ftn-To: Isofarro 

Isofarro <spamblock@spamdetector.co.uk> wrote:
>>> PHP can be used as an all-purpose language, and Perl is good for website
>>> development too.
>> 
>> The latter is an implication of my statement. As for the first, well, I
>> don't want to go into details why I think this is not true. A simple
>> empirical fact is that PHP is not used as an all-purpose language.
>
>So because it is not being used means it can't be used? 

No, it means that on other fields there is a greater chance for some other
language to be used. Like, you can do some win GUI stuff with Perl/Tk if
you're good at it, but someone who does win apps on regular basis with C++,
Delphi or VB, won't even consider looking at Tk(as far as portability isn't
main concern).

AFAIR there was Perl OS project which goal was to write entire OS in Perl.
Enough said. :)



-- 
Matija


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

Date: Sun, 18 May 2003 18:06:03 +0200
From: "J.O. Aho" <user@example.net>
Subject: Re: PHP or Perl ?
Message-Id: <ba8b1t$pumk3$1@ID-130698.news.dfncis.de>

spaghetti wrote:

> I use ASP.NET. Why? It's modern, sophisticated, and I can use one of several
> languages to program it with. PHP/Perl and the rest have nothing like Web
> Forms, and ASP.NET offers some truly smart XML handling. Database tools are
> more robust as well. One feature I like as an HTML guy is the fact I can
> dynamically manipulate the HTML quickly by using the ID= tag on elements.
> Makes filling dynamic text into a certain <div> easy and clean. No throwing
> a bunch of <% %> through my lovely HTML.
> 
> The downside is the constant belittling and accusations of being Microsoft's
> slut.

Phue, thanks for that laugh...
You do have the PHP dotNET module for getting the dotNET stuff.
Visualbasic has the great disadvantige that it's quite well limited to be run 
on quite unstable server environment, but of course for those who don't know 
anything else than point and click it's easy to "program".


  //Aho



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

Date: Sun, 18 May 2003 18:22:36 +0200
From: "steve" <NOSPAMstoianstoian@hotmail.com>
Subject: Re: PHP or Perl ?
Message-Id: <ba8c0d$1lu$1@ctb-nnrp2.saix.net>

> > How would you advice someone who wants to start learning a
programmign
> > language for developping websites ?
> > learning PHP or Perl ?
>
> PHP is yummy and easy.
>
> perl is soooo 1990s
>
> <runs for cover/>

what about ASP




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

Date: Sun, 18 May 2003 13:17:24 -0400
From: "Marc" <seitentaisei@ranmamail.com>
Subject: Re: PHP or Perl ?
Message-Id: <3ec7c023@shknews01>

I prefer PHP because it has easier syntax and the fact that I couldn't get
any CGI working on my machine for some reason. Besides, you need PHP if you
want to create databases with MySQL or PostgreSQL. Better yet, it's free.

PHP can even take advantage of some Perl fuctions. It has built-in
authenticication. And most of all, it 0\/\/n5.




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

Date: Sun, 18 May 2003 13:23:50 -0400
From: "Marc" <seitentaisei@ranmamail.com>
Subject: Re: PHP or Perl ?
Message-Id: <3ec7c1a5@shknews01>

"J.O. Aho" <user@example.net> wrote in message
news:ba8b1t$pumk3$1@ID-130698.news.dfncis.de...
> spaghetti wrote:
>
> > I use ASP.NET. Why? It's modern, sophisticated, and I can use one of
several
> > languages to program it with. PHP/Perl and the rest have nothing like
Web
> > Forms, and ASP.NET offers some truly smart XML handling. Database tools
are
> > more robust as well. One feature I like as an HTML guy is the fact I can
> > dynamically manipulate the HTML quickly by using the ID= tag on
elements.
> > Makes filling dynamic text into a certain <div> easy and clean. No
throwing
> > a bunch of <% %> through my lovely HTML.
> >
> > The downside is the constant belittling and accusations of being
Microsoft's
> > slut.
Accusations nothing. It is. I have a php script that parses my XML rant page
into html. I have some webpages that are entirely made through php commands.
I don't have to have 'a bunch of <% %>' anywhere. Just an opening <?php and
closing ?>. Save as .php or .phtml and I'm set to go.

PHP was partially made to access databases such as MySQL and PostgreSQL. And
it does a darn good job doing it.

I can easily create a web form in html or with PHP and then access a PHP
script to do tons of stuff with it.

Powerful enough for you?




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

Date: Sun, 18 May 2003 19:27:21 +0200
From: Sebastian Hungerecker <sepp00@web.de>
Subject: Re: PHP or Perl ?
Message-Id: <20030518192721.2df4668e.sepp00@web.de>

On Sun, 18 May 2003 13:17:24 -0400
"Marc" <seitentaisei@ranmamail.com> wrote:
> Besides, you need PHP if you want to create databases with MySQL or PostgreSQL.

That's not true, you can create mysql databases with perl, too


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

Date: Sun, 18 May 2003 18:32:54 +0100
From: David Dorward <dorward@yahoo.com>
Subject: Re: PHP or Perl ?
Message-Id: <ba8g20$bh3$1$8302bc10@news.demon.co.uk>

Marc wrote:

> you need PHP if you want to create databases with MySQL or PostgreSQL.

Rubbish. I have no trouble connecting to MySQL or Postgresql using Perl.

> Better yet, it's free.

So is Perl (and so are interpreters/compilers for most programming
languages).

-- 
David Dorward                                     http://david.us-lot.org/
         Redesign in progress: http://stone.thecoreworlds.net/
2 and 5 are objects, as opposed to Java, where they are primitive thingies.


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

Date: 18 May 2003 17:34:45 GMT
From: Rudolf Polzer <denshimeiru-sapmctacher@durchnull.ath.cx>
Subject: Re: PHP or Perl ?
Message-Id: <slrnbcfh1l.hb5.denshimeiru-sapmctacher@message-id.durchnull.ath.cx>

Scripsit ille »Marc« <seitentaisei@ranmamail.com>:
> I prefer PHP because it has easier syntax and the fact that I couldn't get
> any CGI working on my machine for some reason. Besides, you need PHP if you
> want to create databases with MySQL or PostgreSQL.

Wrong. You can do that with both.

> Better yet, it's free.

Both are.

> PHP can even take advantage of some Perl fuctions.

Perl, however, can take advantage of C functions and rape Java servlets.

> It has built-in authenticication.

What for if you have Apache?

> And most of all, it 0\/\/n5.

Perl however, is s!<k3n!ng! #²

y/\w/|/; #³

²: replace every occurence of the string <k3n by ng :OR: sickening
³: replace every occurence of the character w by |  :OR: yawn


-- 
Can't find string terminator "EOF" anywhere before EOF at ./autoindex line 27.


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

Date: Sun, 18 May 2003 13:39:55 -0400
From: "spaghetti" <spaghetti@aspyre.net>
Subject: Re: PHP or Perl ?
Message-Id: <ba8gal$p79qt$1@ID-159842.news.dfncis.de>

> > I use ASP.NET. Why? It's modern, sophisticated, and I can use one of
> > several languages to program it with. PHP/Perl and the rest have nothing
> > like Web Forms
>
> Thankfully! There's enough crap tools generating invalid HTML markup
> already. It would be original if the markup generated was valid and
> accessible.
>

C'mon people. This is my opinion. He was asking (and I quote):

"Or maybe somethign else like Coldfusion , or java servlets , Python ? and
why ?"

So I answered. And besides, if you guys want to bash my preference without
even trying it, then why should I not bash your preference without even
trying it?

As for cluttering up the HTML, you're getting it confused with ASP3. Say I
have this HTML:

<div id="errormessage"></div>

In a code behind file I can do this:

errormessage.InnerHTML = "There was a big problem and everyone is gonna
die!"

And it'll render this:

<div id="errormessage">There was a big problem and everyone is gonna
die!</div>

That's just the beginning of it. You can do XSLT stuff. I'm just saying to
me it feels cleaner and nicer. Not to mention web forms allow you to save
state across round-trips to the server automatically.

So there, it doesn't pollute HTML. It keeps it clean. My preference.






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

Date: Sun, 18 May 2003 13:42:56 -0400
From: "spaghetti" <spaghetti@aspyre.net>
Subject: Re: PHP or Perl ?
Message-Id: <ba8gga$q8pfc$1@ID-159842.news.dfncis.de>

> Accusations nothing. It is. I have a php script that parses my XML rant
page
> into html. I have some webpages that are entirely made through php
commands.
> I don't have to have 'a bunch of <% %>' anywhere. Just an opening <?php
and
> closing ?>. Save as .php or .phtml and I'm set to go.
>
> PHP was partially made to access databases such as MySQL and PostgreSQL.
And
> it does a darn good job doing it.
>
> I can easily create a web form in html or with PHP and then access a PHP
> script to do tons of stuff with it.
>
> Powerful enough for you?

Like I said, it's my opinion. Not like I'm making you use ASP.NET at
gunpoint. Hell, it's not like you guys even know what you're bashing. Have I
done any PHP bashing? No. And btw, you can use a variety of languages with
ASP.NET, not just Visual Basic. :/

So much for freedom of expression and opinion.




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

Date: 18 May 2003 17:40:31 GMT
From: Rudolf Polzer <denshimeiru-sapmctacher@durchnull.ath.cx>
Subject: Re: PHP or Perl ?
Message-Id: <slrnbcfhcf.hb5.denshimeiru-sapmctacher@message-id.durchnull.ath.cx>

Scripsit ille »Dieter D'Hoker« <webmaster@neverseenbefore.com>:
> How would you advice someone who wants to start learning a programmign
> language for developping websites ?
> learning PHP or Perl ?

Do you already know a programming language? If not: definitively PHP.


-- 
i hope that anal monkeys will burrow up your anal cavity through your
intestines, your colon, and steal your kidneys and come out of your
ears, which will be a piece of cake for them because there'd only be
an amoeba sized brain blocking the exit.        [MBVA in japan.anime.evangelion]


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

Date: Sun, 18 May 2003 08:15:33 -0500
From: Barry Kimelman <barryk2@SPAM-KILLER.mts.net>
Subject: Re: Process Multiple Files ?
Message-Id: <MPG.1931436d896c5a49897d3@news.mts.net>

[This followup was posted to comp.lang.perl.misc]

In article <pan.2003.05.18.07.37.58.697344@bigpond.com>, Andrew Rich 
(andrew.rich@bigpond.com) says...
> Howdy,
> 
> Wondering if someone could help me with this:-
> 
> 1. open a dir
> 2. process each file 
> 3. close 
> 
> is it something like this ?
> 
> opendir
> while file
> {
> while (<file>)
> {
> print;
> }
> }
> 

$dirname = $ARGV[0];
opendir(DIR,"$dirname") or
    die("opendir failed for $dirname : $!\n");
@entries = readdir(DIR);
closedir DIR;
foreach $entry ( @entries ) {
    $filepath = $dirname . "/" . $entry;
    unless ( -d $filepath ) {
        # process a file
    }
}

---------

Barry Kimelman
Winnipeg, Manitoba, Canada
email : bkimelman@hotmail.com


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

Date: Sun, 18 May 2003 23:20:52 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: Why causes the "format error" when using Archive::Zip?
Message-Id: <3ec789c0$0$17739@echo-01.iinet.net.au>


"niudou" <niudou@hotmail.com> wrote in message
news:324590c7.0305180344.59ce8c0c@posting.google.com...
> #!/usr/perl/bin -w
> use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
>
> my $zipFile = Archive::Zip->new();
> $zipFile->read( 'c:/temp/temp.zip' );
>
> Error message:
> format error: can't find EOCD signature
>
Archive::Zip::Archive::_findEndOfCentralDirectory('Archive::Zip::Archive=HAS
H(0x1ca8f3c)',
> 'IO::File=GLOB(0x39c1d48)') called at D:/Perl/site/lib/Archive/Zip.pm
> line 1281
> Archive::Zip::Archive::read('Archive::Zip::Archive=HASH(0x1ca8f3c)',
> 'c:/temp/temp.zip') called at C:\temp\z.pl line 5
> 3
>
> What's the "EOCD signature" and why causes such error?
>
> Thanks!

Probably a corrupt zip file.
I just saved a text file as 'bogus.zip' and ran your script.
 I got:

D:\pscrpt>perl try.pl
format error: can't find EOCD signature

Archive::Zip::Archive::_findEndOfCentralDirectory('Archive::Zip::Archive
=HASH(0x1a7f14c)', 'IO::File=GLOB(0x1a75658)') called at
D:/Perl/site/lib/Archiv
e/Zip.pm line 905

Archive::Zip::Archive::readFromFileHandle('Archive::Zip::Archive=HASH(0x
1a7f14c)', 'IO::File=GLOB(0x1a75658)', 'D:/perlmods/bogus.zip') called at
D:/Per
l/site/lib/Archive/Zip.pm line 886
        Archive::Zip::Archive::read('Archive::Zip::Archive=HASH(0x1a7f14c)',
'D:
/perlmods/bogus.zip') called at try.pl line 6

If I try it on a valid zip file there's no problem.

Hth.

Cheers,
Rob




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 5002
***************************************


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