[18716] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 884 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 12 14:11:43 2001

Date: Sat, 12 May 2001 11:10:14 -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: <989691014-v10-i884@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 12 May 2001     Volume: 10 Number: 884

Today's topics:
    Re: if ($x in @a) equivalent in perl? (M.J.T. Guy)
    Re: if ($x in @a) equivalent in perl? <juex@my-deja.com>
    Re: if ($x in @a) equivalent in perl? <uri@sysarch.com>
    Re: if ($x in @a) equivalent in perl? <godzilla@stomp.stomp.tokyo>
    Re: if ($x in @a) equivalent in perl? (Rudolf Polzer)
    Re: If statement question (Abigail)
    Re: module installation problem (M.J.T. Guy)
        NNTP connection timeout <Hans.de.Bruin@chello.nl>
    Re: OOP in Perl (M.J.T. Guy)
    Re: OOP in Perl nobull@mail.com
        Perl d20 GM Utility Available for Use/Comment <bmstroh@cavtel.net>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Tad McClellan)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Tad McClellan)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Tad McClellan)
    Re: setting environment variables (M.J.T. Guy)
        Why do wildcards not work with system function? <mdudley@execonn.com>
    Re: Why do wildcards not work with system function? (Randal L. Schwartz)
    Re: Write to file (M.J.T. Guy)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 12 May 2001 14:21:54 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: if ($x in @a) equivalent in perl?
Message-Id: <9djgu2$kt4$1@pegasus.csx.cam.ac.uk>

Rudolf Polzer <eins@durchnull.de> wrote:
>
> BTW: is
>
>@hash{keys @hash} = values @hash
>
>safe or implementation-defined like ($a++ + $a)?

As you've written it, it's obviously safe.   As it's invalid Perl, it
can't do any harm, or anything else either.      :-)

Assuming you meant

	@hash2{keys %hash} = values %hash;

then yes, that is defined to work and be the same as

	%hash2 = %hash;


Mike Guy


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

Date: Sat, 12 May 2001 07:38:47 -0700
From: "Jürgen Exner" <juex@my-deja.com>
Subject: Re: if ($x in @a) equivalent in perl?
Message-Id: <3afd4afa@news.microsoft.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:3AFC94D8.19F063@stomp.stomp.tokyo...
> This method I displayed is seven-hundred percent more efficient
> than grep for simply running through the alphabet. [...]

Wait a second, are you saying your method actually gains time?
For the sake of argument lets assume 'the other method' takes 2 minutes.
Now, your method being 700% faster would mean your method needs minus 12
minutes (computed as 2min - 700/100*2min = -12min).

Congratulations, you just invented the time machine.

jue




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

Date: Sat, 12 May 2001 14:51:19 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: if ($x in @a) equivalent in perl?
Message-Id: <x7y9s2aad3.fsf@home.sysarch.com>

>>>>> "MJTG" == M J T Guy <mjtg@cus.cam.ac.uk> writes:

  MJTG> Rudolf Polzer <eins@durchnull.de> wrote:
  >> 
  >> BTW: is
  >> 
  >> @hash{keys @hash} = values @hash
  >> 
  >> safe or implementation-defined like ($a++ + $a)?

  MJTG> Assuming you meant

  MJTG> 	@hash2{keys %hash} = values %hash;

  MJTG> then yes, that is defined to work and be the same as

  MJTG> 	%hash2 = %hash;

nope. the slice thing doesn't delete all the old keys in %hash2 while
the plain assignment does.

the slice idiom is very useful to insert all of one hash into another.

it IS equivilent to:

	%hash2 = ( %hash2, %hash ) ;

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


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

Date: Sat, 12 May 2001 09:08:09 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: if ($x in @a) equivalent in perl?
Message-Id: <3AFD5FE9.79ECECFC@stomp.stomp.tokyo>

Jürgen Exner wrote:
 
> Godzilla! wrote:


> > This method I displayed is seven-hundred percent more efficient
> > than grep for simply running through the alphabet. [...]
 
