[11782] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5382 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 14 14:07:29 1999

Date: Wed, 14 Apr 99 11:01:40 -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           Wed, 14 Apr 1999     Volume: 8 Number: 5382

Today's topics:
    Re: $variables in <FILES> (Bart Lateur)
    Re: $variables in <FILES> (Larry Rosler)
    Re: Best books to use... (Randal L. Schwartz)
    Re: CGI embedded in html (Steve Linberg)
    Re: CGI.pm and cookie <gregm@well.com>
    Re: convert IP to country of origin richard@nova.eri.net
    Re: Current Date (Steve Linberg)
    Re: Current Date <gellyfish@gellyfish.com>
    Re: Current Date (Sam Holden)
    Re: DBI as a Base Module <gellyfish@gellyfish.com>
    Re: FAQ 1.1: What is Perl? <sternji@mail.northgrum.com>
        getting mm/dd/yy from localtime() (RemarQ User)
        Grabbing Link Text with HTML:LinkExtor rpearse@my-dejanews.com
    Re: HELP Needed with CGI-PERL on apache 1.3.3 <kperrier@blkbox.com>
        Help with JAVASCRIPT-PERL variables (Alfred J. Manno)
        how do I match all the "1"s in strings like 231451,3132 <same@minspring.com>
        IPC left overs <ryanpc@my-dejanews.com>
    Re: Is it possible to have "..." appear while processin (M.J.T. Guy)
    Re: like print <<...; load a variable? (Tad McClellan)
    Re: Looking for Tutoral Referenced in the Perl Cookbook (Daniel Beckham)
    Re: mailer script question <gellyfish@gellyfish.com>
        Mod_Perl for NT <matt@godzilla.tamu.edu>
        Omaha Perl Mongers Meeting (Patrick Timmins)
    Re: Password encryption (Bart Lateur)
    Re: Perl and MS Access <riche@ix.netcom.com>
    Re: Perl or C? (Randal L. Schwartz)
        perl question... ordering from dbm <terral@cyberplex.com>
    Re: Printing a file <cassell@mail.cor.epa.gov>
    Re: Problem with my & local declarations (Mike Mckinney)
    Re: Problem with my & local declarations (Mike Mckinney)
    Re: Q: Convert two newlines to \n<p> (Abigail)
    Re: Q: Convert two newlines to \n<p> (Abigail)
    Re: Q: Hash tables!!! <cassell@mail.cor.epa.gov>
        Randomize Please Help <dixonmat@pouch.com>
    Re: regex - meta char's (Bart Lateur)
    Re: SQL using the ODBC module (Gus)
    Re: Unitialized var errors & -w flag (Larry Rosler)
    Re: what does this error msg mean? (M.J.T. Guy)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 14 Apr 1999 16:12:38 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: $variables in <FILES>
Message-Id: <3718bdcc.5817051@news.skynet.be>

Tim Herzog wrote:

>while(<FILE>) {
>  foreach $key(%macros) {
>     s/\$$key/$macros{$key}/g;
>  }
>
>  print "$_";
>}

Ouch. What if one of the values you insert is '$blah', and $macros{blah}
exists too. You'd better do a single pass substitution to avoid that.
Plus, this solution is a LOT faster.

 while(<FILE>) {
   s/\$(\w+)/$macros{$1}/g;
   print "$_";
 }

	Bart.


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

Date: Wed, 14 Apr 1999 10:48:48 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: $variables in <FILES>
Message-Id: <MPG.117e74d9ae14cf649898ad@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7f28o4$9cq$1@nnrp1.dejanews.com> on Wed, 14 Apr 1999 
14:29:35 GMT, TimeSpinner@hotmail.com <TimeSpinner@hotmail.com> says...
> Is it possible to have a file which contains the text:
> 
> Hello, my name is $name.
> My address is $address.
> 
> and have a Perl Script read this file, and print it, automatically
> substituting the $name and $address variables in?
> 
> I've tried reading in the file, and processing the @array printing each line,
> but it didn't do the interpolation, so I am guessing that while it reads in
> the file, it's somehow changing the $name into \$name.
> 
> Is there anyway around this?

perlfaq4:  "How can I expand variables in text strings?"

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


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

Date: 14 Apr 1999 10:49:32 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Best books to use...
Message-Id: <m1g1632itv.fsf@halfdome.holdit.com>

>>>>> "Doug" == Doug Crabtree <not@gonna.tell> writes:

Doug> I am new to perl, and am wondering where to start.  I have
Doug> bought a book called "Perl5 by example (David Medinets)".  It
Doug> seems to be a book that will give me a good foundation for basic
Doug> use.  I have heard good things and bad things about Randall's
Doug> "Learning Perl (2nd ed.)".

I was gonna ask you in private "what bad things", but you mangled your
return address.  Please don't do that.  So now I'll have to ask in
public.  <sigh> I'm always open to criticism on my works... in hopes
that my next work will be better.

