[9354] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2949 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 23 14:07:30 1998

Date: Tue, 23 Jun 98 11:00:48 -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           Tue, 23 Jun 1998     Volume: 8 Number: 2949

Today's topics:
        ANNOUNCE: Data::Locations 4.1 (Steffen Beyer)
        ANNOUNCE: Date::Calc 4.1 (Steffen Beyer)
        ANNOUNCE: DBD::XBase version 0.065 (Honza Pazdziora)
    Re: CGI Help Please (David B. White)
        clp.moderated (was: Flames....) (Chris Nandor)
    Re: Comparing conditional ? with if..else construct (Larry Rosler)
        DBD::Altera DBI driver for Altera SQL Server <dsouflis@altera.gr>
        Does Perl/TK reference guide for Tk 400.202 not 402.003 chuckk@monmouth.com
    Re: Error creating file (Dave Lorand)
    Re: Flames.... <JdBornem@tivoli.com>
    Re: Flames.... <mike@newfangled.com>
        Foreach not functioning!?! <mike@newfangled.com>
    Re: Foreach not functioning!?! <rootbeer@teleport.com>
    Re: Foreach not functioning!?! (Larry Rosler)
        Getopt::Long version 2.17 released <jvromans@squirrel.nl>
        How to link in C library to perl? <mark@satch.markl.com>
        Perl and MS SQL Server <mike@accretive.com>
        Perl Job Posting pnassiff@my-dejanews.com
    Re: Sending mail in Perl <xuming@email.unc.edu>
        Setting up Perl32 on Windows NT eddie@eddie.com
        STDIN on Win NT <jg@inf-ltd.co.uk>
    Re: STDIN on Win NT <rootbeer@teleport.com>
    Re: STDIN on Win NT (Larry Rosler)
    Re: system() and security again (Marc Haber)
        Testing perl knowledge <pstatham@dev.tivoli.com>
        w3mir 1.0.3 <janl@math.uio.no>
    Re: Weekdays <-> Dates (John Moreno)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 23 Jun 1998 17:15:12 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: ANNOUNCE: Data::Locations 4.1
Message-Id: <6monr0$70r$1@news.neta.com>

I am pleased to announce version 4.1 of the "Data::Locations" module:


The package is available for download either from my web site at

                  http://www.engelschall.com/u/sb/download/

or from any CPAN (= "Comprehensive Perl Archive Network") mirror server:
(allow a few days for propagation if necessary)

                  http://www.perl.com/CPAN/authors/id/STBEY/


Prerequisites:
--------------

Perl version 5.004 (subversion 0) or higher.


What does it do:
----------------

Did you already encounter the problem that you had to produce some
data in a particular order, but that some piece of the data was still
unavailable at the point in the sequence where it belonged and where
it should have been produced?

Did you also have to resort to cumbersome and tedious measures such
as storing the first and the last part of your data separately, then
producing the missing middle part, and finally putting it all together?

In this simple case, involving only one later-on-insertion, you might
still put up with this solution.

But if there is more than one later-on-insertion, requiring the handling
of many fragments of data, you will probably get annoyed and frustrated.

You might even have to struggle with limitations of the file system of
your operating system, or handling so many files might considerably slow
down your application due to excessive file input/output.

And if you don't know exactly beforehand how many later-on-insertions
there will be (if this depends dynamically on the data being processed),
and/or if the pieces of data you need to insert need additional (nested)
insertions themselves, things will get really tricky, messy and troublesome.

In such a case you might wonder if there wasn't an elegant solution to
this problem.

This is where the "Data::Locations" module comes in: It handles such
insertion points automatically for you, no matter how many and how deeply
nested, purely in memory, requiring no (inherently slower) file input/output
operations.

(The underlying operating system will automatically take care if the amount
of data becomes too large to be handled fully in memory, though, by swapping
out unneeded parts.)

Moreover, it also allows you to insert the same fragment of data into
SEVERAL different places.

This increases space efficiency because the same data is stored in
memory only once, but used multiple times.

Potential infinite recursion loops are detected automatically and
refused.

In order to better understand the underlying concept, think of
"Data::Locations" as virtual files with almost random access:
You can write data to them, you can say "reserve some space here
which I will fill in later", and continue writing data.

And you can of course also read from these virtual files, at any time,
in order to see the data that a given virtual file currently contains.

When you are finished filling in all the different parts of your virtual
file, you can write its contents to a physical, real file this time, or
process it otherwise (purely in memory, if you wish).

Note that this module handles your data completely transparent, which
means that you can use it equally well for text AND binary data.

You might also be interested to know that this module and its concept
has already heavily been put to use in the automatic code generation
of large software projects.


Changes in version 4.1:
-----------------------

 +  Fixed "delete()" to clear the self-references which prevented the eventual
    garbage-collection.
 +  Also fixed "delete()" to free the occupied memory at the time of the call
    of this method rather than at shutdown time of the Perl interpreter.
 +  Removed the unnecessary calls of the "FETCH()" method, resulting in an
    improved performance.
 +  Minor changes to make the code clearer and cleaner.
 +  "Bug fixes" and additions in the documentation.


