[8794] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2411 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 24 12:07:22 1998

Date: Fri, 24 Apr 98 09: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           Fri, 24 Apr 1998     Volume: 8 Number: 2411

Today's topics:
    Re: Are there things NOT answered yet ? (gaj)
    Re: Are there things NOT answered yet ? (gaj)
    Re: best way to find disk space for a directory (Jason Gloudon)
    Re: best way to find disk space for a directory <zenin@archive.rhps.org>
    Re: BUG or FEATURE? -- splice() doesn't extend arrays <zenin@archive.rhps.org>
        Can I have a C++ program call a Perl program? <bth@acsu.buffalo.edu>
    Re: chdir in Perl on NT <sesek@intercortex.com>
    Re: commenting a whole block? <br@ndon.com>
    Re: commenting a whole block? <bmb@ginger.libs.uga.edu>
    Re: Cron job and Date problem <rootbeer@teleport.com>
        dynamically creating a hash of hashes, reading keys/val <martin.hein@maxmobil.at>
    Re: Free http perl cgi windows95 practice platform <rootbeer@teleport.com>
    Re: Grabbing a webpage with Perl (with https) (Leslie Mikesell)
    Re: Help: crypt for Win32 ?? (Gary Weinstein)
    Re: linefeeds and perl formats <rootbeer@teleport.com>
    Re: PB : sendmail subroutine droby@copyright.com
    Re: PC-based editors for Perl? (gaj)
    Re: PC-based editors for Perl? <grinch@whoville.com>
        PERL to DOS executable <rodgee@dlep1.itg.ti.com>
    Re: Perl V4.00 droby@copyright.com
    Re: Perl5 and IIS4 (on NTworkstation) <hauke.dressel@citicorp.com>
    Re: printing using the Format function <rootbeer@teleport.com>
        Re : Regular Expression to match a dotted quad represen (Jason Gloudon)
    Re: Read-only value? <bmb@ginger.libs.uga.edu>
    Re: Remote Process Monitoring (Leslie Mikesell)
        Requiring "use"  (was: Re: Using "require") <jdporter@min.net>
        Retreiving the args from a exec cmd call withing perl p <richard@phoneswitch.com>
    Re: Retrieving input from URL <rootbeer@teleport.com>
    Re: RMS should be invited to O'Reilly's "Free Software  (Eugene O'Neil)
    Re: spoiled noobie <andrewf@cp.pathfinder.com>
    Re: spoiled noobie (gaj)
        Using LEDA with Perl in C++ <ludaesch@kilda.informatik.uni-freiburg.de>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 24 Apr 1998 14:10:58 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: Are there things NOT answered yet ?
Message-Id: <35409d2f.64605548@news.spacestar.net>

On Tue, 21 Apr 1998 17:54:05 GMT, Tom Phoenix <rootbeer@teleport.com>
wrote:

>On 19 Apr 1998, Lloyd Zusman wrote:
>
>> Tom Phoenix <rootbeer@teleport.com> writes:
>> 
>> > Although I'm looking forward to seeing this newsgroup created, I fear that
>> > c.l.p.misc will become devoid of people who can give good answers, and
>> > that it may become, as my pal Randal says, "the stupid leading the blind". 
>> 
>> Well, if that's a concern of yours and Randal's, you both could always
>> continue to post to c.l.p.misc even after c.l.p.moderated comes into
>> existence.
>
>I don't think Randal will, but I may do that. Most of my posts will
>probably amount to "bad answer, check ______", though! :-)
>


Unforch, if I'm not mistaken we've missed the deadline for our second
RFD, haven't we? <sigh> I'd surely like to see it come to pass...


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

Date: Fri, 24 Apr 1998 14:53:44 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: Are there things NOT answered yet ?
Message-Id: <3540a727.67158101@news.spacestar.net>

On Fri, 24 Apr 1998 14:10:58 GMT, gjandl@rf.mnschoolbiz.com (gaj)
wrote:

>On Tue, 21 Apr 1998 17:54:05 GMT, Tom Phoenix <rootbeer@teleport.com>
>wrote:
>
>>On 19 Apr 1998, Lloyd Zusman wrote:
>>
>>> Tom Phoenix <rootbeer@teleport.com> writes:
>>> 
>>> > Although I'm looking forward to seeing this newsgroup created, I fear that
>>> > c.l.p.misc will become devoid of people who can give good answers, and
>>> > that it may become, as my pal Randal says, "the stupid leading the blind". 
>>> 
>>> Well, if that's a concern of yours and Randal's, you both could always
>>> continue to post to c.l.p.misc even after c.l.p.moderated comes into
>>> existence.
>>
>>I don't think Randal will, but I may do that. Most of my posts will
>>probably amount to "bad answer, check ______", though! :-)
>>
>
>
>Unforch, if I'm not mistaken we've missed the deadline for our second
>RFD, haven't we? <sigh> I'd surely like to see it come to pass...

