[19306] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1501 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 12 11:05:33 2001

Date: Sun, 12 Aug 2001 08:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <997628707-v10-i1501@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 12 Aug 2001     Volume: 10 Number: 1501

Today's topics:
        FAQ: How can I output my numbers with commas added? <faq@denver.pm.org>
    Re: Get rid of some ratio ftp (Martien Verbruggen)
    Re: Is regex in grep() automatically precompiled? <bart.lateur@skynet.be>
    Re: Learning Perl, 2nd Edition (Haakon Riiser)
    Re: Need help with error trying to use string as ARRAY  <somewhere@in.paradise.net>
    Re: Reaping zombies in Win32 Perl CGIs <somewhere@in.paradise.net>
    Re: Reaping zombies in Win32 Perl CGIs <bart.lateur@skynet.be>
    Re: Self-Searchable Perl documention - Extremely Useful (Yves Orton)
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu (Martien Verbruggen)
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu <tinamue@zedat.fu-berlin.de>
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu <bernie@fantasyfarm.com>
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu <ilya@martynov.org>
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu (Martien Verbruggen)
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu (Martien Verbruggen)
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu <tinamue@zedat.fu-berlin.de>
    Re: Shouldn't sub foo {} be equivalent to sub foo {retu <pne-news-20010812@newton.digitalspace.net>
        spanish perl books <info@mjais.de>
    Re: voodoo cookie hash problem <gnarinn@hotmail.com>
        Warning  pragma -w (Nkhouri)
    Re: Warning  pragma -w <Tassilo.Parseval@post.rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 12 Aug 2001 12:17:02 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How can I output my numbers with commas added?
Message-Id: <2tud7.58$V3.170740224@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How can I output my numbers with commas added?

    This one will do it for you:

        sub commify {
            local $_  = shift;
            1 while s/^([-+]?\d+)(\d{3})/$1,$2/;
            return $_;
        }

        $n = 23659019423.2331;
        print "GOT: ", commify($n), "\n";

        GOT: 23,659,019,423.2331

    You can't just:

        s/^([-+]?\d+)(\d{3})/$1,$2/g;

    because you have to put the comma in and then recalculate your position.

    Alternatively, this code commifies all numbers in a line regardless of
    whether they have decimal portions, are preceded by + or -, or whatever:

        # from Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
        sub commify {
           my $input = shift;
            $input = reverse $input;
            $input =~ s<(\d\d\d)(?=\d)(?!\d*\.)><$1,>g;
            return scalar reverse $input;
        }

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           05.10
-- 
    This space intentionally left blank


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

Date: Sun, 12 Aug 2001 20:53:58 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Get rid of some ratio ftp
Message-Id: <slrn9nco26.cq.mgjv@martien.heliotrope.home>

On Sun, 12 Aug 2001 14:31:06 +0800,
	Foot <crud_alex@yahoo.com> wrote:
> Is there any way to check how many percentage of a file is completed while
> retrieveing it using Net:FTP?

Call the retr() method on the object that represents your connection.
What comes back from $ftp->retr() is a Net::FTP::dataconn object, which,
as the manual page explains, can be treated as a IO::Socket::INET
object.  It has a read() method that you can use to get the data in
blocks. between blocks, you can do things.

> Then kill the process once the file's completion reach 99%?

Why would you ever want to do this?

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | What's another word for Thesaurus?
NSW, Australia                  | 


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

Date: Sun, 12 Aug 2001 11:44:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Is regex in grep() automatically precompiled?
Message-Id: <mnqcntobrfbe7437d2lhhqacdic6e26f5i@4ax.com>

Malcolm Dew-Jones wrote:

>Having said that, I have questions about the single quotes.  The variable
>is not being interpolated into the eval'd string, instead the value of
>$pat must be resolved sometime later, and I wonder about what value $pat
>will get and whether everything will be recompiled. (since the eval'd
>string is a constant)
>
>(It may be fine)

