[9968] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3561 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 27 13:03:18 1998

Date: Thu, 27 Aug 98 10:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 27 Aug 1998     Volume: 8 Number: 3561

Today's topics:
        \\  ...what's the point? <admin@palisade-euorpe.com>
    Re: \\  ...what's the point? <rootbeer@teleport.com>
        backticks and windows b_redeker@hotmail.com
    Re: COBOL and Perl scott@softbase.com
    Re: Code Style (Was: How to sort this associative array <pdcawley@bofh.org.uk>
    Re: comp.lang.perl.windows.misc (Andrew M. Langmead)
    Re: comp.lang.perl.windows.misc (William D. Reardon)
    Re: Determining strlen (Michael J Gebis)
        dynamic library libperl.sl for HP-UX <Marko.Niinimaki@cern.ch>
        Error mesages from perl? <valerie@tctc.com>
    Re: gd.pm <pdcawley@bofh.org.uk>
        Hash of function refs with variable args <Brett.W.Denner@lmco.com>
    Re: Hash of function refs with variable args (Mark-Jason Dominus)
    Re: HELP: Problems installing PERL <rkoehler@osmre.gov>
    Re: Max value in an array (Abigail)
    Re: need and INI File parser in perl <jdporter@min.net>
    Re: newbie question <aqumsieh@tigre.matrox.com>
    Re: numeric operators (Larry Rosler)
    Re: numeric operators (Craig Berry)
    Re: Pattern match for filename extensions <ckuskie@cadence.com>
    Re: pattern matching (Patrick Timmins)
    Re: Perl compiler <tony_REMOVE@THIS_tld.com>
    Re: Perl compiler <dformosa@st.nepean.uws.edu.au>
    Re: Perl compiler (Abigail)
    Re: Perl compiler (Abigail)
    Re: Perl Docs.. forget the original post (Author) <maierc@chesco.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 27 Aug 1998 11:44:07 -0500
From: Palisade Europe <admin@palisade-euorpe.com>
Subject: \\  ...what's the point?
Message-Id: <35E58CD6.1D825BC8@palisade-euorpe.com>

in single-quoted strings...

print 'I am somewhat \obtuse';

does the same as

print 'I am somewhat \\obtuse';

The only reason I could think of (cf. first print statement)
\\ and \ being the same is that because defining that a single
quote inside a single-quoted string is achieved by \' would
require \\' if one wanted to end a single-quoted string in \

If that is true... why not not just a single exception to
characters within a single-quoted string:  '' (insert a
single quote) instead of two exceptions: \' and \\
(insert a single quote and insert a backslash)?

if this is in the faq, undiscovered by me or is otherwise
inappropriate, please email your condescension to me rather
than posting.

mailto:admin@palisade-europe.com

-- 
Palisade Europe Email/Web Administrator
admin@palisade-europe.com

For information on contacting Palisade Europe
send email to info@palisade-europe.com


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

Date: Thu, 27 Aug 1998 16:59:09 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: \\  ...what's the point?
Message-Id: <Pine.GSO.4.02A.9808270958370.4382-100000@user2.teleport.com>

On Thu, 27 Aug 1998, Palisade Europe wrote:

> why not not just a single exception to
> characters within a single-quoted string

Because this is the way Larry decided to do it. :-)

I think it's easier to parse, too. Hope this helps!

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



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

Date: Thu, 27 Aug 1998 16:00:32 GMT
From: b_redeker@hotmail.com
Subject: backticks and windows
Message-Id: <6s3vr2$i73$1@nnrp1.dejanews.com>

now I am convinced that this must be a FAQ,
so if you know where to find the answer,
please send me there

$out = `echo hey`;
print "Output: $out\n";

In the above, $out doesn't capture the output.
So what am I doing wrong? (besides using windows =o)

--
Boudewijn

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 27 Aug 1998 15:09:11 GMT
From: scott@softbase.com
Subject: Re: COBOL and Perl
Message-Id: <35e57697.0@news.new-era.net>