My total lack of time perception is showing again: there are stil 45
days left. <whew!> Sometimes I love it when I'm wrong!


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

Date: Fri, 24 Apr 1998 14:11:00 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re: best way to find disk space for a directory
Message-Id: <slrn6k17b1.clo.jgloudon@hyssop.bbn.com>

Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On Fri, 24 Apr 1998, Ronald J Kimball wrote:
>
>> > 2. use find to get a list of files and then loop through and stat each
>> > one to get the file size.
>> 
>> Painful.  Watch out for symbolic links.
>
>And sparse files.

In which case he'd do better to look at (stat)[12], number of blocks allocated.

--
Jason Gloudon


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

Date: 24 Apr 1998 15:47:09 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: best way to find disk space for a directory
Message-Id: <893433270.134450@thrush.omix.com>

James Richardson <jamesr@aethos.co.uk.nospam> wrote:
	>snip<
: Definately dont use du.

	Hmm...not so fast there... du(1) is about the only portable way you
	have here.

: Use opendir/readdir/stat/lstat

	ONLY, if you have the source to du(1) so that you can account for
	all problems.  You'll also need to check the du source on *every*
	system you plan to run.  Not all du's on all Unixes are created
	equal (nore are there file systems), which is why calling du /is/
	the only portable method.

	You'll find it much easier to account for systems lacking du then
	for all the conditions of different systems that using du would
	mask.

: This will currently follow symlinks across filesystems (which maybe you
: want), and should report he size of symlinks themselves (linker?) rather
: than the size of the linked-to (linkee?) file.

	Hmm, only stat 7?  What about block holes?  This is why du(1)
	only reports block counts, since "exact" byte counts are useless.

	Use stats 11 & 12 and forget about exact byte counts or you'll
	get burned:

	$ du -sk .
	2665    .
	$ perl foo.pl .
	2102181
	$ perl -e 'open (FOO, ">foo"); seek (FOO, 1000000000, 0); print FOO "foo"'
	$ du -sk .
	2689    .
	$ perl foo.pl .
	1002102184

	DUH! :-)

	There are other problems however.  What if you cross filesystem
	boundaries?  You could have conflicting inode numbers that do not
	point to the same file, so just using stat 1 as a key won't do it.
	You'll have to track both the inode and the filesystem it's on
	(unless you don't care about other file systems (ala du -x), but
	you'd still have to account for this one way or the other).

	What about the disk space used by the directorys?  You only seem to
	track plain file size.


	Yes, I understand that it was a quick attempt and as you said
	hasn't seen much testing so it has problems, but your example
	proves my point that the only portable method here is to leave the
	guts of du to the system and just call it.  Use du(1) and save
	yourself *tons* of porting problems.  This is one case where using
	system() /is/ the most portable method.

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: 24 Apr 1998 13:19:05 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: BUG or FEATURE? -- splice() doesn't extend arrays
Message-Id: <893424387.262891@thrush.omix.com>

Aaron Harsh <ajh@rtk.com> wrote:
: It would cause some code I wrote last week to break:
:    @thingies = sort get_thingies();
:    @top_ten_thingies = @thingies;
:    splice @top_ten_thingies, 10;
: If splice was "fixed" I might end up with undefs in my array (if there are
: fewer than 10 thingies).

	As someone else mentioned, since you're not adding anything it
	shouldn't be affected.

: I suppose I could also have written it as:
:   @top_ten_things = @thingies > 10 ? @thingies[0..9] : @thingies;
: although I'm not sure if that's any better in any way...

	TIMTOWTDI

	$#top_ten_thingies = 9
		unless $#top_ten_thingies < 9;

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Fri, 24 Apr 1998 11:01:58 -0400
From: Bryan T Hoch <bth@acsu.buffalo.edu>
Subject: Can I have a C++ program call a Perl program?
Message-Id: <Pine.GSO.3.96.980424105951.28300A-100000@hercules.acsu.buffalo.edu>


Hi, I'm running a C++ program and i want to have it invoke a Perl program
that i have written. I have the C++ program write to a file, then I want
to call the Perl program to read from that file.

Could anyone tell me what I should do to do this?

Thanks in advance.
					Bryan H

PS- is there anyway to pass parameters between the two programs?



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

Date: Fri, 24 Apr 1998 17:06:57 +0100
From: Tomaz Sesek <sesek@intercortex.com>
Subject: Re: chdir in Perl on NT
Message-Id: <3540B8A1.1EDC1042@intercortex.com>

Yes, I am absolutely sure about the directory. In fact, some more info:
1. the script works fine when run from the command line but does not seem to
be able to change directories when it is run as a CGI script.
2. Does this have to do with access rights of the directories? How do I have
to set them so that perl can change its working directory to another
directory? I am trying to change to '../'.

Tomaz


> > I do this, the chdir() function returns TRUE but perl does not find
> Are you sure that your script is starting in the directory you think it
> is?  It sounds like you think it is starting in one directory, but yet
> it is really running from another.
>
> Have a look at the CWD module.  That has functionality to allow you to
> determine your current working directory (at least on unix).  It should
> be part of the standard dist., and has documentation built in.  (perldoc
> CWD)



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

Date: Fri, 24 Apr 1998 10:19:29 -0400
From: Brandon Golm <br@ndon.com>
Subject: Re: commenting a whole block?
Message-Id: <35409F71.54B923C9@ndon.com>

Stuart Cooper wrote:
> 
> abigail@fnx.com (Abigail) writes:
> 
> > Chris Nandor (pudge@pobox.com) wrote on MDCXC September MCMXCIII in
> > <URL: news:pudge-1704981518550001@ppp-12.ts-1.kin.idt.net>:
> > ++
> > ++ Personally, I like:
> > ++
> > ++ =pod
> > ++
> > ++ comment();
> > ++ out();
> > ++ all_this_code();
> > ++
> > ++ =cut
> >
> >
> > Yeah, but what if that section has a pod piece in it? ;)
> 
> Good point. Just like C comments, pod sections don't nest.
> 
> > Using an elegant editor:
> >       :x,ys/^/#/
> >
> > where x and y are the line numbers of the beginning and end.
> 
> Yeah, but like in many vi region operations, it's a pain having to
> calculate the beginning and end numbers.
> 
> In Emacs (in the Perl Mode) select the region you wish to comment.
> 
> M-x comment-region RET
>   will comment the region
> C-u M-x comment-region RET
>   will uncomment the region
> 

