[12100] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5700 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 17 13:07:19 1999

Date: Mon, 17 May 99 10:00:20 -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           Mon, 17 May 1999     Volume: 8 Number: 5700

Today's topics:
        -> Folkert Meeuw: Value  of <HANDLE> can be "0"; test w <fmee@lfi.uni-hannover.de>
    Re: /usr/bin/perl vs /usr/local/bin/perl <mpersico@erols.com>
    Re: ``/system(); local vs remote behavior problem <cassell@mail.cor.epa.gov>
        Backreferences <grichard@uci.edu>
        CGI (Perl), HTML or Java Code needed to put blank lines <austin.m@virgin.net>
        DBI, mysql, perl <rocket@nacs.net>
    Re: generated functions and caller (or better way?) (Andrew Allen)
    Re: Help! sendmail problems (Brian)
    Re: How to put browse into perl <cassell@mail.cor.epa.gov>
    Re: japh tags (Juho Cederstrom)
    Re: Monadic classes, eponymous metaobjects, and translu <tchrist@mox.perl.com>
    Re: Monadic classes, eponymous metaobjects, and translu <garethr@cre.canon.co.uk>
    Re: No classes.zip file found <gellyfish@gellyfish.com>
    Re: No classes.zip file found <jared@iRenaissance.com>
    Re: password checking (Brian)
    Re: Perl "constructors" (Randal L. Schwartz)
    Re: Perl "constructors" <jeromeo@atrieva.com>
    Re: Perl "constructors" <jeromeo@atrieva.com>
        Perl Librarys for NT <Kimberly.Kulasa@daytonoh.ncr.com>
    Re: perltootc - OO Tutorial for Class Data in Perl <cassell@mail.cor.epa.gov>
    Re: perltootc - OO Tutorial for Class Data in Perl (Andrew Allen)
    Re: Strange file reading problem <cassell@mail.cor.epa.gov>
    Re: The Sendmail Program (Brian)
    Re: Using perl for access control <ron@library.ucsf.edu>
    Re: Weird socket behaviour (Michel Dalle)
        Windows NT Form Mail Response <info@gate.on.ca>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 17 May 1999 18:43:25 +0200
From: Folkert Meeuw <fmee@lfi.uni-hannover.de>
Subject: -> Folkert Meeuw: Value  of <HANDLE> can be "0"; test with defined()
Message-Id: <3740472D.CC8EC8A1@lfi.uni-hannover.de>

Hi Dear Friendly Readers,

I 've got a problem in perl.

#!/usr/local/bin/perl -w
# 1.6 Files read

open (IN, "friends");
while ($line = <IN>)
{
 chomp ($line);
 push (@friends, $lines);
}
close IN;

when I try to execute it in a shell, I will get this:

perl -w 1.6.pl
Value of <HANDLE> construct can be "0"; test with defined() at 1.6.pl
line 5.
Name "main::friends" used only once: possible typo at 1.6.pl line 8.
Name "main::lines" used only once: possible typo at 1.6.pl line 8.


The file "friends" contents names of friends, in each line one name.
Who knows ?

NG Folkert Meeuw




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

Date: Mon, 17 May 1999 12:33:14 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: /usr/bin/perl vs /usr/local/bin/perl
Message-Id: <374044CA.2692B93F@erols.com>



"Ethan H. Poole" wrote:

> Still wouldn't solve the problem, some systems will have multiple versions of
> the same interpreter installed. 

Yes, but there should still be one sane default. If you have multiple
interp. versions installed, then picking the right one and editing the
script to suit becomes your problem.
-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Mon, 17 May 1999 09:49:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Jerrad Pierce <belg4mit@mit.edu>
Subject: Re: ``/system(); local vs remote behavior problem
Message-Id: <37404890.69E77D11@mail.cor.epa.gov>

[courtesy cc sent to poster]

Jerrad Pierce wrote:
> 
> Okay so I have a CGI script and I need to execute an external program.
> I need the output so I should use ``, but the program doesn't seem to be
> executing it. The file permissions are okay. Isystem doesn't work either,
> it returns status 256.        

Without actual code it's pretty tough to tell from this side
of the country, since my PSI::ESP module is on the blink again.  :-)

But the problem may be related to the conditions under which
webscripts are run.  Since you're at MIT, I don't have to tell
you that the server usually runs programs under privileges and
parent directory other than what the naive user might expect.
Use of relative addresses in code can therefore cause failures.
As can file permission problems.  Will your program execute
if 'nobody' tries to run it?