-- 
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: Wed, 14 Apr 1999 12:04:32 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: CGI embedded in html
Message-Id: <linberg-1404991204320001@ltl1.literacy.upenn.edu>

In article <7evasj$3fk$1@beta.infotech.nl>, mkretsch@infotech.nl (Milko
Kretschmann) wrote:

> I tried this but it doesn't work. Can you give a short example how it should 
> work ?

Well, as I said in my other post
(<linberg-1204991737080001@ltl1.literacy.upenn.edu>), it's really not a
good idea to broadcast it, because it's a hack, and one that will get you
in trouble if your admin finds out.  It's usually used to circumvent
sysadmins that don't allow SSI for security reasons.

I don't mean to be obstructive, but dig around on deja news and you'll
find it, if you really want to go there.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: Wed, 14 Apr 1999 09:56:44 -0700
From: Greg McCann <gregm@well.com>
Subject: Re: CGI.pm and cookie
Message-Id: <3714C8CC.1C489826@well.com>

Donny Widjaja wrote:
> 
> I need to write a cgi program in PERL that write a cookie.  I know that
> the newest CGI.pm has Cookie.pm.  I have downloaded the newest CGI.pm,
> but I can't install it because there is an older version of CGI.pm in
> the root directory.  I am running a FreeBSD virtual server.
> Does anybody know how to write a cookie by using CGI.pm ver 2.36?  Or
> where can I get more information on writing a cookie by using CGI.pm or
> other module if not too complicated?

No modules necessary.  You can write a simple cookie with...

# send HTML header
print "Content-type: text/html\n";
print "Set-Cookie: my_cookie=$cookie_text; path=/\n\n";

See cookie documentation for setting other cookie options, like expiration time.

Greg

-- 

======================
Gregory McCann
http://www.calypteanna.com

"Be kind, for everyone you meet is fighting a great battle."  Saint Philo of
Alexandria


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

Date: 14 Apr 1999 17:53:36 GMT
From: richard@nova.eri.net
Subject: Re: convert IP to country of origin
Message-Id: <7f2kn0$ptr$1@news.erinet.com>


Yeah.. they do.  That's why you can't download the strong encryption stuff
if your reverse DNS hasn't been set up or is broken.  If they can't look
at an IP and know that it is coming from a US domain, they will not allow
the download.

But it isn't because they see 207.0.229.11 as being assigned out of some
regional specific block.  They look at the IP, resolve it to
'shell.erinet.com' and say, "Okay, that domain is acceptable," and permit
the file transfer.

-Richard.




Peter L. Berghold <Peter@Berghold.Net> wrote:
> In article <brian-ya02408000R0804991246540001@news.panix.com>, brian@pm.org 
> says...

>>
>>not as a standard it doesn't, but you can tell who is assigned 
>>which IP blocks.  Netscape does this to track where their 128 bit
>>software goes :)
> Brian,

> Don't they do some sort of whois lookup and process off of that? Now that I've 
> seen the original post, I'm intrigued with the problem....


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

Date: Wed, 14 Apr 1999 12:08:58 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Current Date
Message-Id: <linberg-1404991208580001@ltl1.literacy.upenn.edu>

In article <7f2dfn$45b$1@bignews.fundy.net>, "Terra Landry"
<terral@cyberplex.com> wrote:

> I know this has nothing to do with perl, but I'm hoping someone can help me
> anyway...

<snip>

> I want to get the current date in javascript.. 

<snip, with gusto>

> Thanks, and sorry that this isn't a perl question..

*boggle*

Why on EARTH don't you ask your javascript question in
comp.lang.javascript?  Do you ask how to change the oil in your car in
rec.gardening?

Please, please, use the appropriate groups.  Doing so is a Good Thing
(tm).  We programmers try to *increase* the amount of order in the
universe, not add to the chaos.

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: 14 Apr 1999 17:09:36 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Current Date
Message-Id: <3714bdc0.0@newsread3.dircon.co.uk>

In comp.lang.perl,misc Terra Landry <terral@cyberplex.com> wrote:
> I know this has nothing to do with perl, but I'm hoping someone can help me
> anyway...
> 
> I want to get the current date in javascript.. but in my books it says that
> it will only return a 2 digit value for the year... is there any way I can
> get a 4 digit value for the year? The only thing I can find is using the
> date object, but that doesn't seem to work!!
> 
> Thanks, and sorry that this isn't a perl question..
> 

If you knew it had nothing do with Perl why did you post to c.l.p.misc when
there is a perfectly workable Javascript group.

Crossposted and followups-set appropriately

-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: 14 Apr 1999 16:16:13 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Current Date
Message-Id: <slrn7h9fqc.ag5.sholden@pgrad.cs.usyd.edu.au>

On Wed, 14 Apr 1999 12:47:51 -0300, Terra Landry <terral@cyberplex.com> wrote:
>I know this has nothing to do with perl, but I'm hoping someone can help me
>anyway...