I agree.  It's easy to see what's commented to, because emacs will paint
it red (or whatever color you have).  In my emase, Control-C Control-C
is unmapped, so I put this line in my .emacs file, which makes
commenting whatever is selected, oh so easy:

(define-key global-map "\C-c\C-c" 'comment-region)

Also this is cool thing for perl too:

(setq perl-tab-to-comment 1)

But let's not talk about emacs too much on clpm.


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

Date: Fri, 24 Apr 1998 11:25:40 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: commenting a whole block?
Message-Id: <Pine.A41.3.96.980424103955.23654J-100000@ginger.libs.uga.edu>

If IBM hadn't misplaced the control key from its proper place under the
left pinky years ago, I might have chosen emacs over vi.

I have listened with interest to the suggestions regarding perl-aware
editors and have concluded that vi and my eyeballs are probably the best
choice for me.  Settings like number, tabstop=2, shiftwidth=2,
autoindent, showmatch, showmode give me just what I like.

I try to be consistent when I format perl code, and this provides the
visual clues that help me keep things straight in my head.  In
particular, I do always put a comment after lone end-block curlies:

}  # if
}  # else
}  # end sub whatever

This can make it easy to block out code using reqexps for line numbers.
For example, I can go to the beginning of 'sub whatever' and do this:

		:.,/# end sub whatever/s/^/#/

thereby not having to know line numbers at all.

Don't get me wrong!  I'm not trying to start a this-vs.-that pointless
debate.  I'm just adding my suggestion to these couple of threads.
I'm quite sincerely sure that emacs is *wonderful*.  Vi works great
for me and it's fun, except when I leave the caps lock on :-(

And I recommend it to anyone who feels adventurous :-)

On Fri, 24 Apr 1998, Brandon Golm wrote:
> Stuart Cooper wrote:
> > abigail@fnx.com (Abigail) writes:
> > > Yeah, but what if that section has a pod piece in it? ;)
> > Good point. Just like C comments, pod sections don't nest.
> > > Using an elegant editor:
> > >       :x,ys/^/#/
> > > where x and y are the line numbers of the beginning and end.
> > Yeah, but like in many vi region operations, it's a pain having to
> > calculate the beginning and end numbers.
> But let's not talk about emacs too much on clpm.

---
Brad Baxter, UGA



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

Date: Fri, 24 Apr 1998 15:14:13 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Alan Voorhees <radio@hotmail.com>
Subject: Re: Cron job and Date problem
Message-Id: <Pine.GSO.3.96.980424080836.5518W-100000@user2.teleport.com>

On Thu, 23 Apr 1998, Alan Voorhees wrote:

>   open (DATABASE, "$data_file_path") || &file_open_error
>         ("$data_file_path", "Prune Database",  __FILE__, __LINE__);

Putting double quotes around those variable names merely pretends to be
doing something. But what might be really useful (if &file_open_error is
doing the obvious) would be to pass the magical $! variable, which
contains the human-readable reason for the error, such as "permission
denied" or "file not found". 

>     chop $line; 

Almost always, chomp is preferable to chop.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/




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