It is. It compiles code that looks like

	/$pattern/o

which says that the first time the code is run, the regex will be
compiled and that result stored forever.

>I have always used this like so
>
>	my $p = quotemeta($pat);
>	my $grep = eval "sub { grep /$p/o, @_ }"

But that doesn't allow to include an actual pattern. You're allowing
only a string.

The way I have done it, although it's a hack, is that in safety and
power it's somewhere in between

	"/\Q$pattern/"

which is safe, but only searches for literal strings, and

	"/$pattern/"

which is powerful but very unsafe, as it opens a door for the user to
run arbitrary code.

My hack allows any pattern, but the inserted string must still qualify
as  one pattern. It won't run code in a string like

	@{[print 'Hi!']}

>: WHAT gets assigned into $grep?
>
>a ref to a sub that can be run (something like) like &$grep(...) 
>
>: >Note that the first time you call the $grep sub (*with* a parameter),
>: >should be in the scope of $pat, perhaps like this:
>: >
>: >	$grep->("");
>: >
>
>(Ah, he's answering my own questions from above - I should have read this
>more thoroughly first.)

Yes. That's the hack. It's safe, but not very programmer-friendly.

-- 
	Bart.


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

Date: 12 Aug 2001 13:02:53 GMT
From: hakonrk@fys.uio.no (Haakon Riiser)
Subject: Re: Learning Perl, 2nd Edition
Message-Id: <slrn9ncvjs.a9.hakonrk@s.hn.org>

[Randal L. Schwartz]

> The second edition is a fine book, but I also think the third edition
> is better.  Those are not contradictory positions!  Although depending
> on your goals they may end up supporting different behaviors.

I was planning on using Perl in Unix system administration, replacing
sed & awk for many tasks.  I've heard that the 3rd edition is targeted
less towards Unix users, so I think I'll keep the 2nd edition.  I assume
the difference between Perl 5.004 and 5.6 isn't very important in an
introductory book such as this.

Anyway, thanks for answering my question!

-- 
 Haakon


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

Date: Sun, 12 Aug 2001 21:31:55 +1000
From: "Tintin" <somewhere@in.paradise.net>
Subject: Re: Need help with error trying to use string as ARRAY ref...
Message-Id: <zPtd7.17$6K6.2503700@news.interact.net.au>


> Roger Hinson wrote:
>         system "echo PRODDB1_$group establish DEV001 BCV dev $bcvset1";

Am I the only one here who can't see why the above line is needed?  None of
the solutions changed it, so I can only assume I'm missing something
obvious.




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

Date: Sun, 12 Aug 2001 21:24:38 +1000
From: "Tintin" <somewhere@in.paradise.net>
Subject: Re: Reaping zombies in Win32 Perl CGIs
Message-Id: <KItd7.16$6K6.2503700@news.interact.net.au>


"Moth Mann" <mothman@attack.of.the.clones.invalid> wrote in message
news:1exzpcf.1kpude9mw5miyN%mothman@attack.of.the.clones.invalid...
> > p.s. There's always blat. That's a free sendmail "clone" for Windows.
>
> Maybe I will have to look at this.

blat ne sendmail

sendmail is a MTA, blat is a MUA.




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

Date: Sun, 12 Aug 2001 12:01:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Reaping zombies in Win32 Perl CGIs
Message-Id: <oqrcntg8rp2q4op3od8tcut1ruc8d6ad6d@4ax.com>

Moth Mann wrote:

>Unfortunately, even though I do not have to worry about zombies, I still
>cannot seem to do what I want.  Testing on the command line, when I do a
>fork in ActiveState Perl in Winblows 2000, I don't get the prompt back
>until the children finish executing.

Ah, yes. That's true.

Perhaps you can  try a Windows-only solution, and use the ShellExecute()
API call, through the Win32::API module. ShellExecute() is much like
system() in concept, but it mainly serves to launch Windows programs,
which means that it won't wait until they're finished to return. It
returns immediately. The launched programs run asynchronously.

