[18430] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 598 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 30 18:06:20 2001

Date: Fri, 30 Mar 2001 15:05:22 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985993521-v10-i598@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 30 Mar 2001     Volume: 10 Number: 598

Today's topics:
    Re: 'perl guy' wanted. <david@kasey.umkc.edu>
    Re: - Looking for this type of TALKBACK user feedback s <blah@blah.com>
    Re: - Looking for this type of TALKBACK user feedback s (Mogga)
    Re: Can perl handle 'fields' like awk can? dmeyers+news@panix.com
        Code Generator for Perl <michaelw@elkhart.net>
    Re: Data::Dumper <tinamue@zedat.fu-berlin.de>
    Re: Data::Dumper <uri@sysarch.com>
        Help with CGI scripts <jlombana@avellano.datsi.fi.upm.es>
    Re: Help with CGI scripts <keesh@users.pleaseremovethisbit.sourceforge.net>
    Re: Hmmm... Which PERL Book Is Best Suited For This??? <david.kernen@bms.com>
    Re: Hmmm... Which PERL Book Is Best Suited For This??? dmeyers+news@panix.com
    Re: Hmmm... Which PERL Book Is Best Suited For This??? (---Pete---)
        how to specify PI (was: rounding up or down with Perl) <tinamue@zedat.fu-berlin.de>
        list all files in a directory <cam@home.com>
    Re: list all files in a directory <juex@deja.com>
    Re: LWP::Simple  problem nobull@mail.com
    Re: Multidimensional Arrays? <david.kernen@bms.com>
    Re: Perl / CGI Editors (---Pete---)
        PerlScript/ASP programming issues <samara_biz@hotmail.com>
        Problem with regular expression in IF statement! Please <benpottinger@fuse.net>
    Re: Problem with regular expression in IF statement! Pl (John Joseph Trammell)
        quick question on m//o <jesse@uchicago.edu>
    Re: quick question on m//o (Tad McClellan)
    Re: quick question on m//o <uri@sysarch.com>
        Regular exasperation <nospam@nospam.com>
    Re: Regular exasperation <uri@sysarch.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 30 Mar 2001 19:46:32 +0000
From: "David L. Nicol" <david@kasey.umkc.edu>
To: Jim Fitzsimmons <jfitzsimmons1@home.com>
Subject: Re: 'perl guy' wanted.
Message-Id: <3AC4E298.F5BAC11D@kasey.umkc.edu>


You could URL-encode your strings, that will protect them most 
thoroughly:

Before writing to the database:

   $Comments =~ s/(\W)/'%'.pack('HH',ord($1))/ge;

And when you read them from the database, decode them like so:

   $Comments =~ s/%(..)/chr(hex($1))/ge;



Jim Fitzsimmons wrote:

> I've got a perl script using DBI that sends comments from a text field form
> to a mysql database.
> Works great, unless there is an apostrophe in the comments field where the
> posting gets lost in space because mysql complains about the apostrophe.
> 
> I think I need to use quote something or other from the perl DBI, but I have
> no idea where/how to implement it in the script.





-- 
                      David Nicol 816.235.1187 dnicol@cstp.umkc.edu
                            Warning: return type of main is not int


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

Date: Fri, 30 Mar 2001 20:06:10 +0100
From: "Phil Hayz" <blah@blah.com>
Subject: Re: - Looking for this type of TALKBACK user feedback script...
Message-Id: <6N4x6.4219$MZ2.769859@news2-win.server.ntlworld.com>

"Mogga" <mogga@mogga.com> wrote the following drivel:-
>
> >>
> >> Email the site owners.
> >> --
> >
> >I told him to do that when he asked exactly the same question about two
or
> >three weeks ago. Obviously he took no notice.
> >
>
> Ohhhhhhhhh why doesn't that surprise me?
>

Cause he's clearly a silly bugger?
Cause you're not easily surprised?
Cause you're psychic?
Cause you are in fact Jon in disguise?
Cause you're sleeping with him on the sly and you know what he's like?