So you ask in a perl newsgroup anyway...
>
>I want to get the current date in javascript.. but in my books it says that
>it will only return a 2 digit value for the year... is there any way I can
>get a 4 digit value for the year? The only thing I can find is using the
>date object, but that doesn't seem to work!!

I don't know, and I don't really care. Just add a '20' on the front. Sure
it won't work this year, but it will work for one hundred years after that
which is hopefully much longer than javascript will be around...

>
>Thanks, and sorry that this isn't a perl question..

But still you ask it in a perl newsgroup...

Do you do this a lot?

When you need some bread do you go to the optometrist and ask them
for some? When you want a new hard drive do you go and ask the
the McDonalds for one?

-- 
Sam

Basically, avoid comments. If your code needs a comment to be
understood, it would be better to rewrite it so it's easier to
understand.	--Rob Pike


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

Date: 14 Apr 1999 17:05:14 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBI as a Base Module
Message-Id: <3714bcba.0@newsread3.dircon.co.uk>

In comp.lang.perl.misc Sys Adm 89806 Manager of programing development and Intranet Resources <ruben@llinderman.dental.nyu.edu> wrote:
> 
> I'm fairly perplexed at what is happening.  I tried to specifiy the path and    
> diagnostics told me I didn't have permissions??
> 
> Without the path, it says it can't find any such module.
> 
> This small code, for example:
> #!/usr/bin/perl -w
> use SQLHANDLE;
> use diagnostics; 
> $ref = new SQLHANDLE('SELECT * FROM patients');
> print $ref->statement();
> $dbh = $ref->connect("DBI:mysql:ezpages:localhost", 'someuser','somepasswd') or 
> print "Sorry DB DOWN";
> 
> Produces this output:
> 
>  /home/ruben/myootest.pl
> Can't exec "DBI": No such file or directory at /usr/lib/perl5/SQLHANDLE.pm line 
> 2.
> Name "main::dbh" used only once: possible typo at /home/ruben/myootest.pl line
>         6 (#1)
>     
>     (W) Typographical errors often show up as unique variable names.
>     If you had a good reason for having a unique name, then just mention
>     it again somehow to suppress the message.  The use vars pragma is
>     provided for just this purpose.
>     
> SELECT * FROM patientsCan't locate object method "connect" via package "SQLHANDL
> E" at
>         /home/ruben/myootest.pl line 6 (#2)
>     
>     (F) You called a method correctly, and it correctly indicated a package
>     functioning as a class, but that package doesn't define that particular
>     method, nor does any of its base classes.  See perlobj.
>     
> Uncaught exception from user code:
>         Can't locate object method "connect" via package "SQLHANDLE" at /home/ru
> ben/myootest.pl line 6.
> 
> 
> Any clues as to what I am doing wrong?
> 

Have you got:

require DBI;
@ISA = qw(DBI);

in your SQLHANDLE module ?

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



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

Date: Wed, 14 Apr 1999 16:36:11 GMT
From: "James M. Stern" <sternji@mail.northgrum.com>
Subject: Re: FAQ 1.1: What is Perl?
Message-Id: <3714C3FB.4BB9220E@mail.northgrum.com>

Tom Christiansen wrote:
> 
> (This excerpt from perlfaq1 - General Questions About Perl
>     [...]
>   What is Perl?
> 
>     Perl is a high-level programming language with an eclectic
>     heritage written by Larry Wall and a cast of thousands. [...]

Just a nit:  Grammatically, it's unclear whether Larry and the cast of
thousands wrote the language or the eclectic heritage.

English syntax has almost as many pitfalls as Perl's.  :-)

-- 
James M. Stern                Northrop Grumman Corp.  Hawthorne, CA
Opinions expressed above are not necessarily my employer's.


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

Date: Wed, 14 Apr 1999 09:51:52 -0800
From: oekilla@aol.com (RemarQ User)
Subject: getting mm/dd/yy from localtime()
Message-Id: <IA4R2.3982$36.1103454@WReNphoon2>

I'm looking at page 185 of the famous 'Programming Perl', but the localtime
function hasn't sunk in yet. I need the current date with the mm/dd/yy
format.

Where do i look next?



   -**** Posted from RemarQ, http://www.remarq.com/?a ****-
 Search and Read Usenet Discussions in your Browser - FREE -


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

Date: Wed, 14 Apr 1999 17:03:59 GMT
From: rpearse@my-dejanews.com
Subject: Grabbing Link Text with HTML:LinkExtor
Message-Id: <7f2hpo$hnf$1@nnrp1.dejanews.com>

howdy!

ah, the joy of perl modules. . .however, the documentation is sometimes a bit
sparse.

i'm using HTML::LinkExtor to grab URL's just fine. hey, i can even get images!
however, i'm interested in matching up the URL with the link text (y'know the
part that's underlined ;-)

  $parser = HTML::LinkExtor->new(undef, $base_url);
  $parser->parse_file($link_file);
  @links = $parser->links;
  @text  = $parser->text;

@links gets created just fine. @text is the problem. any suggestions?

thanks,

pearse

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


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

Date: 14 Apr 1999 11:09:47 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: HELP Needed with CGI-PERL on apache 1.3.3
Message-Id: <ysizp4byyic.fsf@blkbox.com>

Xavier HEROULT <heroux@iutc3.unicaen.fr> writes:

You should look in comp.infosystems.www.servers.unix as this is the
place to ask about server configuration questions.  Also, you may
want to look in you server error.log file and see is that gives you
any clues to the problem.

Kent

> Hi,
> 
> there is one thing I can't understand:
> Like said before, single CGI scripts (which don't need the famous
> "CGI.pm") like screening date and hour work.
> 
> But, I've got another script which uses "CGI.pm". Off Line (according to
> PERL), by typing "perl5.00404 add.pl", it works. I've got to manually
> type :     name=Something
> 
> email=nothing@nowhere.com....
>     then I simulate an EOF ("ctrl D"), and fields are written at the end
> of a file.
> And this, doesn't work on a web browser:
>                                 - I've got an HTML page with a form
> containing different fields to fill and this action :
> ACTION="http://ganp175.in2p3.fr/cgi-bin/add.pl",
>                                 and this method :METHOD=POST.
> 
> When I click the submit button an Internal Server Error appears.
> here it is :
> "The server encountered an internal error or misconfiguration and
> was unable to complete your request.
> 
> Please contact the server administrator, Xavier@ganp175.in2p3.fr
> and inform them of the time the error occurred, and anything you
> might have done that may have caused the error.
> 
> Premature end of script headers: /home/httpd/cgi-bin/add.pl"
> 
> Please, Ireally need some help. Couldn't it be my server (apache 1.3.3
> on Linux-Mandrake 5.3) refusing POST method ? Then does anyone knows
> what can I do to fix it ? Is it a path to add somewhere or ... I don't
> kow...
> Any suggestion is welcome...
> 
> thanks in advance...
> 
> --
> Xavier HEROULT


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

Date: Wed, 14 Apr 1999 17:03:58 GMT
From: ldspa@postoffice.ptd.net (Alfred J. Manno)
Subject: Help with JAVASCRIPT-PERL variables
Message-Id: <3714ca7c.12946807@news.ptd.net>

I have a Perl program that creates a web page with Javascript. The
program askes a number of questions then the user pushes a button and
the data is posted to a 2nd perl program that takes this info and runs
another Javascript program and creates a password.

The flow is:

Perl1 ---- creates HTML/Javascript to ask questions.
Java1  ---- Ask questions then POST using HTML POST to Perl2
Perl2 ---- creates Javascript to calculate the password 
Java2 ---- Calculates password and immediatly loads Perl3
               (no display or questions are asked) 
Perl3 ---- Automatically E-Mail the info to me and display the
password.

  The password is definatly being generated but I have the following
problems.

1) The  Java2 program does not "stop" by design. I don't want the
encryption code to be seen so once the page is loaded a third page is
displayed and the info along with the password is given.

 I can't get the password from the Javascript variable (Java2) back