Date: Fri, 24 Apr 1998 17:26:45 +0200
From: "Ing.Martin HEIN" <martin.hein@maxmobil.at>
Subject: dynamically creating a hash of hashes, reading keys/values from a file
Message-Id: <3540AF35.3E26AA68@maxmobil.at>

Hi folks,

I'm a totally newbie to perl, and this is my first major encounter with
this language.

My troubles are coming from dynamically setting up/building a hash of
hashes, looking like

     %hoh = {
         key1 => {
             val1 => "...",
             val2 => "...",

             subkey1 => {
                 val1 => "...",
                 val2 => "...",
             },

             subkey2 => {
                 val1 => "...",
                 val2 => "...",
                 val3 => "...",
             },
                  :
                  :
                  :
         },

         key2 => {
             val1 => "...",
             val2 => "...",

             subkey1 => {
                 val1 => "...",
                 val2 => "...",
                 val3 => "...",
                 val4 => "...",
             },

             subkey2 => {
                 val1 => "...",
                 val2 => "...",
                 val3 => "...",
             },
                  :
                  :
                  :
         },
     }

All things like 'key1', 'key2', 'val1', 'subkey1', ... are read from a
file.

So, any helping hand is welcomed!

Thanx in advance,
Martin



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

Date: Fri, 24 Apr 1998 15:17:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Fynes <Mark.Fynes@cs.tcd.ie>
Subject: Re: Free http perl cgi windows95 practice platform
Message-Id: <Pine.GSO.3.96.980424081631.5518X-100000@user2.teleport.com>

On Fri, 24 Apr 1998, Mark Fynes wrote:

> Can anyone recommend a freeware setup for testing / learning perl web
> programming ( through cgi )  on the windows95 platform? 

Yes. It's the Perl distribution on CPAN. Did you realize that you don't
need a server to run Perl CGI scripts? Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 24 Apr 1998 10:31:40 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Grabbing a webpage with Perl (with https)
Message-Id: <6hqb8s$nal$1@Venus.mcs.net>

In article <35407DD9.CEB60699@zdo.wssk.am.wroc.pl>,
Jacek Kubica  <kubica@ch.wssk.wroc.pl> wrote:
>Chris wrote:
>> 
>> Does anyone know how to have a Perl program get a web page?  I just need
>> for it to grab a url I give it.  Thanks.
>
>Simple way is to use  HTTP_LIB.PL
>Script written by Gunther Birznieks.

Is there anything free that will grab a page via https?  Or a way
to control a browser that could do it?

  Les Mikesell
    les@mcs.com


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

Date: Fri, 24 Apr 1998 13:57:24 GMT
From: gary@cs.depaul.edu (Gary Weinstein)
Subject: Re: Help: crypt for Win32 ??
Message-Id: <6hq5om$mco@news.acns.nwu.edu>

In article <6hmtao$sm5$1@mail.ic.uva.nl>, ks@ic.uva.nl (Karel Sprenger) wrote:
>In article <353EA6BB.867BA2DC@netscape.com>, vish@netscape.com wrote:
>> 
>> Where can I find UNIX-like "crypt" function for Win32 Perl ?? Does
>> anyone have a crypt lib for NT Perl ??
>> thanks
>> 
>
>I sure hope it is available somewhere in a precompiled form!  It's downright 
>stupid that it is not in the GS distribution 'due to excessive paranoia'. 
>Sigh! As if the source code is not available in a thousand places.

Well, if you don't mind having it implemented as a COM server, then you can 
get a free crypt component from Stephen Genusa's web site 
(www.serverobjects.com). Look for the component named AspCrypt. Yes, his 
components are aimed at ASP users, but since Perl on NT can create and use 
COM servers, the component works just fine.

To use it, download the zip file (it's only about 72K), unzip it, run 
regsvr32 on the server and you're ready to go (there's a text file 
describing the install in more detail). To use it in Perl you do something 
like this:

use Win32::OLE;
$crypt = new Win32::OLE( 'AspCrypt.Crypt' );
$salt  = 'ab';
$pwd   = 'secret';
$encrypted = $crypt->Crypt( $salt, $pwd );

Pretty simple.

Hope this helps.

Gary


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

Date: Fri, 24 Apr 1998 15:28:12 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: John Caldwell <jcald@lake.ml.org>
Subject: Re: linefeeds and perl formats
Message-Id: <Pine.GSO.3.96.980424082001.5518Y-100000@user2.teleport.com>

On Thu, 23 Apr 1998, John Caldwell wrote:

> > > I'm trying to use perl's 'format' to output some text in some columns. 
> > > My problem is that some of the strings are like "foo\nbar\nbaz\n"
> > 
> > You may want the @* format. Hope this helps!

> This wont work, as i want all the text indented evenly

