[9909] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3502 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 21 16:07:23 1998

Date: Fri, 21 Aug 98 13:00:28 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 21 Aug 1998     Volume: 8 Number: 3502

Today's topics:
    Re: 
    Re: binding operator (=~) with variables ? <ckuskie@cadence.com>
    Re: binding operator (=~) with variables ? <Jehan.Procaccia@inapg.inra.fr>
    Re: COBOL and Perl <jdporter@min.net>
    Re: COBOL and Perl <wmklein@ix.netcom.com>
    Re: Code Style (Was: How to sort this associative array <jdporter@min.net>
    Re: Converting to lowecase <jdporter@min.net>
    Re: Followup: why doesn't this work as expected... <jdw@dev.tivoli.com>
    Re: Getting the 500 series error in IIS 4.0 <kgjones@mitre.org>
        Hacking Schools Network doomen@my-dejanews.com
    Re: Hacking Schools Network <strat@pacifier.com>
        Index.pl (Jim Ray)
        License wrt Docs -- how covered? <jdporter@min.net>
    Re: Netscape response to Perl using Front Page extensio lvirden@cas.org
        Perl Bots! [Chatterbots, FAQbots, InfoBots] (Harry McGreggor)
    Re: Perl Docs.. forget the original post <jdporter@min.net>
        Perl doesn't seem to work... ('nother newbie question) <molotov@gmx.net>
    Re: Perl Lex ? Perl Yacc ? <uwe.honekamp@etas.de>
    Re: Perl on linux <tgray@smlny.com>
    Re: perl plea <jdporter@min.net>
        PerlShop Log Problem TimesOnLine@my-dejanews.com
        Prime numbers [was Re: here's an implementation of diff <mgregory@asc.sps.mot.com>
        Problem using CGI.pm for the first time (Francis Fan)
    Re: Problem using CGI.pm for the first time <kgjones@mitre.org>
    Re: Problem using CGI.pm for the first time <ffan@mail.arc.nasa.gov>
    Re: Question: How to <BR> <upsetter@ziplink.net>
        Reading From File <desquite@hotmail.com>
    Re: Send cmd and Receive result from command? <jdf@pobox.com>
        Send file to user <stathy@jaske.com>
    Re: Sigh <jdporter@min.net>
    Re: solaris2.6 problems with h2ph && types.ph lvirden@cas.org
        Test Post 1 - please ignore <ben.pavon@hsc.hac.com>
    Re: what is 'sub f () {555};' Thanks! <jdf@pobox.com>
    Re: Why dont people read the FAQs <mgregory@asc.sps.mot.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 21 Aug 1998 16:59:45 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: 
Message-Id: <6rk921$184$1@news.iastate.edu>

Bob Langdon (webmaster@retailernews.com$%^&*) wrote:
: Hi,

: Sorry if this is the wrong group, but I couldn't find a Majordomo group. 

So do you also ask questions about Netscape in comp.lang.c?


Josh

-- 
Abstractness, sometimes hurled as a reproach at mathematics, is its chief
glory and its surest title to practical usefulness. It is also the source of
such beauty as may spring from mathematics
            - E.T. Bell



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

Date: Fri, 21 Aug 1998 10:29:45 -0700
From: Colin Kuskie <ckuskie@cadence.com>
To: Jehan Procaccia <Jehan.Procaccia@inapg.inra.fr>
Subject: Re: binding operator (=~) with variables ?
Message-Id: <Pine.GSO.3.96.980821094927.19719B-100000@pdxmail.cadence.com>

On Fri, 21 Aug 1998, Jehan Procaccia wrote:

> I want to match a pattern in a string line using a variable as the
> pattern:
> 
> $line="hello disney";
> $line2="hello happydisneyland";
> $var="disney";
> if ($line =~ /$var/)
>     then .... # match is OK :-)  this is what I want
> 
> if ($line2 =~ /$var/)
>     then .... # match is also OK   :-(  this is not what I want
> 
> I want an exact match

1) The answer to this can be found in the perlre manpage.  Read it
carefully.  Consider buying a book or two.  "Learning Perl' has an
excellent introduction to perl regular expressions.  "Mastering
Regular Expressions" is a great text to learn a lot about regexps.

/disney/ will match the character sequence disney _anywhere_ in
the target string.