into the perl program (Perl2) so that I can pass it to the display
program (Perl3).

 I can't use the normal HTML "POST" because I don't want the
possibility of the Javascript being viewed. I can't have a button to
press to do the "POST". 

2) On the first screen (Java1) I have the user enter various pieces of
info such as their name. This data usually has a space in it. When
Java1 posts the data to Perl2 all the data is chopped off at the 1st
space that is encountered. So "John Smith" will post as just "John".

As a point of reference ALL HTML/Javascript code is generated by
various Perl programs.

  If you would be so kind as to send an e-mail to ajm@cds-pa.com with
your posting. My ISP deletes news all too often and I don't want to
miss your answers.

Thank you in advance,

Al Manno


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

Date: Wed, 14 Apr 1999 13:52:08 -0400
From: "SAM" <same@minspring.com>
Subject: how do I match all the "1"s in strings like 231451,3132414131,etc?
Message-Id: <7f2kkt$4ub$1@camel29.mindspring.com>

Hello,
             Here is a newbie question on perl re.
How do I match a minimum of 2  and a maximum of 4 "1"s in strings like
2312312134
56132141313416512

I used the following re

$String =~ /[1]{2,4}/g;

but this seem to match only successive occurances of "1"s.






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

Date: Wed, 14 Apr 1999 17:42:17 GMT
From: Ryan PC Gibson <ryanpc@my-dejanews.com>
Subject: IPC left overs
Message-Id: <7f2k1n$jt4$1@nnrp1.dejanews.com>

hello:

  so i got this program that uses shared memory via IPC::Shareable calls to
store results of HTTP requests.  i am ending up with a lot of "orphaned" IPC
shared memory segments and semaphores.	after running the script eery minute
for 12 hours i run "ipcs" from the command line and see a list of about
twenty shared mem. segments and semaphores created by processes that are long
since dead.  occasionaly, also, the script will fail to run via cron due to
this error:

semget returned undef: No space left on device at /home/ryan/cgi/wps/wps line
219

   ...which i am attributing to memspace since disk space is fine.