: ¬)

--
Phil Hayz
http://allmyfaqs.com/ - FAQ's
http://www.w3schools.com/ - Web building tutorials
http://members.home.net/krobb7/quoting.html - Please, FFS, bottom post




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

Date: Fri, 30 Mar 2001 19:23:46 GMT
From: mogga@mogga.com (Mogga)
Subject: Re: - Looking for this type of TALKBACK user feedback script...
Message-Id: <3ac4dd2e.16287868@news.freeserve.net>

On Fri, 30 Mar 2001 20:06:10 +0100, "Phil Hayz" <blah@blah.com> wrote:

>>
>> Ohhhhhhhhh why doesn't that surprise me?
>>
>
>Cause he's clearly a silly bugger?
>Cause you're not easily surprised?
>Cause you're psychic?
>Cause you are in fact Jon in disguise?
>Cause you're sleeping with him on the sly and you know what he's like?
>
>: ¬)
>

*splutters*

Erm, can I phone a friend?


-- 
http://www.htmlcook.com     
html as simple as beans on toast
http://www.searchenginescandal.com
http://website.lineone.net/~diane_norton/indiary.htm


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

Date: 30 Mar 2001 15:19:30 -0500
From: dmeyers+news@panix.com
Subject: Re: Can perl handle 'fields' like awk can?
Message-Id: <yobg0fvnh65.fsf@panix2.panix.com>

sendthis@yahoo.delthisandasdf.com (e) writes:

[Please don't top-post.]

> In article <slrn9bn40d.h9i.abigail@tsathoggua.rlyeh.net>, abigail@foad.org 
> says...

> >split

Did you look up "split" in the documenation?

> >%% awk { print $7 } 

> >perl -nawle 'print $F [6]'

> That didn't work. I assumed I replaced $F with $<var> but I tried it both ways 

Works just fine.  See the docs to learn what the -nawle are
all about.

For some wonderful detail about building up a command line
like that and understanding what it does, take a look at
the following:

http://www.stonehenge.com/merlyn/UnixReview/col01.html


--d

-- 
dmeyers@panix.com

Please don't use HTML in e-mail.  Here's how not to:
http://www.geocities.com/CapitolHill/1236/nomime.html


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

Date: Fri, 30 Mar 2001 15:07:48 -0500
From: Michael Wenzelmaier <michaelw@elkhart.net>
Subject: Code Generator for Perl
Message-Id: <3AC4E794.B881FADD@elkhart.net>


Hi guys,

check out the Code Generator for PHP, ASP, PERL, JSP, COLDFUSION with
database connect to ODBC, Oracle, MSSQL, mSQL, MySQL

Download the Trial Version and check it out.

http://www.webprocenter.net/codecharge

Thanks

Michael



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

Date: 30 Mar 2001 19:10:32 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Data::Dumper
Message-Id: <9a2ln8$3arfa$1@fu-berlin.de>

Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>   AS> I find that Data::Dumper doesn't do what I expect:
>   AS>     my $x = [ ( [] ) x 2 ];
>   AS>     $y = eval Dumper( $x);
>   AS>     $VAR1 = [
>   AS>               [],
>   AS>               $VAR1->[0]
>   AS>             ];

> set this global before you call Dumper

> $Data::Dumper::Purity = 1 ;

> you now will get:

> $VAR1 = [
>           [],
>           []
>         ];
> $VAR1->[1] = $VAR1->[0];

> which is what you wanted.

this might work, but I tried it out with the [23] instead
of [] and got the following:
08:59pm tina@linux:perl 657> perl -e'use Data::Dumper;
$Data::Dumper::Purity = 1;
$x = [ ( [23] ) x 2 ];
print Dumper( $x);
$z=eval Dumper $x;
print "z: ".(Dumper $z)."\n"'
$VAR1 = [
          [
            23
          ],
          []
        ];
$VAR1->[1] = $VAR1->[0];
z: $VAR1 = [
          23
        ];

shouldn't $z be [ [23], [23] ] ?
or is it because eval returns the last statement
which is "$VAR1->[1] = $VAR1->[0];" which is indeed [23]?
but somehow my example works if I set $Data::Dumper::Deepcopy to 1.
then i get
z: $VAR1 = [
          [
            23
          ],
          [
            23
          ]
        ];

don't know if this was what anno wanted...

regards,
tina

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Fri, 30 Mar 2001 19:41:09 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Data::Dumper
Message-Id: <x7r8zfvycq.fsf@home.sysarch.com>

>>>>> "TM" == Tina Mueller <tinamue@zedat.fu-berlin.de> writes:

  TM> this might work, but I tried it out with the [23] instead
  TM> of [] and got the following:
  TM> 08:59pm tina@linux:perl 657> perl -e'use Data::Dumper;
  TM> $Data::Dumper::Purity = 1;
  TM> $x = [ ( [23] ) x 2 ];
  TM> print Dumper( $x);
  TM> $z=eval Dumper $x;

that is your problem.  see below.

  TM> $VAR1 = [
  TM>           [
  TM>             23
  TM>           ],
  TM>           []
  TM>         ];
  TM> $VAR1->[1] = $VAR1->[0];

notice the actual code here. that whole string is evaled and the last
expression is returned. so $z = the first element of $VAR1 or just [23],
which is what you see below.

  TM> z: $VAR1 = [
  TM>           23
  TM>         ];

  TM> or is it because eval returns the last statement
  TM> which is "$VAR1->[1] = $VAR1->[0];" which is indeed [23]?

yep.

  TM> but somehow my example works if I set $Data::Dumper::Deepcopy to 1.

  TM> z: $VAR1 = [
  TM>           [
  TM>             23
  TM>           ],
  TM>           [
  TM>             23
  TM>           ]
  TM>         ];

but that is not the same. those anon arrays are not the same ref so it
is different than the above example. deepcopy will do that for you. it
makes complete fresh copies of a (sub)tree, instead of copying only the
refs in common.

the proper way to get what you tried is to pass a variable name into
Dumper (with the [ref], [name] syntax) and just eval it without
assigning it to anything. or in the above case do:

	eval $x ;
	$z = $VAR1 ;
	print "z = ", Dumper( $z ), "\n" ;

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 30 Mar 2001 19:31:05 +0200
From: Jose Luis Lombana Aramendia <jlombana@avellano.datsi.fi.upm.es>
Subject: Help with CGI scripts
Message-Id: <3AC4C2D9.601E52E0@avellano.datsi.fi.upm.es>


--------------B0440559917D37118443C654
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

    I'm in trouble with a 'hello world' CGI - script:

#!/usr/local/bin/perl

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

print "<html><head><title>hello world</title></head><body>Hello
world!</body></html>";

1;

works fine, but if I add

require "headers.pl";

after #!/usr/local/bin/perl, I get

500 Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your
request.

Please contact the server administrator, www@datsi.fi.upm.es and inform
them of the time the
error occurred , and anything you might have done that may have caused
the error.

Error: HTTPd: malformed header from script
/export/home/avellano/pabs/jlombana/.web/cgi-bin/practicas.cgi

    Any help is appreciated.

    Thanks in advance

--
===========================================================
Jose Luis Lombana Aramendia
jlombana@avellano.datsi.fi.upm.es
Facultad de Informatica de Madrid (UPM)
===========================================================



--------------B0440559917D37118443C654
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;&nbsp;&nbsp; I'm in trouble with a 'hello world' CGI - script:
<p>#!/usr/local/bin/perl
<p>print "Content-type: text/html\n\n";
<p>print "&lt;html>&lt;head>&lt;title>hello world&lt;/title>&lt;/head>&lt;body>Hello
world!&lt;/body>&lt;/html>";
<p>1;
<p>works fine, but if I add
<p>require "headers.pl";
<p>after #!/usr/local/bin/perl, I get
<p>500 Server Error
<p>The server encountered an internal error or misconfiguration and was
unable to complete your
<br>request.
<p>Please contact the server administrator, www@datsi.fi.upm.es and inform
them of the time the
<br>error occurred , and anything you might have done that may have caused
the error.
<p>Error: HTTPd: malformed header from script
<br>/export/home/avellano/pabs/jlombana/.web/cgi-bin/practicas.cgi
<p>&nbsp;&nbsp;&nbsp; Any help is appreciated.
<p>&nbsp;&nbsp;&nbsp; Thanks in advance
<pre>--&nbsp;
===========================================================
Jose Luis Lombana Aramendia
jlombana@avellano.datsi.fi.upm.es
Facultad de Informatica de Madrid (UPM)
===========================================================</pre>
&nbsp;</html>

--------------B0440559917D37118443C654--



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

Date: Fri, 30 Mar 2001 20:07:52 +0100
From: "Ciaran McCreesh" <keesh@users.pleaseremovethisbit.sourceforge.net>
Subject: Re: Help with CGI scripts
Message-Id: <9a2lh7$hpq$1@newsg2.svr.pol.co.uk>

In article <3AC4C2D9.601E52E0@avellano.datsi.fi.upm.es>, "Jose Luis
Lombana Aramendia" <jlombana@avellano.datsi.fi.upm.es> wrote:
> require "headers.pl";
> 
> after #!/usr/local/bin/perl, I get
> 
> 500 Server Error

1) Check the file exists and is in path
2) Check permissions
3) Check file returns true
4) Check the code
5) Run the script from command line and look for more debug info


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