Did the server log show any error messages?  Have you 
consider using the CGI::Carp module to get the errors, if you
can't read the server log?

I hope some of these suggestions are helpful.  You might
want to read perlfaq9 to get a lot more help.

PS> Please (b)cc me with an replies, thanks!

Done.. since you asked politely...  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 17 May 1999 09:41:22 -0700
From: "Gabe" <grichard@uci.edu>
Subject: Backreferences
Message-Id: <7hpgil$2op@news.service.uci.edu>

Is there some array associated with $1, $2, $3...etc?

Gabe




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

Date: Mon, 17 May 1999 17:44:50 +0100
From: "Mark Austin" <austin.m@virgin.net>
Subject: CGI (Perl), HTML or Java Code needed to put blank lines between cgi forum message threads.
Message-Id: <7hpgts$7ka$1@nclient5-gui.server.virgin.net>

I'd like to separate the message threads on my forum
(http://www.digiserve.com/bali/), with a single blank line. That's the
threads of messages, not each individual message.

Any ideas?

RSVP

Mark




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

Date: Mon, 17 May 1999 12:28:54 -0400
From: Ken Nagorski <rocket@nacs.net>
Subject: DBI, mysql, perl
Message-Id: <374043C6.D925DA69@nacs.net>

    I have a DBI script that inserts into a mysql data base via CGI,
however I get two fields that are always blank. I am using cgi-lib.pl to
parse the data,

require "/usr/lib/perl5/cgi-lib.pl" || die "Could not open cgi-lib";
&ReadParse;

the code for the cgi is this...   $adjective6=$in{'city'};
and for the html... <TR><TD>city</TD><TD><INPUT TYPE=TEXT
NAME=city></TD></TR>

I have no idea what is causing this problem? the rest of the insert
statement works fine, If you could help I would appreciate it.
Thanks
Ken N



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

Date: 17 May 1999 16:38:26 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: generated functions and caller (or better way?)
Message-Id: <7hpgm2$2pu$1@fcnews.fc.hp.com>

Rand A. Bamberg (rand@qualityic.com) wrote:
: (I originally posted this question to c.l.p.moderated on
: 5/7/99, but it's languished there a week without any reply.
: This is my second attempt, rephrased somewhat.)

: Here's my problem: I want to generate functions on-the-fly
: *and* have the generated functions be able to report
: errors using C<caller>.  (Toy examples below.)

: AFAIK there are two ways to generate a function at
: run-time: either assign an anonymous closure to a typeglob
: as described in the Cookbook p358 (a little exotic), or
: assemble the new function as a string and C<eval> it (ick).

and AUTOLOAD.

Andrew


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

Date: Mon, 17 May 1999 16:01:36 GMT
From: pontz@channel1.com (Brian)
Subject: Re: Help! sendmail problems
Message-Id: <37403ca6.238893225@news1.channel1.com>

This works for me

open(SENDMAIL, "|/usr/sbin/sendmail -t") || &Error("Can't fork for
sendmail:$!\$
print SENDMAIL "To: $email\n";
        print SENDMAIL "From: $email\n";
        print SENDMAIL "BCC: ";
        print SENDMAIL "\n";
        print SENDMAIL "Subject: $name\n\n";
        print SENDMAIL "$comment";
close(SENDMAIL);

The path might not be the same as in yours to SENDMAIL but the rest
should be ok.
Brian

On Thu, 13 May 1999 21:06:31 GMT, "Marie Yelle-Whitwam"
<whitwam@magma.NOSPAM.ca> wrote:

>Hi:
>
>I am trying to get my perl program to send an e-mail containing
>the info collected through a web page form.
>
>I have tried the following:
>
>    open(SENDMAIL, "|/usr/lib/sendmail -oi -t")
>                        or die "Can't fork for sendmail: $!\n";
>    print SENDMAIL <<"EOF";
>    From: $My_name <myemail_address\@host>
>    To: $Recipents_name <recipents_email\@otherhost>
>    Subject: A relevant subject line
>
>    Body of the message goes here, in as many lines as you like.
>    EOF
>    close(SENDMAIL)     or warn "sendmail didn't close nicely";
>
>It didn't work, so I changed the first line to:
>
>    open(SENDMAIL, "|/usr/lib/sendmail -oi -t recipents_email\@otherhost")
>                        or die "Can't fork for sendmail: $!\n";
>
>This worked but the sender and subject fileds were blank in the email.
>
>Can someone tell me how to get the the script to pick up the
>From: , To: and Subject from the SENDMAIL filehandle.
>
>Marie
>
>



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

Date: Mon, 17 May 1999 09:04:13 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: How to put browse into perl
Message-Id: <37403DFD.95692B2C@mail.cor.epa.gov>

dutchie wrote:
> 
> How do i have to put the browse into perl ?
> 
> I mean as you can see at :
> www.betaal.com/test/browser.htm

Oh, you mean that you get a 500 Server Error.  That's a
common problem.  So common, in fact, that it's a FAQ.

Type this at a command prompt:
perldoc -q  500
to get that particular answer.
Or type this at a command prompt:
perldoc perlfaq9 and you'll see that yours is the first
question answered there.

But the bottom line is that this is not a Perl problem
at all.  It is a CGI problem dressed up in llamas'
clothing.  And it is probably not the browser, but the
web *server* which needs to be configured.  So this
question is more appropriate for
comp.infosystems.www.authoring.cgi .

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Sun, 16 May 1999 19:08:26 +0300
From: cederstrom@kolumbus.REMOVE_THIS.fi (Juho Cederstrom)
Subject: Re: japh tags
Message-Id: <slrn7jtrbq.34r.cederstrom@vortex.cede.net>

Here are some Perl tags, not all of them are JAPHs.

--- (This was one of my first ones... Not too fine.)
#!/usr/bin/perl -w
$_="6A75686F63277320656D61696C206164647265737320697320636564657273747";
$_.="26F6D406B6F6C756D6275732E6669A";s/(\w{2})/chr(hex($1))/eg;print"$_\n";
---

--- (I like this one!)
# This perl script will show juhoc's real email address
$_ = 'my e-mail address is NOT fi@cederstrom.kolumbus';
s/N\S+\s//g;s/(\S+)\@(\w+)\.(\w+)$/$2\@$3\.$1\n/;print;          
---

--- (This was another project, which I turned into a tag)
# This is a Perl script which will show the time.
use strict;my @ltime=localtime(time);my $time=$ltime[2]*3600+$ltime[1]*
60+$ltime[0];my $s=$time%60;my $m= int((($time-$s)%3600)/60);my $h=int(
($time-$m-$s) /3600);printf("The time is: %02d:%02d:%02d.\n",$h,$m,$s);  
---


And last but not least, my first JAPH tag:

-- 
#!/usr/bin/perl -wT # Please take a look at my mail address when replying
use CGI;$a=reverse"r56%b6%36%16%H02%l27%56%P02%r56%86%47%f6%e6%A02%t37%".
"57%J=japh";$b=new CGI($a);$c=$b->param(lc(reverse("JAPH")));print"$c\n";



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

Date: 17 May 1999 10:30:51 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Monadic classes, eponymous metaobjects, and translucent data members
Message-Id: <3740443b@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Gareth Rees <garethr@cre.canon.co.uk> writes:
:I think that "Monadic Class" is a confusing choice of name for this
:concept.

[After further research]

The OED definition 1b for "monadic" is 

    of a proposition, fact, function, etc., or the predicate contained
    therein, when the predicate is non-relational and *APPLIES TO ONLY
    ONE SUBJECT TERM*.  [emphasis mine --tchrist]

Do you feel the OED definition of "monadic" does not fit my use of
"monadic class"; that is, when applied to the highlander classes as I have
described them?  Or is the problem simply that the prior ground staked out
by Haskellites and the rest of the pure functional programmers in their
use of the term "monadic function" renders the term potentially misleading
to itinerant theoreticians on sabattical in The World According to Perl?

The OED use definition of "monadic" is similar in form, but not
necessarily in meaning, to the term "dyadic", which the OED defines as

    of or pertaining to a dyad or group of two.  
    dyadic arithmetic: binary arithmetic, in which the radix is 2

Would this use of "dyadic", a topic surely near and dear to the heart
of every programmer, cause distress when applied to what occurs in
expresions like 0b01 + 0b10 == 0b11?

Finally, I note in passing that the documentation for the GNU C
library makes ample use of the term "variadic function".  Would the
long-established use of "variadic" to refer to a function of a variable
number of arguments be similarly distressing?

Your point is well-taken, and I thank you for the references.  Yet I
cannot help but wonder whether there exists some singular inflexibility
about the term "monadic" that resists contextual interpretation?

--tom
-- 
    X-Windows: Some voids are better left unfilled.
	--Jamie Zawinski


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

Date: Mon, 17 May 1999 16:44:30 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: tchrist@mox.perl.com (Tom Christiansen)
Subject: Re: Monadic classes, eponymous metaobjects, and translucent data members
Message-Id: <sig14vfxxt.fsf@cre.canon.co.uk>

Tom Christiansen <tchrist@mox.perl.com> wrote:
> Do you feel the OED definition of "monadic" does not fit my use of
> "monadic class"; that is, when applied to the highlander classes as I
> have described them?  Or is the problem simply that the prior ground
> staked out by Haskellites and the rest of the pure functional
> programmers in their use of the term "monadic function" renders the
> term potentially misleading to itinerant theoreticians on sabattical
> in The World According to Perl?

"Monadic" certainly has the right meaning to be applied to a class which
has a single instance.  In fact I think that your use of the term is
rather better than the category theorists' and functional programmers'
use of the term.

Just be aware that there are people who will be confused!

-- 
Gareth Rees


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

Date: 17 May 1999 16:47:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: No classes.zip file found
Message-Id: <37403a0f@newsread3.dircon.co.uk>

Frank Siegel <NorthernSnow@worldnet.att.net> wrote:
> I recently installed Java1.2.1 and do not have a classes.zip

I think you have the wrong group this is comp.lang.perl.misc  - no Java
spoken here - you probably want a group in the comp.lang.java.*
hierarchy.

Have fun

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Mon, 17 May 1999 12:58:59 -0400
From: "Jared Richardson" <jared@iRenaissance.com>
Subject: Re: No classes.zip file found
Message-Id: <IVX%2.424$u3.2055@news.ipass.net>

agreed... but look for rt.jar instead... ;)

run time stuff...

Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:37403a0f@newsread3.dircon.co.uk...
> Frank Siegel <NorthernSnow@worldnet.att.net> wrote:
> > I recently installed Java1.2.1 and do not have a classes.zip
>
> I think you have the wrong group this is comp.lang.perl.misc  - no Java
> spoken here - you probably want a group in the comp.lang.java.*
> hierarchy.
>
> Have fun
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
>




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

Date: Mon, 17 May 1999 16:25:29 GMT
From: pontz@channel1.com (Brian)
Subject: Re: password checking
Message-Id: <37404248.240336196@news1.channel1.com>

Thanks everyone that helped. I got it working now.  It prob isnt the
right way on how to do it but it works. I forgot to put the 
use Apache::Htpasswd; at the top of my script.


if (! defined($in{'pass'})) { &print_password }
    $pwdFile = new Apache::Htpasswd('.htpasswd');
 if ($pwdFile->htCheckPassword("$lname", "$in{'pass'}")) { exit1;
  } else { &print_bad_password;
  }
}