> I am trying to use pattern matching operators like "starting with" : ^
> operator and "ending with" $ operator but it doesn't seem to work while
> using a variable in the pattern:
> $line =~ /^$var/
> $line =~/^$$var/ .... nothing works :-(

/^$var/ becomes /^disney/ which will match any string that starts
with disney.

> $line =~/^$$var/ .... nothing works :-(

Read the manpages.

Colin Kuskie



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

Date: Fri, 21 Aug 1998 19:25:40 +0200
From: Jehan Procaccia <Jehan.Procaccia@inapg.inra.fr>
To: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: binding operator (=~) with variables ?
Message-Id: <35DDAD94.25C8858F@inapg.inra.fr>



Rick Delaney a icrit:

> [posted and mailed]
>
> Jehan Procaccia wrote:
> >
> > $line="hello disney";
> > $line2="hello happydisneyland";
> > $var="disney";
> [snip]
> > I want an exact match
> >
>
> No, you want a full word match.  For an exact match, you should use eq.
>
>     /\b$var\b/;
>
> Read about the wonderful adventures of \b in perlre.

Unfortunatly it doesn't seems to work :-)

I am showing below the real code I am working with. I am trying to generate
registry files for winnt in order to personnalize a user application
environnment:

#variable affectation
# login name
$login=$ENV{"logname"};

# lower case the login
$login =~ tr/A-Z/a-z/;
$username=$ENV{"fullname"};

# user net home dir
#mutilple \\ are used becuase of regedit files ...
$drive =$ENV{"homedrive"};
$repuser="$drive\\$login";
$repuserreg="$drive\\\\$login";
$repuseradmin= "$repuser\\admin";
$repuseradminreg= "$repuserreg\\\\admin";

%donnees =  (
   "REP-USER-REG-ADMIN","$repuseradminreg",
  "REP-USER-REG","$repuserreg",
  "REP-USER","$repuser",
  );

The following is a sample of a file (X) that is read from perl and I am
affecting a value to each variable on the right side to its defenition
defined above;

[HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Netscape
Navigator\Users\NAV-LOGIN-NAME]
"DirRoot"="REP-USER-REG-ADMIN"

[HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Word\Options]
"DOC-PATH"="REP-USER-REG"

with the following routine:

while ($ligne= <FIN>) {
      foreach $var (keys(%donnees)) {

       if ($ligne =~ $var) {
            $ligne =~s /$var/$donnees{$var}/;
          }
 print FOUT ($ligne);
}

The problem is that when the file (X) is read line by line in $ligne, in
the if statments when perl sees only part of the variable it does the
match, I want him to match only when the whole variable in encontered:
ie when it sees:

"DirRoot"="REP-USER-REG-ADMIN"

and pass throught the REP-USER variable from %donnees (foreach ...) it
match :-(

"DirRoot" is then = to k:\toto-REG-ADMIN :-(

I want him to match only when during the foreach statment it reads in
$ligne and in %donnees the exact same variable and not part of it.

I hope the problem is well define.

Thanks a lot for your help.





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

Date: Fri, 21 Aug 1998 14:37:46 -0400
From: John Porter <jdporter@min.net>
Subject: Re: COBOL and Perl
Message-Id: <35DDBE79.619A@min.net>

Shaun C. Murray wrote:
> 
> In article <35DB2455.1579@min.net>, John Porter says...
> >
> >DavidM wrote:
> >>
> >> IBM will very soon allow COBOL to do everything that JAVA can.
> >
> >It's "Java", for the capslock-impaired out there.
> 
> Better tell Sun. It's JAVA on the front of my 'just JAVA' book though that was
> the JDK 1.0 edition. Maybe they added lower case later. ;-)

Do you think I posted that without validating it first?

Take a little trip to javasoft.com, and tell me what you see.
(Hint: where "JAVA" appears, the entire context is upper-case.
In normal mixed-case contexts, they use "Java".)

-- 
John Porter


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

Date: Fri, 21 Aug 1998 13:47:07 -0500
From: "William M. Klein" <wmklein@ix.netcom.com>
Subject: Re: COBOL and Perl
Message-Id: <6rkfeb$kqc@sjx-ixn6.ix.netcom.com>

I am posting this to both the COBOL and the Perl newsgroup - but it is
really targeted at the COBOL one (and anyone in the Perl NG - who cares).

As those who follow C.L.C know, I am the greatest defender of ANYONE being
able to post ANYTHING to C.L.C.  I also am a strong defender of "read the NG
charter for historical amusement ONLY".  However, I did think that I would
point out, that the one and only thing that the comp.lang.cobol charter says
that is NOT welcome in the NG is "language wars".  I don't think that this
was a statement trying to encourage censorship - but rather to avoid
futility.

Having said that, I know a lot about COBOL and almost nothing about Perl.
Therefore, I have been following the debate (discussion? diatribes?) back
and forth in the hope that I might read something that would give me some
understanding about the differences and what Perl offers (that is harder or
impossible in COBOL).  I have seen a few posts like this, but they sure are
in the minority.

Is there anyone in either NG who actually makes their living today with both
COBOL (the current variation, not some pre-ANS'85 archaic version) and also
Perl who can give a *brief* comment on when they use which and what types of
constructs or applications are better in one than the other?  My guess is
that the major difference on when you use which is dependent on what your
management wants, what your shop is used to, and/or what an existing
application is already expecting.   However, if there are some real
differences (that someone who works with both today) can tell me, then I
would be interested in this.





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

Date: Fri, 21 Aug 1998 14:27:51 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <35DDBC27.69E3@min.net>

Zenin wrote:
> 
>     I'd use this:
> 
>         for (
>             map { $_->[0] }
>             sort { $b->[1] <=> $a->[1] } # descending numaric
>             map { [ $_, (split (',', $team{$_})[3] ] }
>             keys %team
>         ) {
>             ## Insert nifty code here
>         }

Thank you, Zenin!  Great minds think alike. ;-)

Although, for ST-type multi-liners, I usually align the lbrace too:

	map  { $_->[0] }
	sort { $b->[1] <=> $a->[1] } # descending numeric
	map  { [ $_, (split (',', $team{$_})[3] ] }

-- 
John Porter


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

Date: Fri, 21 Aug 1998 13:53:26 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Converting to lowecase
Message-Id: <35DDB416.5A3C@min.net>

Scott Erickson wrote:
> 
> Previously, Jonathan Feinberg wrote:
> >If you can use perl, then you can use perldoc, since they're both in
> >your PATH.  If you can use perldoc, then you've got the entire manual
> >at hand, including all of the FAQs.
> 
> Not necessarily true. The sysadmin who installed Perl on my system,
> for whatever reason, did not install perldoc. Eventually it was
> installed, but, please, do not assume that if you have perl, you have
> perldoc

Sorry.  It is appropriate and correct to assume that your
installation of Perl is not broken.   It may *be* broken,
but it is still appropriate to assume (lacking knowledge
to the contrary) that it is not.

-- 
John Porter


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

Date: 21 Aug 1998 10:31:55 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: Followup: why doesn't this work as expected...
Message-Id: <obpvduic5w.fsf@alder.dev.tivoli.com>


newsgrp@business-heaven.com writes:
> Thanks for the replies, the main issue being that tr doesn't use regular
> expressions.
> 
> Am I right is assuming that the following commands are equivalent. ie both
> escape all the .'s in a string.

nope

> $_ = "a.b.c"  trying to produce $_ = "a\.b\.c"
> 
> $_=~s/\./\\\./g;

That looks right, but you might want to use different delimiters, to
make it more readable:

s[\.][\\\.]g;  # actually not much better... :)

> is the same as
> 
> $_=~tr/./\./;

tr|.|\.|; is still just counting periods...

you might want to look at the perlop manpage.

Consider the following example:

$_ = "ab aa bb";
s/ab/cd/g;
print "$_\n";

$_ = "ab aa bb";
tr/ab/cd/;
print "$_\n";
__END__
cd aa bb
cd cc dd

notice how the regular expression matched, ab and replaced it with cd,
but tr translated all a's to c's and all b's to d's.....  

enjoy...

-- 
Jim Woodgate 
Tivoli Systems
E-Mail: jdw@dev.tivoli.com


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

Date: Fri, 21 Aug 1998 14:48:57 -0400
From: "Ken Jones" <kgjones@mitre.org>
Subject: Re: Getting the 500 series error in IIS 4.0
Message-Id: <6rkfbe$r5f@top.mitre.org>

Chris-
    Couple of ideas.

    What version of Perl are you running?  Some versions (ActiveState, for
example) do not include the CGI.pm module in the build.  You have to go to
MIT's Genome Database Project webpage or to the page associated with Larry
Stein's new book on CGI.pm.  If needed I can dig up the specific URLs.

    When you say you associated .cgi with Perl.exe, was that done in the
Registry or through the options in Windows NT Explorer?  If not in the
Registry, you'll have to do a script mapping so that the web server process
knows what to do with a .cgi file.  I can give you the details on this also.

    Last thing is in the IIS 4.0 Administration Snap-In.  Have you granted
script or execute access to the directory?  Also recommend that you separate
readable files (.html/.htm, etc) from executable files for security reasons.

Ken


>I'm having a problem running CGI scripts properly. We are running a web
server
>from IIS 4.0, part of BackOffice for Small Business. I have my CGI scripts
>located in the \INETPUB\SCRIPTS directory with Everyone Full Control. I
>associated .CGI with PERL.EXE and they are located in the same directory.
The
>library file CGI has the extension .CGI. The script I am trying to run is:
>
> # CGI script using CGI.pm module.

>
>I have tried renaming files, putting them in different locations and the
>like. And I verified that IIS 4.0 had the directory listed in the WWW
>settings.  Does anyone have any ideas?
>
>Thanks,
>Chris





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

Date: Fri, 21 Aug 1998 17:43:12 GMT
From: doomen@my-dejanews.com
Subject: Hacking Schools Network
Message-Id: <6rkbjg$u4q$1@nnrp1.dejanews.com>

<>>>>>>)(>Do anyone know how hack my schools network?

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


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

Date: Fri, 21 Aug 1998 12:32:00 -0700
From: "Christian Brink" <strat@pacifier.com>
Subject: Re: Hacking Schools Network
Message-Id: <35ddcd20.0@news.pacifier.com>


doomen@my-dejanews.com wrote in message <6rkbjg$u4q$1@nnrp1.dejanews.com>...
><>>>>>>)(>Do anyone know how hack my schools network?


Yes, I'm quite sure some people do.






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

Date: Fri, 21 Aug 1998 17:39:18 GMT
From: james.a.ray2@boeing.com (Jim Ray)
Subject: Index.pl
Message-Id: <MPG.104750a19767d465989689@news.boeing.com>

I need a  perl script that will create a linkable list 

Example

Top
  SubDir
     Files
     Files
        SubDir
           Files
           Files
  SubDir
     Files
     Files
        SubDir
           Files
           Files

Each one of these need to have a link attached to them.  Does anyone have 
any suggestions?

Thank You.

Jim Ray


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

Date: Fri, 21 Aug 1998 14:14:32 -0400
From: John Porter <jdporter@min.net>
Subject: License wrt Docs -- how covered?
Message-Id: <35DDB908.4197@min.net>

Michael Genovese wrote:
> 
> On many of our systems here, until quite recently, we had the main
> perl executable and debugger and little else. NOT the docs or perldoc or
> many of the various packages/libraries.  This problem is (slowly) being
> fixed, but there are still "incorrectly installed" perls on some of
> our systems. (*sigh*)

This seems to me to be a violation of the licensing, possibly.

Here's my question for the experts:

Is the documentation (not including the *faq* and *toot* files)
considered part of the "source code", in the language of the licenses?
And is deleting a doc file entirely considered a type of "modification",
and if so, where would one note that in the modified documentation?

-- 
John Porter


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

Date: 21 Aug 1998 18:14:44 GMT
From: lvirden@cas.org
Subject: Re: Netscape response to Perl using Front Page extensions
Message-Id: <6rkdek$rg$1@srv38s4u.cas.org>


According to Fish <fish@civl.port.ac.uk>:
:I have a strange thing happening that I would love someone to have ..

:Submitting a form to a Perl script on an NT machine running Front Page
:extensions and (I think) IIS 4.0 results in the browser asking the client if
:he wants to save the results to file, popping up a Windows Save dialog box,
:rather than printing the form results to the browser direct. This doesn't
:happen using IE3 or IE4, but seems to happen with Netscape 3.01 or
:Communicator. Any ideas?

I am redirecting this to another newsgroup.

This doesn't appear to be perl related.  However, I also just had
something similar happen.  In my case, I don't know for certain the
type of server (it's cooltext.com ).  However, I first got a
Communicator 4.5 Save File dialog box open for a FormMail.pl form.
Then I get email indicating that apparently the form had triggered somehow.


Very strange behavior.
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Fri, 21 Aug 1998 23:21:08 GMT
From: harry@dublin.net (Harry McGreggor)
Subject: Perl Bots! [Chatterbots, FAQbots, InfoBots]
Message-Id: <35ddfca9.67705330@news.netcom.ca>

Hi!

I was wondering if anyone out there would like to share some perl
source code (related to bots, e.g infobots, faqbots, chatterbots etc)

Over the past few days I have been playing around with the Eliza
plugin module for Perl. Has anyone used the Eliza module to create
anything useful? While the Eliza module is a pretty good example of a
Perl ChatterBot, it seems rather limited in it's capabilities.

I hope to create a new Chatterbot which will be taught a group of
topics ranging from HTML to Perl - Hopefully the new Chatterbot to be
slightly more intellignet then Eliza :)

How difficult would it be for a Chatterbot to broaden it's knowledge
on a subject by pooling the resources of other databases? (such as
search engines, searchable FAQ's, databases, etc)

Well, if anyone can point me to some information regarding the
creation of Perl Bots I'd really appreciate it!

Cheers,


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

Date: Fri, 21 Aug 1998 13:46:42 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Docs.. forget the original post
Message-Id: <35DDB282.464A@min.net>

Simon Wistow wrote:
> 
> Some of us with window boxes don't have grep either (now there's an
> idea, hmmmm);

So what. Don't you have "Find: Files or Folders..." ???

-- 
John Porter


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

Date: 21 Aug 1998 17:01:55 GMT
From: "Mr. Molotov" <molotov@gmx.net>
Subject: Perl doesn't seem to work... ('nother newbie question)
Message-Id: <6rk963$kg4@news.euro.net>

Hi!

Once again, Perl doesn't work. I'm running Windows 98, Internet Explorer 4
and I've installed ActivePerl 5.02. The install-procedure runs okay, no
problems. Autoexec.bat is changed, after rebooting, the path settings seems
to be correct. But when I start the Online Documentation and then
"Examples", no examples work! For one thing, when I hit "View source" I get
the message: "HTML Source for: error in filename", in other words, it seems
that he can't find some files (source I guess?) to execute/run. Can someone
help me? Any help would be great! Thank!

M




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

Date: 21 Aug 1998 05:55:20 GMT
From: "Uwe Honekamp" <uwe.honekamp@etas.de>
Subject: Re: Perl Lex ? Perl Yacc ?
Message-Id: <01bdccc8$446001b0$931a0180@fe13803>

Damian Conway <damian@cs.monash.edu.au> wrote =
<6rhg5g$v9m$1@towncrier.cc.monash.edu.au>...

> As RecDescent's proud father, I'd really like to know what you =
perceive
> to be it's "traps", and why you've found it hard to work with (I'd=20
> naturally like it to be trap-free and friendly instead :-)

Sorry, when I wrote "traps" I was thinking about the time I spent
while understanding how the module works. It took me some time
playing with tiny examples, you know. =20
My comment wasn't meant as a flame anyway :-)


> For example, many people will write this:
>=20
> 	list: elem list
> 	    | elem
>=20
> instead of:
>=20
> 	list: elem(s)
>=20
> which may be orders of magnitude faster for long lists!

Agreed, of course.

> PS: You may also want to check out the recently released Parse::Yapp =
by
>     Francois Desarmenien, which is as close to a native Perl lex/yacc
>     as you're ever likely to want.

Maybe next time. I'm not going to reimplement the grammar for my
current project. After all, Parse::RecDescent does the job.

--

Uwe Honekamp * ETAS GmbH * Borsigstr. 10 * D-70469 Stuttgart =20
uwe.honekamp@etas.de * voice: ++49/(0)711/89661-143 * fax: -107



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

Date: Fri, 21 Aug 1998 15:31:30 -0400
From: "Tim Gray" <tgray@smlny.com>
Subject: Re: Perl on linux
Message-Id: <6rkhuj$fkg$1@m5.stny.lrun.com>

By default most UNIX systems do not put the current directory in your path
for security reasons.
Try running the script using its full path name or ./scriptname

Kevin Thorley wrote in message <6rk1bm$o7n@nnrp2.farm.idt.net>...
>Hi!  I've been writing perl scripts for awhile on Win95, but recently
>decided to install linux on my computer.  Now I can't even get a
>simple script to run!  Perl is located at /usr/bin/perl, but when I
>add this command as the first line of the script, it doesn't work :
>#!/usr/bin/perl.  The error message says something like program not
>found. When I run the following from the command line though, it works
>great:
>
> /usr/bin/perl perltest.pl
>
>Whats going on here?  i didn't install perl myself, it came with the
>RedHat 5.1 installation.  Any ideas?
>
> Kevin Thorley
> kthor@idt.net
>




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

Date: Fri, 21 Aug 1998 15:28:46 -0400
From: John Porter <jdporter@min.net>
Subject: Re: perl plea
Message-Id: <35DDCA6E.4068@min.net>

dj_adams8620@my-dejanews.com wrote:
> 

In addition to the advice you got from others
(which basically boils down to 
	use CGI::Carp qw(fatalsToBrowser);
and to include $! in die messages),

You could seriously stand to clean up your code.
Learn to use multi-line prints -- you don't need
a separate call the the print() function for each
line, you know.
Learn to use qq().

if ( /<!--begin-->/ ) {
  print PAGE qq{
    <tr>
      <td width="100%"
          colspan="2"
          bgcolor="C0C0C0"
          bordercolor="FFFFFF"
          bordercolorlight="FFFFFF"
          bordercolordark="FFFFFF"
      >
        <small><font face="Arial">
          <strong>
            [$subject]
          </strong>
            -
          <strong>
            [<a href="mailto:$email">$usrname</a>]
          </strong>
            -
          <strong>
            $time
          </strong>
        </font></small>
      </td>
    </tr>

    <tr>
      <td width="100%" colspan="2">
        <small><font face="Arial">
          [$comments]
        </font></small>
      </td>
    </tr>
    <tr>
      <td width="100%">
        &nbsp;
      </td>
    </tr>

    <!--begin-->
  };


print <<EOH;
Content-type: text/html

<html>
<head><title>thanks</title></head>
<body>
  Your comment was added to $html_page successfully, 
  and you will receive an e-mail confirming this!
  Please click 
  <a href="http://domain.com/directory/$path/board.htm">here</a>
  to return to the message board.
  Thanks for your parcipitation!
</body>
</html>
EOH

print MAIL <<EOM;
To: $usrname <$email>
From: domain BBS <$myemail>
Subject: your comment on the webboard

Thank you for your recent entry on the BBS
Your entry can be viewed at the following URL:

$html_page

You may need to refresh the page in your browser in order to 
see the change If you need assistance, please contact $myemail
EOM

And so on. You get the idea.

-- 
John Porter


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

Date: Fri, 21 Aug 1998 18:32:10 GMT
From: TimesOnLine@my-dejanews.com
Subject: PerlShop Log Problem
Message-Id: <6rkefa$2de$1@nnrp1.dejanews.com>

I have installed PerlShop (from arpanet.com) on my virtual (NT) site and it
works fine so far, except for the log files.

I have setup the same script on a UNIX and the log files work flawlessly, the
directory structures are identical so that can't be it. The NT version has no
problem creating new tokens, customer, or temp files but the order log and
search log don't want to function.

The script runs fine, creates the pages, the cookies etc. but after the page
is loaded the script continues to run until the server times it out. There is
no error message.

Anyone have any ideas?

Help!

TIA

--

Chris, Web Admin.
The Times OnLine, Minden             http://wwww.mindentimes.on.ca
Haliburton Highlands and Northern Victoria County news, sports and
community information online.
ICQ#2679667


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


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

Date: 21 Aug 1998 14:51:09 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Prime numbers [was Re: here's an implementation of diff in perl]
Message-Id: <r8zpcyvrju.fsf_-_@asc.sps.mot.com>


abigail@fnx.com (Abigail) writes:
> -- 
> perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'

Is this some well known trick for detecing prime numbers?

How does it work?

Thanks,

Martin.


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

Date: 21 Aug 1998 17:23:15 GMT
From: ffan@itsa.ucsf.edu (Francis Fan)
Subject: Problem using CGI.pm for the first time
Message-Id: <6rkae3$ovk@itssrv1.ucsf.edu>

Hi, 

I was trying to use CGI.pm for the first time but it is not working.
My script is,
#!/usr/bin/perl -w

use CGI qw/:standard/;

print   start_html('Vegetables');
print   h1('Eat your vegetables');
print   hr;
print   end_html;

But when I run, it gave me this -
torrey:~/public_html>t.cgi
(offline mode: enter name=value pairs on standard input)

And I have to usr Ctrl-C to escape it.
But if I comment the "print start_html('Vegetable');"
it worked, and the output is this -
torrey:~/public_html>t.cgi
<H1>Eat your vegetables</H1><HR></BODY></HTML>torrey:~/public_html>

So could anyone help me with this? Is there any setting I should do
on the machine?

Thanks.


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

Date: Fri, 21 Aug 1998 14:54:19 -0400
From: "Ken Jones" <kgjones@mitre.org>
Subject: Re: Problem using CGI.pm for the first time
Message-Id: <6rkflh$r7o@top.mitre.org>

Francis-

    Did you execute this script through an HTTP connection using a browser
and not the command line?  If so, all you are missing is the http header for
the server to pass to the browser.  Add a line "print header();"  before
your "print start_html..." line.  Should fix the problem.

Ken

Francis Fan wrote in message <6rkae3$ovk@itssrv1.ucsf.edu>...
>Hi,
>
>I was trying to use CGI.pm for the first time but it is not working.
>My script is,
>#!/usr/bin/perl -w
>
>use CGI qw/:standard/;
>
>print   start_html('Vegetables');
>print   h1('Eat your vegetables');
>print   hr;
>print   end_html;
>
>But when I run, it gave me this -
>torrey:~/public_html>t.cgi
>(offline mode: enter name=value pairs on standard input)
>
>And I have to usr Ctrl-C to escape it.
>But if I comment the "print start_html('Vegetable');"
>it worked, and the output is this -
>torrey:~/public_html>t.cgi
><H1>Eat your vegetables</H1><HR></BODY></HTML>torrey:~/public_html>
>
>So could anyone help me with this? Is there any setting I should do
>on the machine?
>
>Thanks.




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

Date: Fri, 21 Aug 1998 12:14:59 -0700
From: Francis Fan <ffan@mail.arc.nasa.gov>
Subject: Re: Problem using CGI.pm for the first time
Message-Id: <35DDC733.19C7B636@mail.arc.nasa.gov>

Ken Jones wrote:

> Francis-
>
>     Did you execute this script through an HTTP connection using a browser
> and not the command line?  If so, all you are missing is the http header for
> the server to pass to the browser.  Add a line "print header();"  before
> your "print start_html..." line.  Should fix the problem.
>
> Ken
>

  No, actually I was running from the command line. Since I want to make it
as simple as possible so I removed the print header part.
  I think it has some thing to do with the "sub self_or_default()" in CGI.pm
but I couldn't figure what caused it.

--Francis



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

Date: 21 Aug 1998 17:43:44 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Question: How to <BR>
Message-Id: <6rkbkg$j5j@fridge.shore.net>

Alex Kovalenko <techsoft@abcpages.com> wrote:
: Hi there,

: I was just wondering, I have this comment using textarea, and is there
: any idea how I can check if the user press enter (break the line) and
: use <br> or <p> instead of #13 (or whatever it is in UNIX)?

It sounds like you want to use a regular expression to check for the
existence of a newline in your data, and substitute an html tag. Check 
perldoc perlre (or man perlre) for further info.

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Fri, 21 Aug 1998 15:51:01 -0400
From: "DesQuite" <desquite@hotmail.com>
Subject: Reading From File
Message-Id: <U8lD1.9$YI.2922138@news.asheboro.com>

Ok, sorry to keep troubling some of you.  I've received responses to my
other messages and I'm very grateful.  I've had troubles with the code given
to me b/c I don't think I explained exactly what I needed.  But I did get
what I asked for.

I'm writing to a file that has 3 different sections.  I've put a header like
section1, section2, etc. at the beginning of each change of section.  I need
the sections to be stored in different variables as a word list probably b/c
here's what I've done.

section1
text
text
section2
text1[]text2[]text3[]
text4[]text5[]text6[]
section3
text1[]text2[]text3[]

I can split section2 & 3 if I can just read it back from the file correctly.
I have a loop that makes a table in html format with each text part of
section2 &3 in a cell after I read all of the values in.  I can't quite tell
the computer to read back the values in a way I can manipulate them.  Please
help if you can.  Thanks for your help everyone.  I appreciate all of your
patience with all of us less experienced programmers.




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

Date: 21 Aug 1998 15:57:04 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Send cmd and Receive result from command?
Message-Id: <ogtecau7.fsf@mailhost.panix.com>

8\(F&@ <versace@gianni.com> writes:

> open (CMD, "|$CMD|");

You need to read perlipc, the section entiitled "Bidirectional
Communication with Another Process", and perlfaq8, "How can I open a
pipe both to and from a command?".

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Fri, 21 Aug 1998 13:02:49 -0500
From: Stathy Touloumis <stathy@jaske.com>
Subject: Send file to user
Message-Id: <35DDB649.CDBA5190@jaske.com>

Hi,
	I have a script that verifies a user.  I would now like to be able to
send that user a file through a web browser out of the the web servers
path.  Is there an easy way to do this?  I tried just opening the file
and printing out the contents but it then named the file the name of the
script.  I would like to retain the name of the file.

Thanks


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

Date: Fri, 21 Aug 1998 14:33:18 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Sigh
Message-Id: <35DDBD6E.3E18@min.net>

Adam Rabung wrote:
> 
> I retire from this newsgroup.

Pity.

> It seeming consists only of
>     1.  Beginning programmers who are too lazy to type "man"
>     2. Seasoned, angry programmers ready to pounce on anyone,
> brandishing references to endless reams of faqs, man pages, and web
> pages.

Sure.  And #2 follows from #1.  Find some magical way to reduce/
eliminate #1, and you'll see #2 drop off as well.

Besides, if this ng seems to consist only of these two things,
then it's only because you're missing the good stuff, due to
the signal-to-noise ratio; but the good stuff is here, to be sure.


> Why have seemingly all of the programmers who actually know Perl
> appointed themselves to be the Universal Stewards of Moral
> Rightousness?

Again, if it seems this way to you, then perhaps your vision is
limited or distorted somehow.

-- 
John Porter


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

Date: 21 Aug 1998 18:19:44 GMT
From: lvirden@cas.org
Subject: Re: solaris2.6 problems with h2ph && types.ph
Message-Id: <6rkdo0$11l$1@srv38s4u.cas.org>


According to  <timh@pasport.press.net>:
:perl 5.004_04

:Using h2ph translates this to types.ph line #84

There's been a lot of fixes to h2ph since that version of perl was released.
The current version translates this:
        eval 'sub P_MYPID () {(0);}' unless defined(&P_MYPID);


-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: Fri, 21 Aug 1998 11:46:59 -0700
From: Ben Pavon <ben.pavon@hsc.hac.com>
Subject: Test Post 1 - please ignore
Message-Id: <35DDC0A3.804C6C5C@hsc.hac.com>

Doing a test. Had problems posting a reply.



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

Date: 21 Aug 1998 15:27:13 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
Subject: Re: what is 'sub f () {555};' Thanks!
Message-Id: <u336cc7y.fsf@mailhost.panix.com>

Jerome O'Neil <joneil@cks.ssd.k12.wa.us> writes:

> > kortbein@iastate.edu (Josh Kortbein) writes:
> > 
> > >: sub f () {555};

> Despite the RTFM flames, CGI off topic posts and other assorted noise
> here, I must say that this is EXACTLY why I read this newsgroup.  Today,
> this thread taught me a new trick, and I will be using in my code soon.

Why not use the "constant" pragma, which has the benefits of constant
functions (since that's how it's currently implemented), with the
additional benefit of being self-documenting.

  use constant RWXR_XR_X => 0755;

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: 21 Aug 1998 14:48:30 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Why dont people read the FAQs
Message-Id: <r83eaqx68p.fsf@asc.sps.mot.com>


Alan Silver <alan@find-it.furryferret.uk.com> writes:

> In article <ant171908b49Rr9i@waveney.demon.co.uk>, Richard Proctor
> <Richard@waveney.demon.co.uk> writes
> >0) People cant read (if so why are they writing)
> 
> Ah, a pure scientist. Who else would have the elagance of taste to start
> counting at zero ?

An engineer.  Only computer scientists, and some mathemeticians, count
from 1.

Martin.


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

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


Administrivia:

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

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


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3502
**************************************

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