Legal issues:
-------------

Copyright (c) 1997, 1998 by Steffen Beyer.
All rights reserved.

This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself, i.e., under the
terms of the "Artistic License" or the "GNU General Public License".


Credits:
--------

Many thanks go to Mr. Gero Scholz (now Head of Department for Core Business
IT-Components at the Dresdner Bank in Frankfurt, Germany) for his personal
support and for writing the "ProMAC" macro processor (some sort of a precursor
to Perl, in spirit) and for implementing the concept of "locations" in it,
which inspired me to write this Perl module!

Mr. Scholz owes his own inspiration to the "DELTA" macro processor (a tool
widely used during the seventies, as it seems), where a rudimentary version
of the concept of "locations" was implemented and where its name ("locations")
seems to originate from.


Author's note:
--------------

If you have any questions, suggestions or need any assistance, please
let me know!

I would in fact be glad to receive any kind of feedback from you!

I hope you will find this module beneficial.

Yours,
--
  Steffen Beyer <sb@engelschall.com> http://www.engelschall.com/u/sb/
       "There is enough for the need of everyone in this world,
         but not for the greed of everyone." - Mahatma Gandhi




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

Date: 23 Jun 1998 17:17:38 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: ANNOUNCE: Date::Calc 4.1
Message-Id: <6monvi$74t$1@news.neta.com>

I am pleased to announce version 4.1 of the "Date::Calc" module:


The package is available for download either from my web site at

                  http://www.engelschall.com/u/sb/download/

or from any CPAN (= "Comprehensive Perl Archive Network") mirror server:
(allow a few days for propagation if necessary)

                  http://www.perl.com/CPAN/authors/id/STBEY/


The package consists of a C library (useful for C developers) which is the
core of a Perl (wrapper) module (for easy access to the library from Perl).

The C library is specifically designed so that it can be used stand-alone,
without Perl.


What does it do:
----------------

This package consists of a C library and a Perl module (which uses
the C library, internally) for all kinds of date calculations based
on the Gregorian calendar (the one used in all western countries today),
thereby complying with all relevant norms and standards: ISO/R 2015-1971,
DIN 1355 and, to some extent, ISO 8601 (where applicable).

(See also http://www.engelschall.com/u/sb/download/Date-Calc/DIN1355/
for a scan of part of the "DIN 1355" document (in German)).

The module of course handles year numbers of 2000 and above correctly
("Year 2000" or "Y2K" compliance) -- actually all year numbers from 1
to the largest positive integer representable on your system (which
is at least 32767) can be dealt with.

Note that this package EXTRAPOLATES the Gregorian calendar BACK
until the year 1 A.D. -- even though the Gregorian calendar was only
adopted in 1582 by most (not all) European countries, in obedience to
the corresponding decree of catholic pope Gregor I in that year.

Some (mainly protestant) countries continued to use the Julian calendar
(used until then) until as late as the beginning of the 20th century.

Finally, note that this package is not intended to do everything you could
ever imagine automagically for you; it is rather intended to serve as a
toolbox (in the best of UNIX spirit and traditions) which should, however,
always get you where you want to go.

If nevertheless you can't figure out how to solve a particular problem,
please let me know! (See e-mail address at the bottom of this document.)


Changes in version 4.1:
-----------------------

Fixed the bug in "Add_Delta_YMD()" involving month offsets with days at
the end of the month, which caused this function to return invalid dates.


Legal issues:
-------------

Copyright (c) 1995, 1996, 1997, 1998 by Steffen Beyer.
All rights reserved.

This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself, i.e., under the
terms of the "Artistic License" or the "GNU General Public License".

The C library at the core of this Perl module can additionally
be redistributed and/or modified under the terms of the
"GNU Library General Public License".


Prerequisites:
--------------

Perl version 5.000 or higher, and an ANSI C compiler (!)
                                     ^^^^^^


Author's note:
--------------

If you have any questions, suggestions or need any assistance, please
let me know!

I would in fact be glad to receive any kind of feedback from you!

I hope you will find this module beneficial.

Yours,
--
  Steffen Beyer <sb@engelschall.com> http://www.engelschall.com/u/sb/
       "There is enough for the need of everyone in this world,
         but not for the greed of everyone." - Mahatma Gandhi




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

Date: 23 Jun 1998 17:16:40 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: ANNOUNCE: DBD::XBase version 0.065
Message-Id: <6monto$70t$1@news.neta.com>

Hello,

The URL

    http://www.fi.muni.cz/~adelton/perl/DBD-XBase-0.065.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/JANPAZ/DBD-XBase-0.065.tar.gz
  size: 52492 bytes
   md5: 0c5bba3218f474b275b99fa2eaa52e79

Major improvments are in the DBD part, tests that fail are only

Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
dbit/40bindpara              24    1   4.17%  22
dbit/40blobs.t               11    3  27.27%  4, 7-8
dbit/50chopblan              35    4  11.43%  8, 18, 28, 32
Failed 3/11 test scripts, 72.73% okay. 8/159 subtests failed, 94.97% okay.