Shaun C. Murray (scm@enterprise.net) wrote:
> >I know no COBOL, but I work in an environment where I am surrounded by
> >COBOL people.  A 'real world' example: Recently one of these poor COBOL
> >slaves (that's a term of endearment, really) came to me with a extract
> >file from a small database from one of our departments.  He was dismayed
> >that the file format was not fixed width, but tab delineated. 

> I'd be dismayed at your COBOL programmers if that was a valid complaint.  
> Post your perl code and I'm sure the group can do it in less lines in COBOL. 
> Then give it to your PCS and tell him to take a refresher course.

You have to remember:

	1) variable length record "free format" files such as UNIX
	and every OS after UNIX (Windows, OS/2, etc) uses are
	almost unknown on the mainframe. Using them is possible
	("unformatted" files are used for executable code, etc and
	can be user-created) but is poorly supported.

	2) a single COBOL program doesn't exist in isolation -- it
	is part of a system which can include other COBOL programs,
	sort utilities, etc. Even if you rewrote this one program
	in Perl, it wouldn't do you any good. You'd have to 
	rewrite everything.

People who are used to the UNIX file system and all the OSes created
after this file system became widely known just can't appreciate how
bizarre the mainframe really is.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 27 Aug 1998 16:14:15 +0200
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <s7pu32yfr60.fsf@serinde.elsevier.nl>

Zenin <zenin@bawdycaste.org> writes:

> Kevin Reid <kpreid@ibm.net> wrote:
> : Just thought I'd list some of my formatting styles:
> : my $self = bless {
> :   param => 'value',
> :   p2 => $input,
> : }, $class;
> 
>         I'd line up the "=>"s, but that's me. :-)

You're not alone there.

>         I personally find this much easier to read:
> 
>         if (
>             some condiontion
>             and cond2
>             and some other condition that is long
>             and something
>             and yet another long condition
>             or (
>                 foo
>                 and bar
>                 and dog
>             )
>         ) {
>             code;
>         }

Ooh yeah. I think I'm going to be doing my stuff like that from now
on, though possibly with the wrinkle:

    if (
            some condition
        and cond2
        and some really long condition that takes up more
            than one line
        and something else
         or (
                 foo
             and bar
             and dog spot
            )
        )
    {
        code;
    }

Thanks for the idea.

Now what do the panel think of:

    $foo = $some_long_variable_name == value ?
           $some_long_variable_name : $some_default

I beginning to be of the opinion that there is no good way of
formatting this particular construct short of pulling it out into a
full on if .. else block.

-- 
Piers Cawley
Where is the life we have lost in living?
Where is the wisdom we have lost in knowledge? 
Where is the knowledge we have lost in information? -- T. S. Eliot. 


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

Date: Thu, 27 Aug 1998 14:08:46 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <EyCpyM.GMn@world.std.com>

Dan Nguyen <nguyend7@msu.edu> writes:

>Some history of Windows.
>Win32 are all derived (NT is less as much) from Win3.x.  Which is just
>the frosty coating on top of MSDOS.  Which use to be PCDOS which was a
>hack of QDOS(Quick and Dirty OS), which was a hack of CP/M which was a
>hack of UNIX.  So most people are running a hack of a frosty coating
>of a hack of a hack of a hack of UNIX.

Uri corrected the mistake in the CP/M derived from Unix portion, and I
just wanted to mention another thing. Most of the Unix similarity that
may be in MS-DOS (which then will lead to its appearance in the later
operating systems) was added in MS-DOS and PS-DOS 2. (I think the
first version of MS-DOS for sale. Only PS-DOS had a version 1) Things
like the hierarchical file system, pipes, redirection, and what became
the prefered I/O API (which look a lot like Unix's file descriptors
and read/write calls) This makes the Unix lineage a bit closer than
you imply. Also I think something is missing in the QDOS is derived
from CP/M statement. MS-DOS's use of the forward slash as the option
introducer implies something other than CP/M in its ancestry.

Without the Unix like additions to to MS-DOS, would the port of Perl
have happened? (Just asking something to try to keep my message on
topic.)
-- 
Andrew Langmead


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

Date: Thu, 27 Aug 1998 15:05:26 GMT
From: wdr1@pobox.com (William D. Reardon)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <EyCsL3.MKJ@midway.uchicago.edu>

