[22780] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5001 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 18 09:05:41 2003

Date: Sun, 18 May 2003 06:05:14 -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: 5001

Today's topics:
    Re: A script that can (conditionally) return 3 differen (Joe Smith)
        CGI Question: Submitting row in a form <kbass1@nc.rr.com>
    Re: CGI Question: Submitting row in a form <noreply@gunnar.cc>
    Re: Losing value in require statement (Joe Smith)
        mark-symlinked-directories <pons@gmx.li>
        multiple sort subroutine <none@none.net>
    Re: multiple sort subroutine <spam@thecouch.homeip.net>
    Re: Perl and MySQL <andrew.rich@bigpond.com>
    Re: PHP or Perl ? <spamblock@spamdetector.co.uk>
    Re: PHP or Perl ? <tassilo.parseval@rwth-aachen.de>
    Re: PHP or Perl ? <spamblock@spamdetector.co.uk>
    Re: PHP or Perl ? <jpaffett@les.forthnet.gr>
    Re: PHP or Perl ? <nomailwanted@e35203.upc-e.chello.nl>
    Re: PHP or Perl ? <kah@kahnews.cjb.net>
    Re: PHP or Perl ? <user@example.net>
    Re: PHP or Perl ? <user@example.net>
    Re: PHP or Perl ? <dorward@yahoo.com>
    Re: PHP or Perl ? <spaghetti@aspyre.net>
    Re: PHP or Perl ? <spamblock@spamdetector.co.uk>
        Process Multiple Files ? <andrew.rich@bigpond.com>
    Re: Process Multiple Files ? <tassilo.parseval@rwth-aachen.de>
    Re: Using grep in populating list of indexes of '1' ? <dmn@box43.pl>
        Why causes the "format error" when using Archive::Zip? (niudou)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 18 May 2003 09:25:09 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: A script that can (conditionally) return 3 different exit codes
Message-Id: <VjIxa.17733$io.348390@iad-read.news.verio.net>

In article <a82b1086.0305161309.671dd53a@posting.google.com>,
A Epstein <epstein_asaf@emc.com> wrote:
>I mean do I just have to go through my code and add a bunch of 'or die
>"..."' statements to every place I can concieve a failure might happen?

Yes.

If you are observering good programming practices, then your code
should already have "or die" everywhere a failure can occur.
	-Joe
-- 
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


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

Date: Sun, 18 May 2003 11:50:34 GMT
From: "Kevin Bass" <kbass1@nc.rr.com>
Subject: CGI Question: Submitting row in a form
Message-Id: <esKxa.59076$fr6.3119648@twister.southeast.rr.com>

Hello:

I am attempting to submit rows in a form individually. When the submit
button is clicked,
an individual row will be updated and the screen will return to its current
state with the
updated data from the submit.  The submitted data is being stored in a
database (Oracle).

I have written the code that will handle this event but I am encountering
problems. I can
dynamically generate the form but the only the first submit works correctly.
When I click the
additional submits on the form (other then the first submit), they do not
capture the data and return the prior data (if there was prior data sorted).
So, in other words, only the first submit works and the others do not. How
can I get pass this problem? If code is needed, please let me know.  I hope
that I am clear on this explanation. Thanks!  Kevin

-----------------------------------------
         |                  |               | submit
-----------------------------------------
         |                  |               | submit
-----------------------------------------
         |                  |               | submit
-----------------------------------------
         |                  |               | submit
-----------------------------------------




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

Date: Sun, 18 May 2003 14:05:58 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI Question: Submitting row in a form
Message-Id: <ba7t0v$q2irh$1@ID-184292.news.dfncis.de>

Please don't post the same question in multiple messages.

/ Gunnar

Kevin Bass wrote:
> Hello:
> 
> I am attempting to submit rows in a form individually. When the submit

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


-- 
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.

HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html


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

Date: Sun, 18 May 2003 08:35:32 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: Losing value in require statement
Message-Id: <oBHxa.17722$io.348390@iad-read.news.verio.net>