But it does involve an elaborate scheme for passing your data to the
program. You could save your data to a temporary file and pass that to
your program, but then you'd still need to delete it when you're done.
Perhaps there are better solutions specific for NT, but I'm not too
familiar with that. What I described here would work on all flavours of
Windows.

-- 
	Bart.


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

Date: 12 Aug 2001 08:02:08 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Self-Searchable Perl documention - Extremely Useful!
Message-Id: <74f348f7.0108120702.662a6771@posting.google.com>

coldwave@bigfoot.com (John Holdsworth) wrote in message news:<2a46b11e.0108110039.406bfe7@posting.google.com>...
> Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3B74791C.D80D8AE5@earthlink.net>...
> > John Holdsworth wrote:
> > [snip]
SNIP
> NS users missing out on something thesedays. Even though IE is the work
> of the devil it is a very fine browser. Besides it supports PerlScript
> which opens up some new and rather interesting possibilities which
> I'm trying to get out there such as:
> 
> Self searching documents:
> http://www.openpsp.org/source/util/search.html.gz
> 
> Searchable perl docs:
> http://www.openpsp.org/source/util/perltoc.pl
> 
> Turn your browser into a Sybase database browser:
> http://www.openpsp.org/source/util/dbbrowser.html.gz
> (requires sybperl+OpenClient)
> 
> These are interesting ideas. Give them a try.

These are damn interesting ideas.  I have soooo many uses for this
stuff its amazing.

Thanks a lot for your contribution, its really cool.

Incidentally, I stayed up all night enhancing your activestate search
engine (found a couple of minor gliitches, but who cares).  Check your
mails for a copy of my mods.

Are you going to post your stuff to CPAN?  

Anyways, much obliged, this has opened up whole area of thought for
me.

Yves


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

Date: Sun, 12 Aug 2001 20:48:02 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <slrn9ncnn2.cq.mgjv@martien.heliotrope.home>

On 12 Aug 2001 01:45:27 -0700,
	John Lin <johnlin@chttl.com.tw> wrote:
> Dear all,
> 
> Today, I encountered a bug and fixed it.
> I imputed this bug to either my misconception or a Perl's bug:
> 
> package X;
> 
> sub new {
>     my $self = bless {};
>     for($self->using) { push @{$self->{objects}},$_ }
>     return $self;
> }
> 
> sub using {}
> 
> sub load {
>     my $self = shift;
>     $_->load for @{$self->{objects}};
> }
> 
> package main;
> X->new->load;
> 
> It died in a deep recursion at  $_->load
> 
> The bug can be eliminated by modifying the
>     sub using {}
> into
>     sub using {()}
> or
>     sub using {return}

This one could be considered marginally better than the previous (in
case you get called in scalar context). However, it's hard to tell what
exactly you want from using() in the first place. As written above, it
would always return an empty list in list context, which means that your
for loop above simply wouldn't ever get executed. 

Out of curiosity, what do you want using() to do? What is its purpose?
What did you _expect_ an empty sub to do?

> "perldoc -f return" says the sub using {} will return
> the value of the last expression evaluated.  My opinion is,
> considering the above case, it should add a condition:
> "Except that when the sub is empty, return ()".  Otherwise the
> result is useless, unexpectable, meaningless and buggy.

Well.. An empty sub will actually return @_. Whether that behaviour
should be called buggy or just surprising is a different issue. I don't
know where, if anywhere, this is documented. I can't find anything that
says that implicitly @_ is always considered to be evaluated, or
anything like that. I might be missing something, though. The Camel also
seems silent on this, but somehow I must have heard about it in the
past, somewhere.

Does anyone have a documentation reference for this? Or is it just
unspecified behaviour?

> What do you think about it?

