[17063] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4475 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 30 06:05:26 2000

Date: Sat, 30 Sep 2000 03:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970308309-v9-i4475@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 30 Sep 2000     Volume: 9 Number: 4475

Today's topics:
        5.6.0 lib.pm changes. <tcl@bunzy.net>
    Re: Anybody out there use TinyWeb server? (Logan Shaw)
        arrays in formats <dzepeda@cs.utsa.edu>
        Bijeenkomst Amsterdam Perl Mongers, Dinsdag 2 November  (Johan Vromans)
        Chicago Perl Seminars by Damian Conway, 10/9-11 <tim@consultix-inc.com>
        DBI and MS-Access <vecernik@aon.at>
    Re: File upload testing if it's there <bwalton@rochester.rr.com>
    Re: File upload testing if it's there <godzilla@stomp.stomp.tokyo>
        how can I run a perl prog on other host in network, fro <robert@chalmers.com.au>
    Re: How to get length of scalar? (Martien Verbruggen)
    Re: How to get length of scalar? <mcarruth@talk21.com>
    Re: matching ms-dos filenames <bwalton@rochester.rr.com>
    Re: matching ms-dos filenames <jargo_nomeatinacanthanks@vet.com.au>
    Re: matching ms-dos filenames <godzilla@stomp.stomp.tokyo>
    Re: matching ms-dos filenames <lr@hpl.hp.com>
    Re: Newbie can't handle the "true"th...  explanation de (Craig Berry)
    Re: Newbie can't handle the "true"th...  explanation de <lr@hpl.hp.com>
        Perl module for WAP/WML??? <tharant@metgames.com>
    Re: POST with variable data (Gwyn Judd)
    Re: PPM: can't install modules from local directory <bwalton@rochester.rr.com>
    Re: What is: Can't locate object method? <anders@wall.alweb.dk>
    Re: What is: Can't locate object method? <philipg@atl.mediaone.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 29 Sep 2000 15:56:31 -0400
From: tc lewis <tcl@bunzy.net>
Subject: 5.6.0 lib.pm changes.
Message-Id: <Pine.LNX.4.10.10009291544540.7456-100000@magician.bunzy.net>


so i can "use lib whatever" in perl, and with pre 5.6 perl that seemed to
make perl look in whatever and whatever/arch for packages.  with 5.6.0, it
seems to look in whatever, whatever/version, and whatever/version/arch,
and not whatever/arch.

however, if i use a PERL5LIB environment variable, it does look in
whatever/arch (and whatever).

installing packages from cpan with a PREFIX of "whatever" seems to install
in whatever and whatever/arch.

so we're a bit confused as to what changes are going on and what we can
expect in the future.  we used to use "use lib whatever" for our perl
stuff, but i'm suggesting PERL5LIB now instead, but we're not sure what
the best method is.  another suggestion is to keep using "use lib
whatever" and to instead install things with a PREFIX of whatever/version
instead of just whatever.

does this make sense?

maybe this has been adressed before.  i didn't see it in the related faq
questions and stuff on perl.org and related sites.  so i turn to you!

comments very very welcome.
thanks!

-tc lewis.
tcl@bunzy.net


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

Date: 30 Sep 2000 01:04:03 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Anybody out there use TinyWeb server?
Message-Id: <8r3voj$35n$1@provolone.cs.utexas.edu>

In article <8r3enk$scn$1@sshuraab-i-1.production.compuserve.com>,
Ray Lj <raylj@compuserve.com> wrote:
>If you useTinyWeb for local  perl/cgi development I could use some help. I
>can not get Tiny to accept more than one REQUIRE statement in a perl
>program.
>
>And, it's worse than that....it will only use one particular file. If I add
>any subroutines to the file it halts, if I name another file it halts, if I
>even rename the second file to the name of the first file it halts.

Have you tried running these CGI scripts from the command line?  The
Perl CGI module (if you are using that) has an interactive interface
you can use for debugging.

I don't really know anything about TinyWeb, but if it truly is a CGI
environment for the scripts, then the web server shouldn't know any
language-specific details.  So, it seems like you have some sort of
problem with the Perl code itself rather than the web server.

  - Logan


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

