[15755] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3168 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 25 21:06:51 2000

Date: Thu, 25 May 2000 18:05:15 -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: <959303115-v9-i3168@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 25 May 2000     Volume: 9 Number: 3168

Today's topics:
        "or" vs. "||" - operator precedence question <gwr@novia.net>
    Re: "or" vs. "||" - operator precedence question (Joe Petolino)
    Re: "or" vs. "||" - operator precedence question (Abigail)
    Re: Advantages of Perl over Cold Fusion? <zapcs@icon.co.za>
    Re: Array Question (Lou Hevly)
    Re: Can't Knit Two Files Together (Randal L. Schwartz)
    Re: Can't Knit Two Files Together <dan@tuatha.sidhe.org>
        Cap.pm (Brandon Metcalf)
    Re: cgi name-value pairs , special characters <flavell@mail.cern.ch>
        DBI:ODBC on windows nt (David Krainess)
        devel.tar.gz does not exist at www.cpan.org/src <sergei_kucherov@3com.com>
    Re: devel.tar.gz does not exist at www.cpan.org/src <dan@tuatha.sidhe.org>
        HELP- Writing to memory IPC?? <ben.dry@internal.ozemail.com.au>
    Re: HELP- Writing to memory IPC?? (Abigail)
    Re: How does INC get into the Perl.exe <cgoehring@rcisd.com>
    Re: how to /s '[item]' <phil@BuxTech.Com>
    Re: how to /s '[item]' <godzilla@stomp.stomp.tokyo>
    Re: how to /s '[item]' <lr@hpl.hp.com>
    Re: how to send fax? <ppi@searchy.net>
    Re: Is anything planned re: Perl error reporting? (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 25 May 2000 18:12:01 -0500
From: George Rapp <gwr@novia.net>
Subject: "or" vs. "||" - operator precedence question
Message-Id: <aqiX4.6953$pX5.471372@sol.newscene.com>

OK, I thought I understood Perl's operator precedence, but I can't
figure this behavior out.  (HP-UX 10.20, perl5.005_02)

I'm using the DBI module, and trying to test for a successful
connection.  If I code it as shown in 'perldoc DBI':

  my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password)
    || die "Can't connect: $DBI::errstr";

then either I achieve a successful connection, or I die with my "Can't
connect" message.  However, if I change the "||" to the
lower-precedence "or":

  my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password)
    or die "Can't connect: $DBI::errstr";

then, if I don't successfully connect, the $DBI::errstr is still
printed out (which can be suppressed with a fourth argument
{PrintError=>0}), but the die() is not executed -- the program goes
right on past it, and my next DBI-dependent statement fails because
$handle isn't valid.

Since I'm not using any operators that lie between "||" and "or" on the
precedence chart, I would have expected the two operators to behave the
same here, but they don't.  What am I missing?  (I've been studying
perlop and perlobj for over an hour, and I'm still not seeing it.)

George
-- 
           George Rapp  (Bellevue, NE)  Go 'Huskers!!!
       Home: gwr@novia.net    ICQ: 14583674  AIM: gwrboing
  Work: grapp01@mail.dfas.msd.eds.com (or) george.rapp@dfas.mil
  Why is it called "after dark" when it really is "after light"?


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

Date: 25 May 2000 23:57:53 GMT
From: petolino@Eng.Sun.COM (Joe Petolino)
Subject: Re: "or" vs. "||" - operator precedence question
Message-Id: <8gkem1$426$1@engnews3.Eng.Sun.COM>

George Rapp  <gwr@novia.net> wrote:

    [ the following two statements behave differently ]

>  my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password)
>    || die "Can't connect: $DBI::errstr";

>  my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password)
>    or die "Can't connect: $DBI::errstr";

>Since I'm not using any operators that lie between "||" and "or" on the
>precedence chart, I would have expected the two operators to behave the
>same here, but they don't.  What am I missing?  (I've been studying
>perlop and perlobj for over an hour, and I'm still not seeing it.)

