[12355] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5955 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 11 00:07:22 1999

Date: Thu, 10 Jun 99 21:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 10 Jun 1999     Volume: 8 Number: 5955

Today's topics:
        'data corruption' when forking. (??) leroy@mpi.com
    Re: **ANY HELP APPRECIATED******* (Abigail)
    Re: Afraid to ask about Y2K! (Steve Bean)
    Re: can't run a java App with my perl script using apac (Hasanuddin Tamir)
    Re: CGI and Access Database <jeff@vpservices.com>
    Re: cookie-monster.pl, a cookie scrambler. (Ronald J Kimball)
    Re: cookie-monster.pl, a cookie scrambler. (Eric Bohlman)
    Re: Documentation Writing was [Re: Perldoc and Perlfaq] (Eric Bohlman)
    Re: duplicate rows (Abigail)
    Re: Executing adduser? Follow Up. (Hasanuddin Tamir)
    Re: how do i fucking run perl w32 <johsieh@cisco.com>
        How do I split this string into an array of words:  CAR <s_shah@ix.netcom.com>
    Re: ie4 and perl...? <rootbeer@redcat.com>
    Re: indexing into a hash (Charles DeRykus)
    Re: Intersection of SEVERAL ( eg. 5 -> ) lists (Abigail)
    Re: matching function for array? (Abigail)
    Re: MIcrosofts Attack on Perl (Ilya Zakharevich)
    Re: Piping to script w/ command line arguments <kk>
    Re: quiz for perl professionals (Ronald J Kimball)
    Re: Require "No NT commands" on UNIX (Larry Rosler)
    Re: Retrieving email (Eric Bohlman)
    Re: Search and replace <outlaw_torn@mailexcite.com>
    Re: Sequently adding data to a hash with $x[x..x]??? (Ronald J Kimball)
    Re: Signal/sleep hidden interaction? (Charles DeRykus)
    Re: Substitution with functions (Hasanuddin Tamir)
    Re: Taking a Poll..... (Eric Bohlman)
        why short of 1 month ?? <eng80386@nus.edu.sg>
    Re: why short of 1 month ?? <tex@engsoc.carleton.ca>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 10 Jun 1999 22:50:13 GMT
From: leroy@mpi.com
Subject: 'data corruption' when forking. (??)
Message-Id: <7jpff1$ver$1@nnrp1.deja.com>

hi!
I have a program that does a great job, but does it slowly,
so trying to speed it up by forking children processes, I start
having lots of problems.

In principle this is simple.
You have a loop :
foreach $id (@universe) {
	@neighbourhood = select_neighbours($id);
	makeSummary($id,@neighbourhood); # will write unto disk
}

as 'makeSummary' takes a long time and I have a solaris machine with
8 cpus, I made a little package ("ProcessorPool") that manages a 'pool'
of (virtual) processors and allows to start some computation in a child
process. (I tested the package on a dumb problem and it went fine!)

$cpus = new ProcessorPool(6);
foreach $id (@universe) {
	@neighbourhood = select_neighbours($id);
	$cpus->runJob(\&makeSummary,$id,@neighbourhood);
}
$cpus->waitAllJobsCompletion;


Of course in my case, this is a bit more complicated :
both the 'select_neighbours' and 'makeSummary' subroutine
rely on connections to 2 Sybase database (via DBI), and some
perl/dbm/text-based databases (files).
So, just to make sure, I force the children processes to drop the
connections they inherit from the parent, and to reconnect to the 2
sybase databases and my perl/dbm/text-based 'databases'.

Unfortunately, for some strange reasons, the children get crazy.
They complain of uncomprehensible data and some of them go a long way in
swalling the 2Gb of RAM the machine offers.
After half a day of debugging, I understood that (for ununderstood
reasons) pieces of data (in the child) are overwritten on the child's
data. The compromised data is from the perl/dbm/text based data (not
Sybase).

Looks like the children are sharing some part of their memory (or the
whole), either between themselves, or with the parent. Nicely enough,
the parent has no problem.

Do any of you know anything about that ?
leroy@godot:~ >uname -a
SunOS godot 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-Enterprise
leroy@godot:~ >perl -v

This is perl, version 5.004_04 built for sun4-solaris

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.


The solution I adopted was to write a second script that would do the
makeSummary($id,@neighbourhood)
where this is read from a file :

