[7847] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1472 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 14 19:08:33 1997

Date: Sun, 14 Dec 97 16:00:26 -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           Sun, 14 Dec 1997     Volume: 8 Number: 1472

Today's topics:
     Re: Another Sort problem, this time with numbers (Andrew M. Langmead)
     Re: Another Sort problem, this time with numbers <beans@bedford.net>
     Re: Are locals automatically initialized ? (Martien Verbruggen)
     ast's magtape quote (was Re: CPAN on CD is not evil...) <Russell_Schulz@locutus.ofB.ORG>
     Re: Best port to Win 95? (Martien Verbruggen)
     Re: best way to find new ora.com releases cheaply (was  <Russell_Schulz@locutus.ofB.ORG>
     Re: delete file in perl (Martien Verbruggen)
     Re: Embedding Perl In A C++ Program <rootbeer@teleport.com>
     Example on Sending E-Cards with Perl <t-n-g@algonet.se>
     Re: getting list of directories, returned as an array (Martien Verbruggen)
     Gost in 459 bytes of PERL <mail@vipul.net>
     Re: Help with a regex (Martien Verbruggen)
     Re: Help: How to get IP and full domain name of my host <rootbeer@teleport.com>
     Re: HELP: Newbie: Sorting an array just on two fields (Martien Verbruggen)
     Re: pgp encrypion via perl script (Michael Budash)
     Re: PIng a Port (Martien Verbruggen)
     Re: pod2html (Martien Verbruggen)
     Re: proposed errata to Programming Perl 2nd ed, system  <rootbeer@teleport.com>
     Re: Script calls embedded in web pages (Martien Verbruggen)
     Re: Socket Connect <rootbeer@teleport.com>
     Solution: getting list of directories, returned as an a (Joshua J. Kugler)
     Re: WANTED: "generic" logfile parse/report (Martien Verbruggen)
     Re: What's wrong with my script ???? (Michael Budash)
     When is FLOCK not supported? <VikR@aol.com>
     Re: Which language pays most 17457 -- C++ vs. Java? (I R A Aggie)
     Workaround for FLOCK? <VikR@aol.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 14 Dec 1997 21:38:33 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Another Sort problem, this time with numbers
Message-Id: <EL784A.Mux@world.std.com>

tiwason@aol.com (Tiwason) writes:

>If i have a bunch of numbers to sort say
>5,7,2,1,21,4,11,32

You know, you're really very lucky. Yes, you have a programming
problem, but you have a clear idea of what you want done. (you want
them sorted numerically, not in dictionary order) and you have a rough
idea of the tools you need to use. (the perl sort() function.)

Now the place where you start going astray is when you thought "where
would be a good place to learn more about the sort function?" and the
answer that came to you was "Usenet!" Its unfortunate because from
what I've seen so far is that you've got two wrong answers and two
flames as responses.

Perl comes with a lot of free documentation. They are often called
"man pages" because of the language's unix heritage. The way of
accessing this documentation depends on the operating system that you
use, but in most cases it seems that the people who work on perl on
these various operating systems have gone through great effort to make
this information available in a convenient format.

On Unix, the perl documentation is installed in the common unix manual
format. This documentation is accessed using the "man" command. If you
type "man perl" at a shell prompt, it will show you a list of other
pages divided by content. To access the page with a list of perl
functions, type "man perlfunc".

On Windows 95 and Windows NT, the man pages are converted into HTML
format for you and placed inside the "docs" directory. You can view
them with any web browser.

On the Macintosh, Matthias Neeracher made a special documentation
viewing program called "Shuck", (the reason for the name is a bit of
an inside joke. I'm tempted to suggest that maybe it should be renamed
to "perl documentation viewer" or something, but then I'm sure that
many will point out that few macperl users have ever asked how to
access that standard documentation.)

On the OS/2 port, Ilya Zakharevich converted the documentation into
OS/2's .INF format.

Other people have spent time converting the documentation into the GNU
systems "info" format, Adobe's PDF, and others.

If you ever pick up the book called "Programming Perl", which most
people consider the definitive perl reference book, you'll realize
that it is most cases a superset of the documentation that is provided
with perl.

All of these resources have been created to help you help yourself
answer your own questions. You probably want to make use of them.

Now some people may be asking "why have this newsgroup if you are
going to be telling people not to ask questions?" or may say that
although I know how to sort numerically, there is no reason why a less
experienced perl programmer may not. I know I can't tell other people
what to think, but let me tell you my view on how things are supposed
to work. If someone can find some flaws in my thinking, feel free to
let me know (maybe via email). I'm willing to consider differing
points of view.

I've always felt that there will always be people around here of
differing levels of ability. There will be new perl programmers who
are learning the language from an instructor or are teaching
themselves by a book. There will be intermediate users who have gone
through the class or the book and now applying what they have
learned. And then there are many levels of more advanced users who
have gone through different unique experiences that have shaped their
knowledge of perl in unique ways.

Now some questions that can come from any perl programmer, from any
level can be answered by the knowledge of a specific feature of the
perl language. Hopefully all of these features have been
documented. Even if they haven't since the attempt was made it is
usually a good first attempt. If a programmer has learned that perl
has a function called "sort", they should be able to find out about
the syntax and features of it. If the answer is an explanation of how
a basic language feature works, there is probably little reason to
post the question.

Sometimes there are questions because a perl feature doesn't seem to
work according to the documentation that they user consulted. These
questions can come from any level of user, and the documentation
referenced varies. Nobody seems to mind these types of questions,
whether it is a neophyte misspelling "elsif" as "elseif" to why you
can't use a reference to a subroutine as the first argument to sort().

There is an entirely separate group of questions that can't be solved
by teaching of a particular perl feature. The answers require a
combination of different aspects of perl to solve a unique problem.
These are usually wonderfully interesting posts to read, and they
various responses are even better. 

I guess basically, if you can point the user to a page of a book or to
a specific section of a man page, then I feel they probably could have
found it themselves.

Now there is another group of people who are probably annoyed because
I've spent all this time saying that Tiwason's post was a waste of
time while supplying no useful perl content to this newsgroup
myself. To make them feel better:

Tiwason, perl has a spot for an optional first argument to
sort(). Perl knows whether you are using it because if you are, there
is no comma after it. In this first argument, you can either put the
name of the subroutine, or a pair of braces in which perl code goes
inside. With this code, you can tell perl how to compare two elements
to allow it to sort in the order you want. To sort numerically, tell
perl which is greater of the two elements it is passing you.

@sorted = sort numerically 5,7,2,1,21,4,11,32;
print "@sorted\n";

sub numerically {
  # the two element are given to us in the variables $a and $b.

  # if $a is greater than $b, return 1
  return 1 if $a > $b;

  # return -1 if $a is less than $b
  return -1 if $a < $b;

  # return 0 since they both must be equal.
  return 0;
}

Now perl has a convenient shortcut for this. It has an operator that
compares two elements and returns 1, -1, or 0 if the element on the
left is greater than, less than, or equal to the element on the
left. This operator has the symbol "<=>". This shortcut make things so
short, it allows you to easily code the sorting comparison code within
the braces and not require a separate subroutine.

@sorted = sort { $a <=> $b } 5,7,2,1,21,4,11,32;
print "@sorted\n";
-- 
Andrew Langmead


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

Date: 14 Dec 97 23:44:51 GMT
From: Tom <beans@bedford.net>
Subject: Re: Another Sort problem, this time with numbers
Message-Id: <34946f73.0@news3.paonline.com>

tiwason@aol.com (Tiwason) writes: > If i have a bunch of numbers to sort say
> 5,7,2,1,21,4,11,32
> 
> is there anyway to get around them sorting like
> 
> 1,11,2,21,32,4,5,7
> 
> other than having 1/every number then sorting or adding zeros on to the
> front...??
> 
> Thanks
> 
> Tim

See Brian Foy's response to the first sort question. 

You can provide a routine that uses "<" instead of "lt"
to change the sort from lexical to numeric...

-Tom


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

Date: 14 Dec 1997 23:15:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Are locals automatically initialized ?
Message-Id: <671pa3$gbd$5@comdyn.comdyn.com.au>

In article <66suup$prh@news1.snet.net>,
	"Kilrogg2_GS" <kilrogg2@mindless.com> writes:
> I wonder if parmeters declared "local"
> in a function are initialized to a default
> value by the compiler ?

First of all, try 

perldoc -f local

If after reading that you still want to use local instead of my

perldoc perlsub

/Temporary Values via local

If you STILL want to use local instead of my, this part explains what
happens when you declare a variable local.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 17:22:45 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: ast's magtape quote (was Re: CPAN on CD is not evil...)
Message-Id: <19971214.172245.8O5.rnr.w164w_-_@locutus.ofB.ORG>

bsa@void.apk.net (Brandon Allbery; change "void" to "kf8nh") writes:

> How soon we forget....
>
> "Never underestimate the bandwidth of a truck full of magtapes, hurtling
> down the highway."

I always thought it was a station wagon...
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 14 Dec 1997 23:11:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Best port to Win 95?
Message-Id: <671p34$gbd$4@comdyn.comdyn.com.au>

In article <3492fc11.7080162@news.one.net>,
	y@rrrr.pah (dave) writes:

> What is best port of Perl to Win 95?

Go to http://language.perl.com/info/software.html, and look at the
Alien Ports section

> Why?

Because that is where the recommended perl ports are referenced.

> How much disk space and memory does it require?

To check? not much. To install it? You'll have to find out there.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 17:31:37 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: best way to find new ora.com releases cheaply (was Re: Q: Learning perl with no progr. experience)
Message-Id: <19971214.173137.0e7.rnr.w164w@locutus.ofB.ORG>

lvirden@cas.org writes:

>> or biz.oreilly.announce (moderated).
>>
>> oh no, wait, they stopped using that in May.  gnash.
>
> But they _do_ have quite a nice mailing list for announcements.  It's
> called ora-news .

I could believe that.  but how hard would it be for them to CC: all the
announcements to the newsgroup for that purpose?
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 14 Dec 1997 22:54:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: delete file in perl
Message-Id: <671o3v$gbd$1@comdyn.comdyn.com.au>

In article <349243F3.20BA20D9@hotmail.com>,
	Kelly Horstmann <kelly_horst@hotmail.com> writes:
> I want to write a perl program to delete a specified kind of file, (for
> example *.o file)in the current directory (say, /usr/bin/perl) and also
> delete all the *.o files in all other subdirectories (eg.
> /usr/bin/perl/dir1, /usr/bin/perl/dir2, /usr/perl/dir3  etc). I
> have been working on that for couple hours, and I just don't know how to
> call perl
> to search all the *.o files in all the subdirectories. Just let me know,
> if you can code
> up this problem.

If you need to have a 'program' (and obviously you're on a unix box)

> find . -name \*.o -exec rm {} \;

If you need to run this from within perl, use the File::Find module.
Comes with perl.

#!/usr/local/bin/perl5 -w

use File::Find;

find( 
	sub {
		unlink("$File::Find::dir/$_") if /\.o$/;
	}, 
	'.');

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 12:52:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: teetshd@ucbeh.san.uc.edu
Subject: Re: Embedding Perl In A C++ Program
Message-Id: <Pine.GSO.3.96.971214125228.29505J-100000@user2.teleport.com>

On Sun, 14 Dec 1997, Greg Teets wrote:

> I'd like to use some Perl string processing functions within a C++
> program I'm doing.  Please point me in the right direction for
> information on how to do this.

There's a man page called 'perlembed'. Does that point you in the right
direction? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 15 Dec 1997 00:15:12 +0100
From: "Andrei Ignat" <t-n-g@algonet.se>
Subject: Example on Sending E-Cards with Perl
Message-Id: <671p0k$m5r$1@zingo.tninet.se>

If you can, please help me find a example on how to send electronic post
cards using Perl.

            /Andrei Ignat




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

Date: 14 Dec 1997 22:05:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: getting list of directories, returned as an array
Message-Id: <671l83$g4t$3@comdyn.comdyn.com.au>

In article <3492eb72.2506337@news.inreach.com>,
	jkugler@inreach.com (Joshua J. Kugler) writes:

> find({push(@dirlist, $File::Find::name) if -d;}, '.');

You probably need a 'sub' in there to create an anonymous sub reference:

find( sub {push(@dirlist, $File::Find::name) if -d;}, '.');

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: 14 Dec 1997 22:49:15 GMT
From: Vipul Ved Prakash <mail@vipul.net>
Subject: Gost in 459 bytes of PERL
Message-Id: <671npb$ctn$1@nntp1.ba.best.com>

Here's a diminutive implementation of GOST (Soviet Encryption Algorithm) 
that does encryption/decryption in Simple Substitution Mode and
generates SBOX permutations and Key unit by hashing the pass 
phrase.

#!/usr/bin/perl -s
sub F{$u=0;grep$u|=$S[$_][$_[0]>>$_*4&15]<<$_*4,reverse 0..7;$u<<11|$u>>21}sub R
{int$_[0]/100*(rand)*100}sub N{vec$_[0],$_[1]/4,32}$e=join'',<>;@t=0..15;for(;$i
<length$p;$i+=4){srand($s^=N$p,$i)}while($c<8){@b=@t;grep{($x,$b[$x],$b[$_])=(R(
15),$b[$_],$b[$x])}@t;$K[$c]=R(2**32);@{$S[$c++]}=@b}@h=0..7;@o=reverse@h;while(
$a<length$e){$v=N$e,$a;$w=N$e,($a+=8)-4;grep$q++%2?$v^=F$w+$K[$_]:($w^=F$v+$K[$_
]),$d?(@h,(@o)x3):((@h)x3,@o);$_.=pack N2,$w,$v}print

 Usage : 
 gost -e -p=password <plain.txt>
 gost -d -p=password <crypt.txt>


Cheers,
Vipul

--
Powell lingered. "How's Earth?"
It was a conventional enough question and Muller gave the
conventional answer, "Still spinning."
                                      -- "Reason", Asimov.
==================================================================
Vipul Ved Prakash                 | - Electronic Security & Crypto
mail@[no-spam]vipul.net                    | - Web Objects
91 11 2233328                     | - PERL Development
198 Madhuban IP Extension         | - Linux & Open Systems
Delhi, INDIA 110 092              | - Networked Virtual Spaces



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

Date: 14 Dec 1997 22:12:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help with a regex
Message-Id: <671lkn$g4t$4@comdyn.comdyn.com.au>

In article <349222AF.41904800@coos.dartmouth.edu>,
	Chipmunk <rjk@coos.dartmouth.edu> writes:
> 
> These should be suitable if all the filenames being processed are guaranteed
> to fit the required syntax.

hehe, yep. I assumed that the filenames fed to this code would all
already be guaranteed to conform to the standard that the original
poster supplied. File names that don't match the 

> filename,version (optional), keyletters some combination of PIWMs 
> (optional) followed by a known file extension..

might break it, as you illustrated with

> file1.2.tgz

Your solution is better, of course :)

Martien
-- 
Martien Verbruggen                  | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au    | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd.       | I can ask him what he meant - Steven
NSW, Australia                      | Wright


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

Date: Sun, 14 Dec 1997 12:51:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Alex Dong Li <lidong@globalserve.net>
Subject: Re: Help: How to get IP and full domain name of my host?
Message-Id: <Pine.GSO.3.96.971214124931.29505I-100000@user2.teleport.com>

On Sun, 14 Dec 1997, Alex Dong Li wrote:

> Could anyone tell me if there is a function to get IP and full domain
> name of my host?

There isn't one. A machine on the Internet may (and generally does) have
more than one number and more than one name. 

Of course, there's nothing Perl-specific about this. If you have further
questions along these lines, you may be able to find the answers in a
newsgroup about Internet protocols and such. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 14 Dec 1997 23:29:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP: Newbie: Sorting an array just on two fields
Message-Id: <671q55$gbd$6@comdyn.comdyn.com.au>

In article <3491792c.15371660@news.on-net.net>,
	djboyd@nospam.sam.on-net.net (David J. Boyd) writes:

> Now I went to the FAQ, but, due to a lack of full understanding of
> perl I did not fully understand what was happening.  So, could some
> one help me out on this.

Show us what needs to be sorted, and we might be able to help.

<OFFTOPIC>
> To response remove nospam  djboyd@sam.on-net.net

If you want an email response, don't put any nospam in your email
address.

> To reply remove nospam from the address: djboyd@sam.on-net.net

If you want an email reply, don't put any nospam in your email
address.

BTW. do you think that those spam email address gathering programs
don't look anywhere else, but in the post headers? If you include your
email address in the body, it is bound to end up on those lists
anyway.
</OFFTOPIC>

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd.       | clothes.
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 13:55:20 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: pgp encrypion via perl script
Message-Id: <mbudash-1412971355200001@d108.pm3.sonic.net>

OK guys. I'm the poor slob who posted this "solution":

  chdir "path_to_dir_containing_pgpe";
  $encrypted_data = `(echo "$unencrypted_data") | pgpe -at -r
  $recipient_email_address`;

Let's go thru the concerns step by step:

>> > 1.  This script does not necessarily store anything to disk.
>> >     It uses "echo", not "cat".  $unencrypted_data is not a filename.
>> >     It might prompt the user to enter data, and then echo it
>> >     to pgp directly.  
>>
>> Thereby placing part of the unencrypted data in the process table for
>> anyone to see.

Echo doesn't prompt on the system in question. (SGI Irix) If it does on
others in this scenario, it's news to me (but then, so much is...).

>> > 2.  Storing unencrypted data to disk is not necessarily bad.
>> >     Whether it's bad depends on how secure your disk is, 
>> >     or how secret the data actually is.  Maybe we don't care
>> >     if any other local users see it. 
>> 
>> It's bad. It compromises the data completely, as when the file
>> is unlinked the data may stay around indefinitely for anyone to
>> see.  If you are using the high security of PGP, it is a very 
>> definite mismatch unless you are using the practice of putting
>> removable disks in a safe when finished.  8-)
>> 

