[6282] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 904 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 6 05:07:29 1997

Date: Thu, 6 Feb 97 02:00:23 -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           Thu, 6 Feb 1997     Volume: 7 Number: 904

Today's topics:
     Re: "-i" switch is unsafe! (Joe Bednorz)
     Re: "-i" switch is unsafe! (Joe Bednorz)
     Re: CGI.pm dynamic tables? <arichards@postoffice.worldnet.att.net>
     Re: CGI.pm dynamic tables? <dehon_olivier@jpmorgan.com>
     Re: Crypting (Tad McClellan)
     Re: Crypting (Dave Thomas)
     FTP Client <max@amagicstore.com>
     Help installing Perl in Windows 95 <surfero@highway1.com>
     Re: How to do this using perl? <dbenhur@emarket.com>
     Re: Looking for an oneliner perl script (Tad McClellan)
     New Module List Posted (Andreas Koenig)
     Re: Nice perl way to generate n! permutations for n=8 ? (Dave Thomas)
     Re: Nice perl way to generate n! permutations for n=8 ? (Dave Thomas)
     Parsing Multiple lines <arichards@postoffice.worldnet.att.net>
     Re: Parsing Multiple lines (Dave Thomas)
     Re: Perl 5.003 causes segmentation fault on SGI Irix <wessel@mat075207.student.utwente.nl>
     printf and % <drwill@loginet.com>
     Re: Question on subprocesses (Tad McClellan)
     Re: setuid() (Michael Fuhr)
     Re: simultaneous dbmopen <rootbeer@teleport.com>
     Re: simultaneous dbmopen <jaymez@creativeaccess.com.au>
     Re: Use of \ considered unfortunate (was: How to do thi <dbenhur@emarket.com>
     Using exec-Why won't this work? <ez045864@peseta.ucdavis.edu>
     Windows 95 Info Guide cjtech@inreach.com
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Thu, 06 Feb 1997 11:09:07 GMT
From: bednorz@mail.net-connect.net (Joe Bednorz)
Subject: Re: "-i" switch is unsafe!
Message-Id: <5dc740$nug@news.net-connect.net>

seldon@eskimo.com (Will Mengarini) wrote:

>Tom Christiansen <tchrist@mox.perl.com> writes:

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

>>In comp.lang.perl.misc, 
>>    karrer@ife.ee.ethz.ch (Andreas Karrer) writes:
>>:Editors (vi, emacs) will not let you modify a mode 444 file, perl -i does.

>>The *kernel* will not let you modify a mode 0444 file.  It is not an
>>application thing.  And -i doesn't actually modify that inode's data,
>>which is why it works.  You may not like it, but it makes perfect sense.

>This is the kind of answer that belongs in /The Unix-Hater's Handbook/
>by Garfinkel et al (great book BTW).  When a user sets a file to be
>read-only, the user isn't thinking about inodes, the user is thinking
>"don't modify the goddamn file"...and modify it is exactly what perl -i
>does.  That Perl internally uses an algorithm that *happens* to
>*accidentally* work around the kernel's prohibition of the modification
>is totally irrelevant to the *user's* perception of what is happening.
>It's not a justification of the unexpected behavior; it's a BUG.  Perl
>should check the writeability of a file before running a -i on it; the
>kernel won't do that, because of the algorithm Perl uses for the -i.

This is the prototypical Unix answer:  It can be rationalized, 
therefore it's right.  

The other day someone on comp.lang.c tried to explain
why 0 was true and all other integer values  were false.  "Well, 
there's only one way for a program to succeed, but many ways
for it to fail."

Horse-puckey.  What about deletion?  Of anything?  If the object
isn't there is that an error?  Of course not.  The desired objective
has been achieved.  

Does the requestor need to know whether or not the object was 
there to begin with?  Who knows?   You just have the program
return a differenct success code that includes that information.

Another case of blindly justifying the system when a half-second's 
thought would have revealed the holes in the rationalization.



Joe Bednorz     	Proud Member of the Unix-Hater's Mailing List


 



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

Date: Thu, 06 Feb 1997 11:01:44 GMT
From: bednorz@mail.net-connect.net (Joe Bednorz)
Subject: Re: "-i" switch is unsafe!
Message-Id: <5dc6m6$nu7@news.net-connect.net>

seldon@eskimo.com (Will Mengarini) wrote:

>Tom Christiansen <tchrist@mox.perl.com> writes:

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

>>In comp.lang.perl.misc, 
>>    karrer@ife.ee.ethz.ch (Andreas Karrer) writes:
>>:Editors (vi, emacs) will not let you modify a mode 444 file, perl -i does.

>>The *kernel* will not let you modify a mode 0444 file.  It is not an
>>application thing.  And -i doesn't actually modify that inode's data,
>>which is why it works.  You may not like it, but it makes perfect sense.


>Microsoft is CONQUERING THE WORLD because Unix geeks
>misthink like this instead of fixing our goddamn code.  This
>takes a complaint about *functionality* & responds with a
>justification based on *implementation*.  Wrong attitude.

You are so right.    Every day I work with both Unix and 
M'khroZofft Windoze.  MS Windoze because it's more
functional, reliable and cheaper than an X-terminal [1].
Unix because, well because my employer has it.

I despise them both.  It's amazing, but invincible ignorance
on Unix part: "That's what I programmed it to do, so therefore
it's right." is managing to lose to the intentional lack of 
compatibility programmed into every MS product.  

Just today we found out that the latest Windows95 PC's we're getting
break our terminal software.  The terminal software works with
our older Win95 PC's.  But since then MS has removed more 
compatibility.   Why?  Who knows?  

But it's still way better than Unix.  We looked on the 'Net for 5 
minutes and found replacement shareware that worked for 
us for a very reasonable price.  We have a Sun SPARCstation
(brand new) where the database software we use *cannot* work 
properly with X-windows.  

There's nothing we can do about it.  No amount of money can
buy us  what we need.   The portion of the software that dumps
core [2] is proprietary.  The software company can't make it
work with X-Windows.   We're forced to use an "unsupported"
character-based method.

When MS Windows-NT finally eliminates Unix [3], I'll cheer Unix's 
death, even while I mourn MS power.

Every day I come to the same conclusion.   MS and Unix
deserve each other.   MS because they try to keep people
from writing software that will work with Windows.  Unix
because it's too stubborn to admit it's committing suicide.


[1] X-Windows: A Mistake Carried Out To Perfection.

[2] That's another rant.



Joe Bednorz
=========================================================
Kill -9 them all.  Let init sort them out.



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

Date: Wed, 05 Feb 1997 22:11:18 -0700
From: Adam Richards <arichards@postoffice.worldnet.att.net>
Subject: Re: CGI.pm dynamic tables?
Message-Id: <32F967F6.6EFA@postoffice.worldnet.att.net>

I think you will also want to use
a REFERENCE to that array...


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

Date: 06 Feb 1997 09:22:46 +0100
From: Olivier Dehon <dehon_olivier@jpmorgan.com>
Subject: Re: CGI.pm dynamic tables?
Message-Id: <njz6806s5rd.fsf@jpmorgan.com>

jacob@bitsrfr.cnd.hp.com (Jacob Miner) writes:

>     Is there any way to create a dynamic table using the CGI.pm
> module, and it's syntax?
> 
> i.e. something like this (which obviously doesn't work)
> 
>     print table(
>                 Tr(
>                     foreach $entry ('one','two') {
>                     td("entry");
>                     }
>                    )
>                )
> 

Just build up the HTML string that makes up the contents of your table,
and then pass this string as an argument of table().

ie:

foreach $entry ('one','two') {
    $table_string .= td($entry);
}

print table(Tr($table_string));

---

I hope this helps.
Regards,
Olivier.


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

Date: Wed, 5 Feb 1997 22:46:22 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Crypting
Message-Id: <umnbd5.8p3.ln@localhost>

Romualdo Ortiz (rom_ortiz@icepr.com) wrote:
: How I can decode after I use crypt in a name?


You can't...

crypt() is a one-way algorithm.

Use something else (PGP maybe) if you need to be able to de-crypt it.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 6 Feb 1997 05:04:26 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Crypting
Message-Id: <slrn5fipeg.qg7.dave@fast.thomases.com>

On Wed, 05 Feb 1997 22:21:15 -0500, Romualdo Ortiz <rom_ortiz@icepr.com> wrote:
> How I can decode after I use crypt in a name?
> Please email me at rom@icepr.com

crypt is one-way - you can't decrypt it (except by using exhaustive
searches). The security of Unices around the world depends on that.

However, if what you're doing is just checking a password, the
conventional approach is to encrypt the original and store the result. Then,
when the user needs to be authenticated, you encrypt what they give you and
compare that encryption with the one you stored earlier.

Dave



-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Wed, 05 Feb 1997 21:03:21 -0800
From: A MAGIC STORE <max@amagicstore.com>
Subject: FTP Client
Message-Id: <32F96619.3830@amagicstore.com>

I've programmed a couple of scripts in Perl, I've uploaded them to my
server (UNIX) but they are not working. My server said that there is a
^M (new line) at the end of each line. I'm using Win95 Notepad.
Does anybody know any FTP client or other program that transform MS-DOS
based text files into UNIX text files (basically without the ^M at the
end of each line)??

Thank you.

Max


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

Date: Wed, 05 Feb 1997 13:54:41 -0500
From: Tirso Maldonado <surfero@highway1.com>
Subject: Help installing Perl in Windows 95
Message-Id: <32F8D771.5226@highway1.com>

I need help on how to configure perl in windows95. I am getting this error..This DPMI32 module cannot run on 
Win32... Guys! I am going nuts... cannot figure it out. Where do you place perl32.exe and glob32.exe.? Do you 
need to write in the registry? do you have to set up a path? do you need anything else? 
Neet serious help... please send me an e-mail at surfero@highway1.com I would really appreciate it! 
Thanks in advance


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

Date: Wed, 05 Feb 1997 22:21:04 -0800
From: Devin Ben-Hur <dbenhur@emarket.com>
Subject: Re: How to do this using perl?
Message-Id: <32F97850.6555@emarket.com>

Abigail wrote:
> On 5 Feb 1997 01:22:09 GMT, Tom Christiansen wrote in comp.lang.perl.misc:
> ++     "Samir Grover" <sgrover@elizacorp.com> writes:
> ++ :@data = split("\", "c:\speech\work");
> ++ :I want to split "c:\speech\work" into array of "c:", "speech" and "work".
> ++ :"\" is creating a problem for perl compiler.
> What's the problem with:
> @data = split /\\/, 'cl:\speech\work';

Or what I would do since most of my scripts want to run
on both DOS & unix:

@data = split /\\|\//, $file_path_and_name;

--
Devin Ben-Hur      <dbenhur@emarket.com>
eMarketing, Inc.   http://www.emarket.com/
"Don't run away. We are your friends."  O-



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

Date: Wed, 5 Feb 1997 22:39:06 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Looking for an oneliner perl script
Message-Id: <a9nbd5.8p3.ln@localhost>

Thierry DELATTRE (th@euro-checkpoint.com) wrote:

:     I'm looking for a free oneliner perl script. Do you ever saw one
: somewhere ?


I guess the other folks who followed up like to type. I don't.

So, here's my free perl one-liner:


perl -e ''


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 6 Feb 1997 08:57:05 GMT
From: andreas.koenig@franz.ww.tu-berlin.de (Andreas Koenig)
Subject: New Module List Posted
Message-Id: <5dc6d1$nde$1@brachio.zrz.TU-Berlin.DE>
Keywords: FAQ, Perl, Module, Software, Reuse, Development, Free


Last night I posted a new revision (2.37) of the Perl 5 Module List to
comp.lang.perl.modules. See the header of this posting for a
reference. The HTML version is uploaded to CPAN as
modules/00modlist.long.html Try
    <URL:http://www.perl.com/CPAN/modules/00modlist.long.html>
or your nearest CPAN site.

Thanks to all you who keep us up to date with recent and future
development. Please continue to check for modules you know about. If
there are no entries for them or if the entries need some cleenup,
please let us know or contact the authors directly. Help to save the
world! Send corrections and suggestions for supplements to
modules@franz.ww.tu-berlin.de (preferred) or modules@perl.com.

Thank you,
andreas

Recent changes in the modules database
--------------------------------------

2) Perl Core Modules, Perl Language Extensions and Documentation Tools
----------------------------------------------------------------------
Pod::
::Lint         cdpO  Lint-style validator for pod                 NEILB +


5) Networking, Device Control (modems) and InterProcess Communication
---------------------------------------------------------------------
Net::
::DNS          adpO  Interface to the DNS resolver                MFUHR +
::SOCKS        cdcf  TCP/IP access through firewalls using SOCKS  SCOOPER !