$cpus = new ProcessorPool(6);
foreach $id (@universe) {
	@neighbourhood = select_neighbours($id);
	$cpus->runJob(\&spawnMakeSummary,$id,@neighbourhood);
}
$cpus->waitAllJobsCompletion;

spawnMakeSummary creates a file with $id and @neighbourhood
and exec-s to the 2nd script.
the 2nd script reads the file and runs the desired procedure.

But that does not satisfy my thirst for understanding.


Thank you for any clue or advice (please no too-obvious advice, I've
been on that the all day), and please Cc your messages to leroy@mpi.com.


thanks!!

christophe



-------------------------------------------------------------------+
Christophe Leroy, Millennium Predictive Medicine     leroy@mpi.com |
One Kendall Square, Bldg 700               Tel: +1 (617) 761 6981  |
Cambridge, MA 02139, U.S.A.                Fax: +1 (617) 577 3560  |
-------------------------------------------------------------------+
 We trained hard, but it seemed that every time we were beginning  |
 to form up into teams, we would be reorganized. I was to learn    |
 later in life that we tend to meet any new situation by           |
 reorganizing; and a wonderful method it can be for creating the   |
 illusion of progress while producing confusion, inefficiency,     |
 and demoralization.                                               |
                 Gaius Petronius Arbiter, 210 BC                   |
-------------------------------------------------------------------+



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 10 Jun 1999 19:35:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: **ANY HELP APPRECIATED*******
Message-Id: <slrn7m0mva.2fo.abigail@alexandra.delanet.com>

dmeyers@tisny.com (dmeyers@tisny.com) wrote on MMCIX September MCMXCIII
in <URL:news:7joto1$oao$1@nnrp1.deja.com>:
,, Can anyone suggest where I can find an Engineer with Javascript/C/UNIX
,, experience for a contract opportunity with a Fortune 1000 firm in San
,, Francisco, Ca?  Please contact dmeyers@tisny.com.  Thank you!


Try a homeless shelter. Or look at night under a bridge.



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Jun 1999 00:13:42 GMT
From: sbean@iex.net (Steve Bean)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <7jpkbm$sc5$1@news.iex.net>

In article <375b7df9@newsread3.dircon.co.uk>, gellyfish@gellyfish.com 
says...
>
>Steve Bean <sbean@iex.net> wrote:
>> But i WILL anyway.  I can't believe someof the flameout answers to good 
>> questions about Y2K in this section.  
>> 
>
>I cant believe that we have got to this stage in the game and
>people are still asking this question - what precisely is it that
>prevents from going to <http://www.deja.com> and searching for 'Y2K'
>in this group ? It found 6500 hits just now.
>
>/J\
>-- 
>Jonathan Stowe <jns@gellyfish.com>
>
This is exactly what I am talking about.  What the hell is deja.com?  And 
who are you to flame out at anybody.  It 's obvious that you are not 
responsible for Y2K.  I dismiss you and do not worry about you.

Steve Bean <sbean@iex.net>




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

Date: 11 Jun 1999 16:35:53 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: can't run a java App with my perl script using apache
Message-Id: <slrn7m0qr1.ctd.hasant@borg.intern.trabas.co.id>

On Thu, 10 Jun 1999 16:10:53 GMT,
nicolased@my-deja.com <nicolased@my-deja.com> wrote:
> I run a java application in my perl code using :
> system("java","ConsultServer");
> perl code alone run fine but when I put it in the cgi-bin of an apache
> Win 98 server.It don't work.

Then try to check the apache log server.
If it says something about perl, you
may comeback here.

HTH,

-- 
-hasan-
uhm, no more sig(h)


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

Date: 11 Jun 1999 01:05:05 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: CGI and Access Database
Message-Id: <37606031.14B7755A@vpservices.com>

Tom Phoenix wrote:
> 
> On Thu, 10 Jun 1999, Tom Renic wrote:
> 
> > My knowledge of CGI and perl is fairly limited. I have an Access
> > Database File that I want hooked up to a form, so that the responses
> > are added to the database. Is this possible?
> 
> If you can use the database from Perl, you can use it from a CGI program
> written in Perl, in general. If you're not sure how to access the
> database, check CPAN for a module which will help. If you're not sure how
> to write programs which implement the CGI protocol, check the CGI module.

