[7344] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 969 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 3 15:08:40 1997

Date: Wed, 3 Sep 97 12:00:25 -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           Wed, 3 Sep 1997     Volume: 8 Number: 969

Today's topics:
     Re: "Odd number of elements in hash list": So? (Kevin)
     Re: "U.S." =~ m/\bU\.S\.\b/ fails (Malachai)
     Re: /usr/bin/perl wrapper for multiple OS <pmp@egnetz.uebemc.siemens.de>
     Re: Array Question about fast method of comparisons (M.J.T. Guy)
     Binary file upload griffithsj@rsc.org
     Can Perl call external programs? <kowens@stride.doe.gov>
     Can Perl call external programs? <kowens@stride.doe.gov>
     Re: Can Perl call external programs? ("John Dallman")
     Re: complex pattern?!? it shouldn't be, i think :) (Terry Michael Fletcher - PCD ~)
     Re: complex pattern?!? it shouldn't be, i think :) <usenet-tag@qz.little-neck.ny.us>
     Is Perl for Win32 really as brain damaged as it seems? (Jessica)
     Re: IS there a 'strlen' in Perl? (brian d foy)
     Re: IS there a 'strlen' in Perl? <curtis@casper.aisf.com>
     Re: Matt Wright's Counter on Windows NT (Thomas Dauria)
     Re: Matt Wright's Counter on Windows NT (Thomas Dauria)
     My vs local declarations <wxguest1@wv.MENTORG.COM>
     Re: pattern matching HELP! (Eric Bohlman)
     Re: perl and XEmacs (Gary D. Foster)
     Re: Q: Instalation on ULTRIX 4 <gonzalez@eucmdx.gae.ucm.es>
     Re: Script on input to perl arrays wanted - Newbie lear (Kevin)
     Re: Script Time (Andrew Starr)
     Re: SSI in SSI.. (Terry Michael Fletcher - PCD ~)
     Re: Time question.. (Andrew Starr)
     Re: Time warp - Perl 4 question (I R A Aggie)
     WHY doesnt this work ?? (COWBYS)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Sep 1997 09:45:00 -0700
From: klander@primenet (Kevin)
Subject: Re: "Odd number of elements in hash list": So?
Message-Id: <340d939d.1937786@news.primenet.com>

On 3 Sep 1997 00:59:14 GMT, dclaar@hp.cNoSPAm (Doug Claar) wrote:

>
>With -w and strict turned on, perl 5.004 warns me that I have an
>"Odd number of elements in hash list". Why does it care, and should
>I care? Seems like a fairly useless error message, in that--if there
>is a reason that this is bad, it certainly doesn't tell you what it
>is, and if it isn't, why print it?
>