and that mostly comes from the fact that XBase (dBase/Fox, if you
like) do not support some features that would be needed. For ordinary
work the module runs fine. It also supports bind parameters and bind
columns.

The XBase part has a read only support for ndx index files.

Comments and bug fixes are always welcome.

(Please note that I will be without email until June 12 so I will not
be able to answer immediately.)

Yours,

Honza Pazdziora

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------




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

Date: 23 Jun 1998 17:07:06 GMT
From: dbwhite@btv.ibm.com (David B. White)
Subject: Re: CGI Help Please
Message-Id: <6monbq$61g$1@mdnews.btv.ibm.com>

In article <6mofh0$826$1@supernews.com>,
        "Dr.V" <worker@capequip.com> writes:
> when i test it using my computer, using perl5 for windows 95/nt it does'nt
> give me an error code. so i then put it on the server and try it.

I'm not sure how you're testing it or which version of perl you're using,
but from the command line, perl 5.004 on AIX reports:
Can't modify print in scalar assignment at YourCode line 17, near "ending_print_tag ;"
  (Might be a runaway multi-line << string starting on line 4)
Execution of YourCode aborted due to compilation errors.

The assignment to the bareword print is actually attempted on line 4,
> print = <<'ending_print_tag';
with line 17 representing the end of the data you're attempting to
save in that bareword.

Remove the assignment operator, and things should work much better!
If the typo was in the CGI Programming book, you may want to see if
the publisher has an errata sheet available...

> Can't find string terminator "ending_print_tag" anywhere befor EOF at
> first.cgi line 4.

You may wish to use the -v option to determine which level of perl
you're running and if there is later level available.  I'll let the
gurus speak about the precision of the error message.
--
David B. White
IBM Microelectronics, Circuit Verification & Design Tools
Internal: dbwhite@btv             Internet: dbwhite@vnet.ibm.com
Phone: 802-769-5671     (TieLine: 446)     Fax: 802-769-5722


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

Date: Tue, 23 Jun 1998 17:17:45 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: clp.moderated (was: Flames....)
Message-Id: <pudge-2306981314580001@dynamic52.ply.adelphia.net>

In article <6mogn3$en4$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:

#  [courtesy cc of this posting sent to cited author via email]
# 
# In comp.lang.perl.misc, 
#     fl_aggie@thepentagon.com (I R A Aggie) writes:
# :I for one am waiting for the clp.moderated newsgroup. 
# 
# You may have to wait a long time.  Unless you're planning
# to campaign in favor of it, I can't help but think that the
# evil news.groupies FUD-spreaders shall have sunk it.

I dunno.

Regardless, everyone who has not voted, vote!  See the announcement for
comp.lang.perl.moderated in news.groups.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Tue, 23 Jun 1998 10:19:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Comparing conditional ? with if..else construct
Message-Id: <MPG.ff9839e58db68f09896b5@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6mo6vc$pvd$11@csnews.cs.colorado.edu>, Tom Christiansen 
<tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
> :Why are you blaming this mistake on C++, or C for that matter?  The 
> :precedences are exactly the same as in Perl.  Even overloading the 
> :operators cannot change the precedences.
> 
> Because it in fact *is* different in C++ than it is in C.
> In C, it's illegal without parens, because C and Perl have
> the same precedence.  But in C++, prececence *differs*, and the
> parens are implicitly supplied for you anyway.

So the situation then is this:

Language  Syntax   Semantics

C         Invalid  Irrelevant (doesn't compile)
C++       Valid    Defined; assignment is higher precedence than ?:
Perl      Valid    Test ignored; value is that of expression after :

Am I correct in inferring that Perl has the worst approach:
valid syntax and screwed-up semantics?

This seems like an avoidable trap for the unwary (like the poster who 
started the thread).  Perhaps some "anti-Gotcha!" treatment is desirable 
here.  My choice would be to invalidate the syntax; the parse tree seems 
screwy in any case.

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


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

Date: 23 Jun 1998 17:14:34 GMT
From: Dimitrios Souflis <dsouflis@altera.gr>
Subject: DBD::Altera DBI driver for Altera SQL Server
Message-Id: <6monpq$6tp$1@news.neta.com>

                    DBD::Altera
---------------------------------------------------------------

Altera Ltd, Greece, announces a new Perl driver for its RDBMS
"Altera SQL Server". The driver fits in the DBI framework and
is written in pure Perl. It is available at the main download
site <http://www.altera.gr/download.html> for the time being.
Hopefully, it will be available at CPAN soon. The file to
download is DBD-Altera-X.XX.tar.gz where X.XX is the release
number (currently 0.09).

The installation is typical for Perl modules: untar and then
    perl Makefile.PL
    make
    make install
Make sure when you "make install" that you have permissions
to upgrade your perl installation.

Prerequisites are: Perl 5.002+, DBI 0.93.
The DBI package can be found at CPAN.

--
Dimitrios Souflis                dsouflis@altera.gr
Altera Ltd.                      http://www.altera.gr/dsouflis





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

Date: Tue, 23 Jun 1998 17:23:15 GMT
From: chuckk@monmouth.com
Subject: Does Perl/TK reference guide for Tk 400.202 not 402.003 exist?
Message-Id: <6mooa4$1fs$1@nnrp1.dejanews.com>

Hello all,

I ran across perl the 5.004 /Tk 402.003  handy reference guide.
(Very Very nice - kudos to Johan Vromans and all!!)

A) Is there a similar document for Tk 400.202?