Sure, it'll work. But you'll have to indent it yourself. Formats (AFAIK) 
can't take multiple lines and re-indent them, but there is at least one
module on CPAN which should be able to help you to wrap your text, if
that's what you want. Or, you may want to use a map expression in the
format.

     format SOMETHING =
     blah blah blah
     @*
     map "       $_\n", split /\n[^\S\n]*/, $multi_lines
     blah blah blah
     .

BTW, formats can be great if they can do what you need, everything you
need, and everything you're ever going to need. But if you'll ever need 
more than what formats can provide, you're probably better off not using
them at all. Their limitations can be pretty severe, and hard to work
around.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 24 Apr 1998 08:38:27 -0600
From: droby@copyright.com
Subject: Re: PB : sendmail subroutine
Message-Id: <6hq4kl$ohl$1@nnrp1.dejanews.com>

In article <01bd6ea5$61c4f980$b26d9ec2@clubinternet.club-internet.fr>,
  <affix@usa.net> wrote:
>
> Hi,
> I dont understand why my message isn't sent.
> I have the right paht for the mailprogram (mail) and i have made the
> changes in the sub routine.
> The last message i had in the error_log was :
> "Name "main::CONFIG" used only once: possible typo at bourdaismail.cgi line
> 334.
> Use of uninitialized value at bourdaismail.cgi line 334.
> No mail for bourdais"

Looks like a typo at line 334.

>
> Thank you
> laurent
> ----------------------------------------
> sub send_mail {
>     # Localize variables used in this subroutine.
>  #
>     local($print_config,$key,$sort_order,$sorted_field,$env_report);
>
>     # Open The Mail Program

I suspect the next line of being line number 334.  It has $CONFIG where most
of your code has $Config.   This is the typo referenced by the error log.

>     open(MAIL,"|$mailprog $CONFIG{'recipient'}");
>

It might be a bit safer and more portable to use the Net::SMTP module,
available from CPAN, instead of piping it to mail.  If you are accepting data
from Web users and sending it out a pipe, you must be very careful about the
data that is allowed through.

--
Don Roby
<droby@copyright.com>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Fri, 24 Apr 1998 14:31:22 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: PC-based editors for Perl?
Message-Id: <3540a12c.65626643@news.spacestar.net>

On Thu, 23 Apr 1998 14:33:43 GMT, leeroth-nospamo@worldnet.att.net
(Lee Roth) wrote:

>
>Any suggestions for an editor on a PC that would be 'better suited' to
>writing Perl code than native editors such as Notepad, Wordpad or
>(uck) a word processing package ?
>
>My personal editor is SEDT, available as freeware at
>http://www.ultranet.com/~anker/sedt/sedt.htm - works on a number of
>platforms (VMS,DOS/Windows,Unix) and offers many nice features among
>which I find valuable for Perl programming:
>
> 1) 'Find the matching curly brace' functionality
> 2) Auto-indent of left margin (indents same as previous line)
> 3) Ability to record keystroke macros and program keys on the fly
>
>Now SEDT is not for everyone (and I think the Windows version lacks a
>bit), so here is my question: What editor on a PC supports features
>1,2, or 3 that I have listed above?
>
>I'd like to be able to suggest an editor to some people doing Perl
>development on a PC.

I use Vim everywhere (Linux, Unix, Win32, Win 3.11, DOS). Does all
those things and more. Even has a module to allow Perl to control the
editor, tho that feature needs some work, IMHO...

www.vim.org for more info. Best bet is to compile it yourself to tweak
and peak it for your preferences, but precompiled binaries are
available for most anything. I use a djgpp compiled binary on all
Wintel stuff, but the gvim version is even GUIfied, if that's your
thing. Don't get the wrong idea...you don't *need* to compile it to
configure it... the .*rc files allow for most things, but some major
features are compiled in...leaving them out can make for a snappier
startup and a smaller footprint if you don't want them. Even at its
most rotund Vim is about half the size of the average Emacs install,
tho, IME, YMMV.


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

Date: Fri, 24 Apr 1998 11:32:10 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: PC-based editors for Perl?
Message-Id: <6hqaek$8n9@fridge.shore.net>

Brent Michalski wrote in message <35407D80.127DA46B@inlink.com>...
>Go to www.solutionsoft.com  They have a Windows Perl IDE that is pretty
>slick, although it is still in development.


It lets you write editor macros in Perl... :-)

-grinch

--
-----
"Yes, I'm paranoid, but that doesn't mean
no one's out to get me." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Fri, 24 Apr 1998 10:14:36 -0500
From: Roderick Gee <rodgee@dlep1.itg.ti.com>
Subject: PERL to DOS executable
Message-Id: <3540AC5C.6525@dlep1.itg.ti.com>

I'm new to PERL programming. Does anyone know of any  conversion utilty
other than  PERL2EXE.

Any help appreciated.

-Rod


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

