[10867] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4468 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 20 18:07:19 1998

Date: Sun, 20 Dec 98 15:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 20 Dec 1998     Volume: 8 Number: 4468

Today's topics:
    Re: $&, $', and $` and parens.... <uri@sysarch.com>
    Re: $&, $', and $` and parens.... (Bart Lateur)
        Can I change a varible on the fly. <tspencer@exconet.co.uk>
    Re: Color Editor <xidicone@iname.com>
    Re: Decent Editor <tnight@ironworx.com>
    Re: find and replace in html docs with perl <gellyfish@btinternet.com>
        Help!!    Count and Subtract <mfoley@richmond.net>
    Re: Help!!    Count and Subtract (Tad McClellan)
    Re: How do I catch this eval exception? <rick.delaney@home.com>
    Re: How do I catch this eval exception? <rick.delaney@home.com>
    Re: How to get start ? Help <nospam@nospam.com>
    Re: How to remove all HTML from all files in directory? <gellyfish@btinternet.com>
        HOWTO(?): Builiding Perl under Win95/98 <newspost@morlock.net>
        HOWTO: Builiding Perl under Win95/98 <newspost@morlock.net>
        I NEED HELP FROM A PERL PROGRAMMER phrostynight@angelfire.com
        jpl mehta@mama.indstate.edu
        List splitting into sections <darrensweeney@eswap.co.uk>
        Materials science, crystallography, and Perl <bruce.ravel@nist.gov>
    Re: Nested sorting <uri@sysarch.com>
    Re: Nested sorting (Bill Moseley)
    Re: Newbie - TreeBuilder, traverse, tags and content (Martien Verbruggen)
    Re: Perl Training - Worth it? <chobbs@silvervalley.k12.ca.us>
    Re: regex wack (Sean McAfee)
    Re: regex wack <jdf@pobox.com>
    Re: regex wack (Tad McClellan)
    Re: Remote Objects (Jan Dubois)
    Re: Retrospective on comp.lang.perl.moderated? <mpersico@erols.com>
    Re: Retrospective on comp.lang.perl.moderated? birgitt@my-dejanews.com
        Running Perl for Win32 -- Beginner Question (Stephen C. Smith)
    Re: Splitting a line at |'s (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 20 Dec 1998 15:37:22 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: $&, $', and $` and parens....
Message-Id: <x7n24ilfct.fsf@sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> Stop blaming my newsreader for a typo *I* made! Or do you prefer a
  BL> newsreader that inserts "^H", when you want to get rid of a character?
  BL> ;-)

  BL> Actually, I would think $` and $4 would make a better pair, but
  BL> unfortunately "4" is not in the Ascii range. Both keys are
  BL> right next to each other on my keyboard, so that doesn't help
  BL> either.

well, are these typos too? i think it is some software you are
using. you may be typing the right key (' or `) but something is doing a
smart^H^H^H^H^Hstupid translation to fancier looking but incorrect
chars. i have seen this many time on the net and web and i hate it. the
number of times i see ? where ' should be on html pages is
astounding. no one proofreads anything on multiple browsers. and in news
there is not need for mime, html OR fancier char sets. especially when
posting code.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sun, 20 Dec 1998 21:04:48 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: $&, $', and $` and parens....
Message-Id: <367d65f4.408147@news.skynet.be>

Uri Guttman wrote:

>well, are these typos too? i think it is some software you are
>using.

No. That's what I typed. $` and $4 look complemtary to me. $` and $' do
not.

>something is doing a
>smart^H^H^H^H^Hstupid translation

Yup. That's the symptom I 'm talking about. "^H" for backspace.

	Bart.


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

Date: Sun, 20 Dec 1998 22:05:44 -0000
From: "Tony" <tspencer@exconet.co.uk>
Subject: Can I change a varible on the fly.
Message-Id: <367d7600.0@glitch.nildram.co.uk>

Hi
I wonder if anyone can tell me if I can change a virable within the html
generating part of a Perl script.
I want to change the virable $PPfile to point to a different file within the
same directory.
Here is a snip of my script...

print <<EOC;
Content-type: text/html
<HTML>
<HEAD>
<TITLE>
User Information
</TITLE>
</HEAD>
<H2>User Information</H2>
<HR>
<b>Email Address :</b> $PPfile=('tony') $userdata[0]
<br>
<b>Email Address :</b> $PPfile='john'; $userdata[0]
</BODY>
</HTML>
EOC

I have tried many ways of doing this without success, the only way it will
work is if I use the line
$PPfile=tony;
at the top of the script, but I want to list email addresses of certain
users, not all, on the same html page.
So I need to change the varible to the directory I want the info to come
from.
Thanks
Tony




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

Date: Mon, 21 Dec 1998 09:15:03 +1000
From: Jussi Jumppanen <xidicone@iname.com>
Subject: Re: Color Editor
Message-Id: <367D84F7.2C4D@iname.com>

Brad wrote:

> I am new to Perl, but not new to programming.  I have been writing
> everything in Notepad.   I am used to having a color editor for certain
> words in the code of a program e.g. in Visual Studio when you type int it
> changes color and when you type bool or class those change color as
> well....So what I leading up to is.
> 
> Is there a color editor like this for Perl?  If so could you please give the
> name of it or the url to the page.

Take a look at the Zeus editor:

  Zeus for Windows 3.x or Win32
  A powerful text editor/ integrated development environment. Features
  include Brief, Epsilon, Emacs or Wordstar emulation,  status bar, 
  toolbar, configurable syntax colorizing, background compiler, inline
  error correction, unlimited undo/redo, keyboard macros, scripting 
  language, templates and more.

  Version: 2.70 Platforms: Windows 3.x, Windows 95 or NT  Size: 1100k

The Zeus home page has lots more details and even some nice screen 
shots of Zeus in action:

   http://ourworld.compuserve.com/homepages/jussi/zLook.htm

> If there isn't such a thing I would be interested in hearing what other
> people are using for editors and what they think about them.

To read what other programmers think of Zeus check out:

   http://ourworld.compuserve.com/homepages/jussi/zOthers.htm


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

Date: Sun, 20 Dec 1998 22:35:48 GMT
From: Terry Nightingale <tnight@ironworx.com>
Subject: Re: Decent Editor
Message-Id: <367D7BC3.8E21563C@ironworx.com>

The editor I use, which almost never gets a mention, is FTE (Folding Text
Editor).  It runs on Unix, OS/2, and Windows.  It does folding like Emacs if
you want to hide/show subs.  It has the best syntax highlighting I've yet
seen for Perl (yes I've seen Emacs).  It's free (GPL).  The URL is:

http://www.kiss.uni-lj.si/~k4fr0235/fte/

HTH,
Terry


Antony wrote:
> 
> Anyone remeber the QBASIC DOS editor.
> 
> It was great for it's time.
> 
> I'd really like to have an editing program for my PERL scripts that shows
> each subroutine as different pages, or something similar to that.
> I'm not really sure if I'm explaing that well or not.
> 
> Anyway, Anyone got any knowledge of where I may find such an editor ??
> Doesn't need to be PERL  specific.
> 
> Cheers
> Antony

--
Terry Nightingale <tnight@ironworx.com>
Senior Consultant, IronWorx LLC


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

Date: 20 Dec 1998 14:25:39 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: find and replace in html docs with perl
Message-Id: <75j1d3$25o$1@gellyfish.btinternet.com>

On Sun, 20 Dec 1998 13:47:51 -0000 Ben Mitchell <ben@spods.net> wrote:
> Hi all,
> 
> I'm looking for a script that will recurse an html directory and
> find/replace particular tags (eg header tags etc) in all tha pages.

This kind of task is best done with the HTML::Parser module (to parse the
HTML of course) and File::Find to get all the files in your directory tree.

There are numerous examples of the use of both modules posted to this group
you will be able to find them easily on DejaNews.

Without knowing the kind of things that you want to do to your files I am 
unable to post a more concrete example I'm afraid.

/J\

-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 20 Dec 1998 14:42:20 -0500
From: "Matthew Foley" <mfoley@richmond.net>
Subject: Help!!    Count and Subtract
Message-Id: <hpcf2.1735$aY5.16105@news3.ispnews.com>

I need to write a script that will

read a file
count to see if there are 5 entries, if not stop
if 5, subtract the first from 5th
if = x do something
if not drop/remove the first entry and stop




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

Date: Sun, 20 Dec 1998 16:29:44 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help!!    Count and Subtract
Message-Id: <ootj57.0a2.ln@magna.metronet.com>


[ No modules here. Followups trimmed ]


Matthew Foley (mfoley@richmond.net) wrote:

: I need to write a script that will

: read a file
: count to see if there are 5 entries, if not stop
: if 5, subtract the first from 5th
: if = x do something
: if not drop/remove the first entry and stop


   OK.

   So what's the problem?

   Show the code you have written and describe what part you are
   stuck on, and we can help you fix it.


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


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

Date: Sun, 20 Dec 1998 19:12:11 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: How do I catch this eval exception?
Message-Id: <367D4DC4.C6F2DCB1@home.com>

[posted & mailed]

Mark-Jason Dominus wrote:
> 
> In article <slrn77otlo.n3v.maurice@we-24-130-58-139.we.mediaone.net>,
> Maurice Aubrey <maurice@hevanet.com> wrote:
> >
> >Global symbol "$try" requires explicit package name at (eval 1) line > >
> >How can I catch that exception?
> 
> For some reason, that message is a warning, even though it is
> generated in the absence of -w and even though it causes the
> compilation to fail.  This is probably a bug.

Is it not a warning so that strict can continue to warn about other
problems?

#!/usr/bin/perl

use strict;

$one   = 1;
$two   = 2;
$three = 3;

Global symbol "one" requires explicit package name at %s line 5.
Global symbol "two" requires explicit package name at %s line 6.
Global symbol "three" requires explicit package name at %s line 7.
Execution of %s aborted due to compilation errors.

I don't know what's going on internally, but I would expect that use'ing
strict would cause the entire program to be checked for errors, warn
about them and then die with the last message.

If each error was fatal, one would have to recompile the script for
every error, which would be kind of annoying.

In the case of eval(), it seems like $@ is not set to the last message
('Execution of %s aborted...'), but then the script isn't actually
aborted, is it?

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Sun, 20 Dec 1998 20:11:07 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: How do I catch this eval exception?
Message-Id: <367D5B99.3E042560@home.com>

Rick Delaney wrote:
> 
> [posted & mailed]
> 
> Mark-Jason Dominus wrote:
> >
> > For some reason, that message is a warning, even though it is
> > generated in the absence of -w and even though it causes the
> > compilation to fail.  This is probably a bug.

[snip idiotic comments of mine]

I think I just don't really understand how pragmas work.  I know that
use indludes the module at compile time, but I guess I was thinking that
it would then check the program at run time before anything else was
executed.

Now I'm thinking that use'ing strict actually affects how the script is
compiled in the first place.  Is this right?  Can someone explain how
the pragmatic modules, in particular strict.pm, are implemented?

Thanks,

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Sun, 20 Dec 1998 12:50:48 -0800
From: "David Christensen" <nospam@nospam.com>
Subject: Re: How to get start ? Help
Message-Id: <367d62e5.0@news.california.com>

Free Stuff wrote in message <367C9B5D.8B18B201@netvigator.com>...
>I'm a very beginner.
>I have a question, please help
>I'll apply a virtual hosting service next week, so I'll learn Perl
>Language to write the cgi
>But I don't know how to get start!
>My first question is :
>1. Do I need to install a Perl language software in my computer to
write
>the program
>Thank you
>Alex


I recommend you get the following book, get and load Perl on your
system (see pages xxii-xxvi in the book for download info), and
start reading/doing exercises:

Schwartz, Randal L. and Christiansen, Tom, 1997, "Learning Perl",
2nd ed., O'Reilly & Associates, Sebastopol, CA, ISBN 1-56592-284-0.


David





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

Date: 20 Dec 1998 14:44:26 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How to remove all HTML from all files in directory? (newbie)
Message-Id: <75j2ga$28k$1@gellyfish.btinternet.com>

On Sun, 20 Dec 1998 05:29:12 -0800 Steve Rudek <srudek@lanset.com> wrote:
> Hello,
>       The subject line just about says it.  I've got a bunch of pages
> downloaded from a netscape browser
> and I'd like to remove all the HTML as a first step to importing it into
> a Dbase/Clipper database.  This is
> in DOS, if that makes a difference.  Obviously, most of the cleanup can
> be done by just removing all
> patterns that begin with "<" and end with ">", but I don't know how to
> do that at this point, either.  If necessary I can probably work in
> Linux, although I'm a newbie there, as well.  If it's not inconvenient,
> an email of any suggested scripts would be appreciated.  Thanks.

You should really use the HTML::Parser as is suggested in perlfaq9 - examples
of the use of that module are posted here quite frequesntly.  Also in that
document you will also see two other suggestions - the following is a 
snippet that is based on the regular expression therein :


#!/usr/bin/perl 
local $/;
while(<>)
{
s/(?:<[^>'"]*|".*?"|'.*?')+>//mgs;
print;
}

__END__

This of course will not deal with comments or with HTML entities so cannot
be considered a complete solution.

If your are going to attempt to create a data file that can be loaded into a
databse of some description then HTML::Parser is certainly your best bet
in that it allows to determine what tags you are reading - thereby you are
able to deal with ,say, table contents in an appropriate manner.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 20 Dec 1998 17:11:30 -0500
From: "Steven Morlock" <newspost@morlock.net>
Subject: HOWTO(?): Builiding Perl under Win95/98
Message-Id: <3Def2.2850$qF5.5818098@lwnws01.ne.mediaone.net>


If you have a desire to build Perl under Windows 95/98 you
might get something out of my experience of building it.

Steve

--
Foliage Software Systems
aka The Nerd Farm
http://www.foliage.com

These are the steps I took to build the latest development
version of Perl (5.005.53) under the Windows 95 & Window 98
operating system.

The compiler I used was Visual C++ 5.0 with Service Pack 3.

As mentioned in the documentation, the normal shell, COMMAND.COM,
is not capable of being used to build.  The alternative shell
mentioned in the documentation, 4DOS, does not seem adequate since
it lacks the necessary shell stdin/stderr redirection used by
the  Makefile & perl scripts.  I did find that 4NT does suffice
for building Perl.  You can download 4NT from JP Software's web
site: http://www.jpsoft.com

In the following <PERL> will refer to the perl source/build
directory.  <INST> will refer to the perl target/install directory.

* Pre-build checklist:

  - Run the VCVARS32.BAT script in order to setup your Visual C++
    build environment.  Because of a bit of quoting confusion in the
    PATH environment variable, CL.EXE may not be able to find all it's
    required DLLs. Verify your PATH by executing the command:

      CL.EXE

    If your environment is okay you'll get the Microsoft copyright.
    Otherwise you will get a dialog reporting a missing DLL - edit
    your PATH to remedy this problem.

  - Set the PERL5SHELL environment variable to point to 4NT.EXE.
    This is necessary because Perl does not use the COMSPEC variable
    (it has hard coded references to COMMAND.COM).

    Issue the following command to set the shell Perl will use:

      set PERL5SHELL=4NT.exe /c

    You also need to make sure that the 4NT directory is in your path.
    I have had problems if I tried to include the full path to 4NT.EXE
    in the PERL5SHELL variable.  I assume this is because the backslash
    directory separators are being interpreted as quoting characters.

  - Edit <PERL>lib\ExtUtils\MM_Unix.pm.  Although 4NT allows
    compound commands (several command joined together with && or ||)
    there seems to be a problem when these command are issued from
    the Makefile.  Edit MM_Unix.pm to simplify the output of the
    subroutines xs_c, xs_cpp and xs_o.  Remove the '&&' in each of
    these subroutines and place the MV command on it's own line.
    For instance, change the line:
      $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs
>xstmp.c && $(MV) xstmp.c $*.c
    to:
      $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs
>xstmp.c
      $(MV) xstmp.c $*.c

    (I think that MM_Unix.pm would not suffer by being permanently
    changed in this fashion.  Someone please consider it.)

  - Edit the Makefile in the <PERL>\win32 directory
    + Changing the line terminators from CR/CR/LF to CR/LF.  I'm
      not sure why, but the Makefile has the wrong terminator for
      this platform.
    + Edit the Makefile as described in <PERL>\README.win32.  I find
      I only need to edit the INST_DRV & INST_TOP variables.  All other
      changes are optional.

  - If you are _not_ creating a debug version of Perl you need to comment
     out the line 'block_type' from the file <PERL>\globvar.sym. Otherwise
     you will get several unresolved symbol errors when linking
     files with PERLDLL.DEF.

* Building:

  Hopefully if you follow the instructions above you will experience no
  problems building Perl.

  (Let's face it, it's bloody unlikely it'll work for you :)

  - Issue the command 'NMAKE' in the directory <PERL>\win32.
    Wait and be patient.

* Testing:

  I found that the majority of the tests passed.  There were no errors
  that I thought particularly scary.  As long as I can run all my own
  scripts, things are fine by me...

  - (Optional) Copy NT.EXE to CMD.EXE.  Many of the test scripts assume
    that if you are on a Win32 system you have CMD.EXE.  You can get a
    great many of these scripts to work by just copying 4NT.EXE to CMD.EXE.

  - Issue the command 'NMAKE test' in the directory <PERL>\win32.
    Wait and be patient.

* Installing:

  The install seems to work okay.  There are many unresolved references
  when processing the POD & HTML files but these appear to be expected.

  - Issue the command 'NMAKE install' in the directory <PERL>\win32.

* Running:

  - Add <INST>\perl\5.00553\bin and <INST>\perl\5.00553\bin\MSWin32-x86
    to your PATH.  See the <PERL>\README.win32 file for further instructions.








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

Date: Sun, 20 Dec 1998 17:05:42 -0500
From: "Steven Morlock" <newspost@morlock.net>
Subject: HOWTO: Builiding Perl under Win95/98
Message-Id: <mCef2.2849$qF5.5817832@lwnws01.ne.mediaone.net>


These are the steps I took to build the latest development
version of Perl (5.005.53) under the Windows 95 & Window 98
operating system.

The compiler I used was Visual C++ 5.0 with Service Pack 3.

As mentioned in the documentation, the normal shell, COMMAND.COM,
is not capable of being used to build.  The alternative shell
mentioned in the documentation, 4DOS, does not seem adequate since
it lacks the necessary shell stdin/stderr redirection used by
the  Makefile & perl scripts.  I did find that 4NT does suffice
for building Perl.  You can download 4NT from JP Software's web
site: http://www.jpsoft.com

In the following <PERL> will refer to the perl source/build
directory.  <INST> will refer to the perl target/install directory.

* Pre-build checklist:

  - Run the VCVARS32.BAT script in order to setup your Visual C++
    build environment.  Because of a bit of quoting confusion in the
    PATH environment variable, CL.EXE may not be able to find all it's
    required DLLs. Verify your PATH by executing the command:

      CL.EXE

    If your environment is okay you'll get the Microsoft copyright.
    Otherwise you will get a dialog reporting a missing DLL - edit
    your PATH to remedy this problem.

  - Set the PERL5SHELL environment variable to point to 4NT.EXE.
    This is necessary because Perl does not use the COMSPEC variable
    (it has hard coded references to COMMAND.COM).

    Issue the following command to set the shell Perl will use:

      set PERL5SHELL=4NT.exe /c

    You also need to make sure that the 4NT directory is in your path.
    I have had problems if I tried to include the full path to 4NT.EXE
    in the PERL5SHELL variable.  I assume this is because the backslash
    directory separators are being interpreted as quoting characters.

  - Edit <PERL>lib\ExtUtils\MM_Unix.pm.  Although 4NT allows
    compound commands (several command joined together with && or ||)
    there seems to be a problem when these command are issued from
    the Makefile.  Edit MM_Unix.pm to simplify the output of the
    subroutines xs_c, xs_cpp and xs_o.  Remove the '&&' in each of
    these subroutines and place the MV command on it's own line.
    For instance, change the line:
      $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs
>xstmp.c && $(MV) xstmp.c $*.c
    to:
      $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs
>xstmp.c
      $(MV) xstmp.c $*.c

    (I think that MM_Unix.pm would not suffer by being permanently
    changed in this fashion.  Someone please consider it.)

  - Edit the Makefile in the <PERL>\win32 directory
    + Changing the line terminators from CR/CR/LF to CR/LF.  I'm
      not sure why, but the Makefile has the wrong terminator for
      this platform.
    + Edit the Makefile as described in <PERL>\README.win32.  I find
      I only need to edit the INST_DRV & INST_TOP variables.  All other
      changes are optional.

  - If you are _not_ creating a debug version of Perl you need to comment
     out the line 'block_type' from the file <PERL>\globvar.sym. Otherwise
     you will get several unresolved symbol errors when linking
     files with PERLDLL.DEF.

* Building:

  Hopefully if you follow the instructions above you will experience no
  problems building Perl.

  (Let's face it, it's bloody unlikely it'll work for you :)

  - Issue the command 'NMAKE' in the directory <PERL>\win32.
    Wait and be patient.

* Testing:

  I found that the majority of the tests passed.  There were no errors
  that I thought particularly scary.  As long as I can run all my own
  scripts, things are fine by me...

  - (Optional) Copy NT.EXE to CMD.EXE.  Many of the test scripts assume
    that if you are on a Win32 system you have CMD.EXE.  You can get a
    great many of these scripts to work by just copying 4NT.EXE to CMD.EXE.

  - Issue the command 'NMAKE test' in the directory <PERL>\win32.
    Wait and be patient.

* Installing:

  The install seems to work okay.  There are many unresolved references
  when processing the POD & HTML files but these appear to be expected.

  - Issue the command 'NMAKE install' in the directory <PERL>\win32.

* Running:

  - Add <INST>\perl\5.00553\bin and <INST>\perl\5.00553\bin\MSWin32-x86
    to your PATH.  See the <PERL>\README.win32 file for further instructions.


Good Luck,
Steve

--
Foliage Software Systems
aka The Nerd Farm
http://www.foliage.com





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

Date: Sun, 20 Dec 1998 22:30:31 GMT
From: phrostynight@angelfire.com
Subject: I NEED HELP FROM A PERL PROGRAMMER
Message-Id: <75jtq7$p6u$1@nnrp1.dejanews.com>

OK,i have a web page with liek 300 sound clips, i want to make them seachable
because that is way tomany to have on a page, i know i have to use perl. But
i know jsut about nothying about perl.	I know html extremly good, and i am
in the process of learning javascript, so i not comptuer or internet dumb.
help me!

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


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

Date: Sun, 20 Dec 1998 22:42:26 GMT
From: mehta@mama.indstate.edu
Subject: jpl
Message-Id: <75jugi$psm$1@nnrp1.dejanews.com>

12/20/98

Hello:

Does cpan or other have binary for perl on w32 (nt) with jpl.  are there any
docs or tutorial on it along with binary distribution.

Thank you.

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


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

Date: Sun, 20 Dec 1998 11:06:13 -0800
From: "Darren" <darrensweeney@eswap.co.uk>
Subject: List splitting into sections
Message-Id: <75jhs4$sdq@dfw-ixnews5.ix.netcom.com>

HI

I am using DBI on a MySQL dB. When I return the results of a search i want
only a predefined number to appear on a page, with links to the
next/previous pages to be at the bottom of the listing.

Does anyone know of a simple script/way to do this which I can then modify
accordingly??

Thanks

Darren




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

Date: 20 Dec 1998 14:33:37 -0500
From: Bruce Ravel <bruce.ravel@nist.gov>
Subject: Materials science, crystallography, and Perl
Message-Id: <m3vhj66226.fsf@h196101.nist.gov>


Hi,

One of my research projects includes codes to perform certain
crystallographic calculations in a materials science context.  To this
end, I have written a perl module defining relevant crystallographic
data types.  The module, Xtal.pm, can be found at its homepage:

	http://feff.phys.washington.edu/~ravel/Xtal/

The following is a brief description excerpted from the web page:

   Xtal.pm is a Perl module defining packages for unit cell and
   crystallographic site objects useful in certain crystallography
   problems.

   In its current form, Xtal.pm is intended to solve a particular (and
   rather simple) sort of crystallography problem. Given a description
   of a crystal in terms of a space group symbol, axis lengths and
   angles, and the fractional coordinates of the unique
   crystallographic sites, Xtal.pm is used to describe the entire
   contents of the unit cell either in fractional or Cartesian
   coordinates. It also has methods relevant to the crystallographic
   unit cell, such as calculation of d-spacing.  More such methods
   will be added over time.

   Two packages are included in Xtal.pm which define two data
   classes. One is a Cell and the other is a Site. Alone, Xtal.pm only
   provides data classes. However, this is the basis of several useful
   applications. Xtal.pm was written to be the crystallographic engine
   of a preprocessor for real-space multiple scattering calculations
   which requires lists of Cartesian atomic coordinates much like
   those needed for ball-and-stick figures. Other applications might
   include powder diffraction or anomalous scattering simulations.

   I am not a crystallographer. I am an absorption spectroscopist and
   a materials physicist who knows enough crystallography to be a
   danger to himself and to others.  8^) Xtal.pm was written for a
   program called ATOMS. ATOMS is used as preprocessor for an ab
   initio x-ray absorption fine structure code called FEFF. The
   purpose of ATOMS is to generate lists of atomic coordinates in a
   form suitable for FEFF from information of the sort published in
   the materials crystallography literature. Xtal.pm provides the
   basic crystallography functionality for ATOMS.


If this were a CPAN entry, it would look something like this:

  Name           DSLI  Description                                  Info
  -----------    ----  -------------------------------------------- -----
  Xray::Xtal     adph  Utilities for materials crystallography      BRAVEL

I welcome comments, suggestions, and criticisms.  I would be
particularly interested to know if something of this sort already
exists.  (If so, I have not yet stumbled upon it.)

Thank you,
Bruce Ravel


-- 
Bruce Ravel ---------- bruce.ravel@nist.gov or ravel@phys.washington.edu
National Institute of Standards and Technology       | Office: Room B356
100 Bureau Dr Stop 8522, Gaithersburg, MD 20899  USA |  ph: 301-975-5759 
http://feff.phys.washington.edu/~ravel               | fax: 301-975-5334


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

Date: 20 Dec 1998 15:57:41 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Nested sorting
Message-Id: <x7k8zmleey.fsf@sysarch.com>

>>>>> "BM" == Bill Moseley <moseley@best.com> writes:

  BM> I'm doing as much as this as I think I can.  I just don't see how
  BM> to set up my keys ahead of time so the sort routine doesn't have
  BM> to check if, say, key number three out of a five level sort should
  BM> be sorted in reverse.

  BM> But what I guess I'm missing from your posts is how I "inverse" a string
  BM> in pre-processing to make it sort in reverse in the normal sort routine.

larry rosler posted a way to do the inverse in stringify. here is a way
to do it with an array in a schwartzian style.


  BM> Now, if I've pre-processed as much as I can, is it my loop structure
  BM> that is the pokey part of this?  And if so, how can it be improved?

a question: how does a ! affect sort compares? it makes no sense for a
compare pair to have a key with ! and the other doesn't. reversing the
sort compare is wrong is when the second key has a ! and the first doesn't.

this logic needs some careful thinking before it goes into production.

this is a two level sort with some up keys and down keys (prefixed with !)

  BM>    # Loop through all the sort keys
   
  BM>    for (1..$#{$a} )  {


this is better done with a plain for loop. index in perl is not cool
unless you must do it. this is not a sort compare routine but the whole
thing. i assume all original keys are in @sort_input

	@sort_list = () ;

	foreach $key ( @sort_input ) {


		if ( $key =~ /^!(.*)$/ ) {

			push( @sort_list, [$key, undef, $1] ) ;
		}
		else {
			push( @sort_list, [$key, $key, undef] ) ;

		}
	}


	@sorted_list = sort {

# normal sort order
			( defined( $a->[1] && defined( $b->[1] &&
				$a->[1] <=> $b->[1] ) ||

# reverse order
			( defined( $a->[2] && defined( $b->[2] &&
				$b->[1] <=> $a->[1] ) ||

# $a is normal, $b is reverse so it is always +1 for sorting

			( defined( $a->[1] && defined( $b->[2] ) ||

# only case left $a is reverse, $b is normal so it is always 11 for sorting

			-1

		} @sort_list


	@sort_results = map $_->[0], @sorted_list ;



that doesn't handle cmp sorts but it could be modified to do that.

doe sit make sense in your case? you were not clear enough in your specs
for how you sort things. you code was broken as i pointed out with pairs
of normal and inverse keys. i think it was broken for both keys being
inverted too.

hth,

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 20 Dec 1998 20:55:17 GMT
From: moseley@best.com (Bill Moseley)
Subject: Re: Nested sorting
Message-Id: <367d6435$0$214@nntp1.ba.best.com>

I wrote:

>> But what I guess I'm missing from your posts is how I "inverse" a string
>> in pre-processing to make it sort in reverse in the normal sort routine.
>> 
>> If I understood this then I could stringify and then do only one compare
>> in the sort routine.
>

In article <MPG.10e6e2a54c9389bc98996b@nntp.hpl.hp.com>, lr@hpl.hp.com says...

>Yes, you could.  Here is how to invert a string in preprocessing:

Thanks, that's exactly what I was looking for.

Now, one pre-process pass to get the field widths for each key, and another
pass to build the keys, xor'ing for keys that need to be reverse sorted, all
placed in one string for the compare.

Thanks, and sorry for being so thick headed!


--------------
Bill Moseley
moseley@best.com



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

Date: Sun, 20 Dec 1998 22:12:51 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie - TreeBuilder, traverse, tags and content
Message-Id: <DDef2.7$lN5.197@nsw.nnrp.telstra.net>

In article <367ced5d.175668537@news.ozemail.com.au>,
	borkman@usa.net (lee borkman) writes:
> Hi all,
> 
> I'm trying my first steps with HTML::Parse, etc, to format my HTML
> code.

Which one are you using? HTML::Parse is deprecated, HTML::Parser or
HTML::Treebuilder are fine, but used differently..

> I'm using the traverse function to bounce through the tree, outputting
> the start tags on the way down and the end tags on the way back up.  
> 
> That's all fine as long as the IgnoreText flag is set to TRUE.  But I
> want to process (pass through) my text as well.  Traverse calls the
> handling sub-routine with the node, startFlag as arguments.  What does
> it pass when it reaches some text?

Once you have a reference to a HTML::Element (as you would when using
HTML::TreeBuilder), you should be able to call the content method on
it, which should return a reference to an array of text segments and
references to enclosed HTML::Element objects.

When using HTML::Parser directly, it has a text method, which may be
what you want.

It's a bit hard to say what exactly you should do, without knowing how
you are trying to do it.

Maybe you could post some code?

> Eg., here's a tag with some text:
> 
> <B>This is bold text</B>
> 
> This entire chunk gets passed to the handling sub-routine, right?  So:

Which handling subroutine? One you defined in your HTML::Parser
subclass?

> Okay, but how do I get at the text in between the start and end tags.
> Is the text a sub-node that will get passed to the handler separately
> one level down?

I think, reading the above, that you may need the content() method for
an HTML::Element reference...

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: Sun, 20 Dec 1998 14:08:03 -0800
From: Chris Hobbs <chobbs@silvervalley.k12.ca.us>
Subject: Re: Perl Training - Worth it?
Message-Id: <367D7543.FFEDC0F9@silvervalley.k12.ca.us>

Tom Christiansen wrote:

> My goodness, but that's expensive!  You can do a lot better than that
> if you look around just a wee bit.  I'd rather not say more than that.

Thanks Tom,

Boulder's got to be cold this time of year though :-)

It looks like I'm going to stock up on O'Reilly books for now, and
perhaps consider further training later next year. I do like the idea of
having a true guru for a trainer though!

-- 
Chris Hobbs chobbs@silvervalley.k12.ca.us|Network Admin   |   Postmaster
Silver Valley Unified School District    |MCP - TCP/IP    |   J.A.W.P.H.
http://www.silvervalley.k12.ca.us/chobbs |A witty saying proves nothing.
                                                              - Voltaire



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

Date: Sun, 20 Dec 1998 19:16:10 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: regex wack
Message-Id: <_1cf2.2226$4w2.9600224@news.itd.umich.edu>

In article <75j9qr$np6@cocoa.brown.edu>,
Jaya_Kanajan <jkanajan@ets.cis.brown.edu> wrote:
>i ran into a little problem with a script i was writing. i've been trying to replace input that looks like "load_maf_" with "load\_maf\_" for use as included LaTeX.

>so my regex for this was  s/\_+/\\\_/;

(Note: _ is not a special regex character, so you don't need to escape it
with "\".)

>is this incorrect, i thought it to mean, match if _ occurs more than replace it each time with \_.

It's incorrect.  Your expression will replace, "_", "__", "___", and so on
for any number of underscores, with "\_".  If you want to put a backslash
before every underscore, you need to use the "g" modifier (see the perlop
man page for details):

s/_/\\_/g;

>here's the whole script: perhaps someone can also comment on how ot make it more efficient.

[snip]
>    s/\\+/\\verb+\\+/; # a slash in code has to become verb \
>    s/\~+/\\verb+~+/;
>    s/\^+/\\verb+^+/;

Are you sure this is what you want?  It will convert the string
"\\\\ ~~~~ ^^^^" to "\verb+\+ \verb+~+ \verb+^+" (for example).  If you
have a misconception here similar to the one above, and you want to prefix
every instance of \, ~, or ^ with "\verb+", this is the right way to do it
(all in one statement):

s/([\\~^])/\\verb+$1/g;

>    s/\015+//;

Removing characters from a string is a job better suited for the tr//
operator:

tr/\015//d;

>    s/\#+/\\\#/;
>    s/\$+/\\\$/;
>    s/\%+/\\\%/;
>    s/\&+/\\\&/;
>    s/\_+/\\\_/;
>    s/\{+/\\\{/;
>    s/\}+/\\\}/;

These seven expressions can be reduced to one:

s/([#\$%&_{}])/\\$1/g;

or (slightly more cryptically):

s/(?=[#\$%&_{}])/\\/g;

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: 20 Dec 1998 20:31:14 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: jkanajan@ets.cis.brown.edu (Jaya_Kanajan)
Subject: Re: regex wack
Message-Id: <m3ww3mvce5.fsf@joshua.panix.com>

jkanajan@ets.cis.brown.edu (Jaya_Kanajan) writes:

> so my regex for this was s/\_+/\\\_/;
> 
> is this incorrect, i thought it to mean, match if _ occurs more than
> replace it each time with \_.

No, it means "replace 1 or more _ characters with \_".

You want

   s/_/\\_/g;

And since there's a number of different characters that you want to
escape, you really want something like

   s/([_$%&}{])/\\$1/g;

See perlop, perlre, and perlfaq6.

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


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

Date: Sun, 20 Dec 1998 14:04:41 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regex wack
Message-Id: <p8lj57.5n1.ln@magna.metronet.com>

Jaya_Kanajan (jkanajan@ets.cis.brown.edu) wrote:

: i ran into a little problem with a script i was writing. i've been trying to replace input that looks like "load_maf_" with "load\_maf\_" for use as included LaTeX.

: so my regex for this was  s/\_+/\\\_/;

: is this incorrect, i thought it to mean, match if _ occurs more than replace it each time with \_.


   It means "replace one or more consecutive underscores with a
   backslash and a single underscore", likely not what you want.

   It will also replace only the first series of underscores
   that it finds in $_

   Underscore is not a regex metacharacter, and therefore does
   not need any escaping.


      s/_/\\_/g;  # precede every underscore with a backslash


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


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

Date: Sun, 20 Dec 1998 23:42:33 +0100
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: Remote Objects
Message-Id: <36817665.11236757@news3.ibm.net>

[mailed & posted]

Pep Mico <pep_mico@hp.com> wrote:

>I'm using Perl for Win-32, and I'd like to know the following
>
>Since Microsoft has released SP4 now is possible to use DCOM technology.
>
>How can I invoke and use a remote object with perl?
>
>Does anybody give me some examples, references?

DCOM has been in WinNT since version 4.0. You don't need SP4 for it.

And yes, you can use DCOM through Win32::OLE:

    my $server = Win32::OLE->new(['my.server.com', 'Prog.Id']);

You pass an array reference of computer name and program id instead of
just the program id. Setting up the appropriate permissions etc. through
DCOMCNFG is independent of the usage of Perl and left as an exercise for
the reader. :-)

-Jan



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

Date: Sat, 19 Dec 1998 22:46:06 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <367C72FE.97A802AA@erols.com>

It's been a long time since I've lurked through misc and I do not misc
:-) it at all. I'm happy with what I read here and even get tio
contribute a little.

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Sun, 20 Dec 1998 22:27:55 GMT
From: birgitt@my-dejanews.com
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <75jtl9$p3d$1@nnrp1.dejanews.com>

In article <ylzp8jh3lj.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:
> birgitt <birgitt@my-dejanews.com> writes:
>
> > But I wonder, if the amount of time, effort and nerves which goes into
> > creating and maintaining a moderated group within the current system, is
> > not too high.
>
> Hitting S D p in my mail reader a couple times a day after reading an
> article I would have read anyway, occasionally writing a quick note to
> someone explaining why they have the wrong newsgroup, and even more
> occasionally tuning a script or two is not much in the way of time,
> effort, and nerves.  The group is running fairly smoothly at this point.
>
>

Agreed, I just remembered the discussion during the creation process as having
been quite heavy and may be I felt this way just because I witnessed something
like it for the first time. Maintaining the current moderated group, I can
imagine, is something easy.

I find that for a beginner, as a learning tool, it is pretty irrelevant if
there is only clp.misc or if there are both .misc and .mod. I use the search
engine for finding answers to specific questions and that only after I
exhausted all other options, like documentation, books, docs etc. And for
that matter I don't care if the search engines scans one, two or three Perl
newsgroups.

birgitt


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


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

Date: Sun, 20 Dec 1998 21:31:21 GMT
From: homeplate@halostorm.com (Stephen C. Smith)
Subject: Running Perl for Win32 -- Beginner Question
Message-Id: <367d6ca4.3683721@news>

	I bought a few books yesterday on Perl so I could learn this
language.  One of them was "Perl for Dummies" (yes, I got the O'Reilly
books too, so don't give me that look).  In the "Dummies" book was the
ActivePerl version 5 from ActiveState.  I've gone to AS's Web site and
updated to the current version for Win32.  (I'm running on Win 95 and
I've installed DCOM from the Microsoft Web site.)
	When I try to run anything, even just a one-line "print"
statement, the results appear on screen and then the DOS window
disappears.  I gather that I have to run Perl in a DOS window; but
when I try to execute Perl from a prompt in a DOS window I get the
message "Cannot run in MS-DOS mode."  So I run Perl from the Win 85
explorer, which opens us a DOS window.  But any lines of code I
execute with Ctrl-Z, the results just flash on the screen and the DOS
window closes, so I don't really see the results.
	How do I get the results to stay on the screen, i.e. the DOS
window doesn't close?  I've tried all sorts of way to tell Win 95 not
to close the window on exit, but so far none have worked.
	Thanks in advance,
	Stephen


Visit the "Anaheim Angels and Lake Elsinore Storm" Web Site
http://www.halostorm.com


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

Date: Sun, 20 Dec 1998 14:07:36 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Splitting a line at |'s
Message-Id: <8elj57.5n1.ln@magna.metronet.com>

Adam Levy (adrade@wwa.com) wrote:

: i'd use:
: ($one,$two,$three) = split(/|/,$vartobesplit,3);


   I wouldn't.


---------------------
#!/usr/bin/perl -w

$vartobesplit = 'foo|bar|baz';

($one,$two,$three) = split(/|/,$vartobesplit,3);

print "one: '$one'\n";
print "two: '$two'\n";
print "three: '$three'\n";
---------------------

output:

one: 'f'
two: 'o'
three: 'o|bar|baz'


   Not So Good...


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


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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