I've been perl'ing for about 6 months, and feel ready to move onto
GUI stuff.  I've gotten the FAQ and installed 400.202 pTk for perl.

B) Is 400.202 still considered the stable version or is 402.003
considered ready-for-prime-time?

C) Besides the html that comes with pTk and the Perl/Tk faq,
what other resources exist - especially one that highlights differnces
between versions???

Thanks very much
Chuck



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


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

Date: Tue, 23 Jun 1998 16:55:57 GMT
From: davel@spc.uchicago.edu (Dave Lorand)
Subject: Re: Error creating file
Message-Id: <davel-2306981155570001@honeybee.spc.uchicago.edu>

In article <358FD11B.F862BFEF@ncsa.uiuc.edu>, altenbur@ncsa.uiuc.edu wrote:

> Hi,
> 
> When I run the code found below, I keep getting a "bad file number"
> error.  If any of you knowlegeable folks would be willing to let me in
> on what's causing the error, I would greatly appreciate it.
> Here's the code:
> 
> ...lots o other code, where  $CourseTitle and $output are defined......
> 
>     $dirname = "/FOO/coursefiles/" . $CourseTitle;

a nit:  change the right side to "/FOO/coursefiles/$CourseTitle";

>     $filename = "description.html";
>     $dirname =~ tr/ /_/;
> 
>     &addToCatalog(@data);
> 
>     mkdir($dirname, 0777);
>     open( COURSEFILE, ">$dirname/$filename" );
>     flock(COURSEFILE, LOCK_EX);
>     print COURSEFILE $output;
>     close(COURSEFILE);

You should be checking what happens after each of these commands. 
Something like:

     if (not mkdir($dirname, 0777)) {
         warn "Could not mkdir $dirname: $!\n";
     }
     elsif (not open( COURSEFILE, ">$dirname/$filename" ) ) {
         warn "Could not open $dirname/$filename: $!\n";
     }
     elsif (not flock(COURSEFILE, LOCK_EX) ) {
         warn "Could not lock $dirname/$filename: $!\n";
     }
     print COURSEFILE $output;
     close(COURSEFILE);

If it's OK for your script to die at this point, then you don't need the
if ... elsif stuff - you can just do "mkdir (...) or die ..." etc.

My humble guess, with only a few months experience, is that the mkdir is
failing, so then of course you can't create a file in a non-existent
directory.  But, doing the above should help you troubleshoot it.

Good luck,

Dave

 ____________________________________________________________
| Dave Lorand                       | davel@spc.uchicago.edu |
| Programmer/Analyst                | 773-702-3792           |
| Social Science Research Computing | 773-702-0793 (dept.)   |
| University of Chicago             | 773-702-2101 (fax)     |
+-----------------------------------+------------------------+


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

Date: Tue, 23 Jun 1998 11:24:04 -0400
From: "J. Borneman" <JdBornem@tivoli.com>
Subject: Re: Flames....
Message-Id: <6mokqi$rnf$1@tivoli.tivoli.com>

>That's why I think, that very explicit automated posts like
>
>   "WHY YOU DON'T GET AN ANSWER TO YOUR QUESTION"
>   "WE EXPECT YOU TO HELP YOURSELF"
>
>on a daily basis will have an effect, especially if they are
>followed up with the appropriate actions.
>
>Your weekly posts (the automated ones) are not enough of a
>"tough love" approach for this crowd.


This reminds me of a Dilbert cartoon where an e-mail was sent to all users
reminding all users to not use the AllUsers address for unnecessary e-mail.

I agree that there are some stupid faqs asked that are easily found in the
readily avaliable documentation.  But there are some cases where a faq in
already said somewhere, but in pieces all over the place.  A very
experienced perl programmer may easily find it and piece it together, but
someone who is relatively new to perl (note, I mean have the basic
knowledge, not a total newbie) may have trouble.  Instead of just bashing
them and saying "look it up dumbass" maybe directing them where to look even
would be a help.

I have been using perl for about a year.  Mostly for CGI stuff.  I will
admit I have shyed away from asking any questions on here from the fear of
being publicly humiliated.  I've looked in some docs for my question, maybe
found a few peices of an answer, but still not been clear on the final
answer.

I'll come out on a limb and say it:  I think there are some people on here
with years of perl experience, they can program a web browser in perl in
their sleep, and they think so much of themselves that they don't remember
there was a time long ago they had to ask questions, get help getting
pointed in the right direction, and generally, be a newbie as well.

I'm not saying all stupid faqs should be answered, but there are some
questions out there, that even though they may be buried in a manpage
somewhere, it would still be a help (and not the 'enabler') to not bash the
person, but instead help direct them.

Just IMHO




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