Brian

On Fri, 14 May 1999 13:58:02 -0400, Ala Qumsieh <aqumsieh@matrox.com>
wrote:

>
>pontz@channel1.com (Brian) writes:
>
>> Ok Thanks ....But the nice indenting still didnt make it work.
>
>Did you try to fix the other (more serious) problems though?
>
>> On Thu, 13 May 1999 00:49:49 -0400, rjk@linguist.dartmouth.edu (Ronald
>> J Kimball) wrote:
>
>[snip]
>
>> >I see at least three things wrong with this sub:
>> >The indenting is atrocious.
>> >You misspelled 'Password' in 'htCheckPassword'.
>> >You do a 'next' even though you don't appear to be in a loop.
>



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

Date: 17 May 1999 09:04:33 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl "constructors"
Message-Id: <m1so8vr8by.fsf@halfdome.holdit.com>

>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:

Larry> This approach requires a translation table in every array.  What are its 
Larry> advantages compared to declaring the array-index constants via

Larry>       use constant X => 0;
Larry>       use constant Y => 1;

Larry> or explicitly:

Larry>       *X = sub () { 0 };
Larry>       *Y = sub () { 1 };

Larry> These constants can be localized in a block to avoid global scoping 
Larry> problems, and the mapping of array indexes should be done at compile 
Larry> time, and there is no per-array storage overhead, right?