Date: Sat, 30 Sep 2000 03:50:13 -0500
From: Daniel Zepeda <dzepeda@cs.utsa.edu>
Subject: arrays in formats
Message-Id: <Pine.GSO.3.95.1000930034749.20800A-100000@ten69>

Hi,
	I'm trying to print out an array in a format. I expected this to
work but it only gave me the first line in the array. I've pored over the
documentation but can't find what I need to help.

#!/usr/bin/perl -w 

format MYFORMAT=
<html>
  <title>This is HTML</title>
  <body bgcolor="white">

  @*
  @input


  </body>
</html>
 .

open( INPUT, "</home/dpz/.bashrc");

@input = <INPUT> ;

open( MYFORMAT, ">somethingorother.html" );

write( MYFORMAT );

close( INPUT );


Daniel P. Zepeda
dpz@pobox.com

"May the Schwartz be with you." -- Yogurt in "Spaceballs"



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

Date: 30 Sep 2000 11:28:40 +0200
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Bijeenkomst Amsterdam Perl Mongers, Dinsdag 2 November 2000
Message-Id: <m2zokqz0s7.fsf@phoenix.squirrel.nl>
Keywords: Amsterdam.pm meeting 2 mei xxLINK


[English version follows the dutch text]
 
Amsterdam.pm staat voor de "Amsterdamse Perl Mongers", een groep van
gebruikers van Perl. In tegenstelling tot wat de naam suggereert is
Amsterdam.pm niet beperkt tot alleen Amsterdam, maar functioneert, tot
er meer gebruikersgroepen in Nederland zijn, als Nederlandse
gebruikersgroep.
 
Amsterdam.pm organiseert informele bijeenkomsten waar Perl gebruikers
kunnen samenkomen en informatie en gebruikservaringen met betrekking
tot Perl kunnen uitwisselen. Deze bijeenkomsten vinden normaliter
plaats op elke eerste dinsdag van de maand. De voertaal binnen
Amsterdam.pm is in pricipe Nederlands, maar indien nodig zal Engels
worden gebruikt, b.v. om te communiceren met niet-Nederlandssprekende
aanwezigen.
 
De eerstvolgende bijeenkomst vindt plaats op dinsdag 2 november 2000 van   
20:00 tot 22:00 uur op het kantoor van Dijkmat, Sarfatistraat 708,
Amsterdam. Deze bijeenkomst onder meer:

 - verslag van de YAPC::Europe in Londen
 - voortgang planning YAPC::Europe 2001, in Nederland
 - laatste nieuws over Perl6
 - en een heleboel Perl gezelligheid

Voor meer details, waaronder een routebeschrijving, zie 
http://www.amsterdam.pm.org/Meetings/next_meeting.html

Liefhebbers van een etentje vooraf kunnen tussen 17:45 en 18:15
verzamelen bij Dijkmat. Om 18:15 (écht om 18:15!) zoeken we een
restaurantje in de buurt om een hapje te eten.
 
Bezoek onze Web site http://www.Amsterdam.pm.org voor meer details.
 
[English version]
 
Amsterdam.pm stands for the Amsterdam Perl Mongers. We're basically a
Perl user group. Despite its name, it is not local to the Amsterdam
environment, but it welcomes Perl mongers from all over the
Netherlands.
 
Amsterdam.pm organises informal meetings where Perl users can meet,
and exchange information and experiences with regard to using Perl.
The meetings are normally held every first Tuesday of the month.
Although the preferred language for communication is Dutch, English
will be spoken if necessary.
 
Our next meeting is Tuesday November 2nd, 2000, from 20:00 till 22:00  
at the office of Dijkmat, Sarfatistraat 708, Amsterdam. This meeting
will have:

 - report on the YAPC::Europe in Londen
 - planning YAPC::Europe 2001, in the Netherlands
 - latest news about Perl6
 - and lots of Perl fun

See http://www.amsterdam.pm.org/Meetings/next_meeting.html for
more detail and the directions to get there.

Should you want to join some of us for dinner, please gather between
17:45 and 18:15 at Dijkmat. At 18:15 sharp we'll leave for a
restaurant somewhere nearby for dinner.