Agreed, totally.

>> > 3.  This script does have one problem, and that is that the text
>> >     of $encrypted_data may show up in a "ps" list on that machine.
>> >     Again, whether this is bad depends on your machine, and how
>> >     secure you need to be.  
>> 
>> I consider it bad, because it can be compromised totally by accident
>> in normal operations.
>> 

A "ps" could show $encrypted_data? So what? It's encrypted and only the
private key can decrypt it. Now, if it was the $unencrypted_data, that'd
be different. Can that data show up w/a "ps"?

>> Especially when it is so easy to fix:
>> 
>>   open(PGP, "| pgpe -atr $recipient > /tmp/pgp_encrypted.$$")
>>         or die "creat: $!\n";
>>   print PGP $unencrypted_data;
>>   close PGP;
>>   die "PGP error" if $?;
>> 
>> Now only PGP encrypted data is stored to disk. Not nearly as unsecure,
>> though you would like to overwrite even that for best security.
>> 
>> I did come in late, so I suppse the question might have been
>> how to do this without creating a disk file.

That _was_ what I was attempting to inject into the discussion: a way to
do it without a disk file.

>> Well, without IPC::Open3
>> or the like you can't with PGP. Not portable. The above is
>> portable to most OSes.

I was originally doing it with a temp file, but decided that if I could
get it to work without one on the platform in question, I would do so. I
did.