is there a way of "killing" these orphaned segments/semaphores?  are they
even a problem (ie does solaris reclaim that space if PID is not running?)

any direction/suggestion/thoughts given would be lovely



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


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

Date: 14 Apr 1999 17:18:27 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <7f2il3$ivu$1@pegasus.csx.cam.ac.uk>

Bart Lateur <bart.lateur@skynet.be> wrote:
>
>You could always print to STDERR, as that is unbuffered by default.

Nope.  At least under Unix, it's unbuffered iff it's going to a terminal.
Just the same as STDOUT.


Mike Guy


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

Date: Wed, 14 Apr 1999 06:40:22 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: like print <<...; load a variable?
Message-Id: <mar1f7.8l6.ln@magna.metronet.com>

Rob Bell (bluesrift@aol.com) wrote:
: As a beginner my understanding is that when using the following 
: method of printing one does not need to escape quotes or special 
: characters.  


   You do not need to escape double quotes in a "double quotish"
   here-doc (like your example below).

   here-docs are just an alternative way of quoting.

   There are "double quotish" here-docs (when delimiter string is
   in double quotes or when not quoted) which have all of the
   same "special characters" that plain old double quoted strings
   have.

   There are "single quotish" here-docs (when delimiter string is
   in single quotes) which have all of the
   same "special characters" that plain old single quoted strings
   have.


: Is there a way to load a variable similarly and 


Here are three ways to end up with the same string in $var:


$var = "line One\nline Two\n";  # plain old double quotes


$var = "line One
line Two
";                              # also  plain old double quotes


$var =<<ENDVAR;                 # double quotish here-doc
line One
line Two
ENDVAR


: thus 
: similarly avoid escaping?


   If it needed escaping in the double quoted representation
   (other than the double quote delimiter), then it needs
   escaping in the double quotish here-doc also.


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


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

Date: Wed, 14 Apr 1999 13:15:16 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Looking for Tutoral Referenced in the Perl Cookbook
Message-Id: <MPG.117e97328621a36e98968a@news.idt.net>

Ouch... thanks.  I noticed before that docs are somewhat thin. I'll ckeck 
that link out.

Daniel

In article <3714a009@cs.colorado.edu>, tchrist@mox.perl.com says...
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, danbeck@scott.net (Daniel Beckham) writes:
> :Thanks, my linux box didn't have the tutorial in the doc directory 
> 
> That's because no Linux distribution has anything resembling
> tolerable documentation.  The situation ranges from an embarrassment
> to an atrocity.  You can fix that.
> 
>     http://synack.net/daemonlinux/
> 
> --tom
> 


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

Date: 14 Apr 1999 16:55:35 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: mailer script question
Message-Id: <3714ba77.0@newsread3.dircon.co.uk>

Tim Herzog <therzog@knotech.com> wrote:
> 
> Go to www.worldwidemart.com and look for formmail.  It's a Perl/CGI script
> that's a front end interface to sendmail, and you can tweak it to do what
> you want.
> 

You recommended him to use what ?  And you didnt tell him *not* to come
back  here when he has problems with it ;-}

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



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

Date: Wed, 14 Apr 1999 11:57:17 -0500
From: Matt Turner <matt@godzilla.tamu.edu>
Subject: Mod_Perl for NT
Message-Id: <3714C8ED.63596BDD@godzilla.tamu.edu>

Does anyone know where I can get a newer compiled copy of mod_perl for
NT?

I have the 1.16 version from
ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/authors/Jeffrey_Baker/,
but it is only good up to Apache 1.3.3.

What I would really like is a binary copy that works with Activestate
Perl and newer version of Apache for NT.

Is it hard to compile mod_perl from the source?  I have Microsoft's
Visual C++.  How would I go about compiling it myself?

Thanks,
Matt



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

Date: Wed, 14 Apr 1999 16:03:10 GMT
From: ptimmins@itd.sterling.com (Patrick Timmins)
Subject: Omaha Perl Mongers Meeting
Message-Id: <7f2e7o$ec7$1@nnrp1.dejanews.com>

The Omaha Perl Mongers will meet NEXT WEEK, Wednesday April 21 at 6:30 pm at
HDR, Inc. at 84th and Dodge (courtesy of HDR and Kent Tegels). Kent will be
giving a presentation entitled: "Teaching a new dog old tricks: Perl on the
Win32 platform".

You can get specific directions/instructions to the meeting location at Kent's
site at http://www.tegels.org:8080/perl/

Time permitting, we will have a "Stump the Hump" question and answer period.
Bring in your toughest Perl questions and see if any of the geeks ... I mean
mongers, can help you out!

There won't be any neat attendance draws: Larry Wall won't be there, Randal
won't be there, Tom C. won't be there, Nathan T. won't be there, Mark-Jason
Dominus won't be there, Jon Orwant won't be there, brian d foy won't be
there, etc, etc. (They *do* all have open invitations to *all* Omaha Perl
Monger meetings, though.  Maybe one of them will get stranded in Omaha on a
lay-over to Denver, or something someday ... we can always hope!)