> Wait a second, are you saying your method actually gains time?
> For the sake of argument lets assume 'the other method' takes 2 minutes.
> Now, your method being 700% faster would mean your method needs minus 12
> minutes (computed as 2min - 700/100*2min = -12min).
 
> Congratulations, you just invented the time machine.


You have created false parameters. Relative elapse times
for code comparisons are not linear in nature and clearly
cannot be calculated by linear extrapolation. This is
clearly exemplified by my methodologies which show 
grep becomes less efficient with increasing array size
where another method remains relatively linear, but
not perfectly linear.

Using your false parameters, code which runs seven times
faster than another which takes two minutes,
this faster code would complete in,

0.285714285 minutes or 17.14285714 seconds


If I were as stupid as you, I wouldn't give a damn.

Give it a rest, Frank.


Godzilla!


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

Date: Sat, 12 May 2001 21:17:07 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: if ($x in @a) equivalent in perl?
Message-Id: <slrn9fr31j.4ls.eins@www42.t-offline.de>

Thoren Johne <thoren@southern-division.com> wrote:
> eins@durchnull.de (Rudolf Polzer) writes:
> 
> > Thoren Johne <thoren@southern-division.com> wrote:
> > > eins@durchnull.de (Rudolf Polzer) writes:
> > > 
> > > > Why not simply
> > > > 
> > > > my @array = (0, 1, 2);
> > > > my @other = ('a', 'b', 'c');
> > > > 
> > > > my %hash = map { $array[$_], $other[$_] } 0..$#array;
> > > 
> > > my %hash;
> > > @hash{@array} = @other;
> > 
> > Thx. I forgot I can use slices... BTW: is
> > 
> > @hash{keys @hash} = values @hash
> 
> that makes no sense:
> 
> %hash1 = %hash2;

I know it is useless. I wanted to transform %hash into itself. I meant
@hash {keys %hash} = values %hash
of course. What I wanted to know is if optimizations like traversing one-by-one
are done like in

for (1..1e9)

which does not allocate even 1GB of memory; the list elements are used one-by-
one.

Of course, when I use different hashes in both places, I know it works.

> perldoc -f keys
>         ...
>         The actual random order is subject to change in future
>         versions of perl, but it is guaranteed to be the same
>         order as either the values or each function produces
>         (given that the hash has not been modified)
>         ...

This is what I know.

-- 
#!/usr/bin/perl -- prints all files of current dir.
open H,"|a2ps -1R";for(sort<*>){print H"$_:\n";open
X,"<$_";print H map{chomp;"> $_\n"}<X>;print H"\n"}


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

Date: Sat, 12 May 2001 13:28:37 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: If statement question
Message-Id: <slrn9fqek5.mlo.abigail@tsathoggua.rlyeh.net>