Date: Fri, 24 Apr 1998 10:33:44 -0600
From: droby@copyright.com
Subject: Re: Perl V4.00
Message-Id: <6hqbcp$a2o$1@nnrp1.dejanews.com>

In article <6ho5nm$sme$1@news4.isdnet.net>,
  "philippe l'hostis" <plhostis@hol.fr> wrote:
>
> Do someone know where i can find an old version of Perl (4.0036) ??
>
> Thank you.
>
>

You can't.  Due to security and Y2K-compliance concerns,
distributions of Perl4 have been removed from servers world-wide.

Randal deleted them single-handedly.
;-)

--
Don Roby
droby@copyright.com


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Fri, 24 Apr 1998 16:35:45 +0200
From: Hauke Dressel <hauke.dressel@citicorp.com>
Subject: Re: Perl5 and IIS4 (on NTworkstation)
Message-Id: <3540A341.1AFC831B@citicorp.com>

I ran into the same problem first. Solution: Restart the machine, then
it should work. (Stopping and restarting the www-service isn't enough.)

Hauke

Ben Lowery wrote:
> 
> Hi there,
> I installed the option pack for NTWKST4.0, and am having problems getting
> perl scripts to run.  I have Perl for Win32 installed, as well as the
> ActiveState Perl for IIS, but it refuses to recognize .pl files as
> executable code.  I can run Perl scripts from the command line just fine,
> with or without extension, but cannot figure out how to associate .pl files
> with either Perl.exe or the ActiveState dll.  Help me out?  Thanks..  e-mail
> is preferable as i don't check the newsgroups that often..  thanks.  btw,
> the site is:
> http://hades.chaotic.net
> 
> --ben
> blowery@umich.edu


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

Date: Fri, 24 Apr 1998 15:45:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: David <davidu@electriciti.com>
Subject: Re: printing using the Format function
Message-Id: <Pine.GSO.3.96.980424083310.5518a-100000@user2.teleport.com>

On Fri, 24 Apr 1998, David wrote:

> I was wondering how I can print information returned from a form/CGI
> and print to a file through a form.  

The same way that you print information that is not returned from a form. 
:-) 

Is your problem in getting information from a web-based form? Knowing how
to print? Knowing how to use formats? Knowing how to open a file?  Knowing
how to generate HTML forms from your Perl script? Getting all this to work
over the web? All of these tasks are documented, of course, but I'm not
sure which problem you're having. 

> p.s. How can I read from this file, and keep the scalers. 

If you don't delete data or let a variable go out of scope, you'll always
"keep the scalars". Is that what you meant?

> By using:
> ($idnum,$title,$author,$body) = split (/:/); ?

That line (except, of course, for the question mark) is valid Perl code. 
Whether it will do what you want - who can say? :-) 

> I have defined a format:
> 
> format DATATABLE =
> -----                
> @<<<<<: 
> $idnum
> <B>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<:</B>
> $title
> <I>@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<:</I>
> $author
> <BR><P>@*:
> $body
> .

Generally, formats aren't especially useful for generating HTML. This is
because formats are for making fixed-format template-driven reports, and
HTML is free-format tag-driven markup. You may want to simply print the
output, possibly with a here-document. (Here-docs are described in the
perldata manpage.)

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 24 Apr 1998 14:18:54 GMT
From: jgloudon@hyssop.bbn.com.bbn.com (Jason Gloudon)
Subject: Re : Regular Expression to match a dotted quad representation IP address
Message-Id: <slrn6k17pr.clo.jgloudon@hyssop.bbn.com>

Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On Fri, 24 Apr 1998, Jason Gloudon wrote:
>
>> Yes it is -that- hairy, because ($num >= 0 && $num <= 255) is a lot simpler
>> to read and write.
>
>There seems already to have been some agreement that a string that
>contains only digits cannot test negative, and hence does not need to be
>tested >=0.  If you know otherwise...? 

I saw this and did remember it at the time I wrote this.
My point is the regular expression is not the best way to test if something you 
know to be a number is in a given range.

--
Jason Gloudon


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

Date: Fri, 24 Apr 1998 10:19:00 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Read-only value?
Message-Id: <Pine.A41.3.96.980424100417.23654G-100000@ginger.libs.uga.edu>