I'm not sure. I can't find any documentation stating what _should_
happen. However, the notion of a totally empty subroutine is
sufficiently awkward to me that I am willing to accept that the current
behaviour has some use. Arguing that 

    sub foo {} 

should be equal to 

    sub foo { return }

just makes no more sense to me than it returning its own argument list.
Whatever it should be, it should be documented somwhere. That would be
the only bug I can see in this: lack of clear documentation in perlsub
(or my own inability to find it).

Martien

PS. The behaviour is the same for 5.004_05, 5.00503 and 5.6.1
-- 
Martien Verbruggen              | 
Interactive Media Division      | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.   | Gates?
NSW, Australia                  | 


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

Date: 12 Aug 2001 11:32:21 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <9l5pg5$7j7km$2@fu-berlin.de>

John Lin <johnlin@chttl.com.tw> wrote:
> Dear all,

> Today, I encountered a bug and fixed it.
> I imputed this bug to either my misconception or a Perl's bug:

> package X;

> sub new {
>     my $self = bless {};
>     for($self->using) { push @{$self->{objects}},$_ }
>     return $self;
> }

> sub using {}

here @_ is returned. i believe that's the normal behaviour
if there's no "last expression evaluated".

> sub load {
>     my $self = shift;
>     $_->load for @{$self->{objects}};
> }
> package main;
> X->new->load;

> It died in a deep recursion at  $_->load
> The bug can be eliminated by modifying the
>     sub using {}
> into
>     sub using {()}

here you are returning the empty list always.

> or
>     sub using {return}

> "perldoc -f return" says the sub using {} will return
> the value of the last expression evaluated.

no, it's saying:
|              (Note that in the absence of a explicit `return',
|              a subroutine, eval, or do FILE will automatically
|              return the value of the last expression
|              evaluated.)

so, for example
sub using {
 # do something with @_
 $x = shift;
 $x++;
}

it would return $x.

sub using {return} returns undef always.

>  My opinion is,
> considering the above case, it should add a condition:
> "Except that when the sub is empty, return ()".  Otherwise the
> result is useless, unexpectable, meaningless and buggy.

> What do you think about it?

doesn't seem like a bug to me...

regards,
tina
-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception
---   Warning: content of homepage hopelessly out-dated   ---


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

Date: Sun, 12 Aug 2001 08:29:57 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <h8tcnt4731ogs6tpbu77bmhislfqblh8m0@news.supernews.net>

mgjv@tradingpost.com.au (Martien Verbruggen) wrote:

} Well.. An empty sub will actually return @_. Whether that behaviour
} should be called buggy or just surprising is a different issue. I don't
} know where, if anywhere, this is documented. I can't find anything that
} says that implicitly @_ is always considered to be evaluated, or
} anything like that. I might be missing something, though. The Camel also
} seems silent on this, but somehow I must have heard about it in the
} past, somewhere.

How strange/interesting.  Note that Perl *ONLY* seems to do this if you
call the sub in list context.  [This after the "0 but true" makes me wonder
just how many more undocumented hacks have been shoe horned into odd
corners of Perl...:o)]

As you suggest:

$ perl -e 'sub x {}; @a = x(1,2,3); die "@a"'
1 2 3 at -e line 1.

But if you call the subroutine in scalar context it doesn't seem to work
the same way:

$ perl -we 'sub x {}; $a = x(1,2,3); die "$a"'
Use of uninitialized value in string at -e line 1.
Died at -e line 1.

}     sub foo {} 
} 
} should be equal to 
} 
}     sub foo { return }
} 
} just makes no more sense to me than it returning its own argument list.

Yeah, but how about only returning its argument list in list context and
returning undef in scalar context.  *that* makes more sense??  :o)

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: 12 Aug 2001 16:51:47 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <874rrd7864.fsf@abra.ru>


BC> How strange/interesting.  Note that Perl *ONLY* seems to do this if you
BC> call the sub in list context.  [This after the "0 but true" makes me wonder
BC> just how many more undocumented hacks have been shoe horned into odd
BC> corners of Perl...:o)]

BC> As you suggest:

BC> $ perl -e 'sub x {}; @a = x(1,2,3); die "@a"'
BC> 1 2 3 at -e line 1.

BC> But if you call the subroutine in scalar context it doesn't seem to work
BC> the same way:

BC> $ perl -we 'sub x {}; $a = x(1,2,3); die "$a"'
BC> Use of uninitialized value in string at -e line 1.
BC> Died at -e line 1.

BC> }     sub foo {} 
BC> } 
BC> } should be equal to 
BC> } 
BC> }     sub foo { return }
BC> } 
BC> } just makes no more sense to me than it returning its own argument list.

BC> Yeah, but how about only returning its argument list in list context and
BC> returning undef in scalar context.  *that* makes more sense??  :o)

Moreover under debugger list context does not work too:

bash-2.05$ perl -de 'sub x {}; @a = x(1,2,3); die "@a"'
Default die handler restored.
 
Loading DB routines from perl5db.pl version 1.07
Editor support available.
 
Enter h or `h h' for help, or `man perldebug' for more help.
 
main::(-e:1):   sub x {}; @a = x(1,2,3); die "@a"
  DB<1> c
Died at -e line 1.
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.
  DB<1> q

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: Sun, 12 Aug 2001 23:10:42 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <slrn9nd02i.cq.mgjv@martien.heliotrope.home>

On Sun, 12 Aug 2001 08:29:57 -0400,
	Bernie Cosell <bernie@fantasyfarm.com> wrote:
> mgjv@tradingpost.com.au (Martien Verbruggen) wrote:
> } 
> } just makes no more sense to me than it returning its own argument list.
> 
> Yeah, but how about only returning its argument list in list context and
> returning undef in scalar context.  *that* makes more sense??  :o)