6) Data Types and Data Type Utilities (see also Database Interfaces)
--------------------------------------------------------------------
Graph::
::Kruskal      Rdpf  Kruskal Algorithm for Minimal Spanning Trees STBEY !

Time::
::Period       Rdpf  Code to deal with time periods               PRYAN +


7) Database Interfaces (see also Data Types)
--------------------------------------------
DBD::
::Ingres       amcO  Ingres Driver for DBI                        HTOUG !


8) User Interfaces (Character and Graphical)
--------------------------------------------
Term::
::ReadLine     Sdcf  Common interface for various implementations ILYAZ !

Term::ReadLine::
::GNU          adcO  GNU Readline XS library wrapper              HAYASHI +
::Perl         RdpO  GNU Readline history and completion in Perl  ILYAZ +


10) File Names, File Systems and File Locking (see also File Handles)
---------------------------------------------------------------------
Filesys::
::Df           ad??  Free disk space utilities                    FTASSIN +


11) Text Processing, Parsing and Searching
------------------------------------------
Parse::
::Lex          adpO  Generator of lexical analysers               PVERD +


14) Security and Encryption
---------------------------
GSS            adcO  Generic Security Services API (RFC 2078)     MSHLD !


15) World Wide Web, HTML, HTTP, CGI, MIME etc (see Text Processing)
-------------------------------------------------------------------
Netscape::
::History      bdpO  Class for accessing Netscape history DB      NEILB +
::HistoryURL   bdpO  Like a URI::URL, but with visit time         NEILB +


