[10759] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4360 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 4 15:07:21 1998

Date: Fri, 4 Dec 98 12:00:21 -0800
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, 4 Dec 1998     Volume: 8 Number: 4360

Today's topics:
    Re: "insecure" variables?   (123) (I R A Aggie)
        \\desired old perl 0.1.8 patch level 36// <ghealton@hiway1.exit109.com>
    Re: auto submitting a form? (Andrew M. Langmead)
    Re: big problem with Perl's time() limitations (Ilya Zakharevich)
    Re: Fast way to produce block of random bytes? (Ilya Zakharevich)
    Re: Fastest way to search through an array? <uri@fastengines.com>
    Re: Is it possible to mix locale and Perl? (Ilya Zakharevich)
        java servlets vs imbedded mod_perl for servers <ptrainor@title14.com>
    Re: java servlets vs imbedded mod_perl for servers (Erik)
    Re: localtime () - perl's  bug ? (Erik)
    Re: New idiom? (Sean McAfee)
        Newbie need help to run Makefile by using script <yt@cs.purdue.edu>
    Re: Newbie needs help with regex in perl script! <conmara@tcon.net>
    Re: Newbie needs help with regex in perl script! (Tad McClellan)
    Re: Newbie needs help with regex in perl script! <nospam23_skidoo@geocities.com>
    Re: Newbie needs help with regex in perl script! (Brand Hilton)
    Re: Newbie needs help with regex in perl script! <jeff@vpservices.com>
        perl and berkeley db->get??? <mike@laserlink.net>
    Re: perl and berkeley db->get??? (Erik)
        Petition: The US Gov't Should Evaluate Open Source soft (Clay Shirky)
        Removing a line... <alcazar@netcomp.net>
    Re: Removing a line... (Tad McClellan)
        socket data ??? <kak@cisco.com>
    Re: Tool to reverse engineer perl code drkeith@bway.net
    Re: wantarray() question. <uri@fastengines.com>
    Re: When does CLOSE not FLUSH? (Bart Lateur)
    Re: When does CLOSE not FLUSH? <uri@fastengines.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 04 Dec 1998 14:35:35 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: "insecure" variables?   (123)
Message-Id: <fl_aggie-0412981435350001@aggie.coaps.fsu.edu>

In article <Pine.SUN.4.05.9812040833560.9223-100000@coyote.rain.org>, Nick
Halloway <snowe@rain.org> wrote:

+ It bombs like this:

+ procmail: Executing "modenv_test,/home/snowe/submission"
+ Insecure $ENV{PATH} while running setgid at 

+ `env >>/home/members/w/wesson9/junk1`;

Oh, you bet that's insecure. Obviously, tainting is turned on (as it
should be with a set(g|u)id program), so you should turn the 'perldoc
perlsec' to help with the untainting.

Hint: which "env" are you getting?
Hint: set $ENV{PATH} in the script

+ What does "running setgid" mean?  Does it mean the process doesn't have
+ a user ID assigned, only a group ID?

Not quite. As I understand it, its a script that allows a user to pretend
momentarily that they're part of a particular group. The user is
probably your Mail Transport Agent (sendmail, etc). Its probably trying
to pretend that its in your group, so that you can access any files it
happens to create.
 
+ Can I get a /bin/sh script to tell me what user ID it's using?

'id' works for me. It may be an SGI-ism.

+ Is the lack of a user ID what would cause those "insecure variable" 
+ messages?

Nah, your getting that because of taint checking in perl.

James


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

Date: 4 Dec 1998 19:42:56 GMT
From: Gilbert C Healton <ghealton@hiway1.exit109.com>
Subject: \\desired old perl 0.1.8 patch level 36//
Message-Id: <749e00$jdr$1@news1.exit109.com>



YeS, I know its old, but... another department is using perl 
4.0.1.8 patch level 36 in production on an NCR UNIX machine and
I would like to get a hold of the source to reinstall that particualr
source release.

I've been looking at the various CPAN sites and can only find 4.036,
the last version. Anyone know where I can get this old thing?



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

Date: Fri, 4 Dec 1998 18:59:18 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: auto submitting a form?
Message-Id: <F3GFEu.6pG@world.std.com>

The Irishman <doconner@copper.ucs.indiana.edu> writes:

>Is it possible for perl to auto submit forms?