Date: Fri, 30 Mar 2001 14:50:04 -0500
From: Dave <david.kernen@bms.com>
Subject: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <3AC4E36B.B833B47D@bms.com>


--------------01CAE4E599744AA12C00B0E9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

---Pete--- wrote:

> I'm looking for a reference book that is instructional as well
> as extensively indexed such that I can pickup a sample
> Perl script and quiclky find topics or functions like sysread(),
> or  even simple things like "$!" that I find in the sample Perl
> code. This PERL book should also written with the CGI in
> mind.

I know everyone else will jump in and say the same thing but so what:
get the camel book!

The camel book (Larry Wall's Programming Perl, O'Reilly & Associates) is
a must-have. It's got the indexing you want (the best indexing I've
seen, IMHO) plus it's written by Larry Himself. It's an absolute
necessity for anybody who has ever thought about potentially maybe
sometime possibly viewing/editing/creating perl code. I open my copy
every day, usually several times a day, and I already know perl quite
well.

I have a huge collection of perl books and each has its strengths and
weaknesses. The camel book's weakness is its tendency to quickly become
the most tattered, dog-eared, and generally scruffy looking book on the
shelf ;-)
(Hint: never buy a book if you see your colleague's copy looks brand new
when you know damn well it isn't.)

And contrary to what some have posted, I have also read two editions of
this book cover to cover and enjoyed them thoroughly. (Okay, I'm a
closet geek but what can I do? I liked it!)

Oh, and did I mention you should get the camel book?

Dave Kernen

--------------01CAE4E599744AA12C00B0E9
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
---Pete--- wrote:
<blockquote TYPE=CITE>I'm looking for a reference book that is instructional
as well
<br>as extensively indexed such that I can pickup a sample
<br>Perl script and quiclky find topics or functions like sysread(),
<br>or&nbsp; even simple things like "$!" that I find in the sample Perl
<br>code. This PERL book should also written with the CGI in
<br>mind.</blockquote>
I know everyone else will jump in and say the same thing but so what: get
the camel book!
<p>The camel book (Larry Wall's <u>Programming Perl</u>, O'Reilly &amp;
Associates) is a must-have. It's got the indexing you want (the best indexing
I've seen, IMHO) plus it's written by Larry Himself. It's an absolute necessity
for anybody who has ever thought about potentially maybe sometime possibly
viewing/editing/creating perl code. I open my copy every day, usually several
times a day, and I already know perl quite well.
<p>I have a huge collection of perl books and each has its strengths and
weaknesses. The camel book's weakness is its tendency to quickly become
the most tattered, dog-eared, and generally scruffy looking book on the
shelf ;-)
<br>(Hint: never buy a book if you see your colleague's copy looks brand
new when you know damn well it isn't.)
<p>And contrary to what some have posted, I have also read two editions
of this book cover to cover and enjoyed them thoroughly. (Okay, I'm a closet
geek but what can I do? I liked it!)
<p>Oh, and did I mention you should get the camel book?
<p>Dave Kernen</html>

--------------01CAE4E599744AA12C00B0E9--



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

Date: 30 Mar 2001 15:04:28 -0500
From: dmeyers+news@panix.com
Subject: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <yoblmpnnhv7.fsf@panix2.panix.com>

bogus@erol.com (---Pete---) writes:

> Sounds like a great library to have, however, to understand where I'm
> coming from, my intent is not to become an expert PERL programmer
> but rather to be able to grab a sample PERL script and be able to
> tweak it to do exactly what I need it to do. The books that I find
> most useful are organized or indexed such that I can quickly locate
> a desired function, operator or whatever, and then have it explain
> what it is and used for, the proper syntax,  some examples, and a few
> important notes about the practical usage or related topics.

What you want is the online documentation which came with
your perl.  From the command line, use the "perldoc" command.
Start by using it to learn about itself:

perldoc perldoc

and check out these forms, too:

       perldoc -f BuiltinFunction
       perldoc -q FAQ Keyword


--d


-- 
dmeyers@panix.com

Please don't use HTML in e-mail.  Here's how not to:
http://www.geocities.com/CapitolHill/1236/nomime.html


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

Date: Fri, 30 Mar 2001 21:39:52 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <3ac4f96d.76641650@news.earthlink.net>

On Fri, 30 Mar 2001 14:50:04 -0500, Dave <david.kernen@bms.com> wrote:

>The camel book (Larry Wall's Programming Perl, O'Reilly & Associates) is
>a must-have. It's got the indexing you want (the best indexing I've
>seen, IMHO) plus it's written by Larry Himself. It's an absolute
>necessity for anybody who has ever thought about potentially maybe
>sometime possibly viewing/editing/creating perl code. I open my copy
>every day, usually several times a day, and I already know perl quite
>well.
---------
Dave, I ended up purchasing the following 2 books.