Well technically, rootbeer is right that you *can* "have an Access
Database File hooked up to a form" and that CPAN has modules that would
help you do it.  BUT, please see the other thread in this newsgroup
right now and the one a few weeks ago, and the one a few weeks before
that which explain why you *should not* try to use Access in that
manner.

-- 
Jeff "Just Another Portland (rootbeer drinkin) Hacker" Zucker
jeff@vpservices.com


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

Date: Thu, 10 Jun 1999 21:38:14 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: cookie-monster.pl, a cookie scrambler.
Message-Id: <1dt7a6o.ywdnx61n1w2eoN@p38.tc1.metro.ma.tiac.com>

Larry Rosler <lr@hpl.hp.com> wrote:

> > @poschars_hex=("a" .. "f","1" .. "0");
> > @poschars_b64=("1" .. "0", "=", "/", "a" .. "z", "A" .. "Z");
> 
> I strongly doubt that that's what you want in the above lines.  And I
> don't mean the double-quotes where single-quotes would do.  :-)

Duh...  I was a bit careless in converting
"1","2","3","4","5","6","7","8","9","0" to use the range operator...

@poschars_hex=("a" .. "f","0" .. "9");
@poschars_b64=("0" .. "9", "=", "/", "a" .. "z", "A" .. "Z");

Thanks for catching that!


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 11 Jun 1999 02:19:22 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: cookie-monster.pl, a cookie scrambler.
Message-Id: <ebohlmanFD554A.1r8@netcom.com>

Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote:
: Larry Rosler <lr@hpl.hp.com> wrote:

: > > @poschars_hex=("a" .. "f","1" .. "0");
: > > @poschars_b64=("1" .. "0", "=", "/", "a" .. "z", "A" .. "Z");
: > 
: > I strongly doubt that that's what you want in the above lines.  And I
: > don't mean the double-quotes where single-quotes would do.  :-)

: Duh...  I was a bit careless in converting
: "1","2","3","4","5","6","7","8","9","0" to use the range operator...

: @poschars_hex=("a" .. "f","0" .. "9");
: @poschars_b64=("0" .. "9", "=", "/", "a" .. "z", "A" .. "Z");

: Thanks for catching that!

Let's count in hex: a, b, c, d, e, f, 0, 1...oops.



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

Date: Fri, 11 Jun 1999 02:38:21 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Documentation Writing was [Re: Perldoc and Perlfaq]
Message-Id: <ebohlmanFD55zx.3uH@netcom.com>

birgitt@my-deja.com wrote:
: I just wondered what the heck my brothers, cousins, fathers and uncles
: were thinking when they allowed that to happen. Who is in power of whom
: and what ? Why is it that documentation is very often neglected ? Is it
: lack of money, lack of the detailed insider knowledge of a software
: package by people other than the developers themselves or is it "on
: purpose" ? - Just shaking my head in disbelieve - . And I hear stories
: similar to that one from other companies...

I think the problem is that many, if not most, software development
projects spend much of their development stages in crisis mode, where most
of the human effort is devoted to "putting out fires."  Documentation,
especially programmer documentation rather than end-user documentation,
seldom has crises associated with it during the development cycle, so it
gets relatively little attention.

This is a special case of short-term thinking.  The benefits of good
maintenance documentation don't show up until well after the code has been
written, tested and installed, so there's a tendency to neglect it in
favor of activities whose benefits are more immediately visible. 
Performance evaluation practices can make this worse--programmers'
performance is usually judged according to measures like lines of code
written in a given time (ugh!), on-time delivery of executables, and the
like.  People being evaluated tend to focus their efforts on things that 
the boss considers important, and good maintenance documentation is 
seldom one of them.  In many cases, the programmer who wants to do a 
thorough job of maintenance documentation has to do it on his own time, 
which is not an attractive prospect in an industry where working 80-hour 
weeks is considered a badge of honor.

Poor documentation arises from many of the same causes as Y2K problems 
(but not Y2K problems in Perl!): "we don't have time to do it right the 
first time, but we have time to fix it later."



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

Date: 10 Jun 1999 19:05:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: duplicate rows
Message-Id: <slrn7m0l7l.2fo.abigail@alexandra.delanet.com>

Raj (technology@workmail.com) wrote on MMCIX September MCMXCIII in
<URL:news:375F0058.459D9D9E@workmail.com>:
() how do i eliminate duplcate rows in a textfield which has say..only one
() column
() ASAP....please  ! TIA