$monger{Omaha}[0]
Patrick Timmins
ptimmins@itd.sterling.com

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


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

Date: Wed, 14 Apr 1999 16:09:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Password encryption
Message-Id: <3717bcec.5592573@news.skynet.be>

Vincent Vanbiervliet wrote:

> need to be able to create .htaccess and .htpasswd files on the fly. To do
>this, I thought I'd use a perl script where you can enter a userid and
>password, and that would then create the needed files.
>Problem is that I don't see any way to create the password file. I know in a
>Unix environment, there's this command 'htpasswd' that you can use, but as
>far as I know, there's no win32 variant of it (I'm using WinNT).

perldoc -f crypt

Something like this might to work:

	{
		local($\,$,) = ("\n",':');
		print $user,crypt($pwd,'xy');
	}

The 'xy' is part of the encrypted password, so you may replace it with
any two letters you like.

	Bart.


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

Date: Wed, 14 Apr 1999 12:52:58 -0500
From: "rich estabrook" <riche@ix.netcom.com>
Subject: Re: Perl and MS Access
Message-Id: <7f2kph$a1e@dfw-ixnews4.ix.netcom.com>

You should check out Selena Sol's tutorials on http://www.wdvl.com.  I found
them very useful.

rich.


Thomas Goesmann <goesmann@do.isst.fhg.de> wrote in message
news:37147DED.59334939@do.isst.fhg.de...
> Hi,
>
> this is maybe a very simple question:
>
> How can I access a MS Access database in Perl?
> The most important requirement is to keep it really SIMPLE.
> What modules are needed?
> Can anybody give me a link to corresponding web resources/examples?
>
> Thank you very much in advance. Please reply by mail to the adress given
> below.
>
> Regards,
>
> Thomas Goesmann




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

Date: 14 Apr 1999 10:47:45 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl or C?
Message-Id: <m1lnfv2iwu.fsf@halfdome.holdit.com>

>>>>> "Alan" == Alan J Flavell <flavell@mail.cern.ch> writes:

Alan> One respected colleague considers that the best way to start programming
Alan> is with Java, even though you subsequently migrate to something else for
Alan> your "real work".  It's the object orientation, you see.

Well, if you're teaching a first language for OO, why go with a hybrid
like C++ or Java (or Perl, for that matter)?  Start with the king of
OO languages -- Smalltalk.  There are free cross-platform Smalltalk
implementations available for easy download (see www.squeak.org for my
favorite one), and a wealth of training material.  And Smalltalk is
still heavily used in WallStreet and other places where rapid
prototyping and response to change is needed.  Smalltalk-80 had an IDE
in *1980*, long before IDE's were even heard of for other languages.

I claim that no-one "knows" OO until they have learned Smalltalk,
where *everything* is an object.  The hybrid languages just don't cut
it.

print "Just another object orientor," :)

-- 
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: Wed, 14 Apr 1999 14:14:07 -0300
From: "Terra Landry" <terral@cyberplex.com>
Subject: perl question... ordering from dbm
Message-Id: <7f2ihj$4c6$1@bignews.fundy.net>

ok... I'm getting information from my dbm... I want to order by applydate,
but it's ordering by key..