See http://www.Amsterdam.pm.org for more details.





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

Date: 30 Sep 2000 04:45:33 GMT
From: Dr Tim Maher <tim@consultix-inc.com>
Subject: Chicago Perl Seminars by Damian Conway, 10/9-11
Message-Id: <8r3r5d$4ve$1@brokaw.wa.com>
Keywords: conway perl programming OOP parsing chicago consultix


     Dr. Damian Conway giving Perl Seminars in Chicago

THE SHORT STORY:

Dr. Damian Conway, the world's leading expert on "Advanced
Object-Oriented Perl Programming" and "Text Parsing with Perl",
and the man who wrote the definitive book and software package
on these topics, is giving two advanced Perl seminars in
downtown Chicago, 10/9-10/11, during a brief visit to America.

Full details and online registration are available at
http:/www.consultix-inc.com , or by calling (888) 781-UNIX.

NOTE: This might be your only chance to learn from Dr. Conway in
the Chicago area!


THE LONG STORY:

Perl is one of the most important programming languages of the modern
era, due to its mixture of simplicity, elegance, power, and wide
range of applicability.

Many start using it as a "procedural" programming language, but later
develop needs to apply "Object-Oriented" techniques, or to use Perl
for "Text Processing" that goes beyond what is practical to achieve
with regular expressions.

Historically, there haven't been many resources to help you learn
OO-Perl, but recently Damian Conway, of Australia's Monash University,
wrote an authoritative book on the subject.  His "Object Oriented
Perl" has been praised by the luminaries of the Perl community,
both for its technical accuracy and for setting a new standard for
readability in technical writing.

Damian has also written some of the most useful freely-available Perl
modules (see: www.cpan.org), including Parse::RecDescent, the definitive
text-parsing utility.  His many prized contributions to the Perl software
archives have earned him three "Larry Wall" awards, which makes him the
most decorated Perl software developer in history!

If you're interested in learning about Object-Oriented Perl from the
man who literally wrote the book on the subject, or discovering the
amazing power of parsing using Parse::RecDescent from the man who
wrote that software module, please consider attending Dr. Conway's
downtown Chicago classes on these subjects on 10/9-10/10 (OOP) and
10/11 (Parsing).

More details, and on-line registration, are available at:
        http://www.consultix-inc.com
or by calling (888) 781-UNIX.


ABOUT DAMIAN CONWAY:

Those who have heard Damian Conway speak at the Perl Conferences of
the last few years know what a gifted communicator and educator he is,
but for the benefit of the rest of you, here are some summary data
on the presentations of his OOP and Parsing seminars at the latest
Perl Conference in July, 2000:

    Advanced Object Oriented Perl (averages of 55 responses):

        Overall quality of presentation 98.8%
        Knowledge                       100.0%
        Preparation                     98.0%
        Speaking skills:                99.2%
        Responses to questions          97.6%
        Real world orientation          93.0%
        Rapport with audience:          98.8%
        Presentation materials:         98.0%
        Overall professionalism:        98.0%
        Handouts:                       95.6%

        Comments:
            Great pace/instruction. Damian is an excellent teacher; very
            creative and knowledgeable. The humor really made for a
            great presentation.

            Wealth of information covered beyond that available in
            Damian's work.

            The tutorial was fun and entertaining. It presented OO Perl
            in ways I had never thought of before. Even though this was
            advanced Perl OO, it had a good, quick description of OO
            basics. The best part was that I felt I learned a lot, even
            though I have read Perl books.

            It was one incredible mind stretcher! I've learned far more
            about Perl Objects than I ever expected existed.

            Instructor is GREAT speaker and very captivating.
            Great information and real world application examples.

            Brain bending (I was thinking of new things at every break).

            Damian Conway has phenomenal command of the material
            and exceptional communication skills.

            Almost every topic taught me something I didn't know. This
            class expanded and twisted my mind like very few things had
            done before in the field of Perl programming.


    Text Parsing (averages of 15 responses):

        Overall quality of presentation 95.8%
        Knowledge                       98.6%
        Preparation                     95.8%
        Speaking skills:                97.2%
        Responses to questions          97.2%
        Real world orientation          92.4%
        Rapport with audience:          97.2%
        Presentation materials:         94.2%
        Overall professionalism:        97.2%
        Handouts:                       92.8%

        Comments:

            The G-WIZ factor was mind blowing, and the humor.

            The presentation was at my level!

            The thing I liked most was the range of examples and the
            degree to which Damian's work embodies the spirit of Perl.

            Very entertaining! Kept whole audience in stitches. Very
            clever use of puns, words, and ideas. Very quick on
            questions. Extraordinary knowledge.

            Informative and interesting; not boring. Lively speaker; no
            way to get any sleep in here.

            Intellectual inventiveness -- and a wide range of
            examples