This happens when you try to assign a list with an odd number of
elements to a hash (i.e. one of the keys doesn't have a value).  For
example:

%stuff = ('el1', 'one', 'el2', 'two', 'el3');

will generate the error because there is no value associated with the
last key.


--
  Kevin -- klander at primenet dot com (add the .com in email replies)
           http://www.primenet.com/~klander
--


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

Date: Wed, 3 Sep 1997 14:05:57 GMT
From: rsh@sun38.humb.nt.com (Malachai)
Subject: Re: "U.S." =~ m/\bU\.S\.\b/ fails
Message-Id: <EFxr5x.16y@sunsrvr6.cci.com>


On Mon, 1 Sep 1997 21:45:03 -0400, Jon Wahl <jjwahl@eznet.net> wrote:
>
> I tried it too and it seems that Perl has a problem with the second \b word
>boundary.  According to the Camel Book,
>'The special character string \b matches at a word boundary, which is
>defined as the "nothing" between a word character (\w) and a non-word
>character (\W), in either order.  (The characters that don't exist off the
>beginning and end of your string are considered to be non-word characters.)'
>Which, as I read it means that your pattern should match.
>
>Scratching my head too,
>
>Jon Wahl
>
>jjwahl@eznet.net
>
>James H. Thompson wrote in article <5ufgc8$ccn@nuhou.aloha.net>...
>>if ("U.S." =~ m/\bU\.S\.\b/) {
>>    print "match\n";
>>    }
>>else {
>>    print "no match\n";
>>    }
>>
>>prints "no match"
>


It's not supposed to match.  You're second period character isn't
alphanumeric like the "\w" that the regexp requires, since the
character that doesn't exist at the end of the string already matches
the "\W".  For that regexp to work, you'd need "\b" to accept a "\W"
on both sides.  The first "\b" works because 'U' is in "\w".

Your regexp _would_ match like this:

"U.S.A" =~ /\bU\.S\.\b/

since the 'A' satisfies the \w and the '.' satisfies the \W of the \b.

-- 
Shawn Halpenny

"It is impossible to make anything foolproof because fools are so ingenious."


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

Date: Wed, 03 Sep 1997 18:55:56 +0200
From: Bernard Weiler <pmp@egnetz.uebemc.siemens.de>
Subject: Re: /usr/bin/perl wrapper for multiple OS
Message-Id: <340D969C.207A@egnetz.uebemc.siemens.de>

I was also searching a wrapper for HPUX and Solaris.
It isn't possible. I'll force my administrator to build an automount
entry depending on the plattform.

Look at old posting:
http://xp10.dejanews.com/getdoc.xp?recnum=5434053&search=thread&threaded=1&server=db95q4&CONTEXT=873305307.962267844&HIT_CONTEXT=873304654.1167722027&HIT_NUM=27&hitnum=3&NTL=1

Don D. Hiatt wrote:
> 
> Hi,
> 
>  I wrote a really brain damaged wrapper(see below) to select between
> the sunOS or solaris perl binary. This works fine when invoked from
-- 
--------------------
Name:		Bernard Weiler
Org.:		OeN TR HW A1, Mch-H, Siemens AG
Keywords:	MCATS;Asic;SDH;Perl
Tel:   		office 722-28374, private 089-7901737
email: 		pmp@egnetz.uebemc.siemens.de 
		or Bernard.Weiler@oen.siemens.de 
Snailmail:  	Siemens AG, OeN TR HW A1, Mch-H, Postfach 700071, D-81359
Munich
Intranet: 	http://susi.oen.siemens.de/~pmp
PGP:		the public key may be downloaded from
pgp-public-keys@uni-paderborn.de
		with Subject 'get Bernard Weiler <Bernard.Weiler@oen.siemens.de>'


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

Date: 3 Sep 1997 18:06:00 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Array Question about fast method of comparisons
Message-Id: <5uk8u8$avp$1@lyra.csx.cam.ac.uk>

D. Dante Lorenso <dlorenso@afai.com> wrote:
>
>I have two arrays:
>
>	@array1 = qw|3 4 5 16 24 1 43 42 31 23 56|;
>	@array2 = qw|4 5 6 2 1 43 31 23 56 18 27 69|;
>
>and I would like to do a comparison of these two arrays and receive output
>of three arrays that contain the following information:
>
>	@out1 = qw|3 16 24 42|;		# Contains all the items in Array 1 but NOT in
>array 2
>	@out2 = qw|4 5 1 43 31 23 56|;	# Contains all the items that are in BOTH
>Array1 and Array2
>	@out3 = qw|6 2 18 27 69|;	# Contains all the items in Array 2 but NOT in
>array 1
>
>What is the most efficient algorithm to use in order to send two arrays and
>return three with the conditions listed?  

See the entry in perlfaq4:

     How do I compute the difference of two arrays?  How do I
     compute the intersection of two arrays?

     Use a hash.  Here's code to do both and more.  It assumes
     that each element is unique in a given array:

         @union = @intersection = @difference = ();
         %count = ();
         foreach $element (@array1, @array2) { $count{$element}++ }
         foreach $element (keys %count) {
             push @union, $element;
             push @{ $count{$element} > 1 ? \@intersection : \@difference },
                  $element;
         }



Mike Guy


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

Date: Wed, 03 Sep 1997 12:01:49 -0600
From: griffithsj@rsc.org
Subject: Binary file upload
Message-Id: <873305540.14810@dejanews.com>

I've created a Perl 5 cgi script to run on our Netscape server (Windows NT
4) that takes information from a Netscape upload form and processes it.
The form has several text input fields (name, address etc) and a file
upload box - the form encryption uses "multipart/form-data".

The script writes the STDIN to a string ($buffer) and writes this string
to a temporary file, reads the information back in from the temporary
file line by line (<>) and assigns the textual information to stings for
later use (eg $name, $address etc).  It then reads the uploaded file and
saves the information into an output file.  It works for all uploaded
files, so long as they're ASCII - binary files only give me the first few
characters.

The snippet of code for writing the file is:
----------
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
open (x, ">$tempfile");
print x $buffer;
close (x);
open (DATA, $tempfile);
while (<DATA>){
	if (!(/-{28,29}$vernum/)){
	print OUTFILE $_;
		}
	}
----------

OK, so I then experimented with another script that stripps the ASCII
information out of $buffer and saves the rest in binary mode:

-------
binmode STDIN;
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# strip out all ASCII bits from $buffer
@patha = (split(/Content-Type: (.*)\n/, $buffer));
@pathb = (split(/----------/, $patha[2]));