dbmopen(%Items, $POSTINGS_DATA, $MODE) || print "Can't open
\"$CategoryDBM\"";

    foreach $key (reverse sort keys %Items) {

($Id,$Category,$Title,$JobNumber,$Description,$Active,$Details,$FullApplyDat
e,$FullRemoveDate,$PostedDate) = split /:::/, $Items{$key};

and so on... I'm putting this in a summary page where they'll all be
listed..

how do I order by $FullApplyDate???

Thanks..

Terra

ps... sorry about that javascript question..




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

Date: Wed, 14 Apr 1999 10:48:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Printing a file
Message-Id: <3714D4E3.619973C0@mail.cor.epa.gov>

Andrew Branson wrote:
> 
> Joshua Justice wrote in message ...
> <snip>>
> [another snip]
> 
> You're absolutely right. I have been programming for 10 years in C, 4 in
> C++, and a bunch of other languages. I used to laugh at people struggling
> with learning a new language. Perl has certainly humbled me. I am begining
> to really enjoy the language now.

Perl has lots of nifty stuff.. which is A Good Thing (tm, Martha
Stewart)
and a learning curve for new people.  'local' vs 'my' throws some people
who expect 'local' to do what 'my' actually does.  Learn about scalar vs
list context.  Read the perltrap manpage and see the [short] list of C
techniques you need to change.

I think that Perl does a better job of OO than C++, but that's another
little learning curve waiting for you.

> I did buy a book - Using Perl 5 for Web Programming - published by Que. It
> sucks as a reference. The index sucks even more. I have been told to pick up
> a copy of the "camel" book. What books do you recommend?
> Thanks.
> 
> Andy

If you have that much C/C++ background, then the camel ought to be about
the right level for you.  It's a good reference.. but a great reference
is the set of docs that come with whatever version of Perl is the most
recent.  That is on-line, and quick to use.  Learn about perldoc
and its friends.  Learn about perldoc's -q and -f switches.

And read this ng.  I find c.l.p.m. a terrific source of Perl wisdom
and technique.. plus occasional humor and/or crankiness.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 14 Apr 1999 16:06:16 GMT
From: mike@mike.local.net (Mike Mckinney)
Subject: Re: Problem with my & local declarations
Message-Id: <slrn7h9f4v.2g7.mike@mike.local.net>

Uri Guttman <uri@home.sysarch.com> wrote:

>i don't know what code you have been looking at but i have never seen a
>my declaration inside an expression like that. i have seen many
>assignments with my (which i don't do either), but not like yoru code.

>so i would have coded it like this:
>
>my( $author, $foo, $bar ) ;
>
>chomp( $author = <STDIN> ) ;

Your exactly right. I haven't ever seen my in a declaration either. What I
have seen is like what you have above. the my does look ugly, and a bit
disorganized.

-- 
mikemck@austin.rr.com



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

Date: Wed, 14 Apr 1999 17:42:20 GMT
From: mike@mike.local.net (Mike Mckinney)
Subject: Re: Problem with my & local declarations
Message-Id: <slrn7h9kp3.2g7.mike@mike.local.net>

Mike Mckinney <mike@mike.local.net> wrote:

>Your exactly right. I haven't ever seen my in a declaration either. What I
>have seen is like what you have above. the my does look ugly, and a bit
>disorganized.

I meant assignment.

-- 
mikemck@austin.rr.com



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

Date: 14 Apr 1999 16:44:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <7f2glu$88c$1@client2.news.psi.net>

Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMLII September
MCMXCIII in <URL:news:3714aa2f.0@newsread3.dircon.co.uk>:
$$ Tom Christiansen <tchrist@mox.perl.com> wrote:
$$ > In comp.lang.perl.misc, Jonathan Stowe <gellyfish@gellyfish.com> writes:
$$ > :Are you sure you have \n\n where you think you have and not \r\n\r\n
$$ > :instead? 
$$ > 
$$ > All systems end text lines in "\n".  Are you forgetting the 
$$ > transparent conversions?
$$ > 
$$ 
$$ Indeed they do for files created on the same system.  But for, say, a file
$$ created in the DOS world and transferred in a binary mode - NFS or samba
$$ say then that is not strictly the case:
$$ 
$$ fatmog:~$ od -c test.blah
$$ 0000000   t   h   i   s  \r  \n   i   s      \r  \n   a  \r  \n   t   e
$$ 0000020   s   t  \r  \n   i   s   n   t  \r  \n   i   t  \r  \n
$$ 0000036
$$ 
$$ test.blah was created in DOS and then FTP'd in binary mode.

That's very misleading. What byte, or byteset, \n is depends from platform
to platform. Whenever I see someone write '\r\n', I wonder if they know
what they are talking about. They probably mean CR LF, but '\r\n' is only
a CR LF on certain systems. 



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: 14 Apr 1999 17:01:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <7f2hl0$8i7$1@client2.news.psi.net>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMLII September MCMXCIII
in <URL:news:3714ae5f@cs.colorado.edu>:
$$  [courtesy cc of this posting sent to cited author via email]
$$ 
$$ In comp.lang.perl.misc, 
$$     Jonathan Stowe <gellyfish@gellyfish.com> writes:
$$ :test.blah was created in DOS and then FTP'd in binary mode.
$$ 
$$ Don't do that.  Duh.


It'll also happen if you have a shared file system, or if you tar or
compress files before ftping.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Wed, 14 Apr 1999 10:54:12 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Q: Hash tables!!!
Message-Id: <3714D644.214A855@mail.cor.epa.gov>

Sam Holden wrote:
> 
> David Cassell <cassell@mail.cor.epa.gov> wrote:
> >Sam Holden wrote:
> >>
> >> Even if perl did free the memory, there is a chance that it wouldn't be
> >> returned to the OS anyway. Depending on your OS of course (and your libc
> >> I guess).
> >
> >Of the OS'es with which I have some familiarity, I can't think of one
> >off
> >the top of my head that will work this way.  Your program can free
> >memory
> >that it can then use again, but that memory does not get reclaimed by
> >the
> >OS until your program exits.  And not necessarily then either, with at
> >least one OS I can think of, which doesn't need to be mentioned by
> >name.
> >:-)
> 
> Isn't that what I said? OK I said 'chance' I should have said
> 'high chance'. I new that if I said it won't be returned to the
> OS someone would provide a counter-example of an OS that isn't
> broken (matched with a libc that isn't broken)...

If so, I apologize.  I must have misunderstood you.

> Oops, I think I may be flamed for that... Did I just call a few
> Unix like OSs 'broken'... ;)

Flaming?  Unix-centricity?  In this ng?  Naaaaaahh.  :-)

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Wed, 14 Apr 1999 16:35:07 GMT
From: "News" <dixonmat@pouch.com>
Subject: Randomize Please Help
Message-Id: <%s3R2.39155$BZ6.9302909@news.optonline.net>