*========================================================================*
| Dr. Tim Maher, CEO, Consultix       (206) 781-UNIX/8649;  ask for FAX# | 
| Email: tim@consultix-inc.com        Web: http://www.consultix-inc.com  |
|Training- TIM MAHER: Unix, Perl  DAMIAN CONWAY: Adv. Perl, OOP, Parsing |
|CLASSES: 10/9: Adv OO-Perl/Parsing  10/16: Int. Perl  10/23: Basic Perl |
*========================================================================*


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

Date: Sat, 30 Sep 2000 10:06:10 +0200
From: Oliver Vecernik <vecernik@aon.at>
Subject: DBI and MS-Access
Message-Id: <39D59EF2.C07DF703@aon.at>

Hi all,

I'd like to read and write to '*.mdb' databases. Working on a NT box
with DBI and ODBC does that job quite well. But is there a way to do it
with a Linux (i386) box? Is there something like ODBC or ADO? Or is
there a DBD for MS-Access? Any sugguestions are highly appreciated!

Oliver


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

Date: Sat, 30 Sep 2000 04:12:31 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: File upload testing if it's there
Message-Id: <39D5683A.57BAA9BB@rochester.rr.com>

jim_marshall2268@hotmail.com wrote:
> 
> I'm new to perl, started two days ago. I've been doing C/C++ and Java
> for many years...
> 
> I'm writing a small script to do file upload (fileupload), I'm using
> the CGI.pm module.  The form I have has three file upload fields, but
> the user can select to upload only 1 file (or just 2 files, or all 3).
> So I want to test if the field is present.
> 
> I tried this
> 
> $jpgFile = $query->param("pic1");
> # if (defined $jpgFile) {
> if ($jpgFile) {
>   print "File pic1 is present";
> }
> elif {
>   print "File 'pic1' is not present";
> }
> 
> No matter what the "is not present" code was being executed. I ended up
> having to do this
> 
> $jpgFile = $query->param("pic1");
> if ($jpgFile ne '') {
>   print "File pic1 is present";
> }
> elif {
>   print "File 'pic1' is not present";
> }
> 
> Can someone explain why the former didn't work?  And if it is safe and
> valid to use the later?  The code works fine with the 'ne' but I want
> to be sure it is ok.
> 
> Thanks
> -Jim
 ...
Couple of things:

1.  Your printed messages indicate that you somehow think this code will
test for the presence of a file.  It is merely testing for the presence
of a filled-in filename in your form.

2.  The "defined" function will return true if the variable is defined,
regardless of the value it stores (except for undef).  If it contains
the null string, it is still defined.  Thus, your call to defined will
always return true, since you have defined $jpgFile and it will never
contain undef.  See:

     perldoc -f defined