Date: Tue, 23 Jun 1998 13:24:45 -0400
From: "Michael S. Brito, Jr." <mike@newfangled.com>
Subject: Re: Flames....
Message-Id: <358FE4CE.FBC62540@newfangled.com>

I think people in the groups forget why the groups were created. To
provide a medium on which dicussion (such as this) and assistance (such
as more than 1/2 of my postings). Some people just get upset like their
to good or too busy to answer newbie questions, but they seem to have
time to flame them.

Deva Seetharam wrote:

> Why do people get mad, when anybody posts a basic/repeat question ?
>
> Person who is posting basic/repeat should be either :
>
> Ignorant (of the resources/references)  or
> Incompetent (to seek resources/references) or
> Lazy (to look at resources/references) or
> Neurotic (Posts the question with the intention to irritate)
>
> Probability for 4th option is pretty less, given the fact that, there
> are so many interesting and easier ways to satisfy such intentions.
>
> If somebody thinks the question is stupid/irrelevant/repeated, why
> can't he/she disregard the question ?
>
> Blasting does not serve any purpose, other than discourage the newbie.
> Why to do that ? Even learning to program, is a metamorphosis.
> I think the initial phases are inevitable.
>
> (Everyone, atleast once, had a tough time to go
> 1,2,3,4....)
>
> Deva


--
-----------------------------------------------------------
Michael S. Brito, Jr., Web Developer
Newfangled Graphics Co. Inc.
mike@newfangled.com

#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
-----------------------------------------------------------




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

Date: Tue, 23 Jun 1998 13:08:37 -0400
From: "Michael S. Brito, Jr." <mike@newfangled.com>
Subject: Foreach not functioning!?!
Message-Id: <358FE107.CDFDF45A@newfangled.com>

Below is a script I have written to grab each e-mail address in a file
(email.txt, one on each line) and send them a message with the body
(body.txt) grabbed from a file. I have shut off (commented out) 'use
diagnostics' and 'use strict' to reduce errors for now (I'll fix 'em
later,  what can I say I'm lazy). The error I am getting with the script
as of now is:

Can't exec "/usr/bin/sendmail": No such file or directory at
/home/mike/www/proj
ect/cgi-bin/sendlist.cgi line 23.
<--cut text -->
(same error 5 more times, I assume becuase there are 6 email addresses
in email.txt)
<-- cut text -->
[Tue Jun 23 12:21:34 1998] access to /home/mike/www/project/thanks
failed for 20
8.159.33.5, reason: File does not exist

Obviously, thanks.html does not exist. But I get that error so at least
I know that it is making it all the way through the script. So I guess
my question is, "WHY is sendmail not being launched". ANY advice would
be appreciated. Here is the script and some essential info:

My Info:

Perl, version 5.003 with EMBED

Red Hat Linux release 4.1 (Vanderbilt)
Kernel 2.1.99 on an i586

CGI.pm Library Version 2.36

Executable Path: /usr/bin/perl



<----------------- SCRIPT STARTS HERE -------------------->

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

$email = "email.txt";
open(EMAIL,$email) or
 die "error opening $email: $!\n";
@email = <EMAIL>;
close(EMAIL);

$filename = "body.txt";
$T = $/;
$/ = "";
open(INF,$filename) or
 die "error opening $filename: $!\n";
$indata = <INF>;
close(INF);
$/ = $T;

$mailprog = '/usr/bin/sendmail';

foreach $address (@email) {
 open (MAIL, "|$mailprog $address") || die "Cant open $mailprog:
$!\n";
print MAIL "From: mike\@newfangled.com\n";
print MAIL "Reply-to: mike\@newfangled.com\n";
print MAIL "Subject: Mailing List\n\n";
print MAIL "$indata\n";
close(MAIL);
}

print "Location:http://208.XXX.XXX.XXX/project/thanks.html\n\n";

<----------------- SCRIPT ENDS HERE -------------------->

-----------------------------------------------------------
Michael S. Brito, Jr., Web Developer
Newfangled Graphics Co. Inc.
mike@newfangled.com

#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=(#####censored######)
-----------------------------------------------------------




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

Date: Tue, 23 Jun 1998 17:26:09 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Foreach not functioning!?!
Message-Id: <Pine.GSO.3.96.980623102243.24075i-100000@user2.teleport.com>

On Tue, 23 Jun 1998, Michael S. Brito, Jr. wrote:

> Can't exec "/usr/bin/sendmail": No such file or directory 

> my question is, "WHY is sendmail not being launched". 

Based upon the evidence, it looks as if there's no such file as
/usr/bin/sendmail. :-)  

It would be somewhat unusual to find sendmail in /usr/bin, I think. Maybe
it's somewhere else on your system. Good luck!

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



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

Date: Tue, 23 Jun 1998 10:25:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Foreach not functioning!?!
Message-Id: <MPG.ff984f6176f3bfd9896b6@nntp.hpl.hp.com>