Okay, forgive me if I'm missing something here, but following is my code
(which contains your code, except I put "ord" in quotes to make -w happy:

#!/usr/local/bin/perl -w
use strict;

my( $val, $v );

$v = {
    "ord" => [ qw( test1array0 test1array1 ) ],
    ordpoints => [ qw( test2array0 test2array1 ) ]
    };

print ref( $v->{"ord"} ), "\n";
print ref( $v->{ordpoints} ), "\n";

foreach $val (@{$v->{"ord"}},@{$v->{ordpoints}})
 {
      print $val, " (1)\n";
      $val="&nbsp";
      print $val, " (2)\n";
      if (! $val)
      {
              $val="&nbsp";
              print $val, " (3)\n";
      }
 }
 __END__

ARRAY
ARRAY
test1array0 (1)
&nbsp (2)
test1array1 (1)
&nbsp (2)
test2array0 (1)
&nbsp (2)
test2array1 (1)
&nbsp (2)


No error messages.  Maybe your attempt to modify a read-only value is
happening somewhere else.  Of course 'if (! $val)' never evaluates to true
in this scenario.  Also, you probably mean $val="&nbsp;";

HTH, Brad


On Thu, 23 Apr 1998, Wade Williams wrote:

> foreach $val (@{$v->{ord}},@{$v->{ordpoints}})
>  {
>  	if (! $val)
>  	{
>  		$val="&nbsp";
>  	}
>  }
> 
> 
> Naturally, $v->{ord} is a reference to an array.
> 
> When I run this code, I get "Attempt to modify read-only value"
> 
> My understanding it that $val should contain a reference to each element
> of the array as the loop iterates, and thus, I should be able to modify
> $val, and thus the array.
> 
> I've got identical code that works, but doesn't involve a reference, so
> I suspect it's just how I'm dereferencing the reference.  (However, if I
> go into the debugger, and do a "x @{$v->{ord}}" I do get the dump of the
> array, exactly as I would expect)
> 
> Anyone have any ideas on what my mistake could be?
> 
> Thanks,
> Wade
> wwilliam@cisco.com
> 
> 

---
Brad Baxter, UGA



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

Date: 24 Apr 1998 10:17:37 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Remote Process Monitoring
Message-Id: <6hqaeh$n2t$1@Venus.mcs.net>

In article <353D2E0C.8FFB940F@sccs.com>, Mike Schlienz  <mike@sccs.com> wrote:
>Does anyone know of a way to monitor processes running on a remote/network
>server? Thanx in advance for any info.

If you don't mind fairly coarse granularity
http://strobe.weeg.uiowa.edu/~edhill/public/spong/
is pretty nice.  It maintains a grid of colored dots on
a web page corresponding to the health of remote services
and tracks the history of transitions for you.

  Les Mikesell
   les@mcs.com


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

Date: Fri, 24 Apr 1998 15:40:34 GMT
From: John Porter <jdporter@min.net>
Subject: Requiring "use"  (was: Re: Using "require")
Message-Id: <3540B3F0.2F89@min.net>

Tom Phoenix wrote:
> 
> The docs for require should explain this. 

The explanation of use documents that.

John Porter
:-/


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

Date: Fri, 24 Apr 1998 09:50:58 -0700
From: Richard Newman <richard@phoneswitch.com>
Subject: Retreiving the args from a exec cmd call withing perl program
Message-Id: <3540C2F2.B1F65307@phoneswitch.com>

Greetings,

The call within the html looks like:
<!--#exec cmd="/cgi-bin/test.shtml arg1 arg2 arg3" -->

How do I retrieve arg1 arg2 and arg3 within my perl program?

I have looked at the enviroment variables and the args do not appear
there.

I think I will have to retrieve them the same way you would in a C
program by using argv and argc but I do not now how to to this in PERL
nor can I find a command that looks appropriate in the two books that I
have.

Thank You In Advance, Richard Newman


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

Date: Fri, 24 Apr 1998 15:06:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Adam Grayson <a-grayson@nwu.edu>
Subject: Re: Retrieving input from URL
Message-Id: <Pine.GSO.3.96.980424075558.5518V-100000@user2.teleport.com>

On Thu, 23 Apr 1998, Adam Grayson wrote:

> Yes, everything after the question mark is part of the
> $ENV{"QUERY_STRING"} variable. Once you have that value imported into
> your script, you can split it on the plus signs, or ampersands, or
> whatever, and then split those subvalues on the equals signs to assign
> values to the variables you are bringing in (hope that was
> intelligable).

Of course, it's (virtually always) better to use a module which implements
the proper algorithm - which is somewhat different than you describe.
Other advantages to using a module: a module should be debugged (so you
don't have to worry about mistakes in that part of the algorithm), it
should provide an easy debugging mode (for checking your programs from the
command line), and it should make it easier to write your code, since
you'll be able to concentrate on the task at hand.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 24 Apr 98 15:44:10 GMT
From: eugene@cs.umb.edu (Eugene O'Neil)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6hqc07$mb7@dfw-ixnews6.ix.netcom.com>

In article <6hlf8h$khr$1@mathserv.mps.ohio-state.edu>, 
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
>[A complimentary Cc of this posting was sent to Eugene O'Neil
><eugene@cs.umb.edu>],
>who wrote in article <6hl3a6$euf@dfw-ixnews8.ix.netcom.com>:
>> Yes they have. The version that was RELEASED as free code will ALWAYS be free! 
>> Any improvements people CHOOSE to contribute as free software will also be 
>> free! Only non-free dirivative works will not be free: they wouldn't be free 
>> under the GPL either, they simply wouldn't exist. Does less software make the 
>> world a better place?
>
>Unfortunately, according to RMS's lawers, this is not *that* simple.
>I do believe that he has some point in requiring transfer of copyright
>to FSF.  How this is logical I do not understand *exactly*, but I do
>not want to ;-).

What isn't true? That software released with a free license will always be 
free? That's basic copyright law: you can't arbitrarily revoke a license once 
you issue it. The only exception to this is if someone can prove you aren't 
really the copyright holder, and never had the right to issue the license in 
the first place. But if this is true, you certianly don't have the right to 
transfer the copyright either. Thus, the FSF is just as vulnerable to using 
badly-transferred copyrights as they would be vulnerable to using badly-issued 
licenses: the FSF copyright policy doesn't really protect anyone from 
anything, it only puts RMS in control of more copyrights. 

Now, let me guess... you don't want to understand that, either. 

-Eugene


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

Date: Fri, 24 Apr 1998 10:34:51 -0400
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: spoiled noobie
Message-Id: <Pine.GSO.3.95.980424103118.15676A-100000@cp.pathfinder.com>

On Thu, 23 Apr 1998, Tom Phoenix wrote:
> On Thu, 23 Apr 1998, Andrew F. Lee wrote:
> > > I grew up? with the trim() function which returns a string with the
> > > leading and the trailing space-chars removed.
> > sub trim {
> > 	my $string = shift;
> > 	$string =~ m/\s*(.+)\s*/;
> > 	return $1;
> > }
> If you must answer questions which are answered (or nearly so) in the FAQ,
> please ensure that you improve upon the FAQ's answer. This attempt,
> unfortunately, is buggy. I encourage you to try it on these strings and
> others to see why and how it fails. 
> 
>     "    fred and barney    "
>     "fred\n and\n barney\n"
>     "\t\t\t"
>     "\tfred\t "
>     "      "
> 
> Don't let this discourage you from answering questions, though; we all 
> make mistakes sometimes. I hope this can be a learning experience for you.
> Cheers!

Woops!

But you know what I meant .... (remember it is an idiomatic (not idiotic)
language ...)  :-)



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

Date: Fri, 24 Apr 1998 14:14:29 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: spoiled noobie
Message-Id: <35409d9f.64718069@news.spacestar.net>

On Fri, 24 Apr 1998 00:16:31 GMT, Bill 'Sneex' Jones
<chasecreek.systemhouse@usa.net> wrote:

>Kevin Reid wrote:
>> 
>> $you{intelligence} += 65535 if $^O eq "MacOS"; # :-)
>> 
>
>Someone asked me just today if I knew of a good Win95 Uninstall program; they wanted to get rid of some scattered DLLs and other useless programs.
>
>I said "I have found that Delete works best for me."  They prolly still have that curious expression of what is he talking about look...  :-)
>