>> On a UNIX system I would also redirect the error output for PGP,
>> as it is a bit nasty about sending random messages through stderr.

The error output (along with several inocuous diagnostic messages) go to
the error log; I and the client have access to said log, so I left it.

So I guess the questions are:

 - can echo prompt in the script I gave as an example, and
 - can the $unencrypted_data show in a "ps" if the "ps"er was lucky
enought to execute the "ps" in the partial-second it could even _be_
available

Thanks!
Michael Budash

-- 
                   _____________________________

                       Michael Budash, Owner
                     Michael Budash Consulting
                           707-255-5371
                        707-258-7800 x7736
                   http://www.sonic.net/~mbudash
                         mbudash@sonic.net
                   _____________________________


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

Date: 14 Dec 1997 23:08:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PIng a Port
Message-Id: <671ou4$gbd$3@comdyn.comdyn.com.au>

In article <66upej$hiq$1@news1.iamerica.net>,
	"Russ Verner" <russ@eastland.net> writes:
> Hello,
>     does anyone know how to ping a specific port.  If I wanted to ping port
> 80 I use the ping command with the host name .   How do you ping a program
> you have running on like port 3335?  I'm using a Linux machine version
> 2.0.32.

You can't ping a specific port. Ping uses it's own ports and stuff.

If you just want a quick check to see if something is listening on a
port on a machine, try telnetting to that port on that machine, and
see what happens.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 


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