In article <c_pxa.1354$rO.177980@newsread1.prod.itd.earthlink.net>,
Travis <dingdongy2k@hotmail.com> wrote:
>I use a require statement after that to execute some other lines of code.
>(ex:  require 'otherlines.pl';)
>
>That has worked fine except that I seem to lose the value in  $now
>(ex:  Sat May 17 00:08:10 2003  )
>
>The rest of the code in the require statement is executed properly.
>
>So even after the require statement is executed , and printed blanks for
>$now, the main script can still print the value correctly.
>
>Any ideas?

Inside otherlines.pl, try "print $main::now;".
Check for my($now) or local($now) which will change the variable's scope.
	-Joe

-- 
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


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

Date: Sun, 18 May 2003 11:18:19 +0200
From: "Pons" <pons@gmx.li>
Subject: mark-symlinked-directories
Message-Id: <ba7flg$q9hjl$1@ID-172702.news.dfncis.de>

[root@Linux bin]# perl -MCPAN -e shell
Undefined value assigned to typeglob at (eval 13) line 15, <RC> line 11.
Warning [/etc/inputrc line 11]:
  Invalid variable `mark-symlinked-directories'

cpan shell -- CPAN exploration and modules installation (v1.70)
ReadLine support enabled

Running RedHat 9.0

Thanks





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

Date: Sun, 18 May 2003 08:06:37 -0000
From: Dave <none@none.net>
Subject: multiple sort subroutine
Message-Id: <Xns937FB4A77ECAnonenonenet@216.168.3.44>

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

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?

Thanks


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

Date: Sun, 18 May 2003 09:04:42 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: multiple sort subroutine
Message-Id: <PxLxa.4881$7B6.11640@wagner.videotron.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

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}
> }
> 
> Unfortunately, I don't know how to get the "or" back into
> equation (see first example above) and sort1-3 are being ignored.

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;
}

Best of luck.

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+x4TveS99pGMif6wRAnBXAKChW/Odm8eoPXBoFpWDPAkU6tRZMACfRP0h
spzNc+gqId1n+lHcJeNuTYo=
=HKOd
-----END PGP SIGNATURE-----



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

Date: Sun, 18 May 2003 17:27:03 +1000
From: "Andrew Rich" <andrew.rich@bigpond.com>
Subject: Re: Perl and MySQL
Message-Id: <pan.2003.05.18.07.27.02.234425@bigpond.com>

#!/usr/bin/perl
use DBI;
my $database_handler = DBI->connect("DBI:mysql:aprs:host=localhost;mysql_socket=/tmp/mysql.sock","root","");
$date = `date +%d/%m/%y" "%H:%M"`;
$statement_handler=$database_handler->prepare ("insert into information values ('$date','$_')");
$statement_handler->execute;
$statement_handler->finish;



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

Date: Sun, 18 May 2003 10:16:34 +0000
From: Isofarro <spamblock@spamdetector.co.uk>
Subject: Re: PHP or Perl ?
Message-Id: <2im7ab.q91.ln@sidious.isolani.co.uk>

Tassilo v. Parseval wrote:

> Also sprach Dieter D'Hoker:
> 
>> How would you advice someone who wants to start learning a programmign
>> language for developping websites ?
>> learning PHP or Perl ?
> 
> Depends on your ambitions. Considering the fact that PHP is quite good
> for website development while Perl is an all-purpose language,

PHP can be used as an all-purpose language, and Perl is good for website 
development too.


-- 
Iso.
FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
Recommended Hosting: http://www.affordablehost.com/
Web Standards: http://www.webstandards.org/


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

Date: 18 May 2003 09:48:19 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: PHP or Perl ?
Message-Id: <ba7kt3$6ko$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Isofarro:

> Tassilo v. Parseval wrote:
> 
>> Also sprach Dieter D'Hoker:
>> 
>>> How would you advice someone who wants to start learning a programmign
>>> language for developping websites ?
>>> learning PHP or Perl ?
>> 
>> Depends on your ambitions. Considering the fact that PHP is quite good
>> for website development while Perl is an all-purpose language,
> 
> 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. 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. 

Tassilo
-- 
$_=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 10:57:28 +0000
From: Isofarro <spamblock@spamdetector.co.uk>
Subject: Re: PHP or Perl ?
Message-Id: <puo7ab.ik1.ln@sidious.isolani.co.uk>

Tassilo v. Parseval wrote:

> Also sprach Isofarro:
>> 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? 

Looking back, Java was introduced as a client side language - originally 
from the embedded sector. Empirically, it wasn't used as a server side 
language for enterprise-level systems. Applying your logic would mean it 
can't be used. Although looking at enterprise-level systems across the UK 
today, Java is as common as Cobol - and succeeding.



-- 
Iso.
FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
Recommended Hosting: http://www.affordablehost.com/
Web Standards: http://www.webstandards.org/


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

Date: Sun, 18 May 2003 13:30:27 +0300
From: Jeff Paffett <jpaffett@les.forthnet.gr>
Subject: Re: PHP or Perl ?
Message-Id: <BAED3B73.2DD%jpaffett@les.forthnet.gr>

On 18/5/03 2:31 am, in article 3ec6c663$0$49117$e4fe514c@news.xs4all.nl,
"Dieter D'Hoker" <webmaster@neverseenbefore.com> wrote:

> How would you advice someone who wants to start learning a programmign
> language for developping websites ?
> learning PHP or Perl ?
> 
> Or maybe somethign else like Coldfusion , or java servlets , Python ?
> 
> and why ?
> 
I would suggest you use PHP, if what you really want to do is mainly website
development. Knowledge you pick up on the way will be quite transferable to
other languages if you want to do other things in the future.



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

Date: Sun, 18 May 2003 10:43:51 GMT
From: Hans Wolters <nomailwanted@e35203.upc-e.chello.nl>
Subject: Re: PHP or Perl ?
Message-Id: <HtJxa.1783563$sj7.76865652@Flipper>

brucie wrote:
> In post <3ec6c663$0$49117$e4fe514c@news.xs4all.nl>
> Dieter D'Hoker babbled:
> 
> 
>>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 

Perl might be a little older but is sure does the job. Use whatever you 
need.

-- 
Pas op, nomailwanted is een spamtrap



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

Date: Sun, 18 May 2003 10:52:28 GMT
From: KAH <kah@kahnews.cjb.net>
Subject: Re: PHP or Perl ?
Message-Id: <Xns937F831759A50kahatkahnewsdotcjbdo@193.213.112.21>

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

KAH


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

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

Dieter D'Hoker wrote:
> How would you advice someone who wants to start learning a programmign
> language for developping websites ?
> learning PHP or Perl ?

Both Perl and PHP are big today when it comes to web-programming. Perl is 
really strong when it comes to strings and how to alter them. IMHO PHP is 
easier to use and learn, it's strong and has good database support.

The best thing is really to take a look at both, see which seems to be easiest 
to understnad and pick it up first, don't forget that you can always start 
with the other language later.

Take a look at
perl: www.cclabs.missouri.edu/things/instruction/perl/perlcourse.html
php: www.phphelpdesk.com/index.php/html/main/phptraining.html

Should help you to pick up the one that you feel is right for you.


> Or maybe somethign else like Coldfusion , or java servlets , Python ?

I haven't used coldfusion, nor python (even if it's installed on my machine), 
but java, it's in my opinion a last way out, as java applications and servlets 
seems to be slower than what other serverside and client side scripts are, as 
you will need to start the virtual java machine.


  //Aho



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

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

Tassilo v. Parseval wrote:
> Also sprach Isofarro:
>>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. 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. 