Take a look at the LWP module on
CPAN. <URL:http://www.perl.com/cgi-bin/cpan_mod?module=LWP>

If the documentation that comes with the module is not sufficient,
then you might want to pick up the book "Web Client Programming with
Perl" <URL:http://www.oreilly.com/catalog/webclient/>
-- 
Andrew Langmead


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

Date: 4 Dec 1998 18:11:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: big problem with Perl's time() limitations
Message-Id: <7498kj$23d$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Sean McAfee
<mcafee@waits.facilities.med.umich.edu>],
who wrote in article <jpU92.115$4w2.416293@news.itd.umich.edu>:
> In article <366907c9.17179022@news.mediaways.net>,
> Andreas Schildbach <andreas.schildbach@rkdnet.de> wrote:
> >I've got a problem with Perl's time()-format limitations, mainly being
> >able to express only dates starting at 1.1.1970.
> 
> This isn't true; although it doesn't meet all of the conditions you specify
> below, you can get dates before 1970 by using negative numbers.  Try this:
> 
> perl -le 'print scalar localtime(-2**30)'

Do not try to push your system idiosyncrasies to us all.

  perl -le "print scalar localtime(-2**30)"
  Thu Jan 28 11:51:12 2072

Btw, I think Solaris 7 allows you to have 64-bit time, so one may have
a sane time *today* on Unixish systems too, not only on mainframes.

Ilya


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

Date: 4 Dec 1998 18:06:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Fast way to produce block of random bytes?
Message-Id: <7498b0$1od$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Zenin 
<zenin@bawdycaste.org>],
who wrote in article <912762823.648234@thrush.omix.com>:
> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> 	>snip<
> : You cannot use rand() because it is not random.  Until perl reads from
> : /dev/random, the maximum you can expect is to get 2, maybe 4 random
> : bytes from Perl.
> 
> 	Or uses random(3), which more system have, along with srandomdev(3)
> 	if available (eg, has /dev/random).

Say, on my system (EMX on OS/2) Perl uses random().  It is a BSD
random() which has only twice as many bits as rand().  I think you are
confused.

Ilya


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

Date: 04 Dec 1998 13:12:06 -0500
From: Uri Guttman <uri@fastengines.com>
To: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Fastest way to search through an array?
Message-Id: <3990gn7p55.fsf@fastengines.com>

>>>>> "EB" == Eric Bohlman <ebohlman@netcom.com> writes:

  EB> sub compare_pop_users {
  EB>   my %temp = map {$_,1} @master_list;

or an idiom i like better:

@temp{ @master_list } = (1) x @master_list ;

  EB>   @temp[@pop_user] = 1 x @pop_user;
             ^         ^   ^
should be {}               ^
                           ^
should be (1)        >>>>  ^


  EB>   @master_list = keys %temp;
  EB> }


hth,

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ibnets.com	


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

Date: 4 Dec 1998 18:02:51 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Is it possible to mix locale and Perl?
Message-Id: <74984b$1he$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Jarkko Hietaniemi 
<jhi@alpha.hut.fi>],
who wrote in article <oeebtlk2tol.fsf@alpha.hut.fi>:
> > Stop spreading this disinfo around!  Perl has no viable locale support.
> > 
> > There is a *kludge* "use locale" which may - by coincidence - work in
> > some situations.  But it is nothing more than a coincidence.
> > 
> > Try mixing 'use locale' with 'use Text::ParseWords'.
> 
> I tried that.  It works.  Could you show us a concrete example, please,
> instead of FUDing?

Make you parse locale-specific.  Use [^\w\s/-"'.,] as a delimiter.

Ilya


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

Date: Fri, 4 Dec 1998 14:57:45 -0500
From: Pat Trainor <ptrainor@title14.com>
Subject: java servlets vs imbedded mod_perl for servers
Message-Id: <Pine.LNX.3.96.981204145012.23067B-100000@aura>


Greets Perl Jockies..

	I'm "down" with thte language (thanks to the regulars here!) 
so please don't bash me for a more general question concerning perl..

	I had a discussion with a tech who is writing in java for an intranet
server and he said that perl is way too wasteful what with spawned
processes to be considered for a large/intense project.
	I hate Sun & Java*, and all it stands for, but I was hard pressed
for anything substantial in perl's defense.. I am designing a system now
that uses perl as a compiled wedge in several of the 15 'areas' of apache
to allow perl-ish processing without the CGI-ish overhead. 
	To the best of my knowledge, apache running perl thus will not
spawn children the way CGI does, nor will simultaneous connections eat
more memory than a normal httpd running..
	I do NOT want to deal with Java in any way, shape or form if at
all possible, so I'm interested in hearing what you guys have to say about
performance issues with java* vs. perl..

	I do NOT want a language war, just straight poop if at all
possible.. 

pat 	
:)