If it's that urgent, you shouldn't waste your time posting on
usenet, not knowing when (or even if) you get an answer.

RTFFAQ instead.



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Jun 1999 16:36:02 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Executing adduser? Follow Up.
Message-Id: <slrn7m0r0o.ctd.hasant@borg.intern.trabas.co.id>

On Thu, 10 Jun 1999 12:11:58 -0400, Toby <@utk.edu> wrote:
> Isn't this chomp here to get rid of potential newlines?
[snip]

Actually for whatever $/ contains.

-- 
-hasan-
uhm, no more sig(h)


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

Date: Thu, 10 Jun 1999 17:59:11 -0700
From: Joseph Hsieh <johsieh@cisco.com>
Subject: Re: how do i fucking run perl w32
Message-Id: <37605F5F.12021FF8@cisco.com>


> > > i just got ActivePerl517. when i run any of the sample scripts, the dos
> > > window opens quickly then closes. i don't know what the programs do or how
> > > to run my own programs. can somebody help me please.

Run the scripts from Command prompt. Then you just type: perl script.pl
(and include any of the switches if you need to, consult a reference
book, manpages for more info)


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

Date: Thu, 10 Jun 1999 22:37:35 -0500
From: "Snehanshu Shah" <s_shah@ix.netcom.com>
Subject: How do I split this string into an array of words:  CAR, DOG, "PIG,4", 5  split into  ('CAR', 'DOG', 'PIG,4', '5')  ?
Message-Id: <7jq0hu$9rs@sjx-ixn5.ix.netcom.com>

How do I split this string into array words using :

    CAR, DOG, "PIG,4", 5 => ('CAR', 'DOG', 'PIG,4', '5')

I tried using split(',' , CAR, DOG, "PIG,4", 5 ) but that separate the word
"PIG,4" into 2 words '"PIG' and '4"'








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

Date: Thu, 10 Jun 1999 18:01:26 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: ie4 and perl...?
Message-Id: <Pine.GSO.4.02A.9906101801060.26349-100000@user2.teleport.com>

On Thu, 10 Jun 1999, Jason Sova wrote:

> But when running ie4 as my browser when displaying
> a page from the perl all the HTML is messed up. 

If you're following the proper protocol but some browser or server doesn't
cooperate, then it's the other program's fault. If you're not following
the protocol, then it's your fault. If you aren't sure about the protocol,
you should read the protocol specification. If you've read it and you're
still not sure, you should ask in a newsgroup about the protocol.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 11 Jun 1999 00:30:30 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: indexing into a hash
Message-Id: <FD502u.Lt8@news.boeing.com>

In article <375EDA53.2FD8C1C7@sismicro.com>,
Jim Keefer  <jim@sismicro.com> wrote:
>Since perl implements a hash as two parallel arrays, is there a way I
>can index into a hash?
>
>I need the speed of a hash key look up, but I also need to be able to
>get the hash key from an integer index.  Currently, I have a hash with a
>string key and integer (index) value, and an array based on these
>indexes which also stores the string.  This gives me the fuctionality I
>want.  But I have some pretty large arrays of strings, which I am
>storing twice because of this arrangement.  It would save time and a lot
>of space if I could store it once in a hash, but still be able to access
>the hash either by string key to get the index, or get the hash key by
>using an integer index.
>

Here's a possibility for setting up the pseudo-hash 
which was suggested:


require 5.005;
my @strings = qw/FOO BAR BAZ/;
my $struct = [{}];
my $index  = 0;
foreach my $string (@strings) {
     ${$struct->[0]}{$string} = ++$index;
     $struct->[$index] = $string;
}

Now, you can say either:

$struct->{FOO} = FOO
$struct->[1] = FOO
 ...


hth,
--
Charles DeRykus


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

Date: 10 Jun 1999 18:20:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Intersection of SEVERAL ( eg. 5 -> ) lists
Message-Id: <slrn7m0ii8.2fo.abigail@alexandra.delanet.com>