23) Miscellaneous Modules
-------------------------
CPAN           RdpO  Perl Archive browse and download             ANDK !


Recent Changes in the users database
------------------------------------

+  ACALPINI Aldo Calpini <dada@divinf.it>
!  AKSTE    Alan K. Stebbens <aks@sgi.com>
+  FTASSIN  Fabien Tassin <tassin@eerie.fr>
+  GRICHTER Gerald Richter <richter@ecos.de>
+  HAYASHI  Hiroo HAYASHI <hayashi@pdcd.ilab.toshiba.co.jp>
+  MFUHR    Michael Fuhr <mfuhr@dimensional.com>
+  PRYAN    Patrick Ryan <pryan@fhcrc.org>
!  PVERD    Philippe Verdret <philippe.verdret@eurolang.fr>
+  SCOOPER  Simon Cooper <sc@sgi.com>
!  SHGUN    Shishir Gundavaram <shishir@ruby.ora.com>
+  SZECK    Steve Zeck <viper@kuentos.guam.net>


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

Date: 6 Feb 1997 06:46:08 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Nice perl way to generate n! permutations for n=8 ??
Message-Id: <slrn5fivd5.qqh.dave@fast.thomases.com>

On 6 Feb 1997 00:40:59 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:

> This takes about 15 seconds to run on my system.  So don't 
> expect speed here.
> 
> #!/usr/bin/perl -n
> permut([split], []);
> sub permut {
>     my @car = @{ $_[0] };
>     my @cdr = @{ $_[1] };
>     unless (@car) {
> 	print "@cdr\n";
>     } else {
> 	my(@newcar,@newcdr,$i);
> 	foreach $i (0 .. $#car) {
> 	    @newcar = @car;
> 	    @newcdr = @cdr;
> 	    unshift(@newcdr, splice(@newcar, $i, 1));
> 	    permut([@newcar], [@newcdr]);
> 	}
>     } 
> }