Rudolf Polzer (eins@durchnull.de) wrote on MMDCCCXI September MCMXCIII in
<URL:news:slrn9fq975.fr1.eins@www42.t-offline.de>:
}}  
}}  Just a style issue. In C I use for(;/*ever*;) to make it look like 'forever'
}}  I just wanted to make for(;;) in Perl look like 'forever'. I do know about
}}  for(;;), I just wanted it to be like forever.

    for (;#ever
         ;) { ... }

    until ($doomsday) { ... }

    $_ = "ever";
    for (;s/ever/and ever/;) { ... }


I still don't understand your question about 'ever' being optimized to 1.
Why should it, and why would it be an optimization?


Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 12 May 2001 13:52:09 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: module installation problem
Message-Id: <9djf69$j90$1@pegasus.csx.cam.ac.uk>

CuneytTaskiran  <taskiran@ecn.purdue.edu> wrote:
>Hi,
>
>I have a problem installing the Math::Random module. The REDME file says
>to
>  perl Makefile.PL
>  make
>  make test
>  make install
>
>I did the 1st three steps but can't do the last one bec I don't have the
>permissions to
>write to the necessary file.

See perlfaq8: "How do I keep my own module/library directory?"


Mike Guy


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

Date: Sat, 12 May 2001 17:16:02 GMT
From: "Hans de Bruin" <Hans.de.Bruin@chello.nl>
Subject: NNTP connection timeout
Message-Id: <mdeL6.331524$eL4.36395119@Flipper>

I have build a script which checks the number of articles in a newsgroep on
serveral newsservers, and puts the result in a rrd database. The script is
run every 5 minutes by a cronjob. When a newserver does not respond (no syn
ack is resieved), the Net::NNTP->new("some.host.name") command times out
after 789 seconds. This is a bit long. The default timeout accoording to the
Net::NTTP manual is 120 seconds. I gues this is the timeout after a tcp
connection has been established and a nntp request is sent to the server. I
gues I need to do somthing with the 'io_socket_timeout' in IO::Socket but
what, how and where?

--
Hans


Net::NTTP uses th following modules:

use IO::Socket;
use Net::Cmd;
use Carp;
use Time::Local;
use Net::Config;








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

Date: 12 May 2001 15:10:06 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: OOP in Perl
Message-Id: <9djjoe$nhi$1@pegasus.csx.cam.ac.uk>

In article <3AFC4318.83B993F3@agilent.com>,
dave jerzycki  <david_jerzycki@agilent.com> wrote:
>
> Just getting started in object oriented programming, I've got a
> quick question to ask:
> How do I read this statement
>   my $pOptionMap = $this->SUPER::getOptionMap( );
> -> is a dereferencing arrow used to call a method on an object, in this
>
> case, let's just say $this equals foo
> How do I interpet SUPER::getOptionMap( )????
> SUPER is what? If I print out what @ISA is, it has no bearing on where
> this program "jumps" to/calls. So getOptionMap is a member of SUPER?
> Any good reference text I could refer to, most texts I've seen define
> $this->cgi( )  or $this->cgi($data) or even App::initInstance( )
> but not something like     $this->SUPER::getOptionMap( )

Search for 'SUPER' in any of the Perl documentation on objects, e.g.
perlboot, perlbot, perlobj, perltoot.


Mike Guy


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

Date: 12 May 2001 16:04:27 +0100
From: nobull@mail.com
Subject: Re: OOP in Perl
Message-Id: <u9u22qzk04.fsf@wcl-l.bham.ac.uk>

dave jerzycki <david_jerzycki@agilent.com> writes:

>  Just getting started in object oriented programming, I've got a
>  quick question to ask:
>  How do I read this statement
>    my $pOptionMap = $this->SUPER::getOptionMap( );
>  -> is a dereferencing arrow used to call a method on an object, in this
>  case, let's just say $this equals foo
>  How do I interpet SUPER::getOptionMap( )????
>  SUPER is what?

SUPER is special.  So let use first consider 

$this->getOptionMap( );

This would look for a method getOptionMap() in the class of $this
recersively searching all the parent clases if necessary.

$this->FOO::getOptionMap( );

Thia will look for a method getOptionMap() in the class FOO
recersively searching all the parent clases if necessary.
Idiomatically this only makes sense if FOO was one of the ancestor
classes of the class of $this.  However Perl does not check that this
is the case.

$this->SUPER::getOptionMap( );

This would look for a method getOptionMap() by recersively searching
all the parent clases of the _current_ class.  That's the one
specified by a package directive in the a lexicial block containing
the call.  Methods are not looked for in the current class only its
parents.  Idiomatically this syntax only makes sense if the current
class is one of the ancestor classes of the class of $this.  However
Perl does not check that this is the case.

> If I print out what @ISA is, it has no bearing on where
>  this program "jumps" to/calls.

False.

> So getOptionMap is a member of SUPER?

No.

>  Any good reference text I could refer to, most texts I've seen define
>  $this->cgi( )  or $this->cgi($data) or even App::initInstance( )
>  but not something like     $this->SUPER::getOptionMap( )

perldoc perlobj

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sat, 12 May 2001 13:09:07 -0400
From: Brent Stroh <bmstroh@cavtel.net>
Subject: Perl d20 GM Utility Available for Use/Comment
Message-Id: <0frqftgdf9sg0v51l5a08863mi6j61cedb@4ax.com>

I've recently put together a handful of modules to support my PBEM Dungeons
& Dragons 3e game.  To make them useful, I've also built a shell program to
tie them together.

As an example of what it does:

C:\rpgshell>rpgshell

RPGShell> load party

RPGShell> roll party init
Alex       (init)      : 1d20+0 :: ( 13  ) +0 = 13
Bob        (init)      : 1d20-2 :: ( 16  ) -2 = 14

RPGShell> roll bob lt-mace vs 16
Bob        (lt-mace)   : 1d20+0 :: (  3  ) +0 =  3 -> Failure

RPGShell> roll Alex dagger vs 16
Alex       (dagger)    : 1d20+1 :: (  4  ) +1 =  5 -> Failure

RPGShell> roll bob fort
Bob        (fort)      : 1d20+6 :: ( 19  ) +6 = 25

RPGShell> roll bob lt-mace vs 16
Bob        (lt-mace)   : 1d20+0 :: (  2  ) +0 =  2 -> Failure

RPGShell> roll alex dagger vs 16
Alex       (dagger)    : 1d20+1 :: (  3  ) +1 =  4 -> Failure

RPGShell> roll bob heal
Bob        (heal)      : 1d20+5 :: (  5  ) +5 = 10

It's currently under-documented, but the README should give you a place to
start.  The example above will probably help, as well.  The code will need
some cleanup, and I've still got some features to add.  However, it's
functional.

Folks interested can get it from Yahoo Groups at:
  http://groups.yahoo.com/group/rpgshell

This requires a Yahoo id; if you don't have/don't want one, you can still
subscribe to the discussion list by sending email to:
  rpgshell-subscribe@yahoogroups.com

Optionally, you can request a copy via email from:
  bmstroh@cavtel.net

I'm interested in feedback, bug reports, bug fixes, etc, if you're
interested in getting involved.



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

Date: Sat, 12 May 2001 11:19:30 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <slrn9fql42.26h.tadmc@tadmc26.august.net>

Eric Bohlman <ebohlman@omsdev.com> wrote:
>Andras Malatinszky <andras@mortgagestats.com> wrote:
>> tadmc@augustmail.com wrote:
>
>>>
>>> Outline
>>>    Before posting to comp.lang.perl.misc
>>>       Must
>
>> Should.
>
>> You are talking to adults. If you start off on a bossy tone you are going to
>> alienate your audience. That's not what we want.


>I think Tad is using "must," "should," etc. in the very particular (some 
>would say "peculiar") sense that they have in specs like RFCs.  


Yes, I was.


>I'm not 
>entirely sure whether that's a good idea here (at least not without some 
>explanation, which would take up valuable space) because:
>
>1) Many or most of the people reading guidelines won't yet be familiar 
>with reading formal specs and
>
>2) Stark imperatives make sense when you're saying what a *computer* is 
>supposed to do (as does a spec) but are rather objectifying and 
>defense-inducing when you're describing what a *person* is supposed to do.


I understand that a stark imperative may be off-putting, but checking
the docs before posting _is_ absolutely required (as it is in most
Big 8 newsgroups).

I could change the "Must" into some other less offensive word
(eg. "Required"), if that word left no room for posting without
checking the docs.


Any suggestions for a better word than "must"?


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


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

Date: Sat, 12 May 2001 12:06:33 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <slrn9fqns9.26h.tadmc@tadmc26.august.net>

tadmc@augustmail.com <tadmc@augustmail.com> wrote:

>Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)


To keep the traffic here minimal:

   Assume the suggestion is accepted. Complain (err, bring it up
   again) if it has not been addressed in the next posted revision.
   That is, assume "no news is good news".

   I will try to followup with some reasoning for things not adopted.


Also, you _can_ email suggestions if they are only editorial/formatting
issues rather than changes in semantics. No need to post typos,
wrong punctuation, etc type of comments.

Thanks.


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


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

Date: Sat, 12 May 2001 12:02:05 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <slrn9fqnjt.26h.tadmc@tadmc26.august.net>

Andras Malatinszky <andras@mortgagestats.com> wrote:
>
>
>tadmc@augustmail.com wrote:
>
>[snip]
>
>Tad, I think what you are doing is great and much needed. 


This is *not* what _I_ am doing. I am just the guy who is writing it down.

It is what _we_ (clpmisc-ers) are doing.


>I hope you don't mind
>some suggestions.


This is supposed to be (as close as is practicable) the concensus
of the group's participants, so your are _supposed_ to be
making suggestions  :-)


>> Outline
>>    Before posting to comp.lang.perl.misc
>>       Must
>
>Should.


I cannot make the change you suggest.


>You are talking to adults. 


Yes. I am trying to succinctly describe what is expected from the
folks in this newsgroup.

"Should" implies that it is OK to post without checking the docs.
I do not believe that that is the concensus here, so changing it
would be misinforming the audience.


>If you start off on a bossy tone 


I'm open to suggestions of less offensive wording. Let's have them...

I'm not open to suggestions that change the _meaning_ of what
is currently there.


Of course, it may be that the group _does_ think that posting without
checking is OK.

If that proves to be the case, then we^H^Hyou will need to get
someone else to maintain the guidelines, as it should be maintained
by someone who participates in the newsgroup.


>you are going to
>alienate your audience. That's not what we want.


I do not want to alienate the audience, of course.

I also do not want to misinform them.

What change would accomplish both of those objectives?


>>        - Check the Perl Frequently Asked Questions (FAQ)
>
>You might want to include a URL here. 


No, not _here_ (in the Outline, as you have quoted above), in
the corresponding section below here.

I feel it would be gratuitous to bother with a URL...


>I know that theoretically you should be
>able to find the FAQ on your own machine, 


 ... for something with less restricted access (no need to be
connected to the internet at all).

And there already is a "find the FAQ" regular posting, no need
to repeat all of that again.


>but in practice this doesn't seem to
>work for newbies.


Yes, I see your point.

As another followup pointed out, I should make some mention of
_using_ perldoc. Right now, I mention it, but never "define" it.

I will make some change mentioning that perldoc is for accessing
the docs.


>>        - Check the other standard Perl docs (*.pod)
>
>What is pod? 


Once I've told them what perldoc is, then

   perldoc perlpod

heh, heh.


>Again, if I know, I probably don't need this piece of advice. If I
                                         ^^^^^^^^^^
>am new to the game, I may not know.


I am unclear which piece you are commenting on. I see 2 "pieces" there:

   1) Check the other standard Perl docs

   2) (*.pod)

If you mean 1) then I disagree.

If you mean 2) then I agree that it could be left out, but I still
don't want to leave it out.


>>     It is *not* required, or even expected, that you actually *read* all of
>>     Perl's standard docs, only that you spend a few minutes searching them
>>     before posting.
>
>Very good point.


It is, in fact, not (supposed to be) required that you _find_ it in
the docs, only that you have _looked_ there. The docs are awfully
big, and (perhaps) not layed out optimally. 

If you "missed it", just say "oops" and move on. A more usual
reaction is some whining about looking at the documentation for
the software that you are using  :-(


>>     Lurk for a while before posting


I, personally, would like this moved up to the bossy "Must" section,
as it would render this entire guidelines thing moot. Folks would
see for themselves how to conduct themselves before actually
conducting themselves. (and some folks just will not lurk no
matter what anyway)

But these aren't my guidelines, so it goes down here.


>>     Search a Usenet archive

>>         One such searchable archive is
>>         <URL:http://www.deja.com/home_ps.shtml>.
>
>How 'bout
>
>http://groups.google.com/groups?hl=en&lr=&safe=off&group=comp.lang.perl.misc
>
>instead?


Let me take this opportunity to repeat what has become a bit of
a mantra with me of late:

  deja/google sucks!


But I get your point. Yes, I'll need to do something about fixing the URL.

The too-damn-long GETs at google may preclude doing more than just
http://groups.google.com/ though.


>>     Check Other Resources
>>         You may want to check in books or on web sites to see if you can
>>         find the answer to your question.
>>
>>         But you need to consider the source of such information, there are a
>>         lot of very poor Perl books and web sites, and several good ones
>>         too, of course.
>
>The logical question at this point is "like for instance?"


The logical answer at this point (would be, after defining perldoc) is:

   perldoc perlbook

   perldoc -q book

:-)

Examples of "bad" ones seems a waste of space.

(though I would like to see the above perldoc entries become
more complete.)


>> Posting to comp.lang.perl.misc
>>     There can be 200 messages in clpmisc in a single day. Nobody is going to
>>     read every article. They must decide somehow which articles they are
>>     going to read, and which they will skip.
>>
>>     Your post is in competition with 199 other posts. You need to "win"
>>     before a person who can help you will even read your question.
>>
>>     These sections describe how you can help keep your article from being
>>     one of the "skipped" ones.
>
>Very, very good approach.


The approach I took in developing the outline for the guidelines
was to examine several scorefiles that I have accumulated, and
noting what got scored down. Then adding a bullet point
to help folks avoid hitting those score rules :-)


>> AUTHOR
>>     Tad McClellan <tadmc@augustmail.com>
>
>Good job, Tad!


Err, you mean: "Good job, us!"   :-)


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


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

Date: 12 May 2001 16:48:15 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: setting environment variables
Message-Id: <9djpgf$t1r$1@pegasus.csx.cam.ac.uk>

Fredrik De Vibe  <fredridv@ifi.uio.no> wrote:
>On 10 May 2001, Anno Siegel wrote:
>> That's a faq, and "perldoc -q environment" takes you there.  The short
>> answer is, you can't make it "permanent".
>
>I couldn't get that to work. "man perldoc" only gave me the alternatives
>h, v, t, u, m and l and "perldoc environment" didn't give me anything. Any
>idea why and/or to what I can do?

Upgrade your Perl.   The -q option to perldoc has been in all versions of
Perl since 5.004_05.

But if that's too drastic:  effectively all "perldoc -q" does is grep
the headers of the various perlfaq* files.    So you can find the
relevant entries with

grep '=head.*environment' /path/to/my/perl/lib/pod/perlfaq?.pod


Mike Guy


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

Date: Sat, 12 May 2001 11:29:07 -0400
From: Marshall Dudley <mdudley@execonn.com>
Subject: Why do wildcards not work with system function?
Message-Id: <3AFD56C3.31EF1FAC@execonn.com>

When trying to do a tar operation with the "*" wildcard for filenames,
tar returns that it is unable to find any files when called via the
system function.  I was finally able to make it work by using the
backtick operator instead.

Anyone have any idea why?

Thanks,

Marshall



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

Date: 12 May 2001 08:37:56 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Why do wildcards not work with system function?
Message-Id: <m17kzm1stn.fsf@halfdome.holdit.com>

>>>>> "Marshall" == Marshall Dudley <mdudley@execonn.com> writes:

Marshall> When trying to do a tar operation with the "*" wildcard for filenames,
Marshall> tar returns that it is unable to find any files when called via the
Marshall> system function.  I was finally able to make it work by using the
Marshall> backtick operator instead.

Marshall> Anyone have any idea why?

Using my crystal ball, I can predict that you were using the multi-arg
version of system().  When you do that, there's no shell involved, so
nobody expands the *'s.  Tar doesn't know *, except as a possible
filename character, and it can't find one of those, so it rightfully
complains.

Either use the single-arg version of system(), or expand your globs
using the glob() (or <>) operator.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 12 May 2001 15:16:21 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Write to file
Message-Id: <9djk45$nue$1@pegasus.csx.cam.ac.uk>

Uri Guttman  <uri@sysarch.com> wrote:
>
>hmm, it helps if you put the die clause on the open statement. i think
>assignment in perl will always work. :)

That particular example probably will.   But assignment in general can fail
in lots of ways.    And in any case, the criterion is "returns TRUE"
rather than "work".    And that aint so:

		$x = 0 or die;


Mike Guy


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

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


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