Pat Trainor ptrainor@title14.com (key: www.title14.com/pgp/pat.key)  
Programming Rates: I do it: $20 You watch: $40 You help: $80




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

Date: 4 Dec 1998 19:12:42 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: java servlets vs imbedded mod_perl for servers
Message-Id: <749c7a$thi$1@news.cyberhighway.net>

[comp.lang.perl.modules trimmed from newsgroups...not really relevant]

In article <Pine.LNX.3.96.981204145012.23067B-100000@aura>,
	Pat Trainor <ptrainor@title14.com> writes:
> 	I'm "down" with thte language (thanks to the regulars here!) 
> so please don't bash me for a more general question concerning perl..

Yah, boyee, gettin jiggy wit perl, yo!

> 	I had a discussion with a tech who is writing in java for an intranet
> server and he said that perl is way too wasteful what with spawned
> processes to be considered for a large/intense project.

Why are "spawned processes" considered wasteful?  Each perl program is
one spawned process.  If you're using more, quit writing perl programs
with a bunch of system calls and forks.  In a program that gets hit several
billion times a day, the interpretive nature of perl might end up
causing a slowdown, but not a really huge one, and if you're really
deeply concerned about it, you can always compile it into bytecode
first.  And Java, by the way, is hardly a speed demon either.
If this guy is so anal about shaving a few precious nanoseconds from
his runtime, why isn't he writing in C?  He didn't want to study any
single language for more than 24 hours?  Java is not at all
well suited for a general-purpose intranet server, nor was it ever
intended to be.

> 	I hate Sun & Java*, and all it stands for, but I was hard pressed

I disagree with you 100% here, but to each their own.

> 	To the best of my knowledge, apache running perl thus will not
> spawn children the way CGI does, nor will simultaneous connections eat
> more memory than a normal httpd running..

Er...you're using perl to run CGI scripts, or you're using it to run
your web server?  What exactly are you trying to accomplish here?  Do
you want to incorporate your CGI scripts directly into Apache?  What
kinds of scripts are these?  If they're forms and such, you might just
want to enable FastCGI or something of the sort.  Either way, Java is
not designed to do anything of the sort, nor was it ever intended to
do anything like that.

> 	I do NOT want to deal with Java in any way, shape or form if at
> all possible, so I'm interested in hearing what you guys have to say about
> performance issues with java* vs. perl..

This is not a valid question.  Java and Perl are languages built on two
totally separate concepts for two totally separate uses.  Java is designed
for machine independence, and due to its self-imposed security
restrictions (which are a good thing), it cannot hope to do many of the
things you would like to do in a CGI script, which can be done
in perl (writing a file on the server, for example).  Java, on the
other hand, is good at writing real-time games and pretty animations
that run on the client side, thus freeing up the server, but is generally
useless for things such as data collection.
Which one of these is best for you really depends on what you're
trying to accomplish.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
Sometimes we choose the generalization.  Sometimes we don't.
             -- Larry Wall in <199709032332.QAA21669@wall.org>


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

Date: 4 Dec 1998 18:46:39 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: localtime () - perl's  bug ?
Message-Id: <749amf$qe4$4@news.cyberhighway.net>

In article <747thi$rud$1@news.nero.net>,
	Dan Sugalski <sugalskd@netserve.ous.edu> writes:
> already an SPD in with TCFKAD to fix that. We've got 8000 years--why worry
> now, right? :)

Of course, the way large corporations work, half the world will still be
using those same systems in 8000 years, so maybe now would be a good
time to start working on a fix.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
last|perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
That's gonna be tough for Randal to beat...  :-)
             -- Larry Wall in  <1991Apr29.072206.5621@jpl-devvax.jpl.nasa.gov>


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

Date: Fri, 04 Dec 1998 18:09:30 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: New idiom?
Message-Id: <uzV92.121$4w2.456123@news.itd.umich.edu>