#set output file (normally done from the rest of script)
$ofile1 = "d:/temp/file.doc";
open (OUTFILE, ">$ofile1");
binmode OUTFILE;
print OUTFILE $pathb[0];
close (OUTFILE);
print "\n\n$pathb[0]";
-------

However, the data still gets saved to file.doc as the ASCII representation
of the binary data.

Any ideas?  Many thanks in advance ...

Griff
PS - I'm not a computer programmer by trade (in case you didn't guess)

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Wed, 03 Sep 1997 13:53:32 -0400
From: Kenny Owens <kowens@stride.doe.gov>
Subject: Can Perl call external programs?
Message-Id: <340DA41C.47A3@stride.doe.gov>


Can Perl call an external program besides C?  I am using Perl to collect
the necessary information from a form.  I need to call a FoxPro 2.6
program and pass 2 or 3 parameters.  Can this be done?  If so, is there
anything special that I need to do within the Perl program, parameters,
or FoxPro program to get this to work correctly?  
Thanks in advance,
Kenny Owens


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

Date: Wed, 03 Sep 1997 14:38:33 -0400
From: Kenny Owens <kowens@stride.doe.gov>
Subject: Can Perl call external programs?
Message-Id: <340DAEA9.3F2E@stride.doe.gov>


Can Perl call external programs besides c??  I need to call a FoxPro
program from within Perl and pass some parameters.  Can this be done? 
Do I need to do anything "special" to handle the parameters or the
FoxPro program?  
Thanks in advance,
Kenny Owens


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

Date: Wed, 3 Sep 1997 18:28:29 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: Can Perl call external programs?
Message-Id: <EFy3BH.H76@cix.compulink.co.uk>

In article <340DA41C.47A3@stride.doe.gov>, kowens@stride.doe.gov (Kenny 
Owens) wrote:

> Can Perl call an external program besides C?  I am using Perl to collect
> the necessary information from a form.  I need to call a FoxPro 2.6
> program and pass 2 or 3 parameters.  Can this be done?

Easily. Look up the system() command in your perl documentation.

--- 
John Dallman                                     jgd@cix.co.uk


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

Date: 3 Sep 1997 17:01:12 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: complex pattern?!? it shouldn't be, i think :)
Message-Id: <5uk54o$ahe$1@news.fm.intel.com>

Tom Phoenix (rootbeer@teleport.com) so eloquently and verbosely pontificated:
> 
> Actually, HTML tags have a more complex format than that regular
> expression will deal with. This is an example of a valid (and potentially
> useful) tag. 
> 
>     <img src= "rt-arrow.gif" alt= "==>" >
> 
> (Admittedly, this could be written with entity encoding, but that's not
> required. You can also include un-encoded angle brackets within HTML
> comments.) Hope this helps!

and then you get the really crazy people who pull crap like me:

<PRE><IMG SRC="gif/sig.gif" ALT="
  __    _____.__          __         .__     
_/  |__/ ____\  |   _____/  |_  ____ |  |__  
\   __\   __\|  | _/ __ \   __\/ ___\|  |  \ 
 |  |  |  |  |  |_\  ___/|  | \  \___|   Y  \
 |__|  |__|  |____/\___  >__|  \___  >___|  /
                       \/          \/     \/ 
" WIDTH=256 HEIGHT=79></PRE>

ahhh, i remember those days when people used to format their pages for the
fastest browser known to man: "lynx".
oh well.

-- 
#!/usr/local/bin/perl -w
print   "J"                      ."u".        #    -- Terry Fletcher
        "s"    ."t".    " A",     "n"         # tfletche@pcocd2.intel.com
   .    "o"   ,""."".   "the",    "r ","P".   #  Views expressed....not
   "e"."rl"   ." Ha",   "c",''    .""  ."".   #  INTeL's....yadda yadda
      ""            ,   "k".      "e"  ."r"  ;#          yadda....



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

Date: 3 Sep 1997 18:44:28 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: complex pattern?!? it shouldn't be, i think :)
Message-Id: <eli$9709031432@qz.little-neck.ny.us>

Kuntal Daftary  <daftary@cisco.com> wrote:
> MJ.VAN OOSTERHOUT wrote:
> > s/<.*?>//g;
> > The question mark stops the * being 'greedy'. See perlre
> cant u just write the same thing as thus:
> s/<[^>]*>//g;

Kuntal's version is better for these reasons:

	(1) works in more regular expression engines (eg perl4)
	(2) more efficent (according to _Mastering Regular Expressions_)
	    in some versions of perl
	(3) less likely to break when context is added to the RE