Sometimes it just doesn't help to study something too long.  ;^)
What you're missing is that "=" lies between "||" and "or" on the
precedence chart.  The first one parses as

   my($handle) = ( DBI->connect("dbi:Oracle:", $user_id, $password)
		     || die "Can't connect: $DBI::errstr" );

and the second one parses as

   ( my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password) )
   || die "Can't connect: $DBI::errstr";


-Joe

--  
Joe Petolino                                 petolino@eng.sun.com


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

Date: 26 May 2000 00:23:52 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: "or" vs. "||" - operator precedence question
Message-Id: <8gkg6o$9nc$1@news.panix.com>

On 25 May 2000 18:12:01 -0500, George Rapp <gwr@novia.net> wrote:
++ OK, I thought I understood Perl's operator precedence, but I can't
++ figure this behavior out.  (HP-UX 10.20, perl5.005_02)
++ 
++ I'm using the DBI module, and trying to test for a successful
++ connection.  If I code it as shown in 'perldoc DBI':
++ 
++   my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password)
++     || die "Can't connect: $DBI::errstr";
++ 
++ then either I achieve a successful connection, or I die with my "Can't
++ connect" message.  However, if I change the "||" to the
++ lower-precedence "or":
++ 
++   my($handle) = DBI->connect("dbi:Oracle:", $user_id, $password)
++     or die "Can't connect: $DBI::errstr";
++ 
++ then, if I don't successfully connect, the $DBI::errstr is still
++ printed out (which can be suppressed with a fourth argument
++ {PrintError=>0}), but the die() is not executed -- the program goes
++ right on past it, and my next DBI-dependent statement fails because
++ $handle isn't valid.
++ 
++ Since I'm not using any operators that lie between "||" and "or" on the
++ precedence chart, I would have expected the two operators to behave the
++ same here, but they don't.  What am I missing?  (I've been studying
++ perlop and perlobj for over an hour, and I'm still not seeing it.)


You are missing the fact that '=' is an operator, 3 steps down from ||
and 5 steps up from or.

    ($var) = EXPR1 || EXPR2;

is equivalent with:

    ($var) = (EXPR1 || EXPR2);

while

    ($var) = EXPR1 or EXPR2;

is equivalent with:

   (($var) = EXPR1) or EXPR2;

However, that's only part of your problem.

   ($var) = EXPR1 or die;

the assignment is in list context. If EXPR1 returns undef, the result
of ($var) = EXPR1 is (undef), a *LIST* of one element. One would expect
that such a list in scalar context returns its element, but assignment
is special. A "list" assignment in scalar context returns the number
of elements of the list on the right hand side of the assignment.
(I fail to use why that's useful at the moment.)

Consider:

    $ perl -wle '(undef) or die'            # Dies.
    $ perl -wle '$foo = (undef) or die'     # Dies.
    $ perl -wle '($foo) = (undef) or die'   # Does not die.

You could fix your problem by removing the ()s on the left hand side
of the assignment.


Abigail


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

Date: Fri, 26 May 2000 00:17:06 +0200
From: Zak McGregor <zapcs@icon.co.za>
Subject: Re: Advantages of Perl over Cold Fusion?
Message-Id: <392DA662.BC8AD27C@icon.co.za>

Cory Phillips wrote:
> 
> I have to write a justification to my employer to allow me to write a
> web database application using Perl.

1 - Perl is Perl
2 - Perl is not Cold Fusion
3 - Perl is Open Source, Cold fusion proprietary
4 - Perl is not (by default) and embedded html pre-processing language
5 - Perl is (likely to be) more flexible

> Can some of you help me come up with reasons why Perl would provide an
> advantage besides the obvious cost?  The company is pretty set on
> standardizing on Cold Fusion.

Well, Perl skills are probably more common to find.
 
> One advantage I've noticed is writing reusable code.  It's easier to
> write Perl in a modular fashion using sub routines.  Cold Fusion
> supports subroutines, but it's kind of clunky getting return values.
> Also, subroutines can only exist in the same directory as the calling
> routine or global directory designated by Cold Fusion (which is
> controlled by the company's IT group and would be a pain to get them
> to install global routines as needed).
 
> This all on Windows NT.

Shame.

HTH 

Ciao
-- 
====================================================================
Zak McGregor
http://www.zap.co.za/zgas - On-line specifications of over 6700 cars
====================================================================


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

Date: Thu, 25 May 2000 22:25:04 GMT
From: lou@visca.com (Lou Hevly)
Subject: Re: Array Question
Message-Id: <392db713.47284691@news.uni-stuttgart.de>

Larry Rosler <lr@hpl.hp.com> wrote:

>In article <392d3d04.15249464@news.wanadoo.es> on Thu, 25 May 2000 
>13:47:06 GMT, Lou Hevly <lou@visca.com> says...
>> Larry Rosler <lr@hpl.hp.com> wrote:
>> 
>> >Any string can be used as a hash key.  In the hash-index context or on 
>> >the left side of a =>, a string (bareword) that looks like an identifier 
>> >will be auto-quoted.
>> 
>> I think this might need to be emmended to "an *ASCII* string that
>> looks like an identifier". Even using locale, I've found that Perl
>> won't auto-quote non-ASCII characters in hash keys:
>
>I think it has nothing to do with auto-quoting of hash keys.  It has to 
>do only with the definition of an 'identifier'.

Quite true. I should have read further before posting :-(. Here's
another pertinent quote:

  The => operator is mostly just a more visually distinctive synonym
  for a comma, but it also arranges for its left-hand operand to be
  interpreted as a string--if it's a *bareword that would be a legal
  identifier*.

And, though it doesn't say so, it seems that non-ASCII characters can
not form part of legal identifiers. So perhaps perldata should say:

  Usually this name is a single identifier, that is, a string
  beginning with an ASCII letter or underscore, and containing
  other ASCII letters, underscores, and digits.

<snip>

>Perhaps you can tell us how this variation of your posted code behaves:
>
>#!/usr/bin/perl -w
>use strict;
>use POSIX;
>use locale;
>POSIX::setlocale(POSIX::LC_ALL, "catalan");
>
>my $València;

Same error:
Unrecognized character \350...

Hmmm, in theory 'qw' should work, right?

#!/usr/bin/perl -w
use strict;
my @ary = qw(à é);
print @ary;

No problem; works fine, even when you turn 'locale' off.

-- 
All the best,
Lou Hevly
lou@visca.com
http://www.visca.com


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

Date: 25 May 2000 15:07:04 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Can't Knit Two Files Together
Message-Id: <m17lcijncn.fsf@halfdome.holdit.com>

>>>>> "Godzilla!" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

Godzilla!> Another problem I have noted is many here post
Godzilla!> code which will only run under the most recent
Godzilla!> versions of Perl 5. These codes quite often, will
Godzilla!> not perform even under version 5.003 which I run.

Perl is free.  Upgrade.  And 5.003 doesn't belong on a webserver,
because it is subject to KNOWN BUFFER OVERFLOWS, which will get you in
trouble the day your website becomes overrun by script kiddies who use
it to launch another DDoS attack against some popular website and you
get implicated for having had lax security on your box.

I don't believe you're wrong all the time.  I don't believe you are
trolling intentionally.  But I do believe you think you know more than
you actually know, and that makes most of your posts useless at best,
and even typically dangerous.  Which is why we have to spend so much
effort in correcting you.  Please go away and learn some more Perl and
then come back and answer questions.  Your help is interfering more
than helping.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 26 May 2000 00:53:43 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Can't Knit Two Files Together
Message-Id: <rWjX4.93846$hT2.388039@news1.rdc1.ct.home.com>

I know I'm going to regret getting into this, but...

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> You make use of Mere Assertion which is quite foolish
> and a National Enquirer style tactic. I walk the talk
> by presenting factual data rather than simply falling
> to Mere Assertion.

Not to put too fine a point on it, but from the code you've posted it's
pretty obvious that you are darned sure of the way perl works. This is not
necessarily a bad thing, though I always distrust being overly sure as a
general rule. Unfortunately it's also pretty obvious that your
understanding of the things you're sure of is in many ways incorrect.

> I am affording readers code which does what is
> indicated. I produce correct results per what
> I indicate my code will do and not do.

Matt Wright's code does what's indicated as well. While I'm not drawing
direct comparisons between his code and yours, "producing correct results"
isn't necessarly a good indicator of actual correctness. You can still get
correct answers when doing things in bad or suboptimal ways. While there's
nothing particularly wrong with that in a private app, this is a public
forum of sorts, and code put up for example should meet a higher standard
than "it works". 

The only piece of your code I've taken any real look at is the error
message translation thing that was posted earlier in this thread, and it
shows a number of flaws in reasoning and knowledge of perl's functioning.
Whether these flaws are obvious or not from perl's docs is something I'm
not really in a position to judge--I'm reasonably familiar with perl's
guts and it tends to color my perceptions and fill in missing pieces. It
does do what you said it will, and I have no argument with that. It does,
however, do it in a way that has some significant issues, and really ought
not be used as an example of good perl programming. (Please don't take
this as a personal slam, as it's not. It's a considered editorial opinion
of your code as posted, nothing more)

Putting aside personal animosities, when Randal corrects you on a
techincal matter it's generally safe to assume he knows what he's talking
about. While you may have no reason to assume it, and reasons to think
otherwise, Larry Rosler is, in general good at what he does and his grasp
of perl is darned good.

> Another problem I have noted is many here post
> code which will only run under the most recent
> versions of Perl 5. These codes quite often, will
> not perform even under version 5.003 which I run.

I wouldn't run any version of the interpreter older than perl 5.004_05.
All the versions of perl older than perl 5.004 have security issues, some
quite severe. (In the "Skript Kiddie can own your server" range of severe)
Running it in any sort of publically accessible production environment's a
bad idea.

Going "Latest and Greatest" isn't always necessary, but there are good
reasons to upgrade, and even perl 5.004's quite old at this point. (We're
at a week past three years if I manage the math right) 

Advising folks to use older versions of perl does them a distinct
disservice, since you're effectively advising them to open up security
holes in their systems. You seem quite serious in helping folks out, so
perhaps advising people to work with one of the secure versions of perl
wouldn't be a bad thing.

					Dan


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

Date: 25 May 2000 22:10:07 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Cap.pm
Message-Id: <8gk8bv$1fb$1@spinner.corpeast.baynetworks.com>


If this is better asked in another newsgroup, please let me know.

Anway, does the Term::Cap module work on aix as a termcap file doesn't
exist on aix in the places where the module looks for it.  Actually, it
doesn't seem to exist in text format anywhere.

Also, /etc/termcap on hpux doesn't have entries for xterm or dtterm.
So, with the env var set to either one of these, the module won't work
on hpux either.

These are very os related questions, but if someone has some insight on
these issues it would be very appreciated.

Thanks,
Brandon


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

Date: Thu, 25 May 2000 23:45:20 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: cgi name-value pairs , special characters
Message-Id: <Pine.GHP.4.21.0005252340200.10338-100000@hpplus01.cern.ch>

On Thu, 25 May 2000, B Kemp wrote:

> Forgive me, I suspected that this was the case.
 ...
> Your original statement was rather brief (hence tantalising).

Well, perhaps I over-reacted; but, with respect, there _is_ an
objective standard of correctness, and it _is_ online for any
interested party to consult.

> Needing to know more, that's why I'm here and why I asked,

well, yes, but just having a usenaut spend time repeating what's in
the spec doesn't make it become any more true, you know.  This _is_ a
programming language forum; I think a certain minimal level of RTFM
isn't too much to ask, is it?

have fun (...the appropriate amount, anyhow)

-- 

     > Glaubt mir, HTML ist so tot....)
     Kann gar nicht sein - erst gestern habe ich noch eins gesehen ;-)
                          -  in de.comm.infosystems.www.authoring.misc



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

Date: Fri, 26 May 2000 00:11:26 GMT
From: davidkrainess@yahoo.com (David Krainess)
Subject: DBI:ODBC on windows nt
Message-Id: <8F3FAA1E9davidkrainessyahooco@38.8.213.2>

the code:


####BEGIN
#Windows-based Perl/DBI/MS Access example
      use DBI;

      #open connection to Access database
      $dbh = DBI->connect('dbi:ODBC:perltest');

      #prepare and execute SQL statement
      $sqlstatement="SELECT checknum,vendornum FROM untitled";
      $sth = $dbh->prepare($sqlstatement);
      $sth->execute || 
            die "Could not execute SQL statement ... maybe invalid?";

      #output database results
      while (@row=$sth->fetchrow_array)
       { print "@row\n" }
####END

This works from the command line.

From a web browser I get this: 
DBI->connect failed: [Microsoft][ODBC Driver Manager] Data source name not 
found and no default driver specified (SQL-IM002)(DBD: db_login/SQLConnect 
err=-1) at C:\InetPub\wwwroot\cgi-bin\testperl1.pl line 5
Can't call method "prepare" on an undefined value at 
C:\InetPub\wwwroot\cgi-bin\testperl1.pl line 9.

I have setup a system & user DSN in odbc.

I never had this many problems in unix :)

Any help would be appreciated.


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

Date: Thu, 25 May 2000 22:15:03 GMT
From: sergei_kucherov <sergei_kucherov@3com.com>
Subject: devel.tar.gz does not exist at www.cpan.org/src
Message-Id: <8gk8ko$v90$1@nnrp1.deja.com>

OK, so my very first day of using perl5.6 I found a bad regression from
perl5.00503, making it unusable for our project. I reported it (thanks
to this newsgroup for telling me the site to use), and then found a 4/28
posting at comp.perl.moderated that reported the same fundamental
problem. "Ilya" said in the 4/28 posting that a patch was available. So
I went to www.cpan.org/src and tried to download the version that
presumably contains the patch, ie. file devel.tar.gz .

devel.tar.gz does not currently exist at www.cpan.org/src (file not
found). So how do I get it? I tried several CPAN mirrors, but for an
unknown reason they don't mirror the devel.tar.gz file.



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 26 May 2000 00:58:26 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: devel.tar.gz does not exist at www.cpan.org/src
Message-Id: <S_jX4.93848$hT2.388039@news1.rdc1.ct.home.com>

sergei_kucherov <sergei_kucherov@3com.com> wrote:
> devel.tar.gz does not currently exist at www.cpan.org/src (file not
> found). So how do I get it? I tried several CPAN mirrors, but for an
> unknown reason they don't mirror the devel.tar.gz file.

devel.tar.gz is a tarball of the current development version of perl.
There isn't one at the moment--5.6.0 was just released and development
work on 5.7.0 hasn't started yet.

Search through the archives of the perl5-porters list (the url's available
on www.perl.com somewhere. I don't have it handy at the moment,
unfortunately) The patch should be in there.

					Dan


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

Date: Fri, 26 May 2000 08:50:18 +1000
From: "Ben" <ben.dry@internal.ozemail.com.au>
Subject: HELP- Writing to memory IPC??
Message-Id: <J6iX4.1627$N4.50100@ozemail.com.au>

Does anyone know how I can get perl to write a small amount of information
to memory to be accessed by another script???

For example, a script called send might write a line of text to memory
initiated by a client, then another client does the same using the same
script until there are 10 different lines of text in memory. The maximum
amount of lines that is put into memory is 10, so on the 11th instance the
oldest line is removed and replaced with the newest one and so on... Another
script grabs all 10 lines that are current and displays them in a browser...
I want to do this instead of writing to text files and appending the text
file because of the amount of people accessing and writing the lines of text
is quite large and happens quite quickly and I want to avoid them to be
honest...

Any ideas??? even a vague example somewhere else or some similar source code
would be beneficial.

regards,

Benjamin Dry
OzEmail Online Services






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

Date: 25 May 2000 23:12:14 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: HELP- Writing to memory IPC??
Message-Id: <8gkc0e$8c7$1@news.panix.com>

On Fri, 26 May 2000 08:50:18 +1000, Ben <ben.dry@internal.ozemail.com.au> wrote:
++ Does anyone know how I can get perl to write a small amount of information
++ to memory to be accessed by another script???

You might want to study 'man perlipc'.


Abigail


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

Date: Thu, 25 May 2000 16:59:25 -0700
From: Chuck Goehring <cgoehring@rcisd.com>
Subject: Re: How does INC get into the Perl.exe
Message-Id: <392DBE5D.FD598306@rcisd.com>

Never mind.

I misunderstood what PERL5LIB is for.  I thought it had to be set for commandline perl scripts.

Thanks
Chuck

chuck wrote:

> Hi everybody,
>
> I'm doing my first build of perl 5.6.0 and have a problem I can't
> resolve.  Every time I build, I get a repeat of the @INC ADDED to the
> @INC.  After studying the makefile and others, I looked in config.h
> (entries listed down below) and all looks ok.  During my first build, I
> did not have PERL5LIB set, and I ended up with a path from the source
> directory tree in the @INC array.  So, I set PERL5LIB hoping this would
> fix it. Now, I get more dups added with each build (perl -V is below).
>
> Platform is Windows NT.  I'm building using the provided make files and
> Makefile.PL scripts as opposed to using the CPAN.pm shell or the PRK
> tools.
>
> I've been reading a lot but haven't been able to determine if @INC is
> "put in the exe" from the header at compile time, read from a Config.pm
> file at run time, copied from the PERL5LIB variable or discovered at run
> time via some internal algorithm.  Can someone clarify this for me.
>
> This perl will mainly be used on a mod_perl server, so I could modify it
> in the startup script, but I might have a need to run non-CGIs on the
> server.
>
> Anybody have some advice for me.
>
> Thanks in advance.
>
> Chuck Goehring
> cgoehring@rcisd.com
>
> ====================================================
> The entries in the makefile are:
>
> INST_DRV = c:
> INST_TOP = $(INST_DRV)\perl
> INST_VER = \5.6.0
> INST_ARCH = \$(ARCHNAME)
> CCTYPE  = MSVC60
> CCHOME  = d:\vs\vc98
> CCINCDIR = $(CCHOME)\include
> CCLIBDIR = $(CCHOME)\lib
> EXTRALIBDIRS =c:\libs
>
> ====================================================
> Environment variables are as follows:
>
> Path=c:\perl\5.6.0\bin;c:\perl\5.6.0\bin\MSWin32-x86;c:\bin;D:\Oracle\Ora81\bin;
>
> C:\Program
> Files\Oracle\jre\1.1.7\bin;C:\WINNT\system32;C:\WINNT;D:\VS\Common\To
> ols\WinNT;D:\VS\Common\MSDev98\Bin;D:\VS\Common\Tools;D:\VS\VC98\bin;
> PERL5LIB=C:/perl/5.6.0/lib/MSWin32-x86;C:/perl/5.6.0/lib;C:/perl/site/5.6.0/lib/
>
> MSWin32-x86;C:/perl/site/5.6.0/lib;
> PROCESSOR_ARCHITECTURE=x86
> PROCESSOR_IDENTIFIER=x86 Family 6 Model 7 Stepping 3, GenuineIntel
> PROCESSOR_LEVEL=6
> PROCESSOR_REVISION=0703
>
> Everything is on c: drive in c:\src or c:\perl\5.6.0 or c:\perl\site.
>
> ====================================================
> perl -V reports:
>
> Summary of my perl5 (revision 5 version 6 subversion 0) configuration:
>   Platform:
>     osname=MSWin32, osvers=4.0, archname=MSWin32-x86
>     uname=''
>     config_args='undef'
>     hint=recommended, useposix=true, d_sigaction=undef
>     usethreads=undef use5005threads=undef useithreads=undef
> usemultiplicity=unde
> f
>     useperlio=undef d_sfio=undef uselargefiles=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
> usesocks=undef
>   Compiler:
>     cc='cl', optimize='-O1 -MD -DNDEBUG', gccversion=
>     cppflags='-DWIN32'
>     ccflags ='-O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT
> -DPERL_MSVCRT_RE
> ADFIX'
>     stdchar='char', d_stdstdio=define, usevfork=false
>     intsize=4, longsize=4, ptrsize=4, doublesize=8
>     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> lseeksize
> =4
>     alignbytes=8, usemymalloc=n, prototype=define
>   Linker and Libraries:
>     ld='link', ldflags ='-nologo -nodefaultlib -release
> -libpath:"c:\perl\5.6.0
> \lib\MSWin32-x86\CORE"  -machine:x86'
>     libpth=d:\vs\vc98\lib c:\libs
>     libs=  oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
> comdlg32
> .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
> uuid.lib wsoc
> k32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
> msvcrt.lib
>     libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
>   Dynamic Linking:
>     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
> -libpath:"c:
> \perl\5.6.0\lib\MSWin32-x86\CORE"  -machine:x86'
>
> Characteristics of this binary (from libperl):
>   Compile-time options:
>   Built under MSWin32
>   Compiled at May 22 2000 12:41:37
>   %ENV:
>
> PERL5LIB="C:/perl/5.6.0/lib/MSWin32-x86;C:/perl/5.6.0/lib;C:/perl/site/5.6.0/lib/MSWin32-x86;C:/perl/site/5.6.0/lib;"
>
>   @INC:
>     C:/perl/5.6.0/lib/MSWin32-x86
>     C:/perl/5.6.0/lib/MSWin32-x86
>     C:/perl/5.6.0/lib
>     C:/perl/site/5.6.0/lib/MSWin32-x86
>     C:/perl/site/5.6.0/lib/MSWin32-x86
>     C:/perl/site/5.6.0/lib
>     c:/perl/5.6.0/lib/MSWin32-x86
>     c:/perl/5.6.0/lib
>     c:/perl/site/5.6.0/lib/MSWin32-x86
>     c:/perl/site/5.6.0/lib
>     .
>
> ====================================================
> In config.h some of the difines are listed as
>
> #define ARCHLIB "c:\\perl\\5.6.0\\lib\\MSWin32-x86"  /**/
> #define ARCHNAME "MSWin32-x86"  /**/
> #define BIN "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/
> #define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/
>
> #define PRIVLIB "c:\\perl\\5.6.0\\lib"  /**/
> #define PRIVLIB_EXP (win32_get_privlib("5.6.0")) /**/
>
> #define SITEARCH "c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86"  /**/
>
> #define SITELIB "c:\\perl\\site\\5.6.0\\lib"  /**/
> #define SITELIB_EXP (win32_get_sitelib("5.6.0")) /**/
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: 25 May 2000 18:52:27 -0400
From: Phil Eschallier <phil@BuxTech.Com>
Subject: Re: how to /s '[item]'
Message-Id: <86em6qckes.fsf@BuxTech.Com>

>>>>> "Malkav" == Malkav Bug <malkav@strato.net> writes:

    > had not had much use for s/ until now to it is giving me some
    > problems well I am trying to do this before printing the html
    > doc $value =~ s/[red]/<font color=red>/g; $value =~
    > s/[\/red]/<\/font>/g;

    > but of course it is taking every letter r e and d and switching
    > them to it instead

    > so my questions, one is this the best way to do this. two how do
    > you write it correctly to say take JUST " [red] " no more no
    > less and switch it to FULLY " <font color=red> " without giving
    > any problems such as just saying " red " or something like
    > that. All help is appreciated, sorry I jiust have not worked
    > long with the s/ option and would like to resolve this quickly

    > ~Malkavbug malkav@strato.net

    > [blue][/blue] =color blue [gold][/gold] =color yellow
    > [green][/green] =color green

Consider escaping the [ and ] characters (ie \[ and \]) ... unescaped,
they designate a character class.

-- 
Phil Eschallier        | Bux Technical Services | Systems, software,
 inet phil@BuxTech.Com | 131 Wells Road         | security and Inter-
  tel 215 348 9721     | Doylestown, PA  18901  | networking for your
  fax 215 230 8265     | http://www.BuxTech.Com | business!
KeyID D6E9B193


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

Date: Thu, 25 May 2000 15:52:23 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: how to /s '[item]'
Message-Id: <392DAEA7.77ED0875@stomp.stomp.tokyo>

Malkav Bug wrote:
 
> had not had much use for s/ until now to it is giving me 
> some problems well I am trying to do this before printing
> the html doc

>   $value =~ s/[red]/<font color=red>/g;
>   $value =~ s/[\/red]/<\/font>/g;
 
> but of course it is taking every letter r e and d and 
> switching them to it instead

(snipped) 

> [blue][/blue] =color blue
> [gold][/gold] =color yellow
> [green][/green] =color green


I am making a guess here, Mr. Bug, you are
working with an html template for your script.

First however, should you not be using an
html template, this will get it done:

$value =~ s/red/<font color=red>/gi;
$value =~ s/\/red/<\/font>/gi;

Use of ' i ' there is to ignore case.

Careful! Your substitution will catch
words with 'red' as a part and substitute!

redbug will become <font color=red>bug !!!

On templates, a bit of foolery is needed
and, there is an easier way to deal with 
this by changing your template and script
in a very minor way.

These are some snippets I use for a template:

## Input comments to output:

$_ =~ s/\[comments\]/$comments/ig;


## Environment Variables Output Data

$_ =~ s/\[\$([^\]]*)\]/$ENV{$1}/ig;


Trick is to backslash your [format] within
a substitution operator:

$value =~ s/\[red\]/<font color=red>/g;
$value =~ s/\[\/red\]/<\/font>/g;

Take note of \/red and \/font in there. You 
also need to backslash a / to prevent problems.

An easier way to avoid substitution operator
problems and, this needs a little effort on 
your part in modifying your template and script,
is to change your format.

This [format] could be changed to ¦format¦
which is a format not requiring any backslashes
or other such tricks. Be cautious if you do 
this. You will need to look very carefully
at both your template and your script to be
sure you don't miss instances of [format]
to change. Might be in a lot of different
locations and each will need to be found.


> [blue][/blue] =color blue
> [gold][/gold] =color yellow
> [green][/green] =color green

$value =~ s/\[blue\]/<font color=blue>/g;
$value =~ s/\[\/blue\]/<\/font>/g;
$value =~ s/\[gold\]/<font color=gold>/g;
$value =~ s/\[\/gold\]/<\/font>/g;
$value =~ s/\[green\]/<font color=green>/g;
$value =~ s/\[\/green\]/<\/font>/g;



Have fun with your templates, Mr. Bug!


Godzilla!


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

Date: Thu, 25 May 2000 16:35:10 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: how to /s '[item]'
Message-Id: <MPG.1397588d4ca54cbd98aae4@nntp.hpl.hp.com>

In article <392D9E1B.FB7C8F9F@My-Deja.com> on Thu, 25 May 2000 14:41:47 
-0700, Makarand Kulkarni <makarand_kulkarni@My-Deja.com> says...
> >
> > but of course it is taking every letter r e and d and switching them to it
> > instead
> 
> remove the [ and ]  around red

I would replace the [ and ] with \b and \b instead of removing them.

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


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

Date: Fri, 26 May 2000 00:10:26 +0200
From: Penpal International <ppi@searchy.net>
Subject: Re: how to send fax?
Message-Id: <392DA4D2.3C2E9ABA@searchy.net>

If you install a faxserver on your pc you could send a fax by using
pipes.


oo wrote:
> 
> i remember it is likely to sendmail
> tel_num@???.???
> 
> ????  :>

-- 
Penpal International
http://ppi.searchy.net/
ppi@searchy.net


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

Date: 25 May 2000 23:01:49 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Is anything planned re: Perl error reporting?
Message-Id: <8gkbct$86a$1@news.panix.com>

On Thu, 25 May 2000 14:53:24 -0700, Tom Phoenix <rootbeer@redcat.com> wrote:
++ On 25 May 2000, Ilmari Karonen wrote:
++ 
++ > But if other people prefer this style, I suppose it couldn't be too
++ > hard to change.
++ 
++ Heck, if someone just suggests that diagnostics.pm could be hacked to
++ enable this, maybe Abigail will do it before the weekend. :-)


ETOOLITTLECONTEXT



Abigail


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

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


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