Gotta disagree with you. I find the following to work much better:

c:>fdisk		# nuke all partitions

place Linux CD in first CD-ROM drive and reboot with linux boot disk
in drive A:. End of problem. ;;)

Now if I could just do that here at work. :(


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

Date: 24 Apr 1998 13:07:21 +0200
From: Bertram Ludaescher <ludaesch@kilda.informatik.uni-freiburg.de>
Subject: Using LEDA with Perl in C++
Message-Id: <led8e78oly.fsf@kilda.informatik.uni-freiburg.de>


Has anybody experience with C++ embedded Perl code when used together
with LEDA classes?

It seems that they don't work together. For example foo.cc:

    #include <EXTERN.h>
    #include <LEDA/list.h>
    #include <perl.h>

    main ()
    {
    list<int> some_list;
    }

yields a parse error:

    foo.cc: In function `int main()':
    foo.cc:8: parse error before `>'

swapping the 2nd and 3rd #include line above yields:

    /home/himmeroe/LEDA/LEDA-3.2.3/include/LEDA/param_types.h:116: 
    macro `Copy' used with just one arg
    /home/himmeroe/LEDA/LEDA-3.2.3/include/LEDA/param_types.h:226: 
    macro `Copy' used with just one arg
    /home/himmeroe/LEDA/LEDA-3.2.3/include/LEDA/param_types.h:227: 
    macro `Copy' used with just one arg
    /home/himmeroe/LEDA/LEDA-3.2.3/include/LEDA/param_types.h:228:
    macro `Copy' used
    [...]


ANY IDEAS/HINTS WHAT TO DO??

(or do we really have to rename macros in the Perl/LEDA code to make
them disjoint??)

Thanks a lot!

	Bertram

PS please cc: to ludaesch@informatik.uni-freiburg.de

-- 
Bertram Lud"ascher	          



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

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

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