[9459] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3055 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 3 16:17:01 1998

Date: Fri, 3 Jul 98 13:11:51 -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           Fri, 3 Jul 1998     Volume: 8 Number: 3055

Today's topics:
        ANNOUNCE: Proc::Background 0.02 (Blair Zajac)
    Re: beginner looking for example perl scripts (Sitaram Chamarty)
    Re: beginner looking for example perl scripts <tchrist@mox.perl.com>
    Re: beginner looking for example perl scripts (Sitaram Chamarty)
        editing a file properly... <alcazar@netcomp.net>
        function prototypes <acornet@emory.edu>
        Looking for Perl-Script to configure Sendmail <Andreas.Heinboke@stud.uni-hannover.de>
    Re: Vertical Perl <mgregory@asc.sps.mot.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Jul 1998 19:40:40 GMT
From: blair@gobi.gps.caltech.edu (Blair Zajac)
Subject: ANNOUNCE: Proc::Background 0.02
Message-Id: <6njc3o$9rt@gap.cco.caltech.edu>

I'm happy to announce the first release of Proc::Background 0.02.

>From the README:

This is the Proc::Generic package.  It provides a generic interface to
running background processes.  Through this interface, users can run
background processes on different operating systems without concerning
themselves about the specifics of doing this.  Users of this package
create new Proc::Generic objects that provide an object oriented
interface to process management.  The following methods are provided
to users of the Proc::Generic package:

	new:        start a new background process.
	alive:      test to see if the process is still alive.
	die:        reliably try to kill the process.
	wait:       wait for the process to exit and return the exit status.
	start_time: return the time that the process started.
	end_time:   return the time when the exit status was retrieved.

A generic function, timed_system, is also included that lets a
background process run for a specified amount of time, and if the
process did not exit, then the process is killed.

This package currently works on both Unix and Win32 platforms.  Users
of this package on Win32 systems needs to install the libwin32-?.??
package by Gurusamy Sarathy (gsar@umich.edu) available from CPAN.

AVAILABILITY

The latest version of this package is available for download from a CPAN
(Comprehensive Perl Archive Network) site near your at

        http://www.perl.com/CPAN/authors/id/B/BZ/BZAJAC/

or from my FTP site:

        ftp://ftp.gps.caltech.edu/pub/blair/Perl/

INSTALLATION

In order to use this package you will need Perl version 5.004_04 or
better.

If you are running on a Windows 95, Windows 98, or Windows NT
system, then first install the latest libwin32-x.x package from CPAN
available as CPAN/authors/id/GSAR/libwin32-x.x.zip or
CPAN/authors/id/GSAR/libwin32-x.x.tar.gz.

Once that is completed, you install Proc::Generic as you would install
any perl module library, by running these commands:

	perl Makefile.PL
	make
	make test
	make install

You can edit the configuration section of Makefile.PL to select which
programs to install in addition to the library itself.  If you don't
want to install any programs (only the library files) and don't want
to mess with the Makefile.PL then pass the '-n' option to Makefile.PL:

	perl Makefile.PL -n

If you want to install a private copy of this package in some other
directory, then you should try to produce the initial Makefile with
something like this command:

	perl Makefile.PL LIB=~/perl

DOCUMENTATION

See the CHANGES file for a list of recent changes.  POD style
documentation is included in all modules and scripts.  These are
normally converted to manual pages end installed as part of the "make
install" process.  You should also be able to use the 'perldoc'
utility to extract documentation from the module files directly.

AUTHOR, COMMENTS AND BUGS

I welcome all comments and bug reports.  Please email them to
Blair Zajac <blair@gps.caltech.edu>.

COPYRIGHT

Copyright (c) 1998 by Blair Zajac.  All rights reserved.  This package
is free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
--
Dr. Blair Zajac			Division of Geological and Planetary Sciences
blair@gps.caltech.edu		California Institute of Technology
(626) 583-6729, FAX: 583-7827	252-21, Pasadena, CA 91125


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

Date: 3 Jul 98 19:21:38 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: beginner looking for example perl scripts
Message-Id: <slrn6pqbij.7tj.sitaram@ltusitaram.diac.com>

On 3 Jul 98 18:32:54 GMT, Sitaram Chamarty <sitaram@diac.com> wrote:

 ...and of course it serves me right for trying to point out an
error in Tom's code :-) but what I had doesnt work either.  It
loses the directory information...

The simple fix, on my system, is to use the full $File::Find::name
in the assignment to %time and %stat inside &wanted.

But I still havent figured out why the original code doesnt work
right *on my system* - even though looks right.  My Perl is
reasonably recent (5.004_04) too...

Anyway - apologies to Tom for the previous post!

>On 29 Jun 1998 17:22:05 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>>#!/usr/bin/perl
>># lst - list sorted directory contents (depth first)
>
>[snip]
>
>Wow - thanks!
>
>May I suggest a minor patch?  The aliasing for $name and $_ should
>be independant of $opt_i, IMHO, since a plain
>    lst.pl -l
>gets just the "." entry, with the info for the last file found by
>find.pm, and not that for "." itself.
>
>    --- lst.pl	Fri Jul  3 12:15:58 1998
>    +++ lst.pl	Fri Jul  3 12:15:53 1998
>    @@ -40,14 +40,15 @@
>     
>     *name = \$File::Find::name;  # forcibly import that variable
>     
>     # the $opt_i flag tricks wanted into taking
>     # its filenames from ARGV instead of being
>    +#                    ^^^^ should be STDIN, maybe??
>     # called from find.
>     
>    +*name = *_;  # $name now alias for $_
>     if ($opt_i) {
>    -     *name = *_;  # $name now alias for $_
>          while (<>) { chomp; &wanted; }   # ok, not stdin really
>     }  else {
>         find(\&wanted, @ARGV);
>     }


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