In article <6s1jlk$mlt$3@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <6s18ga$e65$5@msunews.cl.msu.edu>,
>	Dan Nguyen <nguyend7@msu.edu> writes:
>: IMHO, I realy think there is a need for comp.lang.perl.windows.misc,
>: with all the Windows people (who don't know how to read the FAQs and
>: wonder why chmod() doesn't work.)
>
>I talked to Russ about this (although the name I suggested was
>comp.lang.perl.win32).  He told me that there is a mandatory three
>month waiting period after a change in a hierarchy (such as the
>addition of a group) before other proposals affecting that hierarchy
>would be accepted.
>
>I'd vote for it. :-)

	As would I.  Not for the cluelessness aspect, Lord knows every
platform has enough of those, but simply because I think it would be
a good place to discuss issues specific to Perl on Windows.  
	In the meantime, maybe it would make sense to put something
like [Win32] in the subject line.  That way people who don't care
about Win specific issues can easily kill file 'em, and those who do,
can easily select them. It would make searching on dejanews a heck of
a lot easier too.

Just a suggestion,
-Bill
-- 
William Reardon							 wdr1@pobox.com
Hold fast to dreams, for if dreams die, life is a broken bird that cannot fly.
                  -Langston Hughes


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

Date: 27 Aug 1998 16:49:02 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Determining strlen
Message-Id: <6s42lu$5fa@mozo.cc.purdue.edu>

Uri Guttman <uri@sysarch.com> writes:

}>>>>> "BJFW" == Bill Jones, FCCJ Webmaster <webmaster@fccjmail.fccj.cc.fl.us> writes:
}  >> I've figured out how to find out the length of the URL, but can't
}     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}  >> figure out how to cut from the 81st character to the end out of the
}  >> string.

}  BJFW> God forbid!  Did 'length' just up and disappear?

}he did say he figure that out. read the posting, he needs substr or
}some other perl hack to truncate.

Wouldn't it be cool if length could be an lvalue?

  length($str)=80;

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Thu, 27 Aug 1998 16:50:51 +0200
From: Marko Niinimaki <Marko.Niinimaki@cern.ch>
Subject: dynamic library libperl.sl for HP-UX
Message-Id: <35E5724B.6231@cern.ch>

Dear all,

there seems to be rather hopeless linking problems in
my HP-UX environment (HP-UX B.10.20 A 9000/755) and 
it might be a bit less hopeless it there is a 
libperl.sl (shared library) available instead of libperl.a.
I'm using perl 5.004.

I'd be happy to get any information concerning this. 

TIA,
Marko


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

Date: Wed, 26 Aug 1998 11:34:57 -0500
From: Valerie Philpott <valerie@tctc.com>
Subject: Error mesages from perl?
Message-Id: <35E43931.4A6135E9@tctc.com>

Hello, we recently upgraded our derver to RedHat 5.1. 
I am running a counter script that "used to work" on 4.2 but on 5.1 i
get this message 

"Can't locate gnu/stubs.ph in @INC (did you run h2ph?) (@INC contains:
/usr/lib/p
erl5/i386-linux/5.00404 /usr/lib/perl5
/usr/lib/perl5/site_perl/i386-linux /usr/
lib/perl5/site_perl .) at /usr/lib/perl5/i386-linux/5.00404/features.ph
line 70"

If it is not too obvious, I am new to perl. Can anyone offer any help?
And what is h2ph?


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

Date: 27 Aug 1998 16:58:08 +0200
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: gd.pm
Message-Id: <s7psoiifp4v.fsf@serinde.elsevier.nl>

"Dale Sutcliffe" <dsutclif@NoSpam.ucsd.edu> writes:

> I am trying to use gd.pm.
> It does not seem to be working?
> How is it set up?
> Do I simply place the pm file into a specific directory or what?

Probably 'what'. Try reading the docs that came with it.

-- 
Piers Cawley
Where is the life we have lost in living?
Where is the wisdom we have lost in knowledge? 
Where is the knowledge we have lost in information? -- T. S. Eliot. 


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