I have seen people to start to use php-scripts in their crontab, to do a lot 
different jobs for them. PHP is quite useble outside the web too, even if it 
has been mainly developed for web use. Wouldn't surprise me if we would have 
an extention of PHP in a couple of years that will handle GUI and other stuff too.


  //Aho



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

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

J.O. Aho wrote:
> Wouldn't surprise me if we would have an extention of PHP in a couple of
> years that will handle GUI and other stuff too.

Please adjust your watches for "Open Source Time".

http://gtk.php.net/

-- 
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: Sun, 18 May 2003 07:44:38 -0400
From: "spaghetti" <spaghetti@aspyre.net>
Subject: Re: PHP or Perl ?
Message-Id: <ba7rgi$po9c9$1@ID-159842.news.dfncis.de>


"Dieter D'Hoker" <webmaster@neverseenbefore.com> wrote in message
news:3ec6c663$0$49117$e4fe514c@news.xs4all.nl...
> How would you advice someone who wants to start learning a programmign
> language for developping websites ?
> learning PHP or Perl ?
>
> Or maybe somethign else like Coldfusion , or java servlets , Python ?

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.

~spag






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

Date: Sun, 18 May 2003 13:39:43 +0000
From: Isofarro <spamblock@spamdetector.co.uk>
Subject: Re: PHP or Perl ?
Message-Id: <ve28ab.cm2.ln@sidious.isolani.co.uk>

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

Thankfully! There's enough crap tools generating invalid HTML markup 
already. It would be original if the markup generated was valid and 
accessible.



-- 
Iso.
FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
Recommended Hosting: http://www.affordablehost.com/
Web Standards: http://www.webstandards.org/


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

Date: Sun, 18 May 2003 17:37:58 +1000
From: "Andrew Rich" <andrew.rich@bigpond.com>
Subject: Process Multiple Files ?
Message-Id: <pan.2003.05.18.07.37.58.697344@bigpond.com>

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;
}
}



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

Date: 18 May 2003 08:32:16 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Process Multiple Files ?
Message-Id: <ba7geg$3ff$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Andrew Rich:

> Wondering if someone could help me with this:-
> 
> 1. open a dir
> 2. process each file 
> 3. close 
> 
> is it something like this ?

Yes. But you wouldn't need the help of this group to find that out, eh?
;-)

> opendir

    opendir DIR, $dir or die $!;

DIR is now a directory handle on which you can call readdir.

> while file

    while (my $entry = readdir DIR) {
        my $file = "$entry/$dir";
        next if -d $file;
        ...
    }

readdir() returns just the filenames so you have to prepend the path if
you want absolute paths. The second line in the while block skips each
entry that is a directory and not a plain file.

> {
> while (<file>)

So far you only have the absolute filename. You have to open the file
now:

    open FILE, $file or die $!;
    while (<FILE>) {
        # line in $_
        ...
    }
    close FILE;
    
If all you want to do is look at the lines of each file and don't care
from which file they are, there's a shortcut:

    opendir DIR, $dir or die $!;
    local @ARGV = map  { "$dir/$_" }    # prepend path
                  grep { -f $_ }        # only files
                  readdir DIR;
    closedir DIR;
    while (<>) {
        # line in $_
        ...
    }
    
The empty <> will look at @ARGV and treat those entries as files. It'll
open one after another and return them line-wise.
    
Tassilo
-- 
$_=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 09:32:01 +0200
From: "Dariusz Nowak" <dmn@box43.pl>
Subject: Re: Using grep in populating list of indexes of '1' ?
Message-Id: <ba7cnv$alq$1@atlantis.news.tpi.pl>

>    my $map  = '111010101010111';
>    my @list =  grep {substr $map => $_, 1} 0 .. -1 + length $map;

This is what I have been thinking of,
I don't mind the special variable $_

Thanks
Darek





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

Date: 18 May 2003 04:44:34 -0700
From: niudou@hotmail.com (niudou)
Subject: Why causes the "format error" when using Archive::Zip?
Message-Id: <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=HASH(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!


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

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


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