If you get rid of the array copies (two at the top, two in the inner loop
and the two in the recursive call), and the '..' array creation, you'll find
it goes down to about 9 seconds. Its the four inner copies that are the
killers.

#!/usr/bin/perl -w
$_ = "1 2 3 4 5 6 7 8";

permut([split], []);

sub permut {
  local *car = $_[0];
  local *cdr = $_[1];
 
  unless (@car) {
    print @cdr, "\n";
  } else {
    my @newcar = @car;
    my @newcdr = @cdr;
    my $hd;
    my $count = @car;
    while ($count--) {
      $hd = shift @newcar;
      push @newcdr, $hd;
      permut(\@newcar, \@newcdr);
      pop  @newcdr;
      push @newcar, $hd;
    }
  }
}
__END__

-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 6 Feb 1997 06:53:57 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Nice perl way to generate n! permutations for n=8 ??
Message-Id: <slrn5fivrr.r2f.dave@fast.thomases.com>

On 6 Feb 1997 00:40:59 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
> 
>     % echo '1 2 3 4 5 6 7 8' | permute 
> 
> This takes about 15 seconds to run on my system.  So don't 
> expect speed here.
> 
> #!/usr/bin/perl -n
> permut([split], []);
> sub permut {
>     my @car = @{ $_[0] };
>     my @cdr = @{ $_[1] };
>     unless (@car) {
> 	print "@cdr\n";
>     } else {
> 	my(@newcar,@newcdr,$i);
> 	foreach $i (0 .. $#car) {
> 	    @newcar = @car;
> 	    @newcdr = @cdr;
> 	    unshift(@newcdr, splice(@newcar, $i, 1));
> 	    permut([@newcar], [@newcdr]);
> 	}
>     } 
> }

Something that slows this down a tad is all the array copies. If you get rid
of the two at the top of the sub, the four in the loop (two explicit and two
[]'s), and remove the '..' array creation, the time drops from 15 to about 9
seconds:

#!/usr/bin/perl -w
$_ = "1 2 3 4 5 6 7 8";

permut([split], []);

sub permut {
  local *car = $_[0];
  local *cdr = $_[1];
 
  unless (@car) {
    print @cdr, "\n";
  } else {
    my @newcar = @car;
    my @newcdr = @cdr;
    my $hd;
    my $count = @car;
    while ($count--) {
      $hd = shift @newcar;
      push @newcdr, $hd;
      permut(\@newcar, \@newcdr);
      pop  @newcdr;
      push @newcar, $hd;
    }
  }
}

__END__

Not trying to be a smartass - it was just fun.

Back of my mind, I suspect it can be made to fly by permuting the array in
place, but its late and my mind died a while back.

Regards

Dave
-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Wed, 05 Feb 1997 22:09:56 -0700
From: Adam Richards <arichards@postoffice.worldnet.att.net>
Subject: Parsing Multiple lines
Message-Id: <32F967A4.507D@postoffice.worldnet.att.net>

Sirs:

I have an input file that should have real long line.
that is I want it to have real long lines: one line
for each record, but the program that created the file
wraps it!
example


column1.....................column2..........[CR]
[TAB]Column3.................
data1.......................data2............[CR]
[TAB]data3...................
[EOF]

I want it to be one record for one line: thus
column1.....................column2..........colum3..............[CR]
data1.......................data2............data2...............[CR]
[EOF]

how can I do a massive replace on the whole file.
I want to replace the string [CR][TAB] with a space,
but I dont know how to acquire the entire file for parsing....

please post or e-mail to adam.richards@mci.com


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

Date: 6 Feb 1997 05:34:19 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Parsing Multiple lines
Message-Id: <slrn5fir6e.qm9.dave@fast.thomases.com>

On Wed, 05 Feb 1997 22:09:56 -0700, Adam Richards <arichards@postoffice.worldnet.att.net> wrote:
> Sirs:
> 
> I have an input file that should have real long line.
> that is I want it to have real long lines: one line
> for each record, but the program that created the file
> wraps it!
> example
> 
> 
> column1.....................column2..........[CR]
> [TAB]Column3.................
> data1.......................data2............[CR]
> [TAB]data3...................
> [EOF]
> 
> I want it to be one record for one line: thus
> column1.....................column2..........colum3..............[CR]
> data1.......................data2............data2...............[CR]
> [EOF]
> 
> how can I do a massive replace on the whole file.
> I want to replace the string [CR][TAB] with a space,
> but I dont know how to acquire the entire file for parsing....

It must be something in the air! This week, everyone wants to use regex's to
solve the worlds problems (a month ago it was 'map', and next month it'll be
splice.

Anyway, a regex way might be:

   undef $/;
   $_ = <>;
   s/(.*)\n(.*\n)/$1$2/gm;
   print;
 
However, something like this might be faster:

   while (<>) {
      chomp;
      print $_, scalar <>;
   }
       
Dave

-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Thu, 06 Feb 1997 09:09:41 +0100
From: Wessel de Roode <wessel@mat075207.student.utwente.nl>
Subject: Re: Perl 5.003 causes segmentation fault on SGI Irix
Message-Id: <32F991C5.167E@mat075207.student.utwente.nl>

Tom Phoenix wrote:
> 
> On Tue, 4 Feb 1997, Jeff Ferguson wrote:
> 
> > Hello: I have been running perl 5.001 for some time now on my SGI Irix
> > machine without any problems. I recently upgraded (compiling the source
> > distribution) to 5.003 and since have had strange things happen to
> > existing programs. Certain scripts written some time ago, which operated
> > without a problem, are now causing segmentation faults on the system and
> > dumping core. The strange thing about it is that sometimes they run
> > fine, and sometimes they crash. There doesn't seem to be any rhyme or
> > reason to it. Anyone have any thoughts?
> 
> Perhaps the new perl links to different libraries than the old one, or
> perhaps recently your system has been infected by a virus or an intruder's
> malicious code.
> 
> 5.003 has been a very good release with few serious bugs. But some of
> those bugs are fixed in the upcoming 5.004, so you may want to install the
> 5.004 beta (due out any week now) for testing (not for production; it _is_
> beta) and see whether that shows the same problem. Good luck!
It's a problem with the compilers...
I've a precompiled working version on my site. It's the FreeWare
package..

ftp://Mat075207.student.utwente.nl/pub/SGI/tardist/FreeWare/fw_LWperl5.tardist.gz

Wessel
---
There can be no rainbows around the soul until 
      there are first tears in the eyes.

	  -- Frances Firebrace --


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

Date: 6 Feb 1997 09:06:00 GMT
From: "David & Kristen" <drwill@loginet.com>
Subject: printf and %
Message-Id: <01bc140b$196e8340$1b4281ce@davekris>

Hi,

I'm trying to format the output of a calculated percentage.

I can do:
	printf MYFILE "Answer is %3.2f \n", $variable

But what I really want is the output to look like this:
	Answer is 100.00 %
with the % sign after it.  Obviously, printf thinks I'm trying to format
something when I put the % sign after it so it's not working.  So I try
prefixing the % sign with a backslash intending for PERL to understand I
literally want a "%".  But it still doesn't work.

Any suggestions?  Please e-mail!

Dave

PS Greetings Randal!!!


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

Date: Wed, 5 Feb 1997 22:43:09 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Question on subprocesses
Message-Id: <tgnbd5.8p3.ln@localhost>

D.M. Johnson (ez045864@peseta.ucdavis.edu) wrote:
: This is kind of general.  I am curious as to how I could call a
: subprocess, like spell or crypt, from my program.  I am working with HP-UX
: and ULTRIX machines.  Thanks.


>From the perl FAQ:

5.15) How can I capture STDERR from an external command?

    There are three basic ways of running external commands:

        system $cmd;
        $output = `$cmd`;
        open (PIPE, "cmd |");
    ...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 5 Feb 1997 22:09:51 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: setuid()
Message-Id: <5dbp2v$m8s@nova.dimensional.com>

Daniel Fox <dfox@pobox.com> writes:

>Is there a way to change the uid of a perl program
>like setuid() in C?

Study the predefined variables in the perlvar manpage.  Among
them is what you're looking for.
-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Wed, 5 Feb 1997 21:25:34 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: James Murray <jaymez@creativeaccess.com.au>
Subject: Re: simultaneous dbmopen
Message-Id: <Pine.GSO.3.95.970205212300.24308Q-100000@linda.teleport.com>

On Thu, 6 Feb 1997, James Murray wrote:

> I've written a simple cgi perl script
> which uses a dbmopen call.
> 
> Everything's fine, until it comes to a point where
> simultaneous calls are made to the same script.

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. (Rather than flock'ing the dbm file
directly, I think you'll need to flock a dummy file.) Hope this helps! 

   http://www.stonehenge.com/merlyn/WebTechniques/

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Thu, 06 Feb 1997 16:46:35 +1100
From: James Murray <jaymez@creativeaccess.com.au>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: simultaneous dbmopen
Message-Id: <32F9703B.4C9F@creativeaccess.com.au>

Tom Phoenix wrote:
> 
> On Thu, 6 Feb 1997, James Murray wrote:
> 
> > I've written a simple cgi perl script
> > which uses a dbmopen call.
> >
> > Everything's fine, until it comes to a point where
> > simultaneous calls are made to the same script.
> 
> I think you could use the methods in Randal's fourth Web Techniques
> column, which explains how to use flock() to avoid problems when multiple
> processes need to modify one file. (Rather than flock'ing the dbm file
> directly, I think you'll need to flock a dummy file.) Hope this helps!

I'm not modifying the file, just want simultaneous processes to be able
to read the file.

The files are being opened as mode 400


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

Date: Wed, 05 Feb 1997 22:16:22 -0800
From: Devin Ben-Hur <dbenhur@emarket.com>
Subject: Re: Use of \ considered unfortunate (was: How to do this using perl?)
Message-Id: <32F97736.3E2B@emarket.com>

Lasse Hiller=F8e Petersen wrote:
> In article <gsq8d5.vo.ln@localhost>, tadmc@flash.net (Tad McClellan) wr=
ote:
> >Tom Christiansen (tchrist@mox.perl.com) wrote:
> >: In comp.lang.perl.misc,
> >:     "Samir Grover" <sgrover@elizacorp.com> writes:
> >: :"\" is creating a problem for perl compiler.
> >   ^^^^^^^^^^^^^^^^^^^^^^^^^
> >: And likewise for awk, C, C++, Tcl, Python, or Java -- or in fact any=

> >: language reasonable or otherwise.  It's a stoopid microsoft megablun=
der.
> >                                                    ^^^^^^^^^^^^^^^^^^=
^^^
> >
> >I thought it was a CP/M megablunder, wasn't it?
> >
> >(or should that be CP\M megablunder ;-)
> >
> >Even back then, backward compatability was important to M$, which
>
> I don't recall backslash being part of either CP/M 2.2 or CP/M 3, nor o=
f
> Concurrent CP/M-86, which I believe was the last CP/M (I only had a bri=
ef
> =

> If I recall correctly, even the first DOS didn't have hierarchical
> directory structures. Why backslash was chosen I don't know.

Neither CP/M or MS-DOS 1.x had heirarchical directories.  However,
they both had command line programs that used '/' instead of '-'
to introduce and/or seperate options.  DOS used '/' to be kinda
like CP/M.  (A migration path from i80 based CP/M to i86 based
DOS was considered important at the time.  Unix users tended
to snear at micro-computers anyway, so they didn't get much say.)

When DOS 2.0 incorperated heirarchical directories, using '/' would
have mucked up the syntax of '/' introduced command options, so they
chose to use '\' in the command syntax (though the system calls
actually always parsed both '\' & '/' as dir seperators).

So, yes, '\' can be indirectly blamed on Digital Research.  Of
course Kildall borrowed the /option syntax from RSTS, so perhaps
the blame should follow all the way back to some anonymous
engineer at DEC?

And you know, despite a school of thought that says ways other
what one is used to are STOOPID, sometimes there are pretty valid
reasons for making decisions that turn out to be unfortunate in
the long term.

--
Devin Ben-Hur      <dbenhur@emarket.com>
eMarketing, Inc.   http://www.emarket.com/
"Don't run away. We are your friends."  O-



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

Date: Wed, 5 Feb 1997 22:03:36 -0800
From: "D.M. Johnson" <ez045864@peseta.ucdavis.edu>
Subject: Using exec-Why won't this work?
Message-Id: <Pine.GSO.3.95.970205215719.26151B-100000@bullwinkle.ucdavis.edu>

I am using exec to run a spell function.  I know that it works because if
$pass is spelled wrong then it is put into the file "temp".  However, I
can't read it into $word, nor can I execute any print statement after the
exec call.  Why???  Thanks in advance.

#!/pkg/bin/perl

$pass = "couctrx";
print "This prints out fine\n";

exec "echo $pass | spell > temp";

print "This won't print\n";

open(TEMP,"temp");
print "This won't print either\n";
$word=<TEMP>;
print "$pass\t$word\n";		#Neither of these will print


BTW, I am using ULTRIX.  




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

Date: Thu, 06 Feb 1997 07:12:05 GMT
From: cjtech@inreach.com
Subject: Windows 95 Info Guide
Message-Id: <3ebc4c80.14823249@news.zippo.com>

Find out what you've been missing...

WINDOWS 95 INFO GUIDE

The Only Software Package That Gives You All You Need!

http://home.inreach.com/cjtech

Don't waste money on expensive training videos, books, and magazines
when you can have the information when and where you need it,
at the click of a button.  Order Today and receive your copy of
Windows 95 Info Guide featuring hundreds of tips and tricks in
an easy to use interface and we'll include the updates...FREE!!!




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

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

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 V7 Issue 904
*************************************

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