In article <358FE107.CDFDF45A@newfangled.com>, Michael S. Brito, Jr. 
<mike@newfangled.com> says...
> Below is a script I have written to grab each e-mail address in a file
> (email.txt, one on each line) and send them a message with the body
> (body.txt) grabbed from a file. I have shut off (commented out) 'use
> diagnostics' and 'use strict' to reduce errors for now (I'll fix 'em
> later,  what can I say I'm lazy). The error I am getting with the script
> as of now is:
> 
> Can't exec "/usr/bin/sendmail": No such file or directory at
> /home/mike/www/proj
> ect/cgi-bin/sendlist.cgi line 23.

Why don't you believe this diagnostic?  I have seen sendmail in /usr/sbin 
and /usr/lib, but not in /usr/bin.  Just to be sure, why not put the 
following ahead of your 'open':

$ENV{PATH} .= ':/usr/bin:/usr/lib:/usr/sbin';

and see what happens?

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


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

Date: 23 Jun 1998 17:20:05 GMT
From: Johan Vromans <jvromans@squirrel.nl>
Subject: Getopt::Long version 2.17 released
Message-Id: <6moo45$75f$1@news.neta.com>

Version 2.17 of module Getopt::Long is now available via CPAN. It
should soon appear in directory authors/Johan_Vromans as file
GetoptLong-2.17.tar.gz. It will be standard part of Perl 5.005 or later.

Module Getopt::Long implements an extended getopt function called
GetOptions(). This function implements the POSIX standard for command
line options, with GNU extensions, while still capable of handling
the traditional one-letter options (including option bundling).

The README document is attached to this message.

The best way to download from CPAN is to use a Web browser and point
it to http://www.perl.com/CPAN/ (include the final slash!). It will
automagically be redirected to a CPAN site in your neighborhood. 
URL: http://www.perl.com/CPAN/authors/Johan_Vromans

Changes in version 2.17
-----------------------

* Getopt::Long::config is renamed Getopt::Long::Configure. The old
  name will remain supported without being documented.

* Options can have the specifier '+' to denote that the option value
  must be incremented each time the option occurs on the command line.
  For example:

     my $more = 2;
     Getopt::Long::Configure("bundling");
     GetOptions ("v+" => \$more);
     print STDOUT ("more = $more\n");

  will print "more = 3" when called with "-v", "more = 4" when called
  with "-vv" (or "-v -v"), and so on.

* Getopt::Long now uses autoloading. This substantially reduces the
  resources required to 'use Getopt::Long' (about 100 lines of over
  1300 total).

* To install, it is now required to use the official procedure:

     perl Makefile.PL
     make
     make test
     make install

Previous released version was 2.16.

---- README ----

Module Getopt::Long - extended processing of command line options
=================================================================