Heh, yeah, well.. No, it doesn't.

I'd probably vote for this to be called 'unspecified behaviour' rather
than a bug. It's not behaving contrary to any documentation, it's just
behaving weirdly. And that falls under unspecified :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.   | enough features yet.
NSW, Australia                  | 


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

Date: Sun, 12 Aug 2001 23:11:48 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <slrn9nd04k.cq.mgjv@martien.heliotrope.home>

On 12 Aug 2001 16:51:47 +0400,
	Ilya Martynov <ilya@martynov.org> wrote:
> 
> BC> Yeah, but how about only returning its argument list in list context and
> BC> returning undef in scalar context.  *that* makes more sense??  :o)
> 
> Moreover under debugger list context does not work too:

But that may just be a problem with the debugger. There are other things
that don't work the same way under the debugger as they do outside of
it. There was mention of one not that long ago on clp.misc or
clp.moderated.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | We are born naked, wet and hungry.
Commercial Dynamics Pty. Ltd.   | Then things get worse.
NSW, Australia                  | 


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

Date: 12 Aug 2001 14:07:29 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <9l62j1$7ckhn$1@fu-berlin.de>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On Sun, 12 Aug 2001 08:29:57 -0400,
> 	Bernie Cosell <bernie@fantasyfarm.com> wrote:
>> mgjv@tradingpost.com.au (Martien Verbruggen) wrote:
>> } 
>> } just makes no more sense to me than it returning its own argument list.
>> 
>> Yeah, but how about only returning its argument list in list context and
>> returning undef in scalar context.  *that* makes more sense??  :o)

> Heh, yeah, well.. No, it doesn't.

> I'd probably vote for this to be called 'unspecified behaviour' rather
> than a bug. It's not behaving contrary to any documentation, it's just
> behaving weirdly. And that falls under unspecified :)