Date: 14 Dec 1997 21:59:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: pod2html
Message-Id: <671kr7$g4t$2@comdyn.comdyn.com.au>

In article <3491A7A0.A7438796@aur.alcatel.com>,
	Bruno Pagis <bruno_pagis@aur.alcatel.com> writes:
> What is the latest version of pod2html ?
> Where can I get it ?

pod2html is part of the perl distribution, and should be included in your
installation (in the sources, it's pod/pod2html.PL)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 13:41:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chet Edelman <chester.edelman@gs.com>
Subject: Re: proposed errata to Programming Perl 2nd ed, system function
Message-Id: <Pine.GSO.3.96.971214133726.29505O-100000@user2.teleport.com>

On Sun, 14 Dec 1997, Chet Edelman wrote:

> This concerns the example for the system function at the bottom of page
> 230 of "Programming Perl 2nd ed" as well as
> http://www.perl.com/CPAN/doc/manual/html/pod/perlfunc/system.html.

> <?230?>     $ok = ($rc != 0);
>                        ^
>             $ok = ($rc == 0);
> 
> If $ok is to be an argument to the exit function, then the fragment
> would be correct as it appears in the text .
> 
> I am assuming that the fragement was meant to be used as a perl function
> or block, and am thus proposing the change.
> 
> Am I right or did I miss something?

I don't know; since the author didn't use $ok anywhere else, we can only
guess as to its purpose. But it's worth noting that $rc was munged by some
of the if-code. Maybe $ok should be set before the if? 

If it were up to me, I'd remove that line pending more information. The
example doesn't lose anything without that line.

Cheers!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 14 Dec 1997 23:04:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Script calls embedded in web pages
Message-Id: <671ome$gbd$2@comdyn.comdyn.com.au>

In article <34926561.CB68CF41@fedex.com>,
	"Don Badowski Jr." <ddbadowski@fedex.com> writes:
> Why will it not execute the cgi script from within the html file?
> Am I doing something wrong?  Or is it something to do with the setup of
> the server?  

Probably.

> If so is there any way to check it out?  

Ask your server admin. It's not really a perl issue. Alternatively you
can ask on one of the comp.infosystems.www.* groups.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 12:54:17 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Russ <russ@eastland.net>
Subject: Re: Socket Connect
Message-Id: <Pine.GSO.3.96.971214125336.29505K-100000@user2.teleport.com>

On Sun, 14 Dec 1997, Russ wrote:

> I would like to create a program that will monitor different ports on
> our machines ftp, http, 3335 and such. 

Sounds like SATAN. Can you use that to do what you want? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sun, 14 Dec 1997 21:43:07 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Solution: getting list of directories, returned as an array
Message-Id: <34945274.1746560@news.inreach.com>

On Mon, 8 Dec 1997 17:40:58 -0800, Tom Phoenix <rootbeer@teleport.com>
wrote:

()On Mon, 8 Dec 1997, Joshua J. Kugler (I) wrote:
()I would like (or maybe just would like help writing) a subroutine to
()return a list of directories to an array starting with the current
()directory. 

Ok, I asked for help, and I got it.  You guys are great.  I love the
internet. :)  I better, seeing it is a good part of my line of work.
Ok, enough talk, here's the solution:

-----
#!/bin/perl
use File::Find;
my @dirlist

find(sub {push(@dirlist, $File::Find::name) if -d;}, '.');
-----

Now, wasn't that easy? :)  On large trees, this may be slow as it
cycles through EVERY file, directory or not.  But it works, and works
well.  @dirlist will be your tree, in top down order.  And no, you
don't have to use @main::dirlist.  Even though File::Find packages
itself, @dirlist will be put back into whatever package called it.

Thanks to everyone that helped out:

Tom Phoenix <rootbeer@teleport.com>
Martien Verbruggen <mgjv@comdyn.com.au>
Randal Schwartz <merlyn@stonehenge.com>
Tom Christiansen <tchrist@mox.perl.com>
Chipmunk <rjk@coos.dartmouth.edu>

Thanks again guys.  Hopefully I can return the favor to others
someday.  Umm, maybe this could be put in the FAQ?

j----- k-----

As my ISP's news server isn't always reliable, please reply via e-mail as well.

Joshua J. Kugler
Computer Consultant--Web Developer
Real e-mail address spelled out to prevent spam. jkugler at inreach dot com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



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

Date: 14 Dec 1997 21:49:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
To: eryq@zeegee.com
Subject: Re: WANTED: "generic" logfile parse/report
Message-Id: <671k96$g4t$1@comdyn.comdyn.com.au>