Date: Thu, 27 Aug 1998 09:38:15 -0500
From: Brett Denner <Brett.W.Denner@lmco.com>
Subject: Hash of function refs with variable args
Message-Id: <35E56F57.350FD8FE@lmco.com>

I am trying to write a script that allows a user to calculate 
properties of air.  The user inputs an integer (which corresponds
to the desired quantity: 100 => pressure, 101 => temperature,
102 => density, etc.), and the code runs the proper subroutine
based on the integer.  

I have set up a hash table relating integers to function references, 
like so:

%func_table =
    {
    100 => \&calc_pressure,
    101 => \&calc_temperature,
    102 => \&calc_density,
    };

Then, the function can be called like this:

$prop = $func_table{$user_option}->(ARGUMENT LIST);

The problem is that each function may have a have different 
argument list: e.g., &calc_pressure may require two arguments, 
and &calc_temperature may take three different arguments.  

One solution is to pass every argument that any of these functions 
might require to each and every function, but that would be very 
inefficient.  I would like to pass only the necessary arguments to 
the functions to avoid a lot of overhead.

Can I use closures (or callbacks) to specify the appropriate argument 
list ahead of time, or is there another solution to this problem?

Thanks,
Brett

-- 
 Brett W. Denner                                Lockheed Martin TAS
 Brett.W.Denner@lmco.com                        P.O. Box 748
 (817) 935-1144 (voice)                         Fort Worth, TX 76101
 (817) 935-1212 (fax)                           MZ 9332


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

Date: 27 Aug 1998 12:11:08 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Hash of function refs with variable args
Message-Id: <6s40es$n4$1@monet.op.net>

In article <35E56F57.350FD8FE@lmco.com>,
Brett Denner  <Brett.W.Denner@lmco.com> wrote:
>One solution is to pass every argument that any of these functions 
>might require to each and every function, but that would be very 
>inefficient. 

Says you.

I think a more persuasive objection is that it would be a pain in the butt.