3.  Your second way of doing it should be OK.  It is better than just:

     if($jpgFile){...

since that would fail if the value of $jpgFile was 0.  An unlikely, but
possible, filename.

4.  To actually test for the presence of a file, see the -e operator. 
See:

     perldoc -f -e

-- 
Bob Walton


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

Date: Fri, 29 Sep 2000 21:39:20 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: File upload testing if it's there
Message-Id: <39D56E78.81479CC@stomp.stomp.tokyo>

jim_marshall2268@hotmail.com wrote:

(snippage)
 
> I'm new to perl, started two days ago. I've been 
> doing C/C++ and Java for many years...


Honestly? Then you know Perl code won't compile if
it has fatal syntax errors. Post code which compiles
and perhaps someone can help you. Gotta have code 
which works, before you can locate your bugs.


Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: Sat, 30 Sep 2000 15:57:32 +1000
From: "Robert Chalmers" <robert@chalmers.com.au>
Subject: how can I run a perl prog on other host in network, from within a perl prog.
Message-Id: <U8fB5.41$187.3132@nsw.nnrp.telstra.net>

I have two hosts on the same network, both with perl programs I need to run
that adjust the config files. So they need to run as 'root'. FreeBSD boxes
both.

The question is. Is it possible to have a subroutine in PerlProg-Server-A
call and run a perl program on Server-B. Both are on the same network, and
can understand most rsh things, but I'm wondering if Perl has something in
ti that I can't locate, (or understand) that can call this other program for
me.

It's basically like this. Add to named.conf on A, then call pero-prog on B,
make named.conf additions on B, and restart both processes.

any ideas anyone?

thanks
Bob




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

Date: Sat, 30 Sep 2000 17:32:37 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: How to get length of scalar?
Message-Id: <slrn8tb285.jr6.mgjv@martien.heliotrope.home>

[alt.perl removed]

On Fri, 29 Sep 2000 22:09:59 +0100,
	Mark Carruth <mcarruth@talk21.com> wrote:
> I would just like to add, that to round off this argument, if you people can
> leave it at this,

Leave it at this? You don't know this bunch of people very well, do you?
You don't know any group of people on Usenet very well, do you? No one
ever leaves anything at it. Everyone has the last word. That's why all
this bandwidth out there is necessary. It has nothing to do with the
Web.  That's just a commercial story that all these web-design people
are using out there to get them work.

It's Usenet discussions geometrically increasing because everyone
participates, _and_ has the last word.

>                   is that I didn't even post this reply to any of you
> people, so I don't really think you have the right to start criticising,
> then the information isn't directed at you.
> 
> A voice version of this would be "eavestropping" or listening to other
> peoples conversations which I consider to be down right rude, and therefore
> you people must all be down right rude.

This is a logical fallacy, even if it wasn't based on ignorance of how
Usenet works. I never read any of your articles. Not even the one I'm
responding to... correction, _not_ responding to. I am not writing this.

[Chants:
Must not correct spelling mistakes. 
Must not correct spelling mistakes.
Must not correct spelling mistakes.
Phew]

Instead of getting all defensive, you should probably calm
yourself down, take a valium, sip some coffee, sniff some glue. Then,
you should learn about how Usenet works. Anything you post to Usenet is
public. It does not 'go' to any particular person. It ends up on Usenet
servers, and anyone with a client can read the articles on these
servers.

> Hope you all have a wonderful day,

It's not too bad. About 30 degrees Celsius, not too much wind, calm
water in the Harbour, blue sky. Been doing some nice things. Been
avoiding working in the garden.

Of course, I can't speak for anyone else.

[large snippage of out of context and jeopardy style quote]

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | +++ Out of Cheese Error +++
Commercial Dynamics Pty. Ltd.   | Reinstall Universe and Reboot +++
NSW, Australia                  | 


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

Date: Sat, 30 Sep 2000 10:58:19 +0100
From: "Mark Carruth" <mcarruth@talk21.com>
Subject: Re: How to get length of scalar?
Message-Id: <8r4dh2$q55$1@uranium.btinternet.com>

Yes, do you?

--
-----------------------------------------------
Mark Carruth
mcarruth@talk21.com
"Zaphod" <zaphod@psnw.com> wrote in message
news:39D509BD.8CF36601@psnw.com...
Mark Carruth wrote:
>
> I would just like to add, that to round off this argument, if you people
can
> leave it at this, is that I didn't even post this reply to any of you
> people, so I don't really think you have the right to start criticising,
> then the information isn't directed at you.
>
> A voice version of this would be "eavestropping" or listening to other
> peoples conversations which I consider to be down right rude, and
therefore
> you people must all be down right rude.
>
> Hope you all have a wonderful day,
>
> --
> -----------------------------------------------
> Mark Carruth
> mcarruth@talk21.com
> "Mark Carruth" <mcarruth@talk21.com> wrote in message
> news:8qvur2$4il$1@uranium.btinternet.com...
> The reason I post HTML is that I use Outlook Express to look at these
> newsgroups, and I also use Outlook Express to read my mail.
>
> As I send all my emails (which are part of my LIFE Uri) using HTML, the
> programme sends all my posts in HTML. I never have people moaning about
HTML
> in Email so I don't know why I should change.
>
> --
> -----------------------------------------------
> Mark Carruth
> mcarruth@talk21.com
> "Mark Carruth" <mcarruth@talk21.com> wrote in message
> news:8qthfc$26d$1@uranium.btinternet.com...
> Why is it you people have such a problem with HTML. Either, get a decent
> mail client for Windows, or if you use Unix and you are such a bloody
genius
> at it to go criticising other people, make yourself a f*c*i*g HTML parser
> that will work on Windows.
>
> You will notice that this message is in plain text for you "Challenged"
> people.
>
> --
> -----------------------------------------------
> Mark Carruth
> mcarruth@talk21.com
> "Uri Guttman" <uri@sysarch.com> wrote in message
> news:x7u2b28o07.fsf@home.sysarch.com...
>
> did you actually have anything to say? or was it lost in the sea of html
> crap?
>
> 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

Do you really not understand the concept of a news "group"?

--

Zaphod
Technical Director
------------------------------------------------------------------------
TruckLoad2000                 A Service of Acquisitions Services, LLC.
------------------------------------------------------------------------
Support:   (559) 304-0882               2680 N. Marks suit 106
Direct:    (559) 275-0493               Fresno, CA 93722
Toll Free: (866) 275-0493               http://www.TruckLoad2000.com
Fax:       (559) 275-0529               email: zaphod@TruckLoad2000.com
========================================================================
========================================================================




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

Date: Sat, 30 Sep 2000 04:21:59 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: matching ms-dos filenames
Message-Id: <39D56A72.B365D51@rochester.rr.com>

Jason Argo wrote:
> 
> Hi all,
> 
> I'm having a problem in matching ms-dos filenames.  I'm using something like:
> 
> (when both $file1 and $file2 are "c:\folder\file")
> 
> if ($file1 =~ m/$file2/) {
>         # do stuff...
> }
> 
> This never seems to match.  I think the backslashes on the righthand side 
You need to quote the metacharacters in the interpolated pattern.  Try:

     if($file1=~m/\Q$file2\E/){...

Then look it up in

     perldoc perlre

 ...
> Jason
-- 
Bob Walton


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

Date: Sat, 30 Sep 2000 16:14:34 +1100
From: Jason Argo <jargo_nomeatinacanthanks@vet.com.au>
Subject: Re: matching ms-dos filenames
Message-Id: <39D576BA.C66570EA@vet.com.au>

Many thanks Bob -- this worked perfectly.  I should have read more of TFM.  :)

J

Bob Walton wrote:
> 
> Jason Argo wrote:
> >
> > Hi all,
> >
> > I'm having a problem in matching ms-dos filenames.  I'm using something like:
> >
> > (when both $file1 and $file2 are "c:\folder\file")
> >
> > if ($file1 =~ m/$file2/) {
> >         # do stuff...
> > }
> >
> > This never seems to match.  I think the backslashes on the righthand side
> You need to quote the metacharacters in the interpolated pattern.  Try:
> 
>      if($file1=~m/\Q$file2\E/){...
> 
> Then look it up in
> 
>      perldoc perlre
> 
> ...
> > Jason
> --
> Bob Walton

--
Jason Argo
Manager - Software Testing
Vet - Anti-Virus Software
Computer Associates Pty Ltd


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

Date: Fri, 29 Sep 2000 23:02:09 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: matching ms-dos filenames
Message-Id: <39D581E1.5C16BB7C@stomp.stomp.tokyo>

Jason Argo wrote:

> I'm having a problem in matching ms-dos filenames.
> I'm using something like:
 
> (when both $file1 and $file2 are "c:\folder\file")
 
> if ($file1 =~ m/$file2/) {
>         # do stuff...
> }
 
> This never seems to match.

(snipped)


Mr. Walton has performed a more than adequate
job of explaining a problem with backslashes
imported into regex associated operations.

Here is another method. Based upon your parameters,
you are comparing a file to itself, or possibly
comparing a file to itself. Hard to tell with
a lack of a trailing backslash or a file extension
within your example. However you do indicate
DOS 'filenames' so a presumption is made you
have a file with no extension and, it is quite
impossible to have two files within the same
directory, both with the same filename. So,
you are working with a single file, rather
than multiple files, as indicated. Clearly
then, you wish to compare a file to itself.
Inherently, equality will exist.


if ($file1 eq $file2)
 { &Blow_Up_My_Computer; }


Those dirty rotten no good stinking
backslashes, are not a problem,
especially if equality is true.


Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: Fri, 29 Sep 2000 23:18:05 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: matching ms-dos filenames
Message-Id: <MPG.143f2576ee68c13e98ade5@nntp.hpl.hp.com>

In article <39D56A72.B365D51@rochester.rr.com>, bwalton@rochester.rr.com 
says...
> Jason Argo wrote:

 ...

> > I'm having a problem in matching ms-dos filenames.  I'm using something like:
> > 
> > (when both $file1 and $file2 are "c:\folder\file")
> > 
> > if ($file1 =~ m/$file2/) {
> >         # do stuff...
> > }
> > 
> > This never seems to match.  I think the backslashes on the righthand side 
> 
> You need to quote the metacharacters in the interpolated pattern.  Try:
> 
>      if($file1=~m/\Q$file2\E/){...

But then $file1 = 'c:\folder\filefoo' would 'match' $file2 = 
'c:\folder\file'.

If equality is desired, the 'eq' operator should be used (or, less 
pleasingly, the pattern should be anchored at each end).  If inclusion 
is desired, the 'index' operator should be used.

And in any case, life is a lot easier if one uses forward slashes as 
path separators (yes, even on MS-DOS, unless passing arguments to the 
unspeakable command processor).

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


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

Date: Sat, 30 Sep 2000 04:45:06 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Newbie can't handle the "true"th...  explanation desired
Message-Id: <staruir33opb2a@corp.supernews.com>

Larry Rosler (lr@hpl.hp.com) wrote:
: > Various transformation rules allow this list to be shortened.  For
: > example, undef interpreted as a string yields '', and as a number, 0.
: 
: But there may be warnings caused by conversions of undef.  However, a 
: simple Boolean test of undef never produces a warning.

Of course; I intended this for understanding purposes, rather than coding.
Knowing that undef is false, and that undef can become '' or 0 at need,
and that the latter stringifies to '0' at need, you can see how all the
false values are really special extensions of 'undef is false'.

Interestingly, the set of false values is closed under such
transformations; no conversion will automatically turn a false value into
a true one.  But the reverse is not true:

  my $x = 'a true value';
  print(($x   ? 'true' : 'false'), " as a string\n");
  print((0+$x ? 'true' : 'false'), " as a number\n");

$x is true as a string, but false if coerced into being a number.  Of
course, you'll get a warning about the value of $x being non-numeric if
warnings are enabled.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Fri, 29 Sep 2000 23:09:29 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Newbie can't handle the "true"th...  explanation desired
Message-Id: <MPG.143f237065a5482c98ade4@nntp.hpl.hp.com>

In article <staruir33opb2a@corp.supernews.com>, cberry@cinenet.net 
says...

 ...

> Interestingly, the set of false values is closed under such
> transformations; no conversion will automatically turn a false value into
> a true one.  But the reverse is not true:
> 
>   my $x = 'a true value';
>   print(($x   ? 'true' : 'false'), " as a string\n");
>   print((0+$x ? 'true' : 'false'), " as a number\n");
> 
> $x is true as a string, but false if coerced into being a number.  Of
> course, you'll get a warning about the value of $x being non-numeric if
> warnings are enabled.

To see the same phenomenon without warnings, set $x to the string '0E0' 
or '00' or '0.' or '+0' or infinitely other such.

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


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

Date: Sat, 30 Sep 2000 05:41:40 GMT
From: "Tharant" <tharant@metgames.com>
Subject: Perl module for WAP/WML???
Message-Id: <n2fB5.2633$QF1.368247@paloalto-snr1.gtei.net>

I have some Perl CGIs I need to use to dynamically create WML decks.
Is there a Perl module or function that will help with this?

(WML, as in Wireless Markup Language, as in WAP enabled devices, as in
Wireless Web Cell Phones.)  :-)

Thanks in advance!

-tharant




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

Date: Sat, 30 Sep 2000 07:15:12 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: POST with variable data
Message-Id: <slrn8tb4nt.3k4.tjla@thislove.dyndns.org>

I was shocked! How could briceman@my-deja.com <briceman@my-deja.com>
say such a terrible thing:
>I am trying to POST to another cgi program using
>an input type whose value is set from a
>$variable.  The param is always null on the
>called program.  If the input value is explicitly
>set it works fine.
>
>print '<CENTER><form method=POST action=/cgi-
>bin/info.cgi><input name=aaaa type=hidden
>value="$site"><input name=action type=hidden
>value="delete"><BR><BR> <input type=submit
>value="Do something here"></CENTER>';

That's because you enclosed the printed stuff, including the variable
data in single quotes ('). When you do this, variables are not
interpolated. I recommend using double quotes, along with a
here-document for easier redability:

print <<"EOP";
<CENTER>
<form method=POST action=/cgi-bin/info.cgi>
<input name=aaaa type=hidden value="$site">
<input name=action type=hidden value="delete">
<BR><BR>
<input type=submit value="Do something here">
</CENTER>
EOP

See the documentation on "Quote and Quote-like Operators" in:

perldoc perlop

Hope that helps.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
There was a young lady of Bude
Who walked down the street in the nude.
	A bobby said, "Whattum
	Magnificent bottom!"
And slapped it as hard as he could.


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

Date: Sat, 30 Sep 2000 04:27:49 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: PPM: can't install modules from local directory
Message-Id: <39D56BD0.5B60C35F@rochester.rr.com>

hiroshiishii@my-deja.com wrote:
> 
> Hi All:
> 
> I am having very difficult time to install DB_File module.
> 
> Our situation does not support proxy.  So I downloaded the module
> according to an instruction found in "Using PPM to installl modules."
> 
> I created a local repository on C: drive under the "perl" folder,
> C:\perl\ppm.
>

I've had good luck with:

     ppm "--location=c:/perl/ppm"

The quotes are needed, and the forward slashes are not typos.  Make sure
you preserve the directory structure when you unzip your packages
(sounds like you are).
 
 ...
-- 
Bob Walton


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

Date: Sat, 30 Sep 2000 07:45:42 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: What is: Can't locate object method?
Message-Id: <e7fB5.864$Qu1.74634@news000.worldonline.dk>

MuLE wrote:

> Can't locate object method "TIEHASH" via package "Apache::Session::DBI"
> 
> What does this mean in english?
> 
 
excactly what it says.

Perl couldn't find a method named TIEHASH, which someone assumed was in 
Apache::Session::DBI.

to resolve prolems, you should allways
use strict
use the -w switch
use do or die constructs, dont forget to include the standard error message 
($!) in your die string.

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Sat, 30 Sep 2000 06:30:55 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: What is: Can't locate object method?
Message-Id: <zMfB5.1427$jJ4.509488@typhoon.southeast.rr.com>


Anders Lund <anders@wall.alweb.dk> wrote in message
news:e7fB5.864$Qu1.74634@news000.worldonline.dk...
> MuLE wrote:
>
> > Can't locate object method "TIEHASH" via package "Apache::Session::DBI"
> >
> > What does this mean in english?
> >
>
> excactly what it says.
>
> Perl couldn't find a method named TIEHASH, which someone assumed was in
> Apache::Session::DBI.
>
> to resolve prolems, you should allways
> use strict
> use the -w switch
> use do or die constructs, dont forget to include the standard error
message
> ($!) in your die string.
>
Agreed.  But note that following this advice probably won't solve this
particular problem.  Consider the following:

perl -w -Mstrict -e 'tie my %hash, "Apache::Session::File" or die "tie: $!"'
Can't locate object method "TIEHASH" via package "Apache::Session::File"
at -e line 1.

I'll wager that the problem here is that the OP isn't doing a "use
Apache::Session::File;" in the code.

p




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

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 V9 Issue 4475
**************************************


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