[Posted and Mailed]

In article <3491ACAE.5DD1@zeegee.com>,
	Eryq <eryq@zeegee.com> writes:
> [courtesy CC to author]
> 
> Martien Verbruggen wrote:
>> 
>> In article <348F149C.3CF@zeegee.com>,
>>         Eryq <eryq@zeegee.com> writes:
> (snip)
>> > That "last string" is a slightly difficult problem, since you can have
>> > weird directory names which include spaces; e.g., "/usr/local/whoa there/kid".
>> 
>> Since it is the last field, however, you can use split with three arguments
>                   ^^^^
>                   ^^^^
> Only if you assume that the lines he's interested have a fixed 
> number of "fields" before the path element.  I read his post literally:

Yes, you are right. I read it, assuming that all the log lines looked
like the ones that were included, but reading it again, those lines
seem to be a special case, instead of the general format.

If the number of 'fields' isn't always 7, or without knowing what the
other lines look like, it is indeed a lot more complex :)


Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: Sun, 14 Dec 1997 15:53:36 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: What's wrong with my script ????
Message-Id: <mbudash-1412971553420001@d108.pm3.sonic.net>

In article <62deou$rco@news2.jaring.my>, bslee@pl.jaring.my (B.S.LEE) wrote:

>> Can't modify subtraction in scalar assignment at
>> C:\WebShare\wwwroot\cgi-bin\test1.pl line 13, near "$value;"Execution
>> of C:\WebShare\wwwroot\cgi-bin\test1.pl aborted due to compilation
>> errors..
>> 
>> if ($ENV{'REQUEST_METHOD'} eq 'POST')
>> {
>>         read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>>         @pairs = split(/&/, $buffer);
>>         foreach $index (0..$#pairs)
>>         {
>>                 ($name1, $value) = split(/=/, $pairs[$index] , 2);
>>                 $value =~ tr/+/ /;
>>                 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
>> hex($1))/eg;
>>                 print "$name1 <br> ";
>>                 print "$value <br> ";
>>                 
>>                 $regis-data{$name1}=$value;
>>         }
<SNIP>

Name your hash %regis_data.

Michael

-- 
                   _____________________________

                       Michael Budash, Owner
                     Michael Budash Consulting
                           707-255-5371
                        707-258-7800 x7736
                   http://www.sonic.net/~mbudash
                         mbudash@sonic.net
                   _____________________________


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

Date: Sun, 14 Dec 1997 14:07:07 -0800
From: Vik Rubenfeld <VikR@aol.com>
Subject: When is FLOCK not supported?
Message-Id: <3494588A.A74104EC@aol.com>

My client's machine doesn't support FLOCK. (Error message "# The flock()
function is unimplemented.") Does this just mean that he's got some old PERL
installation and needs to upgrade it? Thanks in advance for any info.

- Vik


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

Date: Sun, 14 Dec 1997 17:54:15 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <-1412971754160001@aggie.coaps.fsu.edu>

What does this have to do with perl?

Followups set...

James - appropriately for a troll, I believe

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Sun, 14 Dec 1997 14:05:35 -0800
From: Vik Rubenfeld <VikR@aol.com>
Subject: Workaround for FLOCK?
Message-Id: <3494582E.D135E94D@aol.com>

I've got a machine that doesn't support FLOCK. (Error message "# The flock()
function is unimplemented.") I'd rather not tell my client to update his PERL
installation. Is there a workaround I can use instead of FLOCK? Also, is there
a way to test for the presence of FLOCK, and use it if it is available? Thanks
in advance to all for any info.

- Vik


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

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

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