In article <36676E5B.A5F6B1A4@shaw.wave.ca>,
Rick Delaney  <rick.delaney@shaw.wave.ca> wrote:
>Sean McAfee wrote:
>> This is what I did:
>> %hash = ( foo => { bar => 5 }, baz => { bletch => 10 } );
>> while ((my $a, local *b) = each %hash) {
>>         while (my ($c, $d) = each %b) {
>>                 print "$a: $c => $d\n";
>>         }
>> }

>> This code runs fine without -w, but I get the above-mentioned warning 
>> when I add it.  I neglected to mention my environment in my original 
>> article, but I'm using 5.005_02 on Solaris 2.6.

>I should have mentioned mine when I asked since I'm still using Perl
>Classic (5.004_04).  That obviously makes all the difference since I get
>no warning when running the above code.  I suppose the warning was added
>because you can't undef a file handle?

Here's what perldiag-5.005 has to say:

     Undefined value assigned to typeglob
         (W) An undefined value was assigned to a typeglob, a la
         *foo = undef.  This does nothing.  It's possible that
         you really mean undef *foo.

Looks like I'll be using

$SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /Undefined value assigned to typeglob/ };

It's not all that much of a hassle, now that I think about it.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Fri, 04 Dec 1998 13:27:55 -0500
From: Yulia Tjahjadi <yt@cs.purdue.edu>
Subject: Newbie need help to run Makefile by using script
Message-Id: <366829AB.8A2CBA7F@cs.purdue.edu>

OK I have lots of directory. In every directories I have a Makefile that
I want to run. What command can I use to achieve this?
I have put all the directories in my @dirs array. 

foreach $dir (@dirs)
{
    what should I put in here? 
    below is my dumb version. Ignore it if it's confuse you.
    $temp = `$dir/make`;
    $DUMP=`$temp`;
}

Your help is REALLY appreciated!!!

Thanx
YT


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

Date: Fri, 04 Dec 1998 12:56:30 -0500
From: Ken McNamara <conmara@tcon.net>
Subject: Re: Newbie needs help with regex in perl script!
Message-Id: <3668224E.F341BEEA@tcon.net>

Your code works.


RemarQ User wrote:

> Hi everyone. I'm a newbie to perl so I will get right to it.
>
> I would like to insert some text (from STDIN) at the *beginning* of _every_
> individual line.
>
> so if I had the line bar .... I would like to be able to insert foo before
> it. As such: foobar.
>
> The problem is that I do not know (and don't care) what the first character
> of line is. I just want to insert
>
> the text on every line at the beginning.
>
> Here is what I have so far. Obviously, it doesn't work or I would be writing
> this.
>
> open (LOGFILE, $filetofix);

open a file to print out to itread in the lines one at a time

>         while ($lines = <LOGFILE>)
>
>         {
>
>         $lines =~ s/^/$inserttext/;
>

print to the outfile

>         }
>

close the outfile

> close (LOGFILE);
>
> I have also tried s/[^./i]/$inserttext/
>
> Can anyone help me out here. These files are apx. 25 MB a piece and I
> __really__ don't want to copy and
>
> paste each one.
>
> TIA,
>
> James H.
>
> james.huff@sierra.com
>
>    -**** Posted from remarQ, Discussions Start Here(tm) ****-
> http://www.remarq.com/ - Host to the the World's Discussions & Usenet





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

Date: Fri, 4 Dec 1998 12:49:07 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Newbie needs help with regex in perl script!
Message-Id: <3ra947.c99.ln@metronet.com>

RemarQ User (james.huff@sierra.com) wrote:

: I would like to insert some text (from STDIN) at the *beginning* of _every_
: individual line.

: Here is what I have so far. Obviously, it doesn't work or I would be writing
: this.

: open (LOGFILE, $filetofix);


   You should *always* check the return value from open() calls:

      open (LOGFILE, $filetofix) || die "could not open '$filetofix'  $!";


:         while ($lines = <LOGFILE>)
:         {
:         $lines =~ s/^/$inserttext/;


          print $lines;


:         }
: close (LOGFILE);


   That should be working fine.

   You need to *output* the changed line somewhere in your program.



   If you want to change the file "in place", then have a look at
   the -i switch in the 'perlrun' man page.


      perl -p -i.bak -e 's/^/foo/' filename


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 04 Dec 1998 18:05:12 +0000
From: 23_skidoo <nospam23_skidoo@geocities.com>
Subject: Re: Newbie needs help with regex in perl script!
Message-Id: <36682452.5066@geocities.com>

> so if I had the line bar .... I would like to be able to insert foo before
> it. As such: foobar.
> 
> The problem is that I do not know (and don't care) what the first character
> of line is. I just want to insert
> the text on every line at the beginning.
> 
> Here is what I have so far. Obviously, it doesn't work or I would be writing
> this.

open (LOGFILE, $filetofix);

        while ($lines = <LOGFILE>)

        {

        $lines =~ s/^/$inserttext/;

        }

close (LOGFILE);

> Can anyone help me out here. These files are apx. 25 MB a piece and I
> __really__ don't want to copy and
> paste each one.

i'm fairly new here too so dunno if this will work but what about
trying:

$lines = $inserttext . $lines;

since you don't care what's in the line you're inserting, why use a
pattern match?

however, as you have not put any way to write back to LOGFILE i don't
see how this is gonna work. think you need to open the $filetofix again
so you can write to it.

-23


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

Date: 4 Dec 1998 18:04:38 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Newbie needs help with regex in perl script!
Message-Id: <74987m$as1@mercury.adc.com>

Several critiques...

In article <1VU92.241$45.372772@WReNphoon1>,
RemarQ User <james.huff@sierra.com> wrote:
>open (LOGFILE, $filetofix);

Always check the return code of open, such as:

 open (LOGFILE, $filetofix) or die "open failed: $!";

>        while ($lines = <LOGFILE>)

That's the wrong condition.  Should be 

 while (defined($lines = <LOGFILE>))

If it was me, I'd just use while(<LOGFILE>) and do the substitution on
$_.

>        {
>        $lines =~ s/^/$inserttext/;

This is performing the substitution you want.  It's just that you
never write it out, so you never see the changes.

>        }
>close (LOGFILE);

It looks like you want to do in-place modification of files.
The simplest way to do what you want to do is as follows:

  perl -pi.bak -e 's/^/foo/' *

This will take all files in the current directory, prefix every line
in the file with "foo", and save the original files with a ".bak"
extension.

man perlrun (or perldoc perlrun) for explanations of the -p, -i, and
-e command-line options.

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: 4 Dec 1998 18:43:59 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Newbie needs help with regex in perl script!
Message-Id: <36682C89.6B7A3136@vpservices.com>

RemarQ User wrote:
>
> I would like to insert some text (from STDIN) at the *beginning* of
> _every_ individual line.
>
[snip]
>
> open (LOGFILE, $filetofix);
>         while ($lines = <LOGFILE>)
>         {
>         $lines =~ s/^/$inserttext/;
>         }
> close (LOGFILE);

Your regular expression is fine, it successfully changes the lines the
way you want them.   The problem is, you don't do anything with the line
once it has been changed.  You need to print the changed line to
somewhere.  You could print it back to the same file, but that's rather
dangerous, so you probably want to print to a new file and once you've
checked it, replace the original file with the new one. 

Try something like the script below. And don't forget those error
messages with die, otherwise you won't know if something goes wrong. 

$! is your friend.

Also notice that you don't need to create a variable "$lines", the
substitution s/// and the print will both automatically assume you mean
each line of the file.

#!/usr/local/bin/perl -w
use strict;
my( $fname, $insert_text ) = @ARGV;
($fname && $insert_text)  || die "Missing filename or insert text!\n";
open (OLD, "<$fname")     || die "$! opening $fname for reading\n";
open (NEW, ">$fname.new") || die "$! opening $fname.new for writing\n";
print "Adding '$insert_text' to '$fname' ...\n";
while (<OLD>)  {
    s/^/$insert_text/;
    print (NEW) || die "$! writing to $fname.new\n";
}
close (OLD) || die "$! closing $fname\n";
close (NEW) || die "$! closing $fname.new\n";
print "Mission accomplished!\n";

-Jeff


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

Date: Fri, 4 Dec 1998 14:01:43 -0500
From: "news.supernews.com" <mike@laserlink.net>
Subject: perl and berkeley db->get???
Message-Id: <749bd8$rn3$1@usenet41.supernews.com>

would anyone know how to perform the perl version of a C lang "DB->get" for
berkeley DB?

thanx
mike
mike@laserlink.net




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

Date: 4 Dec 1998 19:20:12 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: perl and berkeley db->get???
Message-Id: <749clc$thi$3@news.cyberhighway.net>

[Posted and mailed]

In article <749bd8$rn3$1@usenet41.supernews.com>,
	"news.supernews.com" <mike@laserlink.net> writes:
> would anyone know how to perform the perl version of a C lang "DB->get" for
> berkeley DB?

Head over to CPAN and check out modules DB_File for berkeley DB 1.x, or
BerkeleyDB for berkeley 2.x

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
Ignorance is bliss, and when it comes to computing, I want everyone
to be happy... 
             -- Ryan Tucker in a.s.r.


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

Date: 4 Dec 1998 14:39:02 -0500
From: clays@panix.com (Clay Shirky)
Subject: Petition: The US Gov't Should Evaluate Open Source software
Message-Id: <749dom$5he@panix2.panix.com>

Please sign the petition: 

The Federal Government Should Evaluate Open Source Software Whenever
It Purchases or Upgrades Computers.

A group of software professionals, recognizing the maturity and
effectiveness of Open Source software, has launched a petition
requesting that the Federal Government evaluate Open Source software
alongside its commercial alternatives whenever they procure or upgrade
computers. This petition, written by Professor Clay Shirky of Hunter
College and sponsored by the Open Source Initiative and O'Reilly and
Associates, asks the Federal Technology Service, a branch of the
General Services Administration (GSA), to recognize that Open Source
software has in many cases met or exceeded commercial standards, as
demonstrated by its increasing use by companies such as Oracle, IBM,
and Corel, and that its use would lower the cost of IT procurement to
txpayers, reduce the Federal Government's dependancy on individual
vendors, and secure future improvements to such software without
further cost.

The petition itself is at 

http://www.ethepeople.com/etp/affiliates/national/fullview.cfm?ETPID=0&PETID=74386&ETPDIR=affiliates/national

and will only be forwarded to the Federal Technology Service if there
are 10,000 or more signatures.

This petition contains no special pleading - its recipients are
working professionals in the Federal Technology Service, and the
petition does not presume to second-guess their judgement. The
petition does not demand that the Federal Government use Open Source
software, it does not even ask the Federal Government to use Open
Source software, it simply asks that the Federal Government evaluate
Open Source software using the same criteria it currently uses to
evaluate commercial software, and to select Open Source software only
where it meets the needs of the Government as well or better than the
alternatives. 

--
Clay Shirky
Professor, New Media
Department of Film & Media
Hunter College
http://www.shirky.com/opensource/




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

Date: Fri, 4 Dec 1998 12:50:53 -0600
From: "R. Alcazar" <alcazar@netcomp.net>
Subject: Removing a line...
Message-Id: <749art$efs$1@excalibur.flash.net>


    Hello all,

    I'm trying to remove a line from a text delimited list...  a user enters
a string.  Whatever line this string is located on needs to be deleted.  The
text file looks like this (assume an indefinite amount of lines):

    something|lkl;kadjfkladf|klajdlkadf|8934723
    whatever|lk923jad9|09384ladf|0983498df
    string|anotherstring|yetanother|onemore

    Code (in summary)

$user_string = <STDIN>;

open(FILE...)
while(<FILE>){

    @file_info = split(/\|/,$_);
    if ($file_info[0] eq $user_string){

        ###THIS IS WHERE I GET CONFUSED
        $_ =~ tr/$_//;

    }

}

    I just wanna wanna delete the line and all character within that line
(no whitespace).  Any help would be appreciated.

illfigah




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

Date: Fri, 4 Dec 1998 14:13:26 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Removing a line...
Message-Id: <6pf947.3q9.ln@metronet.com>

R. Alcazar (alcazar@netcomp.net) wrote:

:     I just wanna wanna delete the line and all character within that line
: (no whitespace).  Any help would be appreciated.


   Perl FAQ, part 5:

   "How do I change one line in a file/
    delete a line in a file/
    insert a line in the middle of a file/
    append to the beginning of a file?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 04 Dec 1998 14:10:40 -0500
From: Keith Kaple <kak@cisco.com>
Subject: socket data ???
Message-Id: <366833B0.E59ABC53@cisco.com>

When I am reading data from a TCP socket with IO::Socket, text appears
as text when printing out the handle to the socket, but then there is
some "weird" stuff.  I have no control over the messages that the client
(a router) is sending me, but they are consistant.  How would you parse
the mix of hex and text?  

Is unpack the way to go?

Read character by character and convert from ASCII to hex?

Some socket method I don't know about for converting incoming socket
data from text to byte fields?


-- 
Keith Kaple x25759 -----------------------
| New distribution, $40.  Linux compatible
| sound card, $89.  Three button mouse, $18.
| Nuking windows partitions....priceless.


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

Date: Fri, 04 Dec 1998 18:52:46 GMT
From: drkeith@bway.net
Subject: Re: Tool to reverse engineer perl code
Message-Id: <749b1s$km9$1@nnrp1.dejanews.com>

I was just searching for the same thing -- a tool for analyzing perl
application -- required files, sub-routines & data members, inputs, outputs,
etc & generating HTML documentation a la javadoc. Anything exist already?
I've seen debuggers, but I'm wanting to document working apps.

Thanks,

David Keith

In article <744g8p$7e7$1@bcarh8ab.ca.nortel.com>,
  "Steve Walsh" <swalsh@americasm01.nt.com> wrote:
> Has anyone on this list come across a reverse engineering tool that will
> take perl code as input and generate data diagrams, process diagrams
> (flowcharts), etc.  I know that there are lots of software tools available
> that do this for Java, C++, etc but I would like to find one that I can use
> with perl or is customizable to allow me to add perl in as a supported
> language.  If you know of such a tool please email with details.  Thank you.
>
> Steve Walsh
> swalsh@americasm01.nt.com
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 04 Dec 1998 12:54:23 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: wantarray() question.
Message-Id: <39af137pyo.fsf@fastengines.com>

>>>>> "RD" == Rick Delaney <rick.delaney@shaw.wave.ca> writes:

  RD> [
  RD>     snipped code that's basically:
  RD>     sub { return @array } 
  RD> ]
 
  RD> [
  RD>     snipped code that's basically:
  RD>     sub { wantarray ? @array : (scalar @array }
  RD> ]

  RD> The main thing to be aware of here is that an array in list context
  RD> returns the list of all its elements.  An array in scalar context
  RD> returns the number of elements.

you have to be careful to return an actual @array variable to get that
behavior. if you return a list you get the standard scalar evaluation of
a list which is the last element of the list in a scalar context.

sub array {

	my @foo = qw( a b c ) ;
	my @foo2 = qw( w x y z ) ;

	return( @foo, @foo2 ) ;
}

$cnt = array() ;
@a = array() ;
print "array cnt = $cnt a = @a\n";

prints:

array cnt = 4 a = a b c w x y z

which may not be what you expect. it is the length of the last element,
foo2! 

it is just another way to tell you that ONLY @array will give you a
length in a scalar conext, not a list.

think of it as the return value is evaluated in the wantarray context and
THAT value is actually returned.

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ibnets.com	


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

Date: Fri, 04 Dec 1998 19:02:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: When does CLOSE not FLUSH?
Message-Id: <36693149.494874@news.skynet.be>

Russ Allbery wrote:

>> Aha!
>
>> That means that indeed we do need the lock.
>
>Yup, unless you're sure that your data will only be one write, and you
>don't mind other stuff being written around it.  syswrite() can help there
>if one wants to go that route.

How CAN you be sure it will only need one write? Is there maybe some
maximum number of bytes allowed? What is that maximum, or is it
implementation dependent?

In short: use the lock. Always. It's safer.

	Bart.


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

Date: 04 Dec 1998 14:41:03 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: When does CLOSE not FLUSH?
Message-Id: <3967br7l0w.fsf@fastengines.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> Russ Allbery wrote:
  >>> That means that indeed we do need the lock.
  >> 
  >> Yup, unless you're sure that your data will only be one write, and you
  >> don't mind other stuff being written around it.  syswrite() can help there
  >> if one wants to go that route.

  BL> How CAN you be sure it will only need one write? Is there maybe some
  BL> maximum number of bytes allowed? What is that maximum, or is it
  BL> implementation dependent?

according to the man page for write(2) on solaris, write (which is what
syswrite calls) is essentially atomic to a file. for most unix flavors
this is true.

  BL> In short: use the lock. Always. It's safer.

but this is smart too as you cannot always use a single syswrite to
do your i/o and this allows for easier additions later.

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ibnets.com	


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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