Both of these suck for stripping tags out of HTML however.

<!-- <This line is a (single) valid HTML 2.0 comment> -->

I believe < and > are allowed in quoted attributes, such as ALT text,
as well.

Using a single regular expression to remove HTML tags from text
is a non-trivial task. There probably is some method in the HTML::
module you should use instead.

Elijah
------
thinks HTML comments are FUBAR


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

Date: 3 Sep 1997 17:31:37 GMT
From: jdm@thetics.europa.com (Jessica)
Subject: Is Perl for Win32 really as brain damaged as it seems?
Message-Id: <5uk6tp$c2v$1@usenet88.supernews.com>

I'm attempting to write a script to run an external command for every
file in a directory tree under Win95 and WinNT and presents the results.

I tried using backticks to execute the command and it would run the 
command correctly and return the correct output to my script, but for
no apparent reason, _it would access a:\ every time the external command
was executed_.  The external command doesn't reference a:\ and nothing
in my path or environment references a:\.  This made the drive grind
noisily throughout the entire operation and was rather irritating to
listen to.  just the command print `dir c:\`; by itself accesses my
floppy drive for no reason.  This happens with both builds 110 and 307 
and when I mentioned it to a coworker, he claimed to have seen this 
problem before also.

Also, chdir and Win32::SetCwd do not work when attempting to change
the current directory to a different drive and using opendir on the
root of a drive fails.

Frankly, these problems make perl for win32 useless for the application 
I need to use it for.

-- 
If you love someone, set them free.                            Eventually.


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

Date: Wed, 03 Sep 1997 13:09:20 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: IS there a 'strlen' in Perl?
Message-Id: <comdog-ya02408000R0309971309200001@news.panix.com>

In article <5uk3dp$b6g@ringer.cs.utsa.edu>, jzhuang@ringer.cs.utsa.edu (Jun Zhuang) wrote:

>Is there a function like 'strlen()' in C in Perl5?
>I just want to use it to count the chars in a char string.


%[3] man perlfunc | grep length
[snip]
     length EXPR
     length  Returns the length in characters of the value of...
[snip]

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>


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

Date: Wed, 3 Sep 1997 17:18:33 GMT
From: Kevin L Curtis <curtis@casper.aisf.com>
Subject: Re: IS there a 'strlen' in Perl?
Message-Id: <340D9BE9.2C05@casper.aisf.com>

Jun Zhuang wrote:
> 
> Is there a function like 'strlen()' in C in Perl5?
> I just want to use it to count the chars in a char string.
> 
> --
> Jun Zhuang                         |Jun Zhuang
> Department of Computer Science     |Department of Pharmacology
> University of Texas                |UT Health Science Center
> San Antonio, Texas                 |San Antonio, Texas
> Email: jzhuang@ringer.utsa.edu     |Email: zhuang@uthscsa.edu
>                                    |       jun@gcrdb.uthscsa.edu

Try length:
  $chars = length ( $char_string );

Kevin L Curtis
Boeing - Military Transport Aircraft
Long Beach, California
Email: kevin.l.curtis2@boeing.com


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

Date: 3 Sep 1997 18:32:45 GMT
From: tdauria@bu.edu (Thomas Dauria)
Subject: Re: Matt Wright's Counter on Windows NT
Message-Id: <5ukagd$59d$1@news1.bu.edu>

Great how about some example code?

Mike King (m.king@praxa.com.garbage.au) wrote:
: On 1 Sep 1997 02:47:43 GMT, tdauria@bu.edu (Thomas Dauria) wrote:

: >Has anyone got this counter to work on Windows NT.  I set
: >it up and the perl script increments the counter.txt file
: >no problem.  I never get the count on my web page however.
: >I think the problem is with fly.exe but I am unsure.  
: >Any suggestions or pointers to sites with help?

: The smartest way to implement counters on WinNT is to use the
: registry. You can create as many counters as you like, you simply open
: the key, increment it and close it. I found it best to declare the key
: as a string, because perl doesn't mind. The OS looks after locking,
: and you don't have to worry about a user inadvertently removing the
: file, or fiddling with it.

: Mike
: ===== Spam Filter:
: ===== You can email me at the following address after putting out the trash ...
: garbage.m.king@praxa.com.garbage.au


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

Date: 3 Sep 1997 18:34:47 GMT
From: tdauria@bu.edu (Thomas Dauria)
Subject: Re: Matt Wright's Counter on Windows NT
Message-Id: <5ukak7$59d$2@news1.bu.edu>

Great how about some example code please?

Mike King (m.king@praxa.com.garbage.au) wrote:

: The smartest way to implement counters on WinNT is to use the
: registry. You can create as many counters as you like, 
: you simply open
: the key, increment it and close it. I found it best to 
: declare the key
: as a string, because perl doesn't mind. The OS looks after locking,
: and you don't have to worry about a user inadvertently removing the
: file, or fiddling with it.



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

Date: Wed, 03 Sep 1997 11:46:22 -0700
From: WX Guest account <wxguest1@wv.MENTORG.COM>
Subject: My vs local declarations
Message-Id: <340DB07E.D63@wv.MENTORG.COM>

I wanted to get some clarification on variable scoping and declarations.
I have looked over the man pages and the O'Reilly book on Perl 5 and
have not been able to get a clear answer.  What I thought made sense,
doesn't seem to work.  So here are some questions:

1.  "Local:  This operator declares one or more global variables to have
locally scoped values within the innermost enclosing block, subroutine,
eval, or file."

This implies to me that it uses or generates a global variable, but
gives it a locally declared value.  Let's see if this is right:

$file_name = "/scratch1/temp/test.txt";

sub write_me  {
  local $file_name = $_[0];   # $file_name == /scratch1/temp/test2.txt
    
  open (file_name) or die "Ooops:  $!\n";
    print file_name "Did it work??\n";
  close file_name;
}
# $file_name now equals /scratch1/temp/test.txt
&write_me("> /scratch1/temp/test2.txt");
exit 0;

Is this correct??  (It works for me)



2.  The same example with "my" would be:

$file_name = "/scratch1/temp/test.txt";

sub write_me  {
  my $file_name = $_[0];   # $file_name == /scratch1/temp/test2.txt
    
  open (file_name) or die "Ooops:  $!\n";
    print file_name "Did it work??\n";
  close file_name;
}
# $file_name now equals /scratch1/temp/test.txt
&write_me("/scratch1/temp/test2.txt");
exit 0;

Is this correct??   (It doesn't work for me)
The value is passed correctly, but it can't open the file.


3.  One last question.  There are at least three ways to declare a
variable:
	1.  $file_name = blah    #A global declaration
	2.  local $file_name = blah #A global, locally scoped value
	3.  my $file_name = blah  #A local var, meaningless outside innermost
block.

What happens if $file_name isn't declared globally already, but I
declare it with a "local" declaration instead of "my"?  Does it create a
global variable, but hide the locally assigned value?  And are these
declarations static or dynamic?


Lots of questions, thanks for your help.  I have a basic understanding
of this, but when I get into the coplicated, what I thought I knew
doesn't seem to work (or maybe it's something else...).


-- 
*********************************
Mike Oar
Intern, QA Engineer
Mentor Graphics Corp.

mike_oar@mentorg.com
503-685-1747


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

Date: Wed, 3 Sep 1997 17:19:33 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: pattern matching HELP!
Message-Id: <ebohlmanEFy04L.CB1@netcom.com>

Gary Colman (SPAMFREEcolmang@ms.com) wrote:
: Hi Mark

: > I am trying to check for illegal characters in a string.
: > the allowable set is [a-z0-9_&.-] and I am trying to write code
: > But no matter what I do I can't seem to find the right syntax.

: print "Allowable chars: A-Z a-z 0-9 & . - _\n";
: chop($bob=<STDIN>);
: die "foo'ed\n" unless ($bob =~ /^[a-z0-9_&\.-]*$/);

Nope.  That pattern will match *any* string (start of string, followed by
*zero or more* characters in the class, followed by end of string). 
Changing the * to a + won't help; the resulting pattern will match any
string that begins with one of the allowed characters, even if it contains
illegal characters as well. 

What you need is a complemented character class and a reversed sense of 
match:

die "foo'ed\n" if ($bob =~ /[^a-z0-9_&\.-]/);

or

die "foo'ed\n" unless ($bob !~ /[^a-z0-9_&\.-]/);


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

Date: 03 Sep 1997 11:22:34 -0700
From: Gary.Foster@corp.Sun.COM (Gary D. Foster)
Subject: Re: perl and XEmacs
Message-Id: <bcioh6ab6l1.fsf@corp.Sun.COM>

>>>>> "Chris" == Chris Nandor <pudge@pobox.com> writes:

    Chris> In article <nqok9gyvnyk.fsf@mitra.phys.uit.no>, Tom
    Chris> Grydeland <tom@mitra.phys.uit.no> wrote:

    Chris> Sorry, I don't see a necessary difference.  Intelligent
    Chris> design is often called evolution.

    Chris> But somehow I don't think that is the scope of these
    Chris> newsgroups.

Jamie already tried to invoke Godwin's Law on this topic... perhaps he 
didn't try hard enough, so here's my attempt:

Perl was constructed by Hitler as a means to bring the Nazi party into
power.  The use of Lisp by the general populace (especially those
people of Jewish descent) was considered to be inferior, due to the
nature of the word "Lisp" [1] and was usually considered an
affectation, impediment, or defect.

It's a little known fact, however, that the Jewish people, in an
effort to keep their faith and their bloodlines pure, adapted the
"Common Lisp" currently in use by the peasantry into a secret idiom,
referred to in kabbalistic circles as "Emacs Lisp".  This was done in
an effort to preserve the teachings and tenets of the "one true faith" 
[2] and is single-handedly responsible for the creation of Israel and
the preservation of the accumulated lore and knowledge of all mankind.

It is also a little known fact that in an effort to spread Perl
throughout Europe and promote the superiority of the alleged "Master
Race", Hitler then invaded Poland.  He had been informed that rogue
Lispers had fled Germany, and were residing in Poland at the time.
However, these rogues were forewarned by the guardians of the
knowledge [3] and were able to flee Poland and take up residence in
Russia, where they began secret development on Scheme, another attempt 
to keep the Lisp fire burning brightly.

Hitler gained wind of the escape of the German/Polish Lisp dissidents
and greatly feared that they would team up with their Jewish
counterparts in an attempt to merge Scheme and Emacs Lisp.  He
(perhaps correctly) feared that a merging of the Emacs Lisp faithful
and the rogue Scheme faction would result in world domination and he
immediately threw all his armored might against the wall of russian
solidarity.

The russians, buoyed by the faith of the Emacs Lisp contingent, and
strengthened by the righteousness of the German/Polish Schemers in
their midst, were able to repel Hitler and his fascist perl-mongers,
eventually resulting in weakening him to the point that a
conglomeration of free-world allies were able to stop the menace and
return perl to it's rightful place.

>From this we learn a very simple lesson... Lisp is the language of
purity and faith.  Perl is for nazi's and oppresion.  Never forgive,
never forget.  Keep the faith.

-- Gary F.


Footnotes: 
[1]  1. lisp \'lisp\ vb [ME lispen, fr. OE -wlyspian; akin to OHG
	lispen to 1: to pronounce the sibilants s and z imperfectly
	esp. by giving them the sound of th 2: to speak falteringly,
	childishly, or with a lisp : to utter falteringly or with a
	lisp - lisp.er n 2. lisp n 1: a speech defect or affectation
	characterized by lisping 2: a sound resembling a lisp

[2]  Lisp -- The one true language, the language used by Jaweh to
     create the world: (cf. "(defun genesis...)" and very nearly lost
     to us during the tower of babel incident.

[3]  The original Jewish Lisp masters





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

Date: Wed, 03 Sep 1997 18:44:07 +0200
From: Jose Carlos Gonzalez <gonzalez@eucmdx.gae.ucm.es>
Subject: Re: Q: Instalation on ULTRIX 4
Message-Id: <340D93D7.167E@eucmdx.gae.ucm.es>


Forget about my previous e-mail. The problem is the
following: on Ultrix 4 the command pwd fails in directories
that are soft links to other directories (I think).

  Now it works,

  J.C.

--

   'To be is to do.'   (I. Kant)
     'To do is to be.'   (A. Sartre)
       'Doobi-doobi-doo!'  (F. Sinatra)
         'Yabba-Dabba-Doo!'  (F. Flinstone)

====================================================================
   *    J. C. Gonzalez                                     
  .     Dpto. Fisica Atomica, Molecular y Nuclear          
  .     Universidad Complutense de Madrid            
   .    Avda. Complutense, s/n, E-28040 Madrid, Spain
     *  --------------------------------------------------------
 .      Tel.: +34 1 3944491  E-mail: gonzalez@gae.ucm.es            
   .    Fax : +34 1 3945193  WWW: http://eucmdx.gae.ucm.es/~gonzalez
====================================================================


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

Date: 3 Sep 1997 09:58:01 -0700
From: klander@primenet (Kevin)
Subject: Re: Script on input to perl arrays wanted - Newbie learning
Message-Id: <340d9611.2565138@news.primenet.com>

On Wed, 03 Sep 1997 08:05:01 -0500, Nathan Stanford
<nathan@cyberservices.com> wrote:

>Do anyone have a simple script that will show me how to pull a address
>list
>and insert it into an array so I can do things with is....
>
>address file
>23:123 anywhere st., anycity,state:324:888-555-1212
>32:321 john rd.,acity,state:243:888-686-6868
>
>number:address:speeddial:phonenumber
>
>I want an array where -
>
>$number[0]              = the first number in the list
>$address[0]             = the first address in the list
>$speeddial[0]           = the first speeddial in the list
>$phonenumber[0]         = the first phonenumber in the list
>

uhh...

while (<INPUT>) {
   @info = split /:/;
   push @number, shift @info;
   push @address, shift @info;
   push @speedial, shift @info;
   push @phonenumber, shift @info;
}

>I am a newbie but learning fast I want to use : to seperate but would
>use
>other if I can some how make them work in excel  ex: if I use comma's
>then
>the comma's in the addresses would cause a problem what do you suggest
>about
>that as well?
>

I don't think you want to use commas.  Colons are fine as long as one
won't appear as a character in your fields.

[snip, because I didn't understand the question]

>Do anyone use perl on NT?
>

Yes.

--
  Kevin -- klander at primenet dot com (add the .com in email replies)
           http://www.primenet.com/~klander
--


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

Date: Wed, 03 Sep 1997 14:09:30 -0400
From: atspublic@bigfoot.com (Andrew Starr)
Subject: Re: Script Time
Message-Id: <atspublic-ya02408000R0309971409300001@news.negia.net>

In article <340BFB7D.79B@vt.edu>, mweber@vt.edu wrote:

> I would like to put a line of text on my output page that says how long
> it took to run the script...any suggestions?  See altavista's addurl for
> an example.
> 

I'm no expert, but to save the regulars some time I'll give it a stab:

A) Compute time at very beginning of script.
B) Compute time just as you end the script, calculate difference, print it
C) Print the closing "</HTML>" and exit the script.


---begin
#date gets the date for the HTML confirmation
($Second, $Minute, $Hour, $DayofMonth, $Month, $Year, $WeekDay, $DayofYear,       

              $IsDST) = localtime(time);
@DayNames = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
@MonthNames = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 
              'Oct', 'Nov', 'Dec');
$fullyear = 1900 + $Year;
if ($Hour > 11) {
   $meridian = "PM";
   } else {
   $meridian = "AM";
}
if ($Hour == 0) {$Hour=12;}
if ($Hour > 12) {$Hour=$Hour-12;}
$clock= sprintf('%02d:%02d:%02d', $Hour, $Minute, $Second);
#enddate

print "Date: $DayNames[$WeekDay], $DayofMonth $MonthNames[$Month] $fullyear, 
             $clock $meridian\n";
----end

I use the first block of code to get me all of the time information.
Instead of doing the meridian stuff I do, you will probably want to leave
$Hour in military time. Then you need to subtract the initial hour:min:sec
from the later one. You won't want to use the $clock = sprintf command I
use until AFTER the subtraction, assuming your script runs quickly enough
to run in a fraction of a second.

Also, be careful with the subtraction in cases where someone runs the
script a millisecond before midnight and it finishes a millisecond after.
Perhaps keep track of the $DayofMonth; if it is not the same day at end of
script as it was at beginning (either a day later, or approx. 30 days
earlier, if end of month to beginning of next month), then just add 24 to
the hours variable before doing the subtraction.

Good luck!

Meanwhile, for others reading here, the above will get you a nice Date
format on screen:

Date: Wed, 3 Sep 1997, 02:09 PM

But I've found it is not a great idea to use this as a date header for
e-mail; best to let the mailer provide its own date header; I just use this
for on screen confirmation of the time, in case someone wishes to print out
the page.

-Andrew

-- 
Andrew Starr  <mailto:atspublic@bigfoot.com>
http://www.amherst.edu/~atstarr/eudora has my unoff. Eudora Site
http://www.amherst.edu/~atstarr/eudora/faq.html by Hank Zimmerman
I have no connection to Qualcomm other than being a happy customer!
If I am answering a question: please post followup questions to the
newsgroup as well as mailing me a copy. For new questions, please just post
to the newsgroup. Thank you.


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

Date: 3 Sep 1997 16:09:26 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: SSI in SSI..
Message-Id: <5uk23m$9gm$1@news.fm.intel.com>

Bryan Wilkinson (nardo@pobox.com) so eloquently and verbosely pontificated:
> 
> >Problem : I have a perl script wich reads a html file 
> >containing a SSI...does a bunch of things and print 
> >everything back...What's wrong is while using
> >Content-type: text-html\n\n, the call to the SSI
> >(<--#exec cgi="/foo/foo.cgi" -->) is not executed, but
> >simply printed in the output...
> >
> >Is there a solution to this SSI in SSI problem?
> 
> you probably want something like:
> s/<!--#exec cmd="([^"]*)"-->/`$1`/eg;
> 
> so that your perl script executes the SSI

i would also suggest using "Content-type: text/x-server-parsed-html\n\n"
so that the server will parse SSI, then take all followups to an html/ssi
newsgroup.

--
#!/usr/local/bin/perl -w
@"=(qw; P ;,q*e*,qq,r,,q;l;);$_=<<'/\<<$_; :-) \' ^/<\'<>/\'$!=0/\'/<&@_';
^[^a-i*#,k-z@&]u[s,*]t$ ^[]/$%a!&]*not*\(anything\)*here*$ ^p[$_r%,.]i*nt$
[^hi]?[]MOM!#]$ #  tfletche@pcocd2.intel.com  # ^h*[^b$d-j%/,l-z(]\{3\}er$
/\<<$_; :-) ' ^/<'<>/'$!=0/'/<&@_
for(split){map{s;print;join"",@";eg;chop;print}q& &.qx;look -r '$_';}# TMF


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

Date: Wed, 03 Sep 1997 14:13:15 -0400
From: atspublic@bigfoot.com (Andrew Starr)
Subject: Re: Time question..
Message-Id: <atspublic-ya02408000R0309971413150001@news.negia.net>

In article <340BF12E.290C@hotmail.com>, guitarplayer@hotmail.com wrote:

> Is this the best or most effecient way of getting the local time (as for
> just hour, minute, am/pm)???

#date gets the date for the HTML confirmation
($Second, $Minute, $Hour, $DayofMonth, $Month, $Year, $WeekDay, $DayofYear, 
       $IsDST) = localtime(time);
@DayNames = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
@MonthNames = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 
       'Oct', 'Nov', 'Dec');
$fullyear = 1900 + $Year;
if ($Hour > 11) {
   $meridian = "PM";
   } else {
   $meridian = "AM";
}
if ($Hour == 0) {$Hour=12;}
if ($Hour > 12) {$Hour=$Hour-12;}
$clock= sprintf('%02d:%02d:%02d', $Hour, $Minute, $Second);
#enddate

print "Date: $DayNames[$WeekDay], $DayofMonth $MonthNames[$Month] $fullyear, 
      $clock $meridian\n";

This will get you:
Date: Wed, 3 Sep 1997, 02:13 PM
(You can choose not to use all the variables, of course.)

I've indented 3 lines of code where the line was too long for my
newsreader, and these lines are just continuations of the previous line:
the lines beginning:
$IsDST
'Oct'
$clock

Good luck!

-Andrew

-- 
Andrew Starr  <mailto:atspublic@bigfoot.com>
http://www.amherst.edu/~atstarr/eudora has my unoff. Eudora Site
http://www.amherst.edu/~atstarr/eudora/faq.html by Hank Zimmerman
I have no connection to Qualcomm other than being a happy customer!
If I am answering a question: please post followup questions to the
newsgroup as well as mailing me a copy. For new questions, please just post
to the newsgroup. Thank you.


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

Date: Wed, 03 Sep 1997 12:50:07 -0400
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Time warp - Perl 4 question
Message-Id: <fl_aggie-ya02408000R0309971250080001@news.fsu.edu>

In article <340D8471.7B47@sunpub.com>, Benjamin Sugars <bsugars@sunpub.com>
wrote:

+ Seriously, though, there really is no reason to restrict yourself to
+ Perl 4.

Not only that, but perl 4 is dead, dead as a doornail. It is unsupported.
And perl 4 is CERTifiably insecure.

+ The simplest answer to your problems are to stick with Perl 5.

Yes.

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: 3 Sep 1997 17:51:28 GMT
From: cowbys@aol.com (COWBYS)
Subject: WHY doesnt this work ??
Message-Id: <19970903175101.NAA22485@ladder01.news.aol.com>

why doesnt this code work?, it should.

basically, what I am doing is reading in a file list form a directory
($webapps)
and then writing a line of output for each file in that directory to
another file
($delftp).

I am trying to test the file first, before copying it to be sure it is not
empty, i dont want to copy empty files or dirs.. but why doesnt this code work.?

NOTE: if I take out the if,  (if -f $file), it works fine, but it wont write
           any output if I include the "if" test... any help appreciated

$delftp      = "c:/dcf/perltest/delftp.scr";
$webappdir   = "c:/dcf/perltest/webapps";

open ( DELFTP, ">>$delftp") || die "Cant find $delftp !!, $! \n";
opendir( WEBAPPS, "$webappdir") || die "Cant open $webappdir !!, $!" ;
@APPS = readdir(WEBAPPS);
  foreach $file (@APPS) {
    if (-f $file) {
      print DELFTP "del $file \n"; }  
    
  }


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

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

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