Module Getopt::Long implements an extended getopt function called
GetOptions(). This function implements the POSIX standard for command
line options, with GNU extensions, while still capable of handling
the traditional one-letter options.
In general, this means that command line options can have long names
instead of single letters, and are introduced with a double dash `--'.

Optionally, Getopt::Long can support the traditional bundling of
single-letter command line options.

Getopt::Long::GetOptions() is part of the Perl 5 distribution. It is
the successor of newgetopt.pl that came with Perl 4. It is fully
upward compatible. In fact, the Perl 5 version of newgetopt.pl is just
a wrapper around the module.

For complete documentation, see the Getopt::Long POD document or use
the command

    perldoc Getopt::Long

FEATURES
========

* Long option names

Major advantage of using long option names is that it is much easier
to memorize the option names. Using single-letter names one quickly
runs into the problem that there is no logical relationship between
the semantics of the selected option and its option letter.
Disadvantage is that it requires more typing. Getopt::Long provides
for option name abbreviation, so option names may be abbreviated to
uniqueness. Also, modern shells like Cornell's tcsh support option
name completion. As a rule of thumb, you can use abbreviations freely
while running commands interactively but always use the full names in
scripts. 

Examples (POSIX):

    --long --width=80 --height=24

Extensions:

    -long (convenience) +width=80 (deprecated) -height 24 (traditional)

By default, long option names are case insensitive.

* Single-letter options and bundling

When single-letter options are requested, Getopt::Long allows the
option names to be bundled, e.g. "-abc" is equivalent to "-a -b -c".
In this case, long option names must be introduced with the POSIX "--"
introducer.

Examples:

    -lgAd (bundle) -xw 80 (bundle, w takes a value) -xw80 (same)
    even -l24w80 (l = 24 and w = 80)

By default, single-letter option names are case sensitive.

* Flexibility:

  - options can have alternative names, using an alternative name
    will behave as if the primary name was used;
  - options can be negatable, e.g. "debug" will switch it on, while
    "nodebug" will switch it off.    
  - options can set values, but also add values producing an array
    of values instead of a single scalar value, or set values in a hash.

* Options linkage

Using Getopt::Long gives the programmer ultimate control over the
command line options and how they must be handled:

  - by setting a global variable in the calling program;
  - by setting a specified variable;
  - by entering the option name and the value in an associative array
    (hash) or object (if it is a blessed hash);
  - by calling a user-specified subroutine with the option name and
    the value as arguments;
  - combinations of the above.

* Customization:

The module contains a special method, Getopt::Long::Configure, to
control configuration variables to activate (or de-activate) specific
behavior. It can be called with one or more names of options:

  - default

	Restore default settings.

  - auto_abbrev      

	Allow option names to be abbreviated to uniqueness. 

  - getopt_compat   

	Allow '+' to start options.

  - permute
  - require_order           

	Whether non-options are allowed to be mixed with options.

	permute means that 

	    -foo arg1 -bar arg2 arg3

	is equivalent to

	    -foo -bar arg1 arg2 arg3

	(provided -foo does not take an argument value).

	require_order means that options processing
	terminates when the first non-option is encountered.

	    -foo arg1 -bar arg2 arg3

	is equivalent to

	    -foo -- arg1 -bar arg2 arg3

  - bundling

	Setting this variable to a non-zero value will allow 
	single-character options to be bundled. To distinguish bundles
	from long option names, long options must be introduced with 
	"--" and single-character options (and bundles) with "-".

  - ignore_case      

	Ignore case when matching options.

  - pass_through

	Do not issue error messages for unknown options, but leave
	them (pass-through) in @ARGV.

  - prefix

	The string that starts options. See also prefix_pattern.

  - prefix_pattern

	A Perl pattern that identifies the strings that introduce
	options. Default is (--|-|\+) unless environment variable
	POSIXLY_CORRECT has been set, in which case it is (--|-).

* Usable variables

  - $Getopt::Long::error

	Internal error flag. May be incremented from a call-back
	routine to cause options parsing to fail.

  - $Getopt::Long::debug           

	Enable copious debugging output. Default is 0.

AVAILABILITY
============

The official version for module Getopt::Long comes with the Perl 5
distribution. 
Newer versions will be made available on the Comprehensive Perl Archive
Network (CPAN), see "http://www.perl.com/CPAN/authors/Johan_Vromans".

COPYRIGHT AND DISCLAIMER
========================

Module Getopt::Long is Copyright 1990,1998 by Johan Vromans.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

-------------------------------------------------------------------
Johan Vromans                                  jvromans@squirrel.nl
Squirrel Consultancy                       Haarlem, the Netherlands
http://www.squirrel.nl       http://www.squirrel.nl/people/jvromans
------------------ "Arms are made for hugging" --------------------




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

Date: 23 Jun 1998 13:38:19 -0400
From: Mark Lehrer <mark@satch.markl.com>
Subject: How to link in C library to perl?
Message-Id: <m3ogvk81dg.fsf@satch.markl.com>


Has anyone out there successfully done this?  Could I please ask some
basic questions on how do this - like how to get it to link correctly?

The xsub tutorial hasn't been very helpful.

Thanks!
Mark  (mark at lehrer dot nlcomm dot com)


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

Date: Tue, 23 Jun 1998 13:25:52 -0400
From: "Mike Criscolo" <mike@accretive.com>
Subject: Perl and MS SQL Server
Message-Id: <6moomk$iho$1@camel29.mindspring.com>

Hello,

I'm using Perl to access a SQL Server 6.5 database (using Win32::ODBC).
Everything's going fine, except I need to read a field that's declared as
BINARY(8).  When I get a variable of this kind into the Perl script, it
prints as garbage.

I've been using the vec() function to prowl through the result, and I've
been seeing some strange stuff.  First, when I actually use ISQL_w to run my
query, the return value looks like:

0x0010000000005001

When I use vec(), first, I have to skip the first byte (not exactly sure
why), using a loop as follows:

for ($i=1; $i<=16; $i++)
{
    $val .= vec($value_from_DB, $i, 4);
}

OK, I know this routine falls on it's face if you get an A-F in the value
from the database.  However, what I'm seeing is that the resultant string
(0x chopped off):

0010000000005100

I'm not really sure why this is happening.  Does anyone know how BINARY data
from SQL Server shows up in a Perl variable?  Even better, does someone have
code that handles BINARY data from MSSQL queries?

I've tried the CONVERT function, even though the doc says that BINARY to
CHAR conversion is implicit.  No luck there, either.

Thanks,
-Mike Criscolo




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

Date: Tue, 23 Jun 1998 17:09:31 GMT
From: pnassiff@my-dejanews.com
Subject: Perl Job Posting
Message-Id: <6mongb$55$1@nnrp1.dejanews.com>

What website do you recommend to place a job posting for a Perl Programmer
position in Orlando, FL?

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


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

Date: Tue, 23 Jun 1998 12:34:00 -0400
From: Xuming Wang <xuming@email.unc.edu>
Subject: Re: Sending mail in Perl
Message-Id: <358FD8F8.E0AA66F6@email.unc.edu>

Xuming Wang wrote:
> 
> F.Quednau wrote:
> >
> > > $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> > >  00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
> > > rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
> >
> > Odd, very odd. That program outputs:
> >
> > #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> > $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> >  00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
> > rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
> 
> the only part I don't understand is how tr[C-~][:-u] works.

sorry it's just normal tr///, character C to ~ translted to : to u, my brain was confused by all the
other stuff.

sorry about that.

--
Xuming Wang


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

Date: Tue, 23 Jun 1998 10:09:15 -0700
From: eddie@eddie.com
Subject: Setting up Perl32 on Windows NT
Message-Id: <358FE13A.9D0819C3@eddie.com>

Can anyone please tell me the registry setting/value I need to add to
the Windows NT registry to get Perl32 working on this platform. I can't
seem to remember it. Any info greatly appreciated. Please email to
bimp@bigfoot.com. Thanks

BIM
Red Dot Interactive



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

Date: Tue, 23 Jun 1998 18:03:23 +0100
From: "john goodenough" <jg@inf-ltd.co.uk>
Subject: STDIN on Win NT
Message-Id: <358fe9b2.0@vortex.netcentral.co.uk>

Having trouble with STDIN with WinNT.
I have a loop which contains an @lin_in = <STDIN>
the first iteration works OK, subsequent ones do not.

I checked around the FAQ and found some stuff which didn't work and also
some mention of
the sysread function. I cannot find any tangible documentation for any of
this.

Does anyone have any pointers please




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

Date: Tue, 23 Jun 1998 17:21:04 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: STDIN on Win NT
Message-Id: <Pine.GSO.3.96.980623101849.24075h-100000@user2.teleport.com>

On Tue, 23 Jun 1998, john goodenough wrote:

> I have a loop which contains an @lin_in = <STDIN>
> the first iteration works OK, subsequent ones do not.

Are you saying that, after you've read to the end of input, you're going
back to try to read more? 

If that's not it, see whether you can put together a short example program
(no more than half a dozen lines) so that we can see what you're seeing. 
Good luck! 

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



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

Date: Tue, 23 Jun 1998 10:28:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: STDIN on Win NT
Message-Id: <MPG.ff98597b8a3678e9896b7@nntp.hpl.hp.com>

In article <358fe9b2.0@vortex.netcentral.co.uk>, john goodenough <jg@inf-
ltd.co.uk> says...
> Having trouble with STDIN with WinNT.
> I have a loop which contains an @lin_in = <STDIN>
> the first iteration works OK, subsequent ones do not.
 ...

You have asked that the entire contents of STDIN be read into the array 
@lin_in.  To get only one line at a time, you want

$lin_in = <STDIN>;

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


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

Date: Tue, 23 Jun 1998 17:24:13 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: system() and security again
Message-Id: <6moocp$g0n$1@nz12.rz.uni-karlsruhe.de>

Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, 
>    Marc.Haber-usenet@gmx.de (Marc Haber) writes:
>While the "shell magic" of system() and
>:exec() seems a fine thing, it requires major tweaking in a security
>:relevant setting. Has it been consciously designed that way?
>
>Yes, it was.  Remember what Perl was written for: to make it
>convenient to glue together text, files, and commands.  It's
>piggy-backing on the shell's power.  This is certainly by design.

Well, it would be convenient to have a chance to disable that magic
:-)   This is the case of most magic found not only in perl *grin*

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: Tue, 23 Jun 1998 10:49:30 -0500
From: Perry Statham <pstatham@dev.tivoli.com>
Subject: Testing perl knowledge
Message-Id: <358FCE8A.8CD5D6A5@dev.tivoli.com>

My boss just informed me that as the resident perl "expert" he would
like me to interview some job candidates for their perl knowledge. Does
anyone out there have any tests or lists of questions they have come up
with in the past to interview for this?

Please CC: your answers to me at pstatham@dev.tivoli.com.
Thanks - Perry Statham




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

Date: 23 Jun 1998 17:18:45 GMT
From: Nicolai Langfeldt <janl@math.uio.no>
Subject: w3mir 1.0.3
Message-Id: <6moo1l$758$1@news.neta.com>


w3mir 1.0.3 has been released.

Fixes in 1.0.3: 
- The -R/remove option to remove files is no longer more destructive
  than intended.
- Files with 'unsafe' characters in their filename is now saved as
  "foo bar" instead of "foo%20bar" 
- The -B switch works once again. 

As ever it's available from $CPAN/authors/id/JANL/ as well as its
homepage at http://www.math.uio.no/~janl/w3mir/

w3mir is a very powerfull http mirroring program capable of making a
browsable copy (for use with web server or disk/CD) of almost anything
you care to throw at it (yes, CGI too). It also has features to do the
simpler tasks of http copying easily. It works on Unix and win32
platforms.

Nicolai




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

Date: Tue, 23 Jun 1998 17:23:43 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Weekdays <-> Dates
Message-Id: <1db2rvt.13gwf5ekgb41N@roxboro0-056.dyn.interpath.net>

Hauk Langlo <hauk@forumnett.no> wrote:

> Hi there. I'm about to make a program which needs to know which day of
> the week it is. I have a good idea about how to do it, but it feels like
> an unescesary amount of work. If anyone know somewhere I can find a
> model on how to do this, or maybe have a subroutine they have made
> themselfes, I would really apprecuate to have a look at it. Thanks.

You think localtime is too much work?  You could have written the TWO
lines that it takes to do this in the time it took you to write the
above (one to create the array and one to index it off of localtime - three
if you want to both save and print the results).

By the way - this is just a variation of a FAQ, see perlfaq4 for details.

-- 
John Moreno


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

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

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