Date: 3 Jul 1998 19:23:17 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: beginner looking for example perl scripts
Message-Id: <6njb35$30h$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    sitaram@diac.com (Sitaram Chamarty) writes:
:The simple fix, on my system, is to use the full $File::Find::name
:in the assignment to %time and %stat inside &wanted.

You can't do a partial import on something that's local()ized as $name
is within File::Find.  You have to get the whole thing.  that's

    *name = \$File::Find::name;

fails, but 

    *name = *File::Find::name;

works fine. 

--tom
-- 
``I do quarrel with logic that says, `Stupid people are associated with X,
  therefore X is stupid.'  Stupid people are associated with everything.''
	--Larry Wall in <1992Dec31.203724.26018@netlabs.com>


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

Date: 3 Jul 98 20:01:01 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: beginner looking for example perl scripts
Message-Id: <slrn6pqdqt.866.sitaram@ltusitaram.diac.com>

On 3 Jul 98 19:21:38 GMT, Sitaram Chamarty <sitaram@diac.com> wrote:

Every time find descends into a subdir, it's allocating a new
$name, (checked by printing \$File::Find::name inside &wanted).
Since the aliasing is done once at the start, \$main::name has the
original value...

Can someone confirm this behaviour?

No time to fix...gotta go!

>On 3 Jul 98 18:32:54 GMT, Sitaram Chamarty <sitaram@diac.com> wrote:
>
>...and of course it serves me right for trying to point out an
>error in Tom's code :-) but what I had doesnt work either.  It
>loses the directory information...
>
>The simple fix, on my system, is to use the full $File::Find::name
>in the assignment to %time and %stat inside &wanted.
>
>But I still havent figured out why the original code doesnt work
>right *on my system* - even though looks right.  My Perl is
>reasonably recent (5.004_04) too...
>
>Anyway - apologies to Tom for the previous post!
>
>>On 29 Jun 1998 17:22:05 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
>>
>>>#!/usr/bin/perl
>>># lst - list sorted directory contents (depth first)
>>
>>[snip]
>>
>>Wow - thanks!
[snip]


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

Date: Fri, 3 Jul 1998 14:32:17 -0500
From: "Ric Alcazar" <alcazar@netcomp.net>
Subject: editing a file properly...
Message-Id: <uFW#5krp9GA.185@upnetnews03>

    Hello all,

    I'm trying to edit a file, but am not doing it properly...  my file is
similiar to this example:

line1 - and some contents
line2 - and some more contents
line3 - and some more contents
line4 - blah blah blah
 ...
 ...

    the way I'm doing it, (which btw doesn't seem to be working efficiently)
is reading a each line into an array, and performing modifications on each
of the elements and then truncating to the existing file.

    that seems to work, however, it doesn't achieve the result I am looking
for.
    The modification I would like to do is the same for each of the lines,
that is, I'm trying to delete them.  For instance, say I wanted to delete
line3, all i have to do is remove the contents of the corresponding array
element and then print out the array elements accordingly.  The only problem
is that I get something that looks like this:

line1 - and some contents
line2 - and some contents

line4 - ...
 ...
 ...

    There is a blank line where the 3rd line should be... what I'm really
trying to achieve is this:

line1 -- and some contents
line2 - and some contents
line4 - and some contents.
 ... ...

     can somone help me with a solution?

    Thank you very much.
    Ric.




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

Date: Fri, 03 Jul 1998 14:49:03 -0400
From: Ben Cornett <acornet@emory.edu>
Subject: function prototypes
Message-Id: <359D279F.41C6@emory.edu>

A question concerning function prototypes:

sub f1($$);
$a = "one";
$b = "two";

f1 ($a, $b);

print "$a $b\n";

sub f1
{
  $_[0]="ONE";
  $_[1]="TWO";
}

*******************

the above produces "ONE TWO" as I would expect,
however, if f1 is prototyped as f1(\$\$) instead I get "one two";
similarly, f1(\$$) yields "one TWO"
I thought '\$' merely forced the argument to begin with a '$'
why does it prevent f1 from modifying its arguments?
any thoughts on this will be appreciated,

ben


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

Date: Fri, 03 Jul 1998 21:06:33 +0200
From: Andreas Heinbokel <Andreas.Heinboke@stud.uni-hannover.de>
Subject: Looking for Perl-Script to configure Sendmail
Message-Id: <359D2BB9.8AFD490@stud.uni-hannover.de>

I heard from HP, that there exists a perl-script by which I can
configure sendmail for my system. The script shall be interactive asking
me all necessary questions and after this creating my
sendmail-configuration file.
Does anybody knows where I can find this script?



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

Date: 03 Jul 1998 13:58:48 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Vertical Perl
Message-Id: <r8lnqbblrz.fsf@asc.sps.mot.com>

Tushar Samant <scribble@pobox.com> writes:

> Or if you are a lowlife who lives for coarse buffoonery alone ...
> 
> for (@lines = map {chomp; $max = length if $max < length; $_} <>)
>                 {undef substr $_.=' 'x$max,$max}
> print map "$_\n", reverse map {join '', map chop, @lines} 1..$max

Its pretty disgusting.  It works.  

I don't understand the second line (body of the for()).... what is
that doing?



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 3055
**************************************

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