1.) "Programming Perl 3rd Edition" an O'Reily book -
by Wall, Christiansen, Orwant,  (This is the CAMEL book)

2.) "CGI Programming with Perl 2nd edition" an O'Reilly book  -
by Guelich, Gundavaram, Birznieks

I already had, the SAMS book "Teach Yourself PERL in 24 Hours"

The CAMEL book is what I was looking for; it's indexed well and 
very comprehensive but it assumes a certain level of expertise.
I am a Visual Basic programmer and only about 3 weeks into
PERL. I'm finding that the combo of the SAMS book and the 
CAMEL book work great because when I don't quite understand
what the CAMEL book is saying, I go to the SAMS book and it
clarifies the issue for me by using simpler and clearer instruction
and examples. These two books seem to a perfect combo for
someone of my level of expertise.

---pete---




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

Date: 30 Mar 2001 19:30:17 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: how to specify PI (was: rounding up or down with Perl)
Message-Id: <9a2ms9$370iq$1@fu-berlin.de>

Milliwave <milliwave@rfengineering.freeserve.co.uk> wrote:

> I do I specify "pi" = 3.1428, In C, I remember I used to simply write "pi".
> Any ideas how to specify it?

 use Math::Trig;
 print pi;

hth,
tina
-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Fri, 30 Mar 2001 22:33:29 GMT
From: "cam" <cam@home.com>
Subject: list all files in a directory
Message-Id: <ZQ7x6.160509$tP3.2459518@news1.rdc1.bc.home.com>