The advantages of "use fields" can be gleened from looking at the
manpage. :) For one thing, your scheme requires a lot of explicit
work, and would be a nightmare to maintain for multiple inheritance.

"use fields" is smart enough to do all the right things, and takes
advantage of a natural syntax.

The mapping of a pseudo-hash *is* done at compile time if you do all
the right steps, and the overhead of one extra slot per array is a
mere 4 bytes.  (The mapping hash at the front of the object will be a
common hash for all objects.)

Yes, you can do it explicitly, but the pseudo-hash is an interesting
idea with Perl-provided support.  Give it a strong look.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 17 May 1999 09:27:16 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Perl "constructors"
Message-Id: <37404364.DACD828D@atrieva.com>

armchair@my-dejanews.com wrote:
> 

> Or perhaps I have done something that most Perl programmers have not:
> had to modify other people's code. I don't want to inflict anything on
> Perl, but I will certainly not be at service this weekend.

Oh please.   Taking care of other peoples code is part and parcel of
most work-a-day buisness.  When you come down off your cross, you might
figure that out.

$martyr->look_at('somone_elese_code') || die;

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Mon, 17 May 1999 09:48:56 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Perl "constructors"
Message-Id: <37404878.CB8AAC@atrieva.com>

armchair@my-dejanews.com wrote:

> > No, you should probably be raising an exception.
> > printing to stdout is silly.
> 
> Is raising and exception supposed to be the die function?

No.  die() is what happens during the exception.  It might also be
email_someone_with_a_clue(), or log_some_error_somewhere(), or
some_other_dang_thing().


> > :> What, like $count = keys %hash?
> > :Very expensive, not intuitive.
> > Liar.  Twice.

> As it turns out, only once. Someone has proclaimed it not expensive, but
> no sane man, woman or child would ever call it intuitive.

The behavior of keys() is well defined and documented.  No sane man,
woman, or child could read them and ever say it wasn't so.  However,
smarty-pants psedo experts lacking a clue might.

How's the accounting buisness, Topmind?


-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Mon, 17 May 1999 11:54:51 -0400
From: "Kim Kulasa" <Kimberly.Kulasa@daytonoh.ncr.com>
Subject: Perl Librarys for NT
Message-Id: <##dcN1Ho#GA.208@rpc1284.daytonoh.ncr.com>

Does anyone know if the LWP (library for www access for Perl) or the GD.pm
(Graphics library) are available for NT?  We have NT 4 with IIS 4 and
ActiveState's latest activeperl release.

Thanks in advance,

Kim




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

Date: Mon, 17 May 1999 09:14:09 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
To: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: perltootc - OO Tutorial for Class Data in Perl
Message-Id: <37404051.CDFCCAB5@mail.cor.epa.gov>

[courtesy cc to poster]

Jaime Metcher wrote:
> 
> [some interesting addenda heartlessly snipped]
>
> refugees from more patriarchal languages...

Ooh.  Nice.  Mind if I quote you on this someday?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 17 May 1999 16:46:56 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: perltootc - OO Tutorial for Class Data in Perl
Message-Id: <7hph60$2pu$2@fcnews.fc.hp.com>

Jaime Metcher (metcher@spider.herston.uq.edu.au) wrote:


: One small suggestion. In "More Inheritance Concerns", after:

: If you subclass Some_Class, now all you need to do to get separate,
: per-class class attributes is to override the &_classobj
: method in the derived class.

: you could append:

: Unless you also declare %ClassData as a lexical in the derived class's file
: scope, it will be autovivified as a package variable in the derived class's
: package.

No, I don't think this is the correct term for autovivification. I
believe that term is specifically reserved for the calling into
existence a reference when treated as such.

: Justification:
: In the discussion of overriding _classobj to provide access to subclass state,
: refugees from more patriarchal languages may be distracted by the fact that the
: subclass's version of _classobj is accessing an *undeclared variable* <shock,
: horror>.  The presence of a *declared* variable with (sort of) the same name
: right there in front of my eyes momentarily caused the Pascal programmer in me
: rise from it's grave and distract the Perl programmmer.  A phatic mention of
: autovivification here might be kindly.  

Huh? 

phat-ic: (n) : of, relating to, or being speech used for social
or emotive purposes rather than for communicating information. 

Why would perl docs have "social or emotive purposes"? Perhaps
parenthetical? Also autovivification is (again) the wrong term.

Andrew





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

Date: Mon, 17 May 1999 09:33:14 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Strange file reading problem
Message-Id: <374044CA.1BB6DD30@mail.cor.epa.gov>

David Lent wrote:
> 
> I'm using the -w but it's not giving any info. about this problem.  I've noticed something even stranger now.

Oops.  Bad wrap on your newsreader software there.  Let me guess.
Internet Exploder, or Nyetscape?

>  If I use:
> $var=<NEWFILE>;
> print "$var";
> 
> it prints the First part of the file.

Only the first line, to be precise.  Right?
 