I want to randomly display a table how would I do that in perl
I already have the shopping cart system running, but I want it to display a
random table almost like a banner.
How would I do such a task? Please help.


Matt Dixon




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

Date: Wed, 14 Apr 1999 16:05:01 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regex - meta char's
Message-Id: <3716bb88.5236879@news.skynet.be>

kscurry@my-dejanews.com wrote:

>I am trying to use regex to match query data with wildcards
>( *,? ) but I want other special characters ((,),{,},.,^) to
>be interpreted literally.

As others have written, precede them with "\". In fact, ANY non-word
charatcer may be preceded with a backslash in order to get their literal
meaning, metacharacter or not.

This is a good "literalizer":

	s/(\W)/\\$1/g;

Also, there is the quotemeta() function, and '\Q'. As in

	$string = '*.w';
	print "<\Q$string\E>\n";
->
	\*\.w

Note that '\Q' has the SAME effect as the substitution I presented
earlier: all non-word characters are preceded with a backslash. It's
just that variables are interpolated first, and the substitution is
applied to the value.

	Bart.


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

Date: Wed, 14 Apr 1999 16:28:23 GMT
From: spg@quokka.com (Gus)
Subject: Re: SQL using the ODBC module
Message-Id: <3714bd3a.131776875@news.earthlink.net>



I suggest trying a fairly simple query first.  This should work:

use strict;
use DBI;

my $DSN = "your_DSN_here";       
my $query = new CGI;

print header;
print $query->start_html(-title=>'Access Test',
                            -BGCOLOR=>'#FFFFFF');

my $sql = "SELECT * FROM your_tablename_here  ";

my $dbh = DBI->connect("dbi:ODBC:$DSN") || die "Cant connect to $DSN:
$DBI::errstr";
### line wrap due to newsreader ###

my $sth = $dbh->prepare($sql) || die "Can't prepare statement:
DBI::errstr";
### line wrap due to newsreader ###

my $rc = $sth->execute || die "Can't execute statement: $DBI::errstr";

while (my ($field1, $field2) ) = $sth->fetchrow_array  {
	print "Field 1 = $$field1<BR> Field 2 = $field2<P>";
	}

$rc = $sth->finish;


print $query->end_html;

If you still don't connect, and don't get an error message, try
changing die to print.  I had to do this once with access.

gus

On Wed, 14 Apr 1999 08:24:35 GMT, chatswood@my-dejanews.com wrote:

>In article <37136b28.45230277@news.earthlink.net>,
>  spg@quokka.com (Gus) wrote:
>> First guess is you have a problem with quotes, but without seeing
>> sample code, it's just a wild guess.
>
>
>Sorry I haven't got the code itself with me (my own PC isn't networked). I've
>tried it with and without quotes, but what I'd really like to get is any sort
>of error message. Unfortunately I don't get any...
>
>My line is
>$db->sql('....') or die "...";
>
>or thereabouts, but the thing isn't dying. The fact that I'm doing it through
>CGI doesn't make a difference as I've tested it from the DOS Prompt. All I'm
>doing is creating a new ODBC connection, the performing the sql statement, and
>then closing the connection. Am I missing anything?
>
>The fact that it isn't dying - does that suggest that as far as Perl is
>concerned the operation is a success? That I guess would point to the ODBC
>DSN, but I've checked that it is writable. I haven't checked if the database
>itself is read only, but I presume that since I can read/write within Access
>(where the SQL does work) suggests that the DB is writeable.
>
>Thanks for your help
>
>Maurice Kelly
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

Date: Wed, 14 Apr 1999 10:37:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Unitialized var errors & -w flag
Message-Id: <MPG.117e721db9e378b79898ac@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <therzog-1404991004460001@therzog-host105.dsl.visi.com> on 
Wed, 14 Apr 1999 10:04:46 -0500, Tim Herzog <therzog@knotech.com> 
says...
 ...
> Anyone know if there is some trick or workaround to either disable the
> "unitialized variable" warning (but not the other warnings),

use strict;
no strict 'vars';

>                                   or do the
> equivalent of an "extern" declaration (as much as I'd hate having to do
> that)?

use vars '$global_var';

You can use a list here:

use vars qw($scalar @array %hash);

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


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

Date: 14 Apr 1999 16:38:35 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: what does this error msg mean?
Message-Id: <7f2gab$gk9$1@pegasus.csx.cam.ac.uk>

Diane Unger  <geotrace@shentel.net> wrote:
>I am using a variation of the Schwartzian Transform to sort some data
>for display on a web page.  I keep getting the following error:
>
>"map" may clash with future reserved word at /cgi-bin/logs.cgi line 232.

You're running Perl 4.   Upgrade.


Mike Guy


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

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

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