If it's not a pain in the butt to code, I would suggest coding it to
pass all the argmuents all the time and then *see* if it is `very
inefficient'.  Unless the program is going to be run a lot, then the
amount of time you have already spent worrying about the efficiency
problem is probably much larger than the amount of extra time the
program would have spent passing unnecessary arguments.

If your program is so time-critical that passing extra function
arguments is important, I would suggest a round of profiling and
banchmarking, followed by recoding essential parts into C.

>Can I use closures (or callbacks) to specify the appropriate argument 
>list ahead of time, or is there another solution to this problem?

I had written about twenty lines of code with various suggestions, and
then decided that there was probably no point to actually answering
your question, and I would be doing you a disservice by showing you
the code, so I cut it out.

Sorry, but I think you are asking the wrong question.



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

Date: Thu, 27 Aug 1998 14:02:51 GMT
From: "Rick Koehler" <rkoehler@osmre.gov>
Subject: Re: HELP: Problems installing PERL
Message-Id: <EyCpnK.A2@igsrsparc2.er.usgs.gov>

Eric_Strang@FAC.com wrote in message ...
>When I run setup.exe, I get the following message:
>Couldn't find Perl Interpreter!!
>*choke* *gasp* *wheez*
>
>What are the steps to correct this problem [snip]

Eric, it would be helpful if you included a bit more information,
such as what platform you're attempting the install on,
what specific version of Perl, etc.  Doing so makes answering
your question much easier.

Also, as you will undoubtably hear more of, and hopefully,
take to heart, please read the FAQ, perldocs and so on, as they
very possibly contain the information you're seeking.
Good luck.




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

Date: 27 Aug 1998 16:36:23 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Max value in an array
Message-Id: <6s41u7$oju$1@client3.news.psi.net>

Craig Berry (cberry@cinenet.net) wrote on MDCCCXXII September MCMXCIII in
<URL: news:6s2a40$efs$4@marina.cinenet.net>:
++ Abigail (abigail@fnx.com) wrote:
++
++ : ++ I find that any time you find yourself doing map in a void context, you
++ : ++ should instead use foreach.  There may be some case where this is
++ : ++ inappropriate, but if so, I haven't encountered it yet. :)
++ : 
++ : I use map {} where map {} is more intuitive.
++ 
++ This is obviously a matter of taste, but can you describe more clearly how
++ map is more intuitive than foreach, in this instance or in general?  I

For short operations, I use map if I think the operation is more important
than the data. For long blocks, I've a preference for foreach.

++ find that having to think about using the () trick to avoid building a
++ results list argues against this idea.  Leave that aside, and the two are
++ basically rearranged versions of each other:
++ 
++   map { op($_) } @arr;
++   foreach (@arr) { op($_) }
++ 
++ ...other than the unneeded return list from map, of course.

Which is a bug in perl that remains unfixed - apparently it isn't much
of a performance hit to have people fix it. map {} seems the exception
on the rule that there are no lists in scalar context. But you miss one
important thing. Context. The op ($_) in the map is in list context,
while the op ($_) in the foreach is in scalar context.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Thu, 27 Aug 1998 12:43:58 -0400
From: John Porter <jdporter@min.net>
Subject: Re: need and INI File parser in perl
Message-Id: <35E58CCE.416D@min.net>

Prasad Suravarapu wrote:
> 
> If there is an INI type configuration file parser in perl,
> I need it. Don't want to re-invent the wheel.

Not reinventing the wheel is a good impulse.
That impulse should trigger the following response: Check CPAN.
You will find that you are in luck -- there is a module
that does what you want.

-- 
John Porter


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

Date: 27 Aug 1998 11:13:08 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: newbie question
Message-Id: <x3ypvdmo3uj.fsf@tigre.matrox.com>


Justin Kidder <jrkst34+@pitt.edu> writes:

> 
> I'm installing a message board script from off the web, but it didn't
> work.  So I ran it with the command "perl -w" and I got the following
> error:
> 
> "my" may clash with future reserved word at multipageboard.cgi line 769.
> Syntax error in file multipageboard.cgi at line 769, next 2 tokens "my
> ("
> Execution of multipageboard.cgi aborted due to compilation errors.
> 

Apparently your Perl compiler is too old to support lexical scoping!

> Here is my result of "perl -v":
> 
> This is perl, version 4.0
> 

Bingo! Lexical scoping was introduced in Perl5 .. so you should
upgrade your version of Perl. Try downloading the latest version from
www.perl.com
 
> 
> Can anyone help me out here and tell me how to fix it?  I've never
> really studied perl before, and I don't want to have to learn the whole
> language to install this one script.  Thanks so much to whoever can help

You don't need to learn the WHOLE language to do something
useful. From all the Perl users in the world, I would estimate that
0.000000000000000001% of them know the *WHOLE* language; the rest just know
"enough"! Maybe you should read some more about Perl or else you would
develop many an enemy around this newgroup!

> 
> Justin
> -- 
> -----------------------------------------------------------------------
> Justin Kidder, Research Asst.   |   Automation and Robotics Laboratory
> jrkst34+@pitt.edu               |   University of Pittsburgh
>                                 
>                Home page:   http://www.pitt.edu/~jrkst34
> -----------------------------------------------------------------------
>          There are two rules for ultimate success in life:
>                 1. Never tell everything you know.


-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: Thu, 27 Aug 1998 08:28:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: numeric operators
Message-Id: <MPG.104f1ae792802f909897f7@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <904181795.747.0.nnrp-10.c2deb1c5@news.demon.co.uk> on Thu, 27 
Aug 1998 02:36:05 +0100, Daniel Adams <dan@fearsome.net> says...
 ... 
> # set $day_found to $day
> $day_found = $day;
> 
> # set $expire to $day minus seven
> $expire = $day - 7;
> 
> # go to subroutine "find_out"
> &find_out;
 ...
> # decrement the numerical value of variable $month by one
> $month--;
> # increment variable $day_found by 31
> $day_found += 31;
> # increment variable $expire by 29
> $expire += 29;
 ...

Others have tried to analyze your code, which I won't repeat.  They 
omitted to comment on your comments.  Please look at TomC's latest:

<URL:http://language.perl.com/style/slide5.html>

It is short enough that I can reproduce it here in its entirety, for the 
benefit of any other lazy souls:

Perl Style: The Art of Commenting Code

     Explain what the code does, don't just perl2englishify. 
     Eschew gaudy block banners. 
     Use comments in regexes with /x. 
     Comment entire blocks, not single lines. 
     `Comments on data are usually much more helpful than on algorithms.' 
          (Rob Pike) 
     `Basically, avoid comments. If your code needs a comment to be           
          understood, it would be better to rewrite it so it's easier to 
          understand.' (Rob Pike)

-- 
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 27 Aug 1998 06:18:38 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: numeric operators
Message-Id: <6s2tnu$hcd$2@marina.cinenet.net>

Daniel Adams (dan@fearsome.net) wrote:
: I'm throwing myself to the mercies of the clpm ng, unable to get my head
: around a problem I seem to be having with numeric operators and the like. I
: am trying to be a model Usenet citizen, and I have made every effort in this
: post to improve upon my earlier efforts which provided insufficient
: information. I have included comments in my code, I have said what I
: expected the script to do, what it actually does, and included my code at
: the foot of the message - I hope someone feels inspired to help!

Well...you're going to kill me for saying this...you're actually a bit too
wordy!  I'm going to snip large chunks of what you've written to get at
the relevant parts.

: What is Meant to Happen: Let me say that the aim of (this part of the)
: script is simply to go to one of two subroutines ("success" or "fail") based
: largely on whether certain files exist. When I feed the script information
: intending to make the script reach subroutine "success" it works as
: expected. (I have tested subroutine "fail" also and, if it works properly,
: _when reached_.)
: 
: What Actually Happens:  When I feed the script information (through a form
: on the web) intending to make it reach subroutine "fail" it times out to the
: browser, and it does nothing when executed via telnet

'Does nothing' as in hangs, looping endlessly?  I might suggest using
either some strategically placed prints or the debugger to determine
exactly where it's looping.

: Code:
: ############################
: 
: $FORM{$name} = $value;
: 
: $year = $FORM{'year'};
: $month = $FORM{'month'};
: $day = $FORM{'day'};
: $path = $FORM{'path'};

Just for notational convenience, you might prefer the form

  ($year, $month, $day, $path) = @FORM{'year', 'month', 'day', 'path'};

: # set $day_found to $day
: $day_found = $day;

That sort of comment (which most of your comments resemble) is considered
more harmful than helpful.  It simply reiterates exactly what the next
line of code does.  In general, comments should be aimed at why things are
being done, or what state things are in at a given point, or the like. 
What-the-next-line-does comments just clutter your script, and also mean
that any change will also involve either changing comments or letting code
and comments get out of sync.  I've clipped your further comments that fit
this category. 

: $expire = $day - 7;
:
: &find_out;
: 
: sub find_out {
: if (-e "/disk1/usr//public_html/archive/$year/$month/$day_found/index.htm")
: { &success; }
: # if the file doesn't exist, then go to subroutine "not"
: else { &not; }

'not' is a Perl reserved word.  Using it as a subroutine name is a bad
idea.

: exit;

Exiting from inside a subroutine is generally bad form.  Why not let it
return to the main code block and continue cleanly there?  Random exit
points make programs harder to analyze and debug.

: }
: 
: sub not {
: # if $day_found has been decremented to a value of 0, then go to subroutine
: "prev_month"
: if ($day_found =~ 0) { &prev_month; }

Oops.  That's not comparing to 0 for equality, that's the =~ operator,
which is treating 0 as a pattern and seeing if $day_found matches it.  You
want == instead.

Without this catch point working properly, I'll bet (haven't thoroughly
analyzed it, but seems probable) that day_found falls past zero and on
into increasingly negative numbers.  Not sure how it misses being caught
as it passes $expire, but then you haven't shown what fail() does.  Hope
this helps!

: elsif ($day_found == $expire) { &fail; }
: else { $day_found--; }
: &find_out;
: exit;
: }

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Thu, 27 Aug 1998 08:42:44 -0700
From: Colin Kuskie <ckuskie@cadence.com>
Subject: Re: Pattern match for filename extensions
Message-Id: <Pine.GSO.3.96.980827083644.6520A-100000@pdxmail.cadence.com>

On Mon, 24 Aug 1998, Andrea Spinelli wrote:

> @ftypes = (".txt", ".exe", ".doc", ".pl", ".bat");
> print "ftypes=@ftypes\n";
> 
> # now replace the '.' with '\.', since '.' is special
> # for regular expressions
> 
> @otherftypes = map( {s/\./\\./; $_} @ftypes );

##Handle any/all regular expressions characters
@otherftypes = map( { quotemeta($_) } @ftypes);

> print "otherftypes=@otherftypes\n";
> 
> # join the types using the regular expression '|' operator
> 
> $pattern = join( '|', @otherftypes  );
> print "pattern=$pattern\n";
> 
> # since you are interested in File::Find,
> # you should use something like
> 
> sub wanted
> {
>         if( $_ =~ $pattern ){
          if( $_ =~ /$pattern/o ){  ##/o to compile pattern only once!
                                    ##Or as Ilya would say, optimize!

Colin



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

Date: Thu, 27 Aug 1998 14:35:01 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: pattern matching
Message-Id: <6s3qqm$caj$1@nnrp1.dejanews.com>

In article <35e43cdd.29585853@news.nottingham.ac.uk>,
  itxjcs@unix.ccc.nottingham.ac.uk (James Stout) wrote:
> Hi
>
> I've chcked the FAQ's, and have an idea what to do, but I'm not
> totally sure. My attempts have failed.
>
> I am reading text from a database into scalar variables. I want to
> check the text for the @ sign (i.e. and email address - so it would be
> better to check for xxxxxxxxxxx@xxxxxxxxxx.xxxxxx.) If the text
> contains the @ sign, I want to put <a href mailto:$variable_name> in
> front of the text and </a> at the end of that text.
>
> Something like:
>
> $variable = "this could be an email address like
> itxjcs@nottingham.ac.uk";
> $variable = ~/@/;
> if($variable)
> {
>
> 	help please!
>
> }
>
> I've tried it, I get a match, but when I print the $variable, it's a
> bunch of numbers.
[snip]

Have you been following the newsgroup over the past day or two? A very
similar question was asked very recently. Do you know about the
substitution operator? Can we see some of your code?

Something like:

while (<>) {
    s|(\S+\@\S+)|<a href="mailto:$1">$1</a>|g;
    print;
}

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 27 Aug 1998 09:18:45 -0700
From: "Tony Bearman" <tony_REMOVE@THIS_tld.com>
Subject: Re: Perl compiler
Message-Id: <6s40tc$4fm$1@news.bctel.net>


George Kuetemeyer wrote in message:

> We've started using the perl2exe compiler for reasons
> other than $$ or security.

As have I. The question of software morality aside, have you (or anyone
else) had a chance to compare the outputs of perl2exe with pl2exe that comes
in the resource kit?

Thanks.





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

Date: 27 Aug 1998 09:01:49 +1000
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Perl compiler
Message-Id: <6s244t$sm2$1@godzilla.zeta.org.au>

In <yek7lzvsnr4.fsf@grymoire.birch> Bruce Barnett <see.my.address.below@domain.com> writes:

[...]

>Suppose some company invested $250,000 in a project written in
>PERL. Suppose patents were pending on the concepts.  Suppose those
>that funded it wanted to get compensated for it?

It would be better to have the buyers of the software sing a non
disclosure aggrement.  Of cause softwhere patents are also ungood.



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

Date: 27 Aug 1998 16:40:56 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl compiler
Message-Id: <6s426o$oju$2@client3.news.psi.net>

Simon Wistow (simon@new-mediacom.com) wrote on MDCCCXXII September
MCMXCIII in <URL: news:645CAC0140CED111AF1500805FEDDB8AB06F@ns.new-mediacom.co.uk>:
++ 
++ And people wonder why the *nix community gets a reputation for being
++ snobbish/elite-ist/arseholes.


*ploink*


Abigail
-- 
Is that elite-ist enough?


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

Date: 27 Aug 1998 16:55:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl compiler
Message-Id: <6s432n$p12$1@client3.news.psi.net>

Bruce Barnett (see.my.address.below@domain.com) wrote on MDCCCXXII
September MCMXCIII in <URL: news:yekww7ur19h.fsf@grymoire.birch>:
++ abigail@fnx.com (Abigail) writes:
++ 
++ > The people who decided to write it in Perl should have thought about
++ > this question before. 
++ 
++ 
++ So, Perl is unsuitable for prototyping new concepts?


If prototyping means distributing and keeping it a secret, yes.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


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

Date: Fri, 28 Aug 1998 00:58:00 -0400
From: Charles Maier <maierc@chesco.com>
Subject: Re: Perl Docs.. forget the original post (Author)
Message-Id: <35E638D8.92F48F09@chesco.com>

John Porter wrote:
> 
> Simon Wistow wrote:
> >
> > > Simon Wistow wrote:
> > > >
> > > > Some of us with window boxes don't have grep either (now there's an
> > > > idea, hmmmm);
> > >
> > > So what. Don't you have "Find: Files or Folders..." ???
> >
> > Yeah, but that doesn't work exactly like grep does, does it?
> 
> No, but does it need to?  You can still search for specific text,
> which is sufficient 93% of the time.
> 
> --
> John Porter

This just is not true. FIND: Files or Folders..." will find FILENAMES
that match the argument. However.. There are utillities that run from
DOS and windows that are available to search a series of files for
'hits' on "content".

Try this one... "How do you DELETE a data file in Perl?". What <should>
your arguments be??  


This "thread" was MY original post. I have been watching it waft in the
breeze that is this newsgroup. The point of my post was simply:

"Do we want the docs to be better?"

- and -

"Can we (collectively or individually) make them better?"

- and -

"HOW?"... "Through what MECHANISM??"

This was proposed to be constructive.. NOT to criticize. 

There were numerous entries to this thread that eluded to:

1. Things are FINE the way they are. 
2. "I" use/used them this way.. whats-a-matta-u ??

and ALL SORTS of diatribe in-and-around these.

As I said.. I 'doctored' what I thought was an "official" version of the
HTML perl docs (for myself)... only to discover it was not the
('official'.. HAHA) version that the folks on this NG <quote> from. I
had installed the ActiveState version.. which has (IMO) nicer HTML but
has no PERLDOC executable (bat/com/exe). So.. when the inscrutable
answers pour in on newbie heads saying simply "PERLDOC -F PRINTF" ..
guess what?.... duh!!

Long story short.. I have blown off the ActiveState version.. and
instaled one with a functioning PERLDOC. I think this was a mistake. It
does not have actual HTML with it. There may be some way of getting it..
but read on....

So.. off to the online HTML. This works for most cases.. but have GAPS
(I choose this word with tongue-in-throat).. my cheek got sore  ;o) .
The plain truth is the "windoz world",as you folks call them, will RELY
on a HTML document to explore the power and syntax of Perl. Whether this
is 'correct' or not... is, unfortunately, left to the user. He is gonna
go nutz looking for the answers in there.

I will say.. it is very CLEARLY stated in EVERY SINGLE page.... <QUOTE>

We are painfully aware that these documents may contain incorrect links
and misformatted HTML. Such
bugs lie in the automatic translation process that automatically created
the hundreds and hundreds of
separate documents that you find here. Please do not report link or
formatting bugs, because we cannot
fix per-document problems. The only bug reports that will help us are
those that supply working patches
to the installhtml or pod2html programs, or to the Pod::HTML module
itself, for which I and the entire
Perl community will shower you with thanks and praises. 

If rather than formatting bugs, you encounter substantive content errors
in these documents, such as
mistakes in the explanations or code, please use the perlbug utility
included with the Perl distribution. 

    --Tom Christiansen, Perl Documentation Compiler and Editor
</QUOTE>

or as I read it... "THESE DOCS SUK"

SO... my questions are still open. 

!. Do <"WE"> want better docs?
2. Can someone knowledgable... explain how to accomplish it in a way
that any changes through perl evolution willl allow these changes to
follow along?

Enough yada - yaya...What is wrong with this picture?


-- 
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 942-2726


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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