> If I use:
> print <NEWFILE>;
> it prints the Second part of the file.  This is one of the strangest things I've ever seen.

Then you haven't been hanging around here for long.  :-)

>> [snip of Jonathan's response]

Seriously, Jonathan was trying to be helpful, and indeed he
hit the nail on the head.  You have two issues going on here.

First of all, when you program in Perl, you must remember to 
watch out for list vs scalar context, because the compiler
is so smart that it can tell what you told it to do.

<INFILE> reads in a line or multiple lines from the given
infile, depending on context.  Watch:

@vars = <INFILE>   #list context, reads whole file into @vars

vs.:

$var = <INFILE>;    #reads one line in, i.e. the *next* line

Now what happens if you combine these in one program?
This is actually a fairly common beginner mistake.

$line1 = <INFILE>;   #got the first line only
print <INFILE>;      # prints out lines 2 through n

because print() takes a *list*.  The compiler looks at
your codes, sees that you want list context, and puts
the <> operator into list context.

So.. you told Perl to read in one line, then print the
rest.  We're still working on the DWIM compiler.  :-)

Although you'll find that sometimes Perl does more DWIM
than you wanted it to.  :-)

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 17 May 1999 16:33:52 GMT
From: pontz@channel1.com (Brian)
Subject: Re: The Sendmail Program
Message-Id: <3740447c.240899680@news1.channel1.com>

 The -t option says to use the headers to decide who to send the
message to. I dont remember what the pipe | does. I got this from 
On
ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/doc/manual/html/pod/perlfaq9.html#How_do_I_send_mail_

I know it's pretty long.

Brian

Mon, 17 May 1999 01:01:52 -0400, brian@pm.org (brian d foy) wrote:

>In article <373f9337.0@wznews.webzone.net>, "Wassim Metallaoui" <wassimk@iname.com> posted:
>
>> Can anyone tell me what
>> 
>> open (MAIL, "|$mailprog -t")
>> 
>> does? I am wondering about the pipe and the -t
>
>see the open() docs (perldoc -f open) to read about the pipe, and
>the docs for whatever $mailprog holds to see what -t does. :)
>
>-- 
>brian d foy                    
>CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
>Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>



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

Date: Mon, 17 May 1999 09:26:49 -0700
From: Ron Klatchko <ron@library.ucsf.edu>
Subject: Re: Using perl for access control
Message-Id: <37404349.5C6B5E@library.ucsf.edu>

John wrote:
> I want to be able to give visitors access to page when they enter a
> username and a password that is related by a function.

It would be extremely helpful if you would mention what Web server you
are running.

If you're using Apache, check out mod_auth_external at:
  http://modules.apache.org/search?id=9

it allows you to handle authentication via an outside program.  You can
then use whatever language you like to implement your logic.

moo
----------------------------------------------------------------------
          Ron Klatchko - Manager, Advanced Technology Group           
           UCSF Library and Center for Knowledge Management           
                        ron@library.ucsf.edu


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

Date: Mon, 17 May 1999 16:10:50 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Weird socket behaviour
Message-Id: <7hpf0q$9f6$1@news.mch.sbs.de>

In article <37402EB8.AE83A315@cc.newcastle.edu.au>, James Smith <engjs@cc.newcastle.edu.au> wrote:
>I have written a perl program to open an internet socket and download
>a webpage, the sort of thing Netscape does. It works fine in some cases
>and not in others. The problem appears to be with the site I am
>downloading from (which is one of a number of such sites).
[snip]

Have you looked at the actual contents of the page (View Page Source) ?
- Does it contain JavaScript ?
- Does it use style sheets ?
- Does it contain objects, Java applets, RealAudio, MIDI, ...?

Have you tried downloading the page with Netscape after disabling JavaScript ?

Does your perl program send back a UserAgent together with the
HTTP request ? Does the server check that UserAgent (e.g. CGI) ?
(not likely, but who knows...)

Do you use a proxy server to access the Internet ?

Does the webserver send back a cookie ?

Have you looked at the LWP module on CPAN ?

All of the above should tell you that it may be 'difficult' to obtain exactly
the same page via a perl script as you'll get with Netscape.

Michel.


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

Date: Mon, 17 May 1999 12:41:25 -0400
From: "Jorge Torres" <info@gate.on.ca>
Subject: Windows NT Form Mail Response
Message-Id: <37404770.0@lightning.ica.net>

Anybody with an script that response to an email address using WINNT and
exchange or NT mail.

I know there plenty of them for UNIX but there not compatible, willing to
pay.




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

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

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