there's another unspecified behaviour:
03:56pm tina@lux:perl 665> perl -wle'
sub test {@_}
@_ = (2,3,4);
@x = &test;
print "<@x>"'
<2 3 4>
03:57pm tina@lux:perl 666> perl -wle'
sub test {}
@_ = (2,3,4);
@x = &test;
print "<@x>"'
<>
03:57pm tina@lux:perl 667> perl -wle'
sub test {}
@_ = (2,3,4);
@x = &test(@_);
print "<@x>"'
<2 3 4>

and perlsub says:
|        &foo;               # foo() get current args, like foo(@_) !!

but in the above example you can see that &test behaves
different from &test(@_)


-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception
---   Warning: content of homepage hopelessly out-dated   ---


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

Date: Sun, 12 Aug 2001 16:34:32 +0200
From: Philip Newton <pne-news-20010812@newton.digitalspace.net>
Subject: Re: Shouldn't sub foo {} be equivalent to sub foo {return} or sub foo {()} ?
Message-Id: <7v4dnt08mlqlph8mit9o43qclss4pgajd0@4ax.com>

On 12 Aug 2001 11:32:21 GMT, Tina Mueller <tinamue@zedat.fu-berlin.de>
wrote:

> sub using {return} returns undef always.

Well, or the empty list (if called in list context).

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Sun, 12 Aug 2001 16:29:03 +0200
From: Markus Jais <info@mjais.de>
Subject: spanish perl books
Message-Id: <9l63lt$7ms4q$1@ID-75083.news.dfncis.de>

hi,
does anybody know where I can buy spanish perl books??
If you know spanish online bookstores, booklists or
web-sites of publishers or any other source of information
on spanish perl books, please let me know!
thanks a lot!!!

are there any translations of the oreilly perl books to spanish??

regards
markus


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

Date: Sun, 12 Aug 2001 12:45:53 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: voodoo cookie hash problem
Message-Id: <997620353.188921264838427.gnarinn@hotmail.com>

In article <dc31dfbf.0108111558.6cf64280@posting.google.com>,
Mongo <mongo@firewallx.com> wrote:
>Here is the code, maybe someone else can see somthing. When I try to
>put one of these env or cookie values into an email it ends up as a
>blank space??
>
>
>%cookies = &getCookies;
>&getCookies;

why 2 calls to &getCookies ?

(snipped rest of code.)

I would prefer if you created a simple but complete example program,
instead of just a part of your program, with lots of stuff that are
irrelevant.

you are calling this as a cgi, right?

show us an example that both outputs $ENV{'HTTP_COOKIE'} to browser
and to your email, and show us both outputs

gnari


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

Date: 12 Aug 2001 06:22:32 -0700
From: circuller@yahoo.com (Nkhouri)
Subject: Warning  pragma -w
Message-Id: <64ffc63e.0108120522.4b82587e@posting.google.com>

I used the -w while developing my FCGI program , the program worked
fine with
 many harmless warnnings {used of unitialized values }! now if i take
the -w
 out , the program stop responding and logs an error " terminating
program with  exit status 2 " to STDERR .

 i added the $^W=0,$^W=1 to ignore warnings , but nothing happen ,
same error occurs !

 help plz !


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

Date: Sun, 12 Aug 2001 16:34:03 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Warning  pragma -w
Message-Id: <3B7693DB.5050408@post.rwth-aachen.de>

Nkhouri wrote:
> I used the -w while developing my FCGI program , the program worked
> fine with
>  many harmless warnnings {used of unitialized values }! now if i take
> the -w
>  out , the program stop responding and logs an error " terminating
> program with  exit status 2 " to STDERR .

Well, the purpose of the warning pragma is not to get warnings and 
consider them harmless but instead alter the program so that they no 
longer occur. The 'unitialized value' thing is certainly not likely to 
make a program bail out, yet they can easily be fixed by either checking 
whether a variable contains something before printing or by assigning an 
empty string in case it is empty: $var ||= "";

Either way: There must be something that you are not telling us. Better 
tell us what you really did or post your code.

Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

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


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