Thomas Weholt (u970130@studbo.hit.no) wrote on MMCVIII September MCMXCIII
in <URL:news:375ecd74.1841552@news1.c2i.net>:
:: Hi,
:: 
:: Perhaps I didn`t make it clear that I need to compute the intersection
:: of more than 4-5 lists, often 10-12. And this varies. 


And the intersection of 10-12 requires a different algorithm than 
the intersection of 4-5 lists, because....... ?



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Jun 1999 19:13:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: matching function for array?
Message-Id: <slrn7m0llc.2fo.abigail@alexandra.delanet.com>

OPENLINX (openlinx@openlinx.net) wrote on MMCIX September MCMXCIII in
<URL:news:375F46BA.93CB5D6A@openlinx.net>:
'' Is there a function that match an element in a given array?


RTFFAQ.


Abigail
-- 
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Jun 1999 01:53:52 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: MIcrosofts Attack on Perl
Message-Id: <7jpq7g$7g7$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Phoenix 
<rootbeer@redcat.com>],
who wrote in article <Pine.GSO.4.02A.9906101744050.26349-100000@user2.teleport.com>:
> > An answer to this post would be very much appreciated as I am one of
> > the "few" who would actively participate in "movements" to counteract
> > the negative force of "inforced capatilism".
> 
> It's good to know that you and others are ready to throw yourself upon a
> grenade, if need be, for the good of Perl. 

And to throw yourself is *so* easy: subscribe to p5p, read the archive
for the last several weeks to get yourself aquainted with how things
are done, and start fixing problems of Perl.

You do not even need M$ to egg you on for this.  ;-)

> Speaking only for myself, I'd say that you can restrain from heroic
> measures for the time being.

Except as noted above.

Ilya


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

Date: Thu, 10 Jun 1999 21:53:22 -0400
From: <kk>
Subject: Re: Piping to script w/ command line arguments
Message-Id: <37606af8@news3.us.ibm.net>

use <STDIN> to get piped input, and @ARGV for command line.
DAvid zADE
dzade@ibm.net
d_dave@my-deja.com wrote in message <7jpep2$v61$1@nnrp1.deja.com>...
>this is basically what i want to do on the commandline:
>
>% echo "dog" | ./perlscript option1 option2
>
>anyone know how to distinguish between the piped info and the command
>line args?
>
>So far Ive been able to distiguish the arguments by using the @ARGV
>indicator but i havent been able to access the piped argument. Using <>
>returns errors for the command line args but returns the piped args.
>
>dave
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.




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

Date: Thu, 10 Jun 1999 21:38:15 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: quiz for perl professionals
Message-Id: <1dt7c3q.wsx1qmc3vdn5N@p38.tc1.metro.ma.tiac.com>

Kiriakos Georgiou <kgnews@olympiakos.com> wrote:

> How do you find the length of an array?

length('an array');


> In the context of regular expressions, what does \S+ stand for ?

Freedom and democracy.


> How would you count the number of words in a string?
>   (split it and use scalar context on the array)

Umm...  Split it and use scalar context on the array?
  (just a guess)


> What does 'eval' do?

Just about everything perl does, only later.


> Why wouldn't you want to put an eval in a loop?

Why do you assume I wouldn't want to put eval in a loop?


> How would you get around the problem in the previous question?

I would distract you by pointing out the window and while your back was
turned I would eat the paper with test questions.


> What will    $_ = eval 'sub { print @_; }';   print?

It will print the same thing as

print exit, "Hello world!\n";


> what does it do?

I just told you, it prints the same thing as

print exit, "Hello world!\n";


> what will  &$_(1,2,3);   do?

It will not print the same thing as

print exit, "Hello world!\n";


> What is the difference between 'local' and 'my'?

print 'local' - 'my', "\n";
0


> How do you pass parameters by value?

I pass the parameters to worth, and then worth passes the parameters to
value, and then value passes the parameters to cost, and then cost
passes the parameters to you.


> How do you pass parameters by reference?

This time I pass the parameters to indication, and then indication
passes the parameters to reference, and then reference passes the
parameters to allusion, and allusion passes the parameters to you.


> Can you describe what the taint mode does?  Can you name of any ways for
> untainting tainted data?

Taint mode has very little to do with printing the same thing as

print exit, "Hello world!\n";

Can you name of any ways for tainting untainted data?



-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 10 Jun 1999 18:23:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Require "No NT commands" on UNIX
Message-Id: <MPG.11ca04d79cac0bf9989bbc@nntp.hpl.hp.com>

In article <929059463.22446@www2.remarq.com> on Thu, 10 Jun 1999 
16:04:21 -0800, Ashish Kadakia <anonymous@web.remarq.com> says...
> Currently I cannot run web server on that UNIX machine,
> also the perticular command that I am looking for
> is "gunzip". In future, I may look for some other commands.
> language.perl.com/ppt doesn't have gunzip.

Download an evaluation version of WinZip from 
<URL:http://www.winzip.com> .

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 11 Jun 1999 02:51:59 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Retrieving email
Message-Id: <ebohlmanFD56Mn.588@netcom.com>

Neil Prater (neil.prater@ype.gmpt.gmeds.com) wrote:
: I am writing a perl script to retrieve email and do specific
: things with it according to subject. I am current using
: Mail:POP3Client module and all is fine except when I go to
: use the Retrieve function. It returns both the head and body
: as expected, but it looses the formating of the message.
: Everything is then dumped into one line.. Some direction is
: certainly apprectiated.

My guess is that the body of the mail in question really does consist of
just one long line, but your newsreader hides this from you by wrapping it
when it shows the message to you.  This is unfortunately quite common
nowadays with people sending mail from half-assed "mailers"  embedded in
Web browsers. 

If this is the case, Text::Wrap will probably be quite helpful.



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

Date: Thu, 10 Jun 1999 23:36:13 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: Re: Search and replace
Message-Id: <7jpi5c$fu$1@nnrp1.deja.com>

I'd try some code that goes something like this:

open (IN, "infile");
@file = <IN>;
close (IN);

open (OUT, "outfile");
foreach $line (@file) {
	if ($line !~ /First/ && $line !~ /Last/) {
		print OUT $line;
		}
	}
close (OUT);

That should do...although if the Server line happens to contain First or
Last then there could be some hassles.

In article <7jot06$o1u$1@nnrp1.deja.com>,
  jhagerty@my-deja.com wrote:
> Sorry for the newbie but I can't get something figured out.  I want to
> do a search and replace on a text file.  More accurately I want to
trim
> out a bunch if lines.  Here's a sample
>
> First        Joe
> Last         Hagerty
> Server       Temp_FS
>
> I want to make both of those lines go away.  I'd like to find First
and
> delete until Server to end up with:
>
> Server       Temp_FS
>
> Is there a way to make s/ / / do this?
>
> Thanks a ton!!!!
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 10 Jun 1999 21:38:16 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Sequently adding data to a hash with $x[x..x]???
Message-Id: <1dt7d1s.155n393nxfae2N@p38.tc1.metro.ma.tiac.com>

Larry Rosler <lr@hpl.hp.com> wrote:

> In article <7jmrh6$jau@cypress.nwnet.net> on 9 Jun 1999 15:57:42 -0700,
> Dean Hudson <deanh@nwnet.net> says...
> ...
> >     /^[^,]+,[^,]+/g;      # step past 1 & 2
> >     while ( /([^,]+),([^,]+)/g ) {      # grab a pair
> >         $hsh{$1} = $2;      # assign to %hsh
> >     }
> ...
> > Note that it's stepping past the first two values with the first regex
> > and it's using /g to stay in the right spot on each line.
> 
> That is somewhat surprising.  I thought that every 'm//g' expression had
> its own value for the position iterator.  But evidently *identical* 
> expressions share an interator, which means they are compiled into 
> references to the same pattern.  (Though these aren't even identical, in
> that one is anchored and the other isn't, and one captures while the 
> other doesn't.)
> 
> I can't find any documentation of this behavior in perlop or perlre.  Is
> my understanding correct, and is this the way one would expect it to 
> work?

perlop:

    In scalar context, each execution of m//g finds the next match,
    returning TRUE if it matches, and FALSE if there is no further
    match. The position after the last match can be read or set using
    the pos() function; see pos in the perlfunc manpage.   A failed
    match normally resets the search position to the beginning of the
    string, but you can avoid that by adding the /c modifier (e.g.
    m//gc).  Modifying the target string also resets the search
    position.


Note that _a failed match_ resets the search position.  A successful
match, or a failed match when /c is used, does not reset the search
position.


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: Fri, 11 Jun 1999 01:18:26 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Signal/sleep hidden interaction?
Message-Id: <FD52Aq.D9y@news.boeing.com>

In article <7jp9j1$t4l$1@nnrp1.deja.com>,  <dhosek@quixote.com> wrote:
>
>I've actually come up with a better diagnosis of what's going on: The
>sighup works the first time, but the second time it doesn't respond to
>any signal but kill -9 (and yes, I'm using the correct pid).
>

Still strange. Perhaps the OS or Perl version... ? 

The following worked on Solaris 2.6 with both 5.004_04
and 5.005_02:

use POSIX;

$pid = fork;
exit if $pid;
die "couldn't fork: $!" unless defined $pid;
POSIX::setsid()
    or die "can't start a new session: $!";
my $hup;
while (1) {
   local $SIG{HUP} = sub { $hup++ };
   warn "restarting...\n" and $hup=0 if $hup;
   sleep 50;
   eval {
       local $SIG{ALRM} = sub { die "timeout" };
       open (PING, "ping localhost 1 |") or die $!;
       alarm 10;
       $responses=0;
       $responses++ while (<PING>);
       alarm(0);
   };
   if    ($@ =~ /^hup/)     { die "got a hup\n" } 
   elsif ($@ =~ /^timeout/) { warn "got a timeout\n"; next; } 
   elsif ($@)               { die $@ }
} 
__END__



hth,
--
Charles DeRykus


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

Date: 11 Jun 1999 16:36:12 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Substitution with functions
Message-Id: <slrn7m0rg9.ctd.hasant@borg.intern.trabas.co.id>

On Thu, 10 Jun 1999 09:41:27 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
> In article <fa2oj7.b95.ln@magna.metronet.com> on Thu, 10 Jun 1999 
> 05:59:43 -0400, Tad McClellan <tadmc@metronet.com> says...
> > Herve Foucher (Herve.Foucher___NO_SPAM@helio.org) wrote:
> ...
> > : >    $a_string =~ s/##(\w+)#/&MyPerlFunction($1)/ge;
> > 
> > : It works! But I prefer using $&
> > : Why do you use $1 ?
> ...
> >    So the answer to your question is:   It is faster.
> 
> Isn't there a better answer than that?  'It is correct.'
> 
> 'xyz##whatever#pdq' =~ /##(\w+)#/;
> 
> The value of $& is '##whatever#', but the value of $1 is 'whatever'.
> 

And I like it too.
Beside, it has more siblings than $& does :-)

-- 
-hasan-
uhm, no more sig(h)


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

Date: Fri, 11 Jun 1999 02:46:54 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Taking a Poll.....
Message-Id: <ebohlmanFD56E6.4r7@netcom.com>

rkidd@luc.edu wrote:
: and I need your assistance. I plan on teaching myself Perl but I don't
: know which book to use. If you have and suggestions please email me at
: rkidd@luc.edu. Thank you. By the way I am a CS major with a background
: in C++.

Start by reading Perl's excellent documentation (which comes free with
every distribution).  If you find yourself a little (or more than a
little!) disoriented, then you should probably start with _Learning Perl_
(mentioned in another response).  If, OTOH, you find yourself breezing
through the documentation, then you should probably choose between
_Programming Perl_ (if you want something that resembles the documentation
but goes into more detail), _The Perl Cookbook_ (if you're the sort who
learns best by getting your hands on some working code, reading it and
playing around with it), or possibly even _Advanced Perl Programming_ (if
your interests lie especially in the topics covered there).  Once you've 
become moderately proficient in Perl, you should consider _Effective Perl 
Programming_.

Details on all the books mentioned are available in the perlbook manpage 
that's part of Perl's documentation.




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

Date: Fri, 11 Jun 1999 10:13:34 +0800
From: "NCB" <eng80386@nus.edu.sg>
Subject: why short of 1 month ??
Message-Id: <7jprtd$rb6$1@newton.pacific.net.sg>

Hi all ,
Given

    ($sec ,$min,$hr,$mntdy,$mon,$yr,$wk,$yrdy,$stm)=localtime;

why is the variable  $mon which stands for month always slower by 1 month ??

Thanks




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

Date: 11 Jun 1999 03:09:45 GMT
From: Clayton L. Scott <tex@engsoc.carleton.ca>
Subject: Re: why short of 1 month ??
Message-Id: <7jpulp$ib4$2@bertrand.ccs.carleton.ca>

You, yes you, NCB. Stop writing crap like this:
: Hi all ,
: Given

:     ($sec ,$min,$hr,$mntdy,$mon,$yr,$wk,$yrdy,$stm)=localtime;

: why is the variable  $mon which stands for month always slower by 1 month ??

	It counts starting at 0. So 0 in January and 11 is December.


/tex
-- 
Warning: Dates on Calendar are closer than they appear.


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5955
**************************************

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