Hi:

How do I create a list of all files within a directory?

eg:

$theFiles="site/cgi-bin/data/";

Thanks.

Cam
cam@home.com





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

Date: Fri, 30 Mar 2001 14:46:12 -0800
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: list all files in a directory
Message-Id: <3ac50cb9$1@news.microsoft.com>

"cam" <cam@home.com> wrote in message
news:ZQ7x6.160509$tP3.2459518@news1.rdc1.bc.home.com...
> How do I create a list of all files within a directory?

Just a few ideas:
- `ls` (that's ls in backticks)
- readdir
- glob
- ...

I'm sure there are more




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

Date: 30 Mar 2001 20:16:41 +0100
From: nobull@mail.com
Subject: Re: LWP::Simple  problem
Message-Id: <u9n1a3jcdi.fsf@wcl-l.bham.ac.uk>

news-no-spam-group@home.com writes:

> I need to install the LWP:: Simple  modules for same below - I have NO CLUE 
> how to do this.

Clues can be found in the FAQ.  Look for the question that relates to
the installation of modules.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 30 Mar 2001 15:00:56 -0500
From: Dave <david.kernen@bms.com>
Subject: Re: Multidimensional Arrays?
Message-Id: <3AC4E5F8.3DF99F29@bms.com>



Michael Carman wrote:

> Milliwave wrote:
> >
> > I'm new to Perl, and have been reading about how to create
> > a (n-row by 7 column) array? The book I have only shows me
> > how to access a multidimensional array, but does not
> > inform me how to go about creating one?
>
> ...Start with the
> perlreftut manpage for a crash course, then read the perldsc (Perl Data
> Structures Cookbook) manpage. It includes some examples which should be
> helpful to you. After you've gotten a grip on those delve into the
> perlref manpage to get a full understanding of references.
>
> -mjc

Or you could just:
    push @LoL, [ $X,  $Y,  $Z,  $Y-$X ];
    all over your nested "if's" (changing the vars as needed).

djk



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

Date: Fri, 30 Mar 2001 21:52:51 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: Perl / CGI Editors
Message-Id: <3ac4fdba.77742315@news.earthlink.net>

On Thu, 29 Mar 2001 22:51:03 GMT, bogus@erol.com (---Pete---) wrote:

>PS: I found the basic message above at... comp.lang.perl.announce
>Just a few days ago (~3/27/01),  I downloaded and installed a copy
>and tried it on my PC. I loaded a simple HELLO_WORLD PERL script
>and tried the RUN function -- Nothing happened so I went looking for
>the DOCS for Visual Perl IDE but could not locate any. I contacted the
---------
Everyone, 
I found the solution to the above problem, I experienced with
the PERL IDE program v9.5. The fix for the new v9.7 is also
included here.  ---pete---

=============================================================
Installation Problems:

Problem: I successfully installed Open Perl IDE on my Windows
system, the basic editor operates normally but when I load a
simple Hello_World.pl script and attempt to run it using the
RUN (F9) feature, nothing happens.

Solution: When you RUN a script and you should see the output
displayed in the 'Console' window. The problem is most likely
due to Open Perl IDE not knowing where Perl.exe is located on 
your computer. You can solve this problem using one of 3
different methods as follows:

1.) If you have created a short-cut on your desktop to 
Perlide.exe then right-click on the short-cut, select 
'Properties', go to the 'Start in:' box and enter the 
"Drive:\path" to Perl.exe .

Example... E:\Perl\bin

2).) Use your favorite text editor to edit your autoexec.bat
by adding the "Drive:\path" to Perl.exe to the current PATH.

Example... PATH=c:\windows;c:\windows\command;E:\perl\bin;

3.) For PERL IDE versions 9.7 or higher, the program has an option
to configure the PATH to Perl.exe.  Select EDIT / Preferences /
Directories and go to the 'Path to Perl.exe' box and enter the 
"Drive:\path" to Perl.exe .

Example... E:\Perl\bin

=============================================================

---end---



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

Date: Fri, 30 Mar 2001 14:36:32 -0500
From: Alex <samara_biz@hotmail.com>
Subject: PerlScript/ASP programming issues
Message-Id: <3AC4E040.99E23EFB@hotmail.com>

Hi,

I'm writing active server pages in Perlscript for IIS/PWS. I was
wondering what a good approach for programming in ASP is. I read
somewhere that it's better when you separate your Perlscript code from
HTML code. On the other hand, when I look at tutorials about ASP, often
script is mixed with HTML code... I don't think that provides for an
easy to  maintain solution.

Can someone give me any insights on that? Or, maybe point me to some
resources? I would really appriciate that!

Thanks,

Alex



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

Date: Fri, 30 Mar 2001 14:29:47 -0800
From: "Ben P" <benpottinger@fuse.net>
Subject: Problem with regular expression in IF statement! Please help!
Message-Id: <tc9no442ijarfd@corp.supernews.com>

Hello everyone, sorry to make a stupid question my first post but I can not
seem to figure this out (I know it has to be something simple too).

Why does this IF statement ALWAYS return true and print the contents of
$results ??

 I've included the script, and the contents of a "whois" query just in case
you don't know.

 Please help!

  Ben

benpottinger@hotmail.com


#!/usr/bin/perl -w

$results = '';
$whois   = 'whois.txt';

open (WHOIS, "< $whois") or die "Can't open $whois: $!";

while (<WHOIS>) {
   chomp;
   $results = system("whois $_");
   if ($results =~ /No match for/) { print "$results\n\n\n"; }
  }


[whois.crsnic.net]

Whois Server Version 1.3

Domain names in the .com, .net, and .org domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

YAHOO.COM.IS.TRYING.TO.STEAL.YAHOO.VU.HOW.ACIDULOUS.COM
YAHOO.COM

To single out one record, look it up with "xxx", where xxx is one of the
of the records displayed above. If the records are the same, look them up
with "=xxx" to receive a full display for each record.

>>> Last update of whois database: Thu, 29 Mar 2001 08:24:30 EST <<<

The Registry database contains ONLY .COM, .NET, .ORG, .EDU domains and
Registrars.





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

Date: Fri, 30 Mar 2001 19:50:06 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: Problem with regular expression in IF statement! Please help!
Message-Id: <slrn9c9mqv.rao.trammell@bayazid.hypersloth.net>

On Fri, 30 Mar 2001 14:29:47 -0800, Ben P <benpottinger@fuse.net> wrote:
> Hello everyone, sorry to make a stupid question my first post but I can not
> seem to figure this out (I know it has to be something simple too).

To make matters worse -- you're asking the wrong question!

[snip]
> #!/usr/bin/perl -w

use strict;

[snip]
> $results = system("whois $_");
> if ($results =~ /No match for/) { print "$results\n\n\n"; }

I do not think system() returns what you think it does.



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

Date: Fri, 30 Mar 2001 15:52:57 -0600
From: Jesse James Jensen <jesse@uchicago.edu>
Subject: quick question on m//o
Message-Id: <3AC50039.532ACC98@uchicago.edu>

Is using "o" a promise that the variable will never ever change the
whole time the script is running?  I always thought it was more like
that it wouldn't change right in the middle of a check, but that later
on, it might get called again with a different value in the variable.


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

Date: Fri, 30 Mar 2001 16:13:19 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: quick question on m//o
Message-Id: <slrn9c9tnf.oeh.tadmc@tadmc26.august.net>

Jesse James Jensen <jesse@uchicago.edu> wrote:

>Is using "o" a promise that the variable will never ever change the
>whole time the script is running?  


Since that is what the manual says, I'd go out on a limb and say "Yes".

   "is useful when the value you are interpolating won't change over
    the life of the script."


>I always thought 


Read the manual and *know*.


>it was more like
>that it wouldn't change right in the middle of a check, but that later
>on, it might get called again with a different value in the variable.


What happened when you tried it out in a little sample program?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 30 Mar 2001 22:10:06 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: quick question on m//o
Message-Id: <x7lmpmx60x.fsf@home.sysarch.com>

>>>>> "JJJ" == Jesse James Jensen <jesse@uchicago.edu> writes:

  JJJ> Is using "o" a promise that the variable will never ever change
  JJJ> the whole time the script is running?  I always thought it was
  JJJ> more like that it wouldn't change right in the middle of a check,
  JJJ> but that later on, it might get called again with a different
  JJJ> value in the variable.

/o says the regex should not be recompiled EVEN if any of the variables
used in it have changed. normally a regex is not recompiled unless some
changes have been detected. so /o is rarely needed and with qr// it is
basically obsolete.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 30 Mar 2001 15:04:55 -0600
From: "William D. Ezell" <nospam@nospam.com>
Subject: Regular exasperation
Message-Id: <3AC4F7C3.5DF9AE9B@nospam.com>

I'm in need of a little enlightenment regarding regular expressions. 
Specifically, I'm writing a Perl subroutine to perform "proper"
capitalization for strings with unusual, special-case acronyms.

Passing 
  $string = 'john a smith, dmd llc';
 
through a series of s///g sequences such as
  $string =~ s/dmd/DMD/g;

I can arrive at 'john a smith, DMD LLC' but I can't figure out a simple
regular expression to pick off [a-z] following a whitespace character
and convert it to uppercase.

I last tried
  $string =~ tr/(?<= )[a-z]/[A-Z]/;

which I thought would convert any [a-z] preceded by a space to uppercase
but obviously I'm way off.

Can anyone point out what I'm missing?  Advice appreciated.

Please reply via e-mail (see below) if possible.

Thanks,
Bill


******  To reply, remove the "~" from  "wd~ezell@snowhill.com"  ******

-----------------EXPERIMENTAL CONTENT - PLEASE DISREGARD--------------
ATF communist Pope hapax legomenon fututrix Waco subversion Democratic
ratite ACLU explosive Clinton extremists CIA abortion Koresh supremacy
Oklahoma cleansing Reno obfuscate KKK Montana seminiferous pood ratite
Gore Russian semper paratus McVeigh UN assasinate NAACP Hussein Semtex
C-4 Toronto Reno bombs Rudolph ratite Tzupo KGB Chinese nitro Davidian
Greenspan hijack Kacczynski ratite President pood Sit Ubu Sit FBI pood
Koresh ratite SETI Bosnia Nazi nuclear anthrax tribade agent IRA death
yeti sex classified smegma Rudolph Confederate subversion infiltrators
Captain Kangaroo biological DEA threat Quebec Whitehouse ratite NASDAQ
--------------------------N 31-33-07 W 85-46-56 ----------------------


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

Date: Fri, 30 Mar 2001 21:14:47 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Regular exasperation
Message-Id: <x7ofujvu0o.fsf@home.sysarch.com>

>>>>> "WDE" == William D Ezell <nospam@nospam.com> writes:

  WDE> I can arrive at 'john a smith, DMD LLC' but I can't figure out a simple
  WDE> regular expression to pick off [a-z] following a whitespace character
  WDE> and convert it to uppercase.

  WDE> I last tried
  WDE>   $string =~ tr/(?<= )[a-z]/[A-Z]/;

  WDE> which I thought would convert any [a-z] preceded by a space to uppercase
  WDE> but obviously I'm way off.


you are confusing s/// with tr///. tr translates all chars and does NOT
do regular expressions. you need to use s///.

then you need to GRAB the char you are trying to change and the refer to
that in the replacement string as $1 (or $2 ...)

read perldoc perlre and perldoc perlop for the s/// operator.

also get the book mastering regular expressions.

  WDE> Please reply via e-mail (see below) if possible.

unless you use a normal email address, i won't reply via email. you
post here, you read here.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V10 Issue 598
**************************************


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