[11184] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4784 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 30 07:07:12 1999

Date: Sat, 30 Jan 99 04:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 30 Jan 1999     Volume: 8 Number: 4784

Today's topics:
    Re: @xyz = {}; and @xyz = (); What do these mean? (Tad McClellan)
        activeperl ppm help <emperry@swbell.net>
        advertising script problem <elst.fels@nospam.ping.be>
        AOL and perl?? <mwatkins@promotion4free.com>
    Re: cgi in perl kaz@eudoramail.com
    Re: database in perl kaz@eudoramail.com
    Re: Good CGI Book info@gadnet.com
    Re: Help a newbie Please. <jjarrett@ecpi.com>
        HELP!!!   Using XS With C++ <chloe_fung@hotmail.com>
        How to e-mail Web Form Data? <tbellmer@sky.net>
    Re: how to pass scalars AND variables to a sub? <staffan@ngb.se>
    Re: MacPerl question, Calling another script rupert@no.spam.leeds.ac.uk
    Re: ok please don't shoot me for this question (Ronald J Kimball)
    Re: outputting perl errors as html? (Ronald J Kimball)
    Re: Parsing FTP Directory listing (Ronald J Kimball)
    Re: Parsing FTP Directory listing <uri@home.sysarch.com>
    Re: Perl Criticism (Bart Lateur)
    Re: Perl programs kaz@eudoramail.com
    Re: Perl ressources kaz@eudoramail.com
    Re: Perl Web browser problem kaz@eudoramail.com
    Re: Remove all non a-z characters? (Owen Cook)
    Re: Secuity hole with perl (suidperl) and nosuid mounts <$}xin{$@esperi.demon.co.uk>
    Re: Sending email info@gadnet.com
        SQL setup <jjarrett@ecpi.com>
    Re: system function, Pros and Cons?? (Tad McClellan)
    Re: system function, Pros and Cons?? <pasha@actcom.co.il>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 30 Jan 1999 02:05:11 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: @xyz = {}; and @xyz = (); What do these mean?
Message-Id: <nfeu87.sb3.ln@magna.metronet.com>

R. Nottrott (RNott@LTERnet.edu) wrote:
: Having done most of my programming in C and Java, I am somewhat shaky
: with certain Perl constructs.  Would someone out there please help by
: explaining the meaning following declarations (or if they are not
: declarations what are they ?).  


   They are not declarations.

   They are assignment statements.


: Both occur at the beginning of a perl
: script:


   I hope they have meaningful names in your real code...


: @xyz = {};
: @uvw = ();

: They look like arrays, but what about the {} versus ()?


   They are both arrays.

   What gets assigned to them is different though.

      @xyz = {};

   There, the curly braces are a reference to an anonymous hash, 
   with no elements in the anon hash.

   The reference to the hash is stored in the first element of @xyz.

   @xyz contains one element.


      @uvw = ();

   All of the members of the RHS list are assigned to the @uvw array.

   Since the list is empty, zero elements are assigned, effectively
   "clearing" @uvw.

   @uvw contains no elements.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 30 Jan 1999 02:52:46 -0600
From: Edward Perry <emperry@swbell.net>
Subject: activeperl ppm help
Message-Id: <36B2C85E.4421@swbell.net>

I just downloaded and install activeperl 509,
connect to net, run ppm.bat, enter search, and
get nothing. Is it just me or is ppm hosed?
Any other recommends for installing Tk module?

Thanks

EdVenture


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

Date: Sat, 30 Jan 1999 08:22:57 +0100
From: "myname@mydomain.com" <elst.fels@nospam.ping.be>
Subject: advertising script problem
Message-Id: <78ubsr$a3f$1@news3.Belgium.EU.net>

Can anyone give me an idea how to make a script that:

- displays one bannerimage for instance 50% of the time
  and other banners at an other percentage of time.
- it is not the idea to show the same banner time and time over till the 50%
is done
  it must come between the other banners otherwise the advertising is not
balanced over time.

Anyone got a way to handle such a script ?

Thank you,

Peter





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

Date: Sat, 30 Jan 1999 10:08:59 -0000
From: "Mike Watkins" <mwatkins@promotion4free.com>
Subject: AOL and perl??
Message-Id: <eDw8XiDT#GA.185@nih2naaf.prod2.compuserve.com>

Hi there,

I've created a very simple password protection script.  It works perfectly
for everyone except for the ones using the IE 4 AOL browser.  What happens
is they login via a form, the script will check their info, and if
successful will write their username, ip #, and time to a session database.
On every page of Members Only Area there is a line of SSI which calls the
script and checks the session database for the persons IP#, ect...

Now, the people using IE 4 AOL brower can do the actual login fine, but when
it comes to the SSI which checks if they have logged in, they always seem to
get an access denied page.

I have tried to figure this out for the longest time.  The people using the
IE AOL browser, can write to the session database when the login to a form,
and can write to the sessino database via SSI.  Also, they get redirected
ok, and both $ENV{'REMOTE_ADDR'} and $ENV{'REMOTE_HOST'} work on them.

Any ideas?
Mike





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

Date: Sat, 30 Jan 1999 07:16:04 GMT
From: kaz@eudoramail.com
Subject: Re: cgi in perl
Message-Id: <78ubjg$5aq$1@nnrp1.dejanews.com>

There is a CGI directory page.  You can find CGI related sites including
password protection.

http://www.dodge.co.uk/cgindex/

In article <78pfhd$g6$1@fafnir.cf.ac.uk>,
  "Chris Yeates" <C.N.Yeates@cs.cf.ac.uk> wrote:
> I am completely new to CGI programming in Perl. I wish to password protect
> some web pages. Does anybody know how to do this?
>
> Cheers!
>
> Chris
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 30 Jan 1999 07:22:23 GMT
From: kaz@eudoramail.com
Subject: Re: database in perl
Message-Id: <78ubvb$5lh$1@nnrp1.dejanews.com>

You can find CGI related sites at

http://www.dodge.co.uk/cgindex/

In article <78k094$dok$1@news.netvision.net.il>,
  "Karen Soudry" <karenl@security7.com> wrote:
> HI
>
> HELP!!!!
>
> I need codes and examples on how to write a database in perl and the method
> "search" in perl!!!
>
> THANKS
> KAREN
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 30 Jan 1999 12:31:06 GMT
From: info@gadnet.com
Subject: Re: Good CGI Book
Message-Id: <36b2fb2c.67301791@news.newsguy.com>

My favourite Perl book is 'Perl 5 Interactive Course' by Waite Group.
See also http://www.waite.com





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

Date: Sat, 30 Jan 1999 01:45:09 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
Subject: Re: Help a newbie Please.
Message-Id: <36B2AA74.DCF9C165@ecpi.com>

You should have a section like this:

   if ($SECURE_NAME ne "" && $fields{'submit_to'} ne $SECURE_NAME)
       {
      print "Content-type: text/html\n\n";
      print <<__W9__;

      <H1>You cannot use this script from your server!</H1>

__W9__
      exit;

MAKE SURE the     __W9__    is on your left-hand margin, no spaces. See how the
__W9__ terminates a section of HTML code?

hth,
John T. Jarrett

Rob Blake wrote:

> I need some help, I've just downloaded the BNBFORM script however when I try
> to compile it I get an error.
>
> Can't find string terminator "__W9__" anywhere before EOF at bnbform.cgi
> line 140.
>
> I've tried to comment this line out then I get loads of extra errors, if
> anyone would be able to help me I would be grateful,
>
> Rob
> rblake@brookes.ac.uk



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

Date: Sat, 30 Jan 1999 17:45:43 +0800
From: "Chloe" <chloe_fung@hotmail.com>
Subject: HELP!!!   Using XS With C++
Message-Id: <78uk2d$egn$1@imsp009a.netvigator.com>

Hi there,

I have been trying to write a perl module which invokes functions in its C++
counterpart object, based on the perlxs documentation.  I create a C++
object in the perl module like,
        $c_obj = MyClass::new("MyClass");        // this constructor
initializes some data members in the C++ object

and then invoke the C++ function like,
        $c_obj->functionA();

I found that when functionA is called, the data members in the corresponding
C++ object seems to be undefined.  Thus, I have added code to print the
"this" in both C++ constructor and C++ functionA method.  The two "this"s
are different.  However, $c_obj is the same in the perl side.  Can anyone
tell me what I have done wrong?  I have been stuck here for quite a while.
Thanks a lot for your help.

Chloe




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

Date: Sat, 30 Jan 1999 05:52:47 -0600
From: "Tom Bellmer" <tbellmer@sky.net>
Subject: How to e-mail Web Form Data?
Message-Id: <oqCs2.156$Hm1.6871029@alpha.sky.net>

I have very little experience with either CGI or Perl.

What I would like to do is the following:

Capture the contents of a HTML form (method=POST) and
let the action return all the form variables via an
e-mail.  I could use hidden variables on the form to
store my e-mail address as a constant.

I have seen this done before, now I just need the
generic code to utilize this on my UNIX based system
home page.  Can anyone forward this code or recommend
a web site that might be what I am after?

Please respond to me directly via e-mail as I will
not be a regular read of this newsgroup.  Thanks so
much!

mailto:tbellmer@sky.net




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

Date: Sat, 30 Jan 1999 12:40:33 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: how to pass scalars AND variables to a sub?
Message-Id: <36B2EFB1.618FF490@ngb.se>

Jonathan Feinberg wrote:
> I think
> 
>    split ' ', $_;
> 
> or just the default
> 
>    split
> 
> is preferred, since those will automatically discard inital spaces,
> whereas / +/ will give you null initial fields (and also fails to
> account for whitespace other than space).

Sorry. My fault. Didn't think of leading whitespace (BAD BOY)

Staffan


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

Date: Sat, 30 Jan 1999 11:31:41 +0000 (GMT)
From: rupert@no.spam.leeds.ac.uk
Subject: Re: MacPerl question, Calling another script
Message-Id: <1999Jan30.113141.7023@leeds.ac.uk>

> >Hi.  Can someone tell me how to call a MacPerl script from within 
> >another MacPerl script?
> 
> Try using do or eval.  See the docs for details.

Most people who who ask about one script calling another
are trying to get an effect similar to

	system( "perl SecondScript.pl params" );

so that the output of the second script can be captured.

This cannot easily be done with MacPerl, but I have had
some success sending a DoScript AppleEvent.

Check the MacPerl archives at 
<http://www.binary.net/dturley/macperl/search.html> .

Ben.


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

Date: Sat, 30 Jan 1999 02:18:16 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: ok please don't shoot me for this question
Message-Id: <1dmf91o.1g1xn61t6fghcN@bay1-458.quincy.ziplink.net>

Jeff Kerrigan <jeff_kerrigan@hotmail.com> wrote:

> It seems like people on this channel waste more time delivering sarcastic
> answers than the 2 seconds it takes to help out a newbie.

Actually, it takes *four* seconds to help out a newbie, whereas I can
deliver a sarcastic answer in under three seconds.

> Try Matt's Scripts
> Archive at:
> 
> http://www.worldwidemart.com/scripts/
> 
> It seems to be a popular place to get a lot of prewritten CGI scripts.

Yes, judging from the number of people who come to clpm asking for help
with actually getting Matt's scripts to work, Matt's Script Archive is
depressingly popular.  Specifically, they are outdated, buggy, and
unsupported, and they don't do such things as error checking or file
locking.

Now we'll be seeing even more newbies coming here asking for help with
Matt's scripts, and we'll have to waste even more time delivering
sarcastic answers.  Thank you so much.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 30 Jan 1999 02:18:17 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: outputting perl errors as html?
Message-Id: <1dmf9de.1xwyjoyi7zfcwN@bay1-458.quincy.ziplink.net>

Chris Denman <c-denman@dircon.co.uk> wrote:

> I need to output perl error messages as html, instead of getting the typical
> default server error page.

use CGI::Carp qw(fatalsToBrowser);

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 30 Jan 1999 02:18:19 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Parsing FTP Directory listing
Message-Id: <1dmf9eg.lbyu508r14h8N@bay1-458.quincy.ziplink.net>

George <gpace@i-2000.com> wrote:

> I am doing some work on using FTP and trying to pull out the Date, Size and
> Filename from a directory listing.  While a very simple first program, I
> have learned a lot already (for instance ls -l gives a time instead of a
> year if < 6 months).
> 
> However when I use the following split:
> 
>    @fields = split(/ /, $file);
> 
> I get some interesting results in @fields.  I think it has to do with the
> extra blank spaces in the directory listing itself.

That's because split(/ /) splits on each individual space, whereas you
wanted to split on runs of spaces, as in split(/ +/), or even better,
the special case split(' '), which is explained in detail in the
perlfunc documentation.

> What I would really
> like to do, is have split work on a string, but in REVERSE.  Is this doable
> ?

I think what you would really like to do is use the filetest operators
and/or stat().  Then you don't have to rely on an external shell and the
output format of an external program.  Refer to the perlfunc
documentation.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 30 Jan 1999 02:50:43 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Parsing FTP Directory listing
Message-Id: <x7iudpqjvw.fsf@home.sysarch.com>

>>>>> "RJK" == Ronald J Kimball <rjk@linguist.dartmouth.edu> writes:

  RJK> George <gpace@i-2000.com> wrote:

  >> I am doing some work on using FTP and trying to pull out the Date,
  >> Size and Filename from a directory listing.  While a very simple
  >> first program, I

  RJK> I think what you would really like to do is use the filetest
  RJK> operators and/or stat().  Then you don't have to rely on an
  RJK> external shell and the output format of an external program.
  RJK> Refer to the perlfunc documentation.

ronald, how can perl's file test operator work over ftp? :-)

he is trying to parse the output of the ftp dir command which is similar
to the output of ls -l.

there is a module for this (what else is new!) and i always have trouble
finding it. after my usual looking around, it is in libwww and it is
called File::Listing.pm. it only parse unix ftp listings.

the mirror program has a package called lsparse.pl that will handle many
types of listings. unfortunately it is written in perl4 like the rest of
mirror. it is hard to look at sub names like lsparse'line_netware at
this time. i think they do that for some strange religious reason to
keep it working on very old sites. it is a very powerful ftp utility in
general.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sat, 30 Jan 1999 09:04:18 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Criticism
Message-Id: <36b2b938.1076639@news.skynet.be>

topmind@technologist.com wrote:

>Yes, they confused me, and I am NOT A DUMB PERSON!
>
>If they confuse me, I guarentee they will confuse a good many
>programmers, perhaps a majority.

Well, *I*(can't make head nor tail of Prolog. I tried, yes, and how I
tried! And *I* am not a dumb person. Does that mean that Prolog is junk?
No. It just isn't for me, and probably idem dito for thousands of other
programmers as well. 

But I won't ever say that the theories behind it are stupid, or that
Prolog is stupid or dangerous, just because I can't grasp them. Prolog
has it's place, and nothing else can give a better alternative in what
it was designed for. Thermodynamics isn't stupid or useless either, even
though I failed to grasp it's concepts, too.

[ About references ]
>> > I do not see much use in them anyhow except
>> > to *compensate* for Perl's shortcommings, such as "leaky" parameter
>> > passing and only 1 dimensional arrays (or lack
>> > of table-orientedness).  (I love that word "leaky"!)

I can't make head or tails of it. "Leaky"? There's no leak.

Sure, Perl's one-dimensionality can be annoying. But it is a simple
concept. And it has beautiful side effects, such as being able to
combine different items or arrays into one larger array, just like that.

	@d = ( @a, 'b', @c);

See that? I just combined all the elements of the array @a and the array
@c, with the element 'b' between them, into a new array. Try *that* in a
language that supports multiple dimensions.

The one slightly annoying thing is, is the lack of support for matrices.
As a consequence, I won't do much matrix multiplications in Perl.

On the other hand, you can easily build tree structures in Perl, thanks
to references. You can't do that in VB, for example. Or in tables. I
like trees better than tables.

Who needs tables anyway; I don't NEED to associate more than value with
a key. When that happens, it's usually an error. So I check for it
first, and if I see it already had a value, I give a warning. So I get a
nice list of exceptions as a side effect. Try doing that in Access, or
in SQL. It will gladly combine every duplicate key with every duplicate
association. 2 by 2 means 4 results, *and* an unupdatable query. Just
like that. No warning where the duplicates are.

>Look at the Perl gunk people use for signitures. You are telling
>me you can look at that and easily tell what are variables, routines,
>parameters, what is being passed to each, etc?

Sure you can. That's what the $ @ & () {} [] are for. Most people find
those annoying, but they DO tell you what is what.

	Bart.


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

Date: Sat, 30 Jan 1999 07:38:13 GMT
From: kaz@eudoramail.com
Subject: Re: Perl programs
Message-Id: <78uct4$6ep$1@nnrp1.dejanews.com>

You can try http://www.dodge.co.uk/cgindex/

In article <78l5j3$m8g$1@supernews.com>,
  "Tom West" <westt@pins.co.uk> wrote:
> I am a 6th form student from Britain trying to create some intranet pages
> for an A-level project in I.T. I need some code to enable me to link my web
> site page to data from and accounting package that will load it up in the
> right format. If anyone has any code that is similar to this that they could
> E-mail me or knows anywhere i can get it then i would be very grateful for a
> reply.
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 30 Jan 1999 07:34:51 GMT
From: kaz@eudoramail.com
Subject: Re: Perl ressources
Message-Id: <78ucmr$64k$1@nnrp1.dejanews.com>

You can visit http://www.dodge.co.uk/cgindex/

In article <36A8517D.C5E3C06C@webline.dk>,
  Kaare Rasmussen <kar@webline.dk> wrote:
> Any other valuable ressources than CPAN? I'm especially looking for
> one-liners that actually do something useful.
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 30 Jan 1999 07:51:48 GMT
From: kaz@eudoramail.com
Subject: Re: Perl Web browser problem
Message-Id: <78udmi$6vo$1@nnrp1.dejanews.com>

You probably needs to set "content type".

print "Content-type: text/html\n\n";

In article <77viu2$885$1@heracles.fw.cuci.nl>,
  "Ronald Martens" <rmartens@nmsmedia.nl> wrote:
> Does anyone has  a clue?
> I can run my perl script in telnet mode.
> However when I want to run it in a browser I get a misconfiguration error. I
> set the MOD 777 for testing,
> use standard $|=1; used STDOUT and...
>
> Does anyone has a simple working perl script e.g. Hello world" that MUST
> work, for me to test with.
>
> Ronald.
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 30 Jan 1999 09:10:57 GMT
From: rcook@pcug.org.au (Owen Cook)
Subject: Re: Remove all non a-z characters?
Message-Id: <36b5c9bc.18360561@newshost.pcug.org.au>

On Mon, 25 Jan 1999 21:26:57 -0800, lr@hpl.hp.com (Larry Rosler) wrote:


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

$y = 't4(e3*s@22t';

timethese(1 << (shift || 0), {
    Cntrl => sub { my $string = $y },
    Tr    => sub { (my $string = $y) =~ tr/a-z//cd },
    Regex => sub { (my $string = $y) =~ s/[^a-z]//g },
});
------------------------------------------------------------------------
I tried this with build 509 of ActiveState perl and had to increase the
"1" in     timethese(1 << (shift || 0),  to 100000 before I could elimimate
an warning message which read;
(warning: too few iterations for a reliable count)

I then increased it to 262144 and obtained "similiar" results to what was
posted.

How come  "1" is used and  262144 iterations are made, yet I have to use
262144, or is there something I should be reading?

There is also another one later on

-----------------------------------------------------------------------------
my $string = 'TO:REGEX:IS:HUMAN,:SPLIT:-:DIVINE!';

timethese(1 << (shift || 0), {

 .........

------------------------------------------------------------------------
and 65536 iterations were done.
65536=2**16 and 262144=2**18 , so maybe there is a clue in there.

-- 
TIA

Owen











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

Date: 30 Jan 1999 05:11:18 +0000
From: Nix <$}xin{$@esperi.demon.co.uk>
Subject: Re: Secuity hole with perl (suidperl) and nosuid mounts on Linux
Message-Id: <87g18t1h1l.fsf@loki.wkstn.nix>

peter@nemesis.niar.twsu.edu (Peter Samuelson) writes:

>                                                Linus most of the time
> seems more than reasonable and open in his development process -- for
> small changes he will literally take patches from anybody, and for
> large changes he discusses the issues on the mailing lists.

>From my observations Linus' Golden Rules appear to be

- Thou shalt not make Linux into a non-Unix (thus thou shalt obey POSIX
  unless they perpetrate a spectacular brokenness)
- Thou shalt not implement a patch in an ugly or unmaintainable manner
- Thou shalt not get a scheme implemented which uglifies or overly
  complicates the kernel internals

Everything else seems to be pure `technical merit'. (And when you think
about it most of these are `technical merit' too.)

My experience when the suid scripts issue came up last, some time back,
is that there was little consensus on it and what there was leant towards
`suid scripts are not a kernel thing, leave it up to the interpreter'.

Simply that there is no consensus on it should say something.

-- 
`I didn't want the bug *fixed*, I wanted to bitch pointlessly.' - Matthew
                                        R. Williams on alt.religion.emacs


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

Date: Sat, 30 Jan 1999 12:24:03 GMT
From: info@gadnet.com
Subject: Re: Sending email
Message-Id: <36b2f4aa.65638777@news.newsguy.com>

>> >You don't check the return value when you open the file.
>> 
>> True, but that's not causing the problem.
>
>How do you know?  You said that no mail is being sent.  If this open
>fails, then the array you assign the input to is empty, and the text you
>pipe to your mail program looks like this:

You are, of course, correct. That was indeed at least part of the
problem. What should my code look like if I want to ignore that record
and carry on with the loop if the open fails?

>which is one plausible explanation for the problem you are having.
>
>That gives me an idea; how about, in addition to piping the text to the
>mail program, you also print it to a logfile, so you can get a better
>idea of what your program is doing.

I did this and now the program behaves even more oddly. All the emails
get sent whether the address is valid or not. That's fine. Then the
script is supposed to send some HTML to the browser but it returns the
same server error message instead.

# end of email loop.

	print DEBUG "start html";	
	&header('Email Sent');
	print "<br><br><br><br>\n";
	print "<center><font face=verdana>Email Successfully
Sent<br><br><br>\n";
	print "Click <a href=$bpurl/bpadmin.htm>Here</a> to return to
the main admin page\n";
	print "</center></font>\n";
	&footer;
	print DEBUG "close";

sub header
{
	print "<HTML><HEAD><TITLE>$title - @_[0]</TITLE></HEAD>\n";
	print "<BODY $bgcolor $link $vlink>\n";
	print "<center><br><b><font face=verdana><font
color=\"#008080\"><font size=+1>$title</font></font></font></b>\n";
	print "<br><b><font face=verdana><font color=\"#008080\"><font
size=+0>@_[0]</font></font></font></b></center>\n";
      if ($memberhead)
	{
		open(MHEAD,"$memberhead");
                while (<MHEAD>)
		{
			print;
		}
		close (MHEAD);
	}
}
sub footer
{
	print "<center><hr WIDTH=100%>\n";
	print "<br><b><font face=Verdana><font size=-2>\n";
	print "<a href=\"http://www.gadnet.com/bplus\">Banner Software
by BannerPlus</a></font></font></b>\n";
	print "</center></BODY></HTML>\n";
	exit;
}

The script starts with:

print "Content-type: text/html\n\n";

so that shoudn't be the problem.

Any ideas?

Thanks,

Drummond



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

Date: Sat, 30 Jan 1999 01:10:50 -0500
From: "John T. Jarrett" <jjarrett@ecpi.com>
Subject: SQL setup
Message-Id: <36B2A269.97F96735@ecpi.com>

Stupid question #12

If the DBI and DBD modules are loaded in my path for a particular
database (like mSQL or MySQL) do you need to have the database programs
compiled on your server?

I can't compile nuthin on my clients' servers (vast majority of the
time) (don't have permission to execute Make and I still haven't found
the man page for Utils::MakeMaker) and can't really mess around with it
(obviously, since I can't compile...).

Can I just get the DBI and DBD in the path and then use Perl to create
the database without the database server running?

John
<!--#echo var="jobob" value="perl hack wannabee....." -->



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

Date: Sat, 30 Jan 1999 01:27:14 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: system function, Pros and Cons??
Message-Id: <i8cu87.3v2.ln@magna.metronet.com>

Abraham Grief (abey@cs.ucr.edu) wrote:
: TC>and just do what it takes to
: TC>get your job done so that you get to go home to
: TC>your family and friends before the cock crows. Let
: TC>no man tell you otherwise!

: Let me start this off with that Tom knows a lot more
: about perl than I do.  I'm just some college student
: who only started learning perl a little over a year
: ago, and I read books that he helped write.

: However, I disagree heartily with what is being said
: here.  When you get a job to do something, the goal
: shouldn't be to minimize the time you spend on that
: job, it should be to do the best job possible.  


   Do they include a course in economics in your curriculum?

   Time is money (pretty original, huh?).

   Unless you work for the government or a non-profit, what
   you do has to make economic sense.

   You can build the best possible car, but if it costs
   $120,000, you, and all of your coworkers, may well get
   a chance to pursue other opportunities.

   :-)


   Making tradeoffs is fundamental to design. You do what's
   best for your situation.

   Shelling out to get a list of files from a directory or to
   get the date, for instance, should never need to be done.

   Running Mathematica to do a complex statistical anlaysis
   is an example of where shelling out probably makes sense.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 30 Jan 1999 13:02:10 +0200
From: Pasha Zusmanovich <pasha@actcom.co.il>
Subject: Re: system function, Pros and Cons??
Message-Id: <36B2E6B2.D8FCDD6E@actcom.co.il>

Tad McClellan wrote:
> 
> Abraham Grief (abey@cs.ucr.edu) wrote:
> : TC>and just do what it takes to
> : TC>get your job done so that you get to go home to
> : TC>your family and friends before the cock crows. Let
> : TC>no man tell you otherwise!
> 
> : Let me start this off with that Tom knows a lot more
> : about perl than I do.  I'm just some college student
> : who only started learning perl a little over a year
> : ago, and I read books that he helped write.
> 
> : However, I disagree heartily with what is being said
> : here.  When you get a job to do something, the goal
> : shouldn't be to minimize the time you spend on that
> : job, it should be to do the best job possible.
> 
>    Do they include a course in economics in your curriculum?
> 
>    Time is money (pretty original, huh?).
> 
>    Unless you work for the government or a non-profit, what
>    you do has to make economic sense.
> 
>    You can build the best possible car, but if it costs
>    $120,000, you, and all of your coworkers, may well get
>    a chance to pursue other opportunities.
> 
>    :-)
> 
>    Making tradeoffs is fundamental to design. You do what's
>    best for your situation.
> 

I feel that these days programmers worry too much about economical side
of things than on aesthetical one. Can you say "The Art of Computer
Programming"? I think there are enough guys around here whose primary
responsibility is "to make economic sense" (and don't let to programmers
to forget about it). 

-- 
Pasha Zusmanovich    -------o x x "What i tell you three times is true."
pasha@actcom.co.il          o o x L.Carroll, "The Hunting of the Snark"
www.actcom.co.il/~pasha     x x o---------------------------------------


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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