[6696] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 321 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 17 04:07:29 1997

Date: Thu, 17 Apr 97 01:00:32 -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, 17 Apr 1997     Volume: 8 Number: 321

Today's topics:
     Re: -e command-line option (Jack Applin)
     Re: CGI Prog words, but not all the time (Brian Lavender)
     HELP:  Redirection with Perl... (No Mass Spam E-Mail!)
     How do I post to a newsgroup?? <kuken@dds.nl>
     Re: Ousterhout and Tcl lost the plot with latest paper (Hume Smith)
     Re: Passwords <jfweber@if.insa-lyon.fr>
     Re: PERL BUG: ([]) x 3 does not work correctly <dbenhur@egames.com>
     Re: Perl pattern matching question (Paul Tyson)
     Puzzle: Count Actual Days from MM,DD,YYY to localtime(t (rga)
     Re: Puzzle: Count Actual Days from MM,DD,YYY to localti <tchrist@mox.perl.com>
     Re: quotewords function - "0" problem (Shishir Gundavaram)
     References question !!! <joe@via.net>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Hume Smith)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and <etxbrjn@nrk.ericsson.se>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Chris Bitmead uid(x22068))
     Re: Source code security for Perl 5 on NT (Activeware) (Brooks Davis)
     Re: Unexpected Behavior using open () <steveg@ccis.adisys.com.au>
     Re: Unexpected Behavior using open () <tchrist@mox.perl.com>
     Re: Unix and ease of use  (WAS: Who makes more ...) (Steve Mading)
     Re: user authentification <jfweber@if.insa-lyon.fr>
     Re: Wanted: UNIX email parser <tibbs@hpc.uh.edu>
     Re: What does "UNIX" stand for.. <Michael.Salmon@uab.ericsson.se>
     Re: Win 32: tie/sdbm problems. (Massimo Morelli)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 17 Apr 1997 04:57:22 GMT
From: neutron@fc.hp.com (Jack Applin)
Subject: Re: -e command-line option
Message-Id: <5j4aji$eso@fcnews.fc.hp.com>

> > perl -e 'while(<>){ print "$. $_"; }' -e 'print "DONE\n"' < ~/.login
> > perl -pe 'END { print "DONE\n" } print "$. "' < ~/.login
> > perl -pe 's/^/$. /; $_ .= "DONE\n" if eof' ~/.login
>   perl -pe 's/^/$. /; eof && s/$/\nDONE/' ~/.login

What a waste of a caret!

    perl -pe 's//$. /; eof && s/$/\nDONE/' ~/.login


						-Jack Applin


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

Date: Thu, 17 Apr 1997 05:54:43 GMT
From: brian@brie.com (Brian Lavender)
Subject: Re: CGI Prog words, but not all the time
Message-Id: <3355ba17.42186932@nntp.netcruiser>

Try inserting 
$|++;
at the beginning of your script. This makes your STDOUT piping hot and
whatever gets sent goes immediately. Otherwise it might be buffered,
holding the output.

In addition, look at the idiots guide to cgi. It has a lot of basics.

http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html

brian
----------------
Brian Lavender
Brie Web Publishing
Owner
Napa, CA
(707) 226-8891

Brie Business Directory - Napa Valley      http://www.brie.com/bbd 

On 17 Apr 1997 01:11:49 GMT, "Michael Wilson" <mwilson@csd.uwm.edu>
wrote:

>Two CGI program at my web site work, but they
>only work intermittently.  Sometimes you  have to
>re-fresh the page 4 or 5 times before the CGI program
>finally runs.  
>
>When it was happening with my search program, I
>thought it was the software. But I installed a guestbook
>program, and it also works intermittently.
>
>When it doesn't work, the returned box says: "Internet
>Explorer cannot open the Internet Site. . . . The operation
>completed successfully."  When Netscape doesn't work,
>it returns saying the page is empty, as I recall.
>
>One of the web sites is:
>	http://www.uwm.edu/~mwilson/nativelit/2
>		try the search engine.
>
>Thanks for any suggestions.
>
>Mike



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

Date: 17 Apr 1997 05:59:36 GMT
From: zippidy@do.dah.com (No Mass Spam E-Mail!)
Subject: HELP:  Redirection with Perl...
Message-Id: <5j4e88$9v3@usenet85.supernews.com>

Not quite newbie..

I did it once before, and since have lost my drive, and all my
development CGI's!

I want to call a url and have the browser load it from Perl.

Also, Iam haveing some trouble with printing " chars.

I tried:

print "<META HTTP-EQUIV=&#34REFRESH&#3 
CONTENT=&#34URL=http://www.digispec.com/loadthis.htm&#34>";

This does not work.  It will work on an HTML page with
the &#34 replaced with the actual ' " '.

Any suggestions on this, also??

Thanks for any help in advance-
PLEASE e-mail me at webmaster@digispec.com


 
The *REAL* Internet users prayer:
"Lord, I pray that spam will disappare from the Internet.
Lord, I ask if this is to be done, may it be soon.
Lord, you know how fustrating it is to find real
and valuable information while wadeing throught
the garbage. Thank you Lord, Aman"



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

Date: Tue, 15 Apr 1997 17:21:39 +0200 (MET DST)
From: Kennart Knoelpung <kuken@dds.nl>
Subject: How do I post to a newsgroup??
Message-Id: <Pine.SUN.3.90.970415172050.18810B-100000@dds.dds.nl>


Just trying how to post to newsgroups!!!


                            ///////
                            //    O
                           //      >
                            / \__ ~
                              ||                           /////
                             (\ \)   (~)                    //  o
                             ( \ \  / /                    //    >
                             (  \ \/ /         ____________/ \__O
                             (   \__/         /  ___ ______\//
                             /   | /@        (  /  / ______)/
                            (    |//          \ \ / /   (_)
                             \   ()            \ \O/
                              \  |              ) )
                               ) )             / /
                              (  |_           / /_
                              (____>         (____>


/K




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

Date: 16 Apr 1997 15:22:55 GMT
From: hclsmith@tallships.istar.ca (Hume Smith)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5j2qsf$hj0@news.istar.ca>

In article <5j1ib1$kp3@roar.cs.utexas.edu>, wilson@cs.utexas.edu says...

>   So the bottom line is that Ousterhout seems to have bailed, and 
>other Tcl fans don't seem to be defending Tcl against several serious 
>technical criticisms.  Is that because they don't have good answers
>(except for market-share arguments), or just that they lost interest
>in the flamewar?

bingo.

I gave up fighting "my language is better than your language" junta years ago. 
they *are* religious wars and *cannot* be resolved.  why can't we just let 
people use what language they like and stop the fucking quabbling!?!  i'm sick 
to bloody death of this bollocks.  i've used around twenty languages; tcl is 
nice for some things (it was the first X program i had; it's been very nice 
in DB-HTML-WWW interfacing), awful for others (i wouldn't try writing yacc or 
other symbol-heavy stuff in it; but then i wouldn't write them in C either).  
right now i like it because it's a vast improvement over opther UNIX scripting 
languages (lists that work (nest, can have arbitrary strings), globbing 
that works (doesn't blast any little string that comes along with a * in 
it), arrays that work, procedures that work, commands that nest (do 'this 'do 
that''? right)...), i can run my email program on both my Unix and Windows 
machines, i can glue things into it on UNIX (Windows doesn't have anything 
worth glueing in), i can read it (i've passed the point of being able to keep 
straight all the little squiggly characters so beloved in the Temples of C++ 
and Perl)...

i don't do everything in it, but i'm alwful gald it exists.  now shut UP and 
leave me BE.



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

Date: Thu, 17 Apr 1997 10:06:00 +0200
From: Jean-Francois Weber <jfweber@if.insa-lyon.fr>
Subject: Re: Passwords
Message-Id: <3355D9E8.678D@if.insa-lyon.fr>

Stephen Hill wrote:
> 
> I am working on a script that will allow people to send/receive email
> through thier browser.
> I want to have people fill out a form on the main page to check thier mail
> and I want to use the existing password file.
> Is there a way to encrypt the password and then compare it to the password
> file? If so, where do I get info on that?
> 
 There is a way to do the password comparaison.
 You can find it in the Perlfunc(1) documentation, at the function
"crypt". Here is the sample code:

	$pwd = (getpwuid($<))[1];
	$salt = substr($pwd, 0, 2);
	 
	system "stty -echo";
	print "Password: ";
	chop($word = <STDIN>);
	print "\n";
	system "stty echo";
 
	print "$pwd\n";
	if (crypt($word, $salt) ne $pwd) {
	   die "Sorry...\n";
	} else {
	   print "ok\n";
	}

 I hope you have much luke than me by using it. On my Solaris 2.5 box
with shadow password, it doesn't work. But in the faq, it is said that
it must.
 If someone as an idea, I wourld appreciate his help.
--
Jean-Francois Weber / Sys-Admin |  E-Mail    :  jfweber@if.insa-lyon.fr
     INSA Lyon - Dept IF        |  Telephone :    (0 | +33) 4-7243-8325
  Bat 501 - 20 Av. A. Einstein  |  Fax       :    (0 | +33) 4-7243-8518
  F69621 VILLEURBANNE Cedex     \


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

Date: Wed, 16 Apr 1997 21:15:45 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Brian Dellert <xpress@pobox.com>
Subject: Re: PERL BUG: ([]) x 3 does not work correctly
Message-Id: <3355A3F1.44BB@egames.com>

[mail&post]
Brian Dellert wrote:
> Thanks for the info. Any idea how I can get my array to contain an
> arbitrary number of *different* array references. This is the code
> I'm using now:
> my($i, @chain);
> for($i=0; $i<@$pieces; $i++) {
>         push @chain, [];
> }
> Is there any more elegant/faster solution? My gut feeling is that
> there must be, but maybe this is my only bet.

Well, the above seems pretty straight forward to me, but
if you want something more concise try:

  @chain = map [], @pieces;

This is likely NOT faster as it has to alias $_ to each
element of @pieces as it iterates and it builds a temporary
array which then gets assigned to @chain.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out, 
 you didn't want to know anyway..." --Larry Wall



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

Date: 16 Apr 1997 23:18:08 -0500
From: ptyso@southwind.net (Paul Tyson)
Subject: Re: Perl pattern matching question
Message-Id: <m2bu7eqo3j.fsf@southwind.net>

>>>>> "Hans" == Hans Suijkerbuijk <Hans.Suijkerbuijk@SD.BE> writes:

    Hans> Hi, As I start using perl and used to use Omnimark (an
    Hans> SGML-aware conversion-tool), my way of converting may be
    Hans> influenced by Omnimark, but what I want to do is the
    Hans> following:

    Hans> I want to convert the following string:

    Hans> <WREF TYPE="INSERT" RB="LAW" RBDATE="22.12.89"></WREF>

    Hans> to:

    Hans> <B>INSERTED BY LAW ON 22.12.89</B>

If you're doing a lot of SGML conversion you might look at the SGMLSpm
module.  It uses sgmls to parse the SGML document and makes attribute
and element information available to the perl program, similar to what
you can do with OmniMark.

I have not used SGMLSpm myself, but it seems to work for people who
know perl and sgmls.  Look at http://www.perl.com/perl for directions
to the package.


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

Date: Thu, 17 Apr 1997 05:34:13 GMT
From: rga@io.com (rga)
Subject: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <3355a6f7.17526421@news.io.com>


No laughing out loud, please.

And yes, I know about DATE::MANIP @ CPAN,
which is very good; however, I want only to be
able to calculate actual days between a date
until the current date, in as few lines as possible, 
and all contained in one file without using the module.

You know, the simple "How Many Days You 
Have Been On The Planet" program that 
everyone did in basic many years ago, except that
I never learned basic, and don't know how it went.

And yes, please flame if this question really belongs in
alt.mathmatician.puzzles.that.math.dummies.ask ...
and there's a math formula that does this.
 
=================

My G*d, there's gotta' be an easier way to do this than
what my amature mind came up with; however, it does
work, even counts leap year months correctly.  It's just
some pretty serious looping going on !

PS - does anyone have a better is this leap year YYYY line ?
PS - does anyone have a quick formula to turn the $total_days into
real Years, Months, Days ?




#!/usr/local/bin/perl

	# assign current date values

($mday,$mon,$year) = (localtime(time))[3,4,5];
      if ($mday < 10) { $mday = "0$mday"; }
      $year = "19$year";


	# assign the Beginning date values
($MTH,$TDD,$YRW) = (MM,DD,YYYY);

@TM = (31,$F,31,30,31,30,31,31,30,31,30,31);
$total_days = 0;


while ($MTH <= ($mon + 1) && $YRW == $year || $MTH <= 12 && $YRW <
$year)  {


	## test for leap year 
   	$yeardiv = ($YRW / 4);
   	$yearint = int($yeardiv);
   	$yeardiv1 = ($YRW / 100);
   	$yearint1 = int($yeardiv1);
   	if ($yeardiv eq $yearint && $yeardiv1 ne $yearint1) {
      	$TM[1] = 29;
   	}else {
      	$TM[1] = 28;
   	}


     if ($MTH == ($mon + 1) && $YRW == $year)   {

          while (++$TDD <= $mday)  {
      
	$total_days += 1;

           }

     }else{

           while (++$TDD <= $TM[$MTH - 1])  {

	$total_days += 1;

           }

	$TDD = 0;   # reset TDD after each full month


     }   # end inside if/else


	$MTH += 1;

	if  ($MTH == 13 )  {
	$MTH =1;
	$YRW += 1;
	}

}  # end outside loop


Hmmm .. believe it or not
It seems to work !

print "Total Days = $total_days.";





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

Date: 17 Apr 1997 07:03:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <5j4hv7$2tb$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, rga@io.com writes:
:No laughing out loud, please.
:And yes, I know about DATE::MANIP @ CPAN,
:which is very good; however, I want only to be
:able to calculate actual days between a date
:until the current date, in as few lines as possible, 
:and all contained in one file without using the module.

I suppose you'd like us to built that functionality
into the perl core binary, since you aren't allowed
to use modules? 

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    Real Programmers don't write in PL/I.  PL/I is for programmers who
    can't decide whether to write in COBOL or FORTRAN.


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

Date: 17 Apr 1997 04:52:54 GMT
From: shishir@ruby.ora.com (Shishir Gundavaram)
Subject: Re: quotewords function - "0" problem
Message-Id: <5j4ab6$1n7$1@amber.ora.com>

bsautter@get-it.net wrote:
: I am using the "quotewords" function along with
: some other code to split a CSV file.

[deleted]

: It eliminates any zero found at the end of a line!
: Zeros in the middle are not affected as in "string0".
: Only by putting quotes around the last value will it
: keep the zero:

[deleted]

: Has anyone noticed this problem before or have a solution?

Yep. Here's the modified version of quotewords. You might want
to check out Sprite, available at your local CPAN mirror. This
module allows you to manipulate CSV data using a "pseudo" SQL
syntax, though it's a little buggy.

--Shishir

-----------------------------< Cut Here >----------------------------

sub quotewords
{
    my ($delim, $keep, @lines) = @_;
    my (@words, $snippet, $field);

    local $_ = join ('', @lines);

    while (length) {
        $field = '';

        for (;;) {
            $snippet = '';

            if (s/^"([^"\\]*(\\.[^"\\]*)*)"//) {
                $snippet = $1;
                $snippet = qq|"$snippet"| if ($keep);

            } elsif (s/^'([^'\\]*(\\.[^'\\]*)*)'//) {            
                $snippet = $1;
                $snippet = "'$snippet'" if ($keep);

            } elsif (/^["']/) {            
                die 'Unmatched quote';

            } elsif (s/^\\(.)//) {            
                $snippet = $1;
                $snippet = "\\$snippet" if ($keep);

            } elsif (!length || s/^$delim//) {
               last;

            } else {
                while (length && !(/^$delim/ || /^['"\\]/)) {
                   $snippet .= substr ($_, 0, 1);
                   substr ($_, 0, 1) = '';
                }
            }

            $field .= $snippet;
        }

        push (@words, $field);
    }

    return (@words);
}

1;


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

Date: Wed, 16 Apr 1997 20:48:08 -0700
From: Joe McGuckin <joe@via.net>
Subject: References question !!!
Message-Id: <33559D2E.5C64FE6E@via.net>

Given the following:

$foo = "joe";

$$foo{"foo"} = "foo";
$$foo{"bar"} = "bar";

How do I say %$$foo, so I can foreach over the keys in the
$$foo reference?

I'd like to be abe to say

  foreach $i (keys(%$$foo)){
  }

But that's not correct syntax.

Thanks!

Joe


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

Date: 16 Apr 1997 14:54:24 GMT
From: hclsmith@tallships.istar.ca (Hume Smith)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5j2p70$hj0@news.istar.ca>

In article <335476A5.18EA@maths.anu.edu.au>, graham.matthews@maths.anu.edu.au 
says...
>
>
>> In article <33545E78.4983@maths.anu.edu.au>, Graham Matthews
>> +No its not irrelevant. The question was why did JO chose the "everything
>> +is a string" paradigm, when he could have chosen the "everything is an
>> +integer", or "everything is a list" paradigm? This correspondence shows
>> +the stupidity of the "everything is a string is so powerful" argument.
>Michael L. Siemon wrote:
>> Sorry, but that does not follow. Bijections are all very well (hey, I'm
>> a topologist by training :-)), but human predispositions are relevant
>> here, and most people are more intuitively at home with "reading" a
>> string "1.0 + 3" as a sequence of characters than, e.g., processing a
>> text into a Goedel enumeration, (or more directly to the point, going
>> the other way, from the integer to the text.)
>
>You have missed the point! I am arguing against the claim that
>"everything is a string is so *powerful*". This claim is rubbish since
>"everything is a list" is just as powerful.

"everything" is a list. hmm.  so what should this do:
	((()((()((()()))(()))))((()())))
i think we'd want a little more than just lists.  not even Lisp constrains us 
to just lists; it's got symbols, namespaces, strings, characters, umpteen kinds 
of numbers; some lisps have structures, objects, classes, closures...

>This leads to the question of why do you think the "everything is a
>string" approach is so convenient. As far as I can see its less
>convenient than allowing a mixture of typed objects.

"everything as strings" is convenient because in most languages, programs 
actually exist as a string at some stage - as their original source code.  tcl 
goes through a minimum of fuss converting source to internal form.



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

Date: Thu, 17 Apr 1997 07:44:43 -0700
From: Bror Johansson <etxbrjn@nrk.ericsson.se>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <3356375B.11EA@nrk.ericsson.se>

Erik Naggum wrote:
> 
> * Charles Lin
> | If one had to choose a single type for everything, a string is a pretty
> | good choice.  Why not a number?  How would you represent a string with a
> | number?
> 
> excuse me?  what you call a "string" already _is_ a number.  computers
> don't have characters.  display devices and printers do.
> 

Programming language related topics should then be discussed in the
context of number theory, or...? If so, sci.math.* should host this
ever ongoing, and rapidly deteriorating thread of discussion.

> one of the first lessons of computer science _should_ have been internal
> and external representation are so wildly different concepts that they
> cannot even be confused, except, of course, by people who are fully aware
> of the difference, but proceed to attempt to obliterate it.
> 
> #\Erik
> --
> I'm no longer young enough to know everything.

Bror Johansson
Ericsson Telecom AB, Norrkvping, Sweden


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

Date: 17 Apr 1997 17:00:09 +1000
From: Chris.Bitmead@alcatel.com.au (Chris Bitmead uid(x22068))
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <s6ypvvukubq.fsf@aalh02.alcatel.com.au>

mls@panix.com (Michael L. Siemon) writes:


> Sorry, but that does not follow. Bijections are all very well (hey, I'm
> a topologist by training :-)), but human predispositions are relevant
> here, and most people are more intuitively at home with "reading" a
> string "1.0 + 3" as a sequence of characters than, e.g., processing a
> text into a Goedel enumeration, (or more directly to the point, going
> the other way, from the integer to the text.)
> 
> Simplicity and uniformity *are* relevant. One might argue that it matters
> not *what* primitive representation is used, but I would laugh at anyone
> who seriously thought that non-string representations were "simpler" than
> strings.
> 
> Try representing the _Iliad_ as either an integer or a list. Just try;
> I want to see what kind of idiocies you will commit. That it is possible
> I willingly acknowledge; that it is sane, I seriously doubt.

Goodness me, The Iliad! As in Homer? 

Ok, let's talk about that, but I pick Aristotle instead :-).

Now Aristotle wrote in Greek, the characters of which you cannot
represent in an ascii string.

I don't subscribe to the "everything is a ...." theory. Sure it's nice
to be able to deal with different types in the same way, but that's
what *polymorphism* is for. Oh sorry, JO don't like OO.

I can see no advantage whatsover in making everything fit in a string
(or a list or a bignum). Take lists for example. A properly designed
OO library would allow you to traverse a string or list or array
without knowing what the underlying type is.
 
> Humans reading strings which *happen* to contain conventional represent-
> ations of numbers are happy to make mental conversions. The converse is
> *not* true -- "reading" an arbitrary integer as (by some abstruse mapping)
> a text string is utterly weird and non-standard. It is quite hopeless for
> documentation, for training, and for maintenance. And in case you were a
> bit out of it, LANGUAGE is what humans ordinarily use in communication.
> It is human readers (and writers) who matter, when we are talking about
> programming.

While Lisp does not store numbers as strings, I never know or care
that this is the case. In fact I could write a Lisp implementation
that does store numbers as strings, and a programmer using it would be
none the wiser (apart from awful performance of course). Why do you
want to fit everything in a string?? It buys you NOTHING.



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

Date: 17 Apr 1997 05:16:34 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: Source code security for Perl 5 on NT (Activeware)
Message-Id: <5j4bni$nps$1@cinenews.claremont.edu>

John A. Kaliski (johnk@krypton.mankato.msus.edu) wrote:
: Does anyone have any other ideas?  Has anyone out there developed a PERL
: based system for NT which you are marketing?  If so how did you protect
: your source code?

Checkout the relavant section of the Perl FAQ titled "How can I hide the
source for my Perl program?"

This should give you some ideas, however, the most important statement
in the document from my point of view is:

"If you're concerned about people profiting from your code, then the bottom
line is that nothing else but a restrictive licence will give you legal
security."

-- Brooks

--
Brooks Davis            +------------------------------------------------+
brdavis@hmc.edu         | "_Slackware_ [Linux] is the MacOS of UNIXes."  |
Harvey Mudd College     |                    -- Richard Garnish          |
340 E. Foothill Blvd.   |                       on alt.sysadmin.recovery |
Claremont, CA 91711     +------------------------------------------------+


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

Date: Thu, 17 Apr 1997 19:24:30 GMT
From: Steve Gunnell <steveg@ccis.adisys.com.au>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Unexpected Behavior using open ()
Message-Id: <335678EE.3F7@ccis.adisys.com.au>


Tom Christiansen wrote:

> Because you *told* it to.   Did you read the entry for open in
> the perlfunc manpage?  Did you read the FAQ?  Here's the FAQ
> entry for that:
> 
>    How come when I open the file read-write it wipes it out?
> 
>    Because you're using something like this, which truncates the file
>    and then gives you read-write access:
> 
>        open(FH, "+> /path/name");  # WRONG
> 
>    Whoops.  You should instead use this, which will fail if the file
>    doesn't exist.
> 

Jeez Tom,

Have YOU read the perlfunc manpage? Here's an extract:

             contains the filename.  If the filename begins with
             "<" or nothing, the file is opened for input.  If
             the filename begins with ">", the file is opened for
             output.  If the filename begins with ">>", the file
             is opened for appending.  (You can put a '+' in
             front of the '>' or '<' to indicate that you want
             both read and write access to the file.)  If the

Where does it say "truncates the file?

Stop shooting the bloody messangers and have the guts to accept
that sometimes the documentation is unclear or missing. Not
everyone has web access to get to the FAQ list. Lighten up a
bit.

Steveg


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

Date: 17 Apr 1997 07:01:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Unexpected Behavior using open ()
Message-Id: <5j4hs0$2tb$1@csnews.cs.colorado.edu>

:Where does it say "truncates the file?

Where I put it:

    If the filename begins with '<' or nothing, the file is opened
    for input.  If the filename begins with '>', the file is truncated
    and opened for output.  If the filename begins with '>>', the file
    is opened for appending.  You can put a '+' in front of the '>' or
    '<' to indicate that you want both read and write access to the file;
    thus '+<' is almost always preferred for read/write updates--the '+>'
    mode would clobber the file first.  The prefix and the filename may
    be separated with spaces.  These various prefixes correspond to the
    fopen(3) modes of 'r', 'r+', 'w', 'w+', 'a', and 'a+'.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    That means I'll have to use $ans to suppress newlines now.  
    Life is ridiculous. 
        --Larry Wall in Configure from the perl distribution


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

Date: 16 Apr 1997 23:37:07 -0500
From: madings@earth.execpc.com (Steve Mading)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5j49dj$aeg$1@earth.execpc.com>

Kaz Kylheku (kaz@vision.crest.nt.com) wrote:
: In article <5j2ljd$q0f@tracy.nacs.net>, Jettero Heller <heller@nacs.net> wrote:
: >Tim Behrendsen (tim@a-sis.com) wrote:
: >  [in reference to pkzip over tar+gzip]
: >: Or how about self-extracting archives?
: >
: >This concept is utterly useless in un*x. The fact that you bring it
: >up indicates that you aren't completely clear on the concept behind
: >un*x.

: Really? Perhaps you have never heard of shell archive files? ;)

: I use the beasties on a regular basis.

So do I.  But I don't think they count.  See below.

: I recently prepared UNIX archive that will not only self extract directly off
: a tape drive, but also configure itself. That way the customers only have one
: command to execute.

The whole point of a self extracting EXE is that the end customer does
not need any other software other than the EXE to extract the file.
A shell archive, while useful, still has to make assumptions about
what software is on the destination machine (the shell interpeter,
plus whatever else is used (uuencode, tar, gzip, etc) ).

Don't get me wrong, I prefer shell archives, but they are not
the same thing as PKZIP self extracting EXE's, and they don't
exist for the same reason.



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

Date: Thu, 17 Apr 1997 10:12:02 +0200
From: Jean-Francois Weber <jfweber@if.insa-lyon.fr>
Subject: Re: user authentification
Message-Id: <3355DB52.4759@if.insa-lyon.fr>

Santiago Alvarez Rojo wrote:
> 
> Are there any module to perform user authentification (username/password)
> using /etc/passwd file.
> 
 You can found it in th Perlfunc(1) section or in th Posix Module.
 Look at the "crypt" function, there is a code example.
--
Jean-Francois Weber / Sys-Admin |  E-Mail    :  jfweber@if.insa-lyon.fr
     INSA Lyon - Dept IF        |  Telephone :    (0 | +33) 4-7243-8325
  Bat 501 - 20 Av. A. Einstein  |  Fax       :    (0 | +33) 4-7243-8518
  F69621 VILLEURBANNE Cedex     \


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

Date: 17 Apr 1997 00:40:16 -0500
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
To: mirtos@panix.com
Subject: Re: Wanted: UNIX email parser
Message-Id: <ufaohberyv3.fsf@sina.hpc.uh.edu>

comp.lang.perl does not exist.

>>>>> "m" == mirtos  <mirtos@panix.com> writes:

m> To, From, Subject, Body, and the number of attachments if there were
m> any.

You can do plenty of things with the MIME modules.  Parse a MIME message,
get header values, pull apart the body into nested attachments, decode and
save them.  There is example code in the MIME tools package.

m> Ive looked into MailTools, but there doesnt seem to be anything that
m> will do this specifically.

MailTools does it all except the parsing of the body for MIME stuff.  The
MIME tools use MailTols for the basic parsing, in fact.
-- 
      Jason L. Tibbitts III - tibbs@uh.edu - 713/743-8684 - 221SR1
System Manager:  University of Houston High Performance Computing Center
                1994 PC800 "Kuroneko"      DoD# 1723


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

Date: Thu, 17 Apr 1997 09:03:14 +0200
From: Michael Salmon <Michael.Salmon@uab.ericsson.se>
Subject: Re: What does "UNIX" stand for..
Message-Id: <3355CB31.2188@uab.ericsson.se>

Ron Natalie wrote:
> 
> >      unix is based on a high portability
> >      design philosophy ...
> 
> Actually, while UNIX ended up being portable, I don't
> think that was the design philosophy.  UNIX's design
> philosophy (unfortunately lost in the bloated systems
> of today) was to make a series of small, interoperable
> tools, to be combined into powerful operations by the
> user.

I don't think that that was a design philosophy. My understanding is
that Ken Thompson became tired of cross assembling his space travel
simulation :^) on a GE mainframe and wrote Unix so that he could do
native assemblies, other people found the new system interesting and
wrote tools for it in their "spare time", the small interoperating tools
were more pragmatic than philosophic. Personally I think that it is the
difference between people developing tools and teams/companies doing it.
Of course the teletypes of the day must have helped to prevent too many
bells and whistles.

> Much of early UNIX wasn't exactly portable.  Large
> chunks were still in assembler (and C had yet to be widely
> ported either).  Goofy PDP-11 specific features abounded
> and still exist to this day in things like the UNIX
> signal names.

The original Unix of course was on a PDP 7.

-- 
This space intentionally left non-blank.


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

Date: Thu, 17 Apr 1997 07:04:29 GMT
From: Massimo.Morelli@comune.bologna.it (Massimo Morelli)
Subject: Re: Win 32: tie/sdbm problems.
Message-Id: <3355caf3.1098923@news.comune.bologna.it>

On Tue, 15 Apr 1997 17:14:37 GMT, Massimo.Morelli@comune.bologna.it
(Massimo Morelli) wrote:

>It seems I have problems with tie/sdbm (I tried also dbmopen).
>I have windows 95.
>Perl version:
>------------------------------------------------------------------
>Perl for Win32 Build 304 - Built 10:41:07 Mar 22 1997
>
>This is perl, version 5.003_07
>------------------------------------------------------------------

OK, my installation is broken, I tried on another PC and worked.
Thanks.

Massimo Morelli


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

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

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