[8159] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1777 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 31 13:07:30 1998

Date: Sat, 31 Jan 98 10:00:21 -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           Sat, 31 Jan 1998     Volume: 8 Number: 1777

Today's topics:
        Announce: PDF-1.02 <antonio.rosella@venere.inet.it>
        ANNOUNCE: X11::Motif 1.1 beta (Ken Fox)
    Re: Beginner needs help... <corky@ultranet.com>
    Re: boston.pm.org (Chris Nandor)
    Re: Compiling regexs for efficency <*@qz.to>
    Re: Don't forget the Perl Journal (was Re: Good place t (Michael R Weholt)
    Re: Forcing 7-digit number? (Anthony Boyd)
    Re: Forcing 7-digit number? (Anthony Boyd)
    Re: Getting mail from a pop3 server with PERL WIN32 (Sean Dowd)
    Re: Help in finding Control Characters in a string. <mike@ns.minivend.com>
        HTTP::is_success not found <KlausRusch@atmedia.net>
    Re: I would like for a field to be variable width in a  (Tad McClellan)
        Image::Size 2.6 uploaded to CPAN (Randy J. Ray)
        Math::Pari 0.93 released (Ilya Zakharevich)
        p5p mail2news gateway dead? (was: Don't use signal hand <link@tss.no>
        Perl5 Database (Bruce Davidson)
        Please Help!! Problems with Perl path to browsers (Linda Starr)
        regex to extract text from string variable <family@gerrard.org>
        removing a line from a file <ccordero@wiley.csusb.edu>
        Using -w <andrew.spiers@virgin.net>
        Where Is sub Autoloader? <robert_sampleNOSPAM@mediaone.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 31 Jan 1998 15:23:17 GMT
From: Antonio Rosella <antonio.rosella@venere.inet.it>
Subject: Announce: PDF-1.02
Message-Id: <6avfl5$9pi$1@news1.teleport.com>

I have just updated a new Perl module:

PDF

available at CPAN under

http://www.perl.com/CPAN/modules/by-authors/Antonio_Rosella/PDF-1.02.tar.gz

It basically permit to access the PDF data structure with Perl.

Let's give it a chance and let me know what you think about.
I'm continuing to develop and any suggestion is welcome.

Antonio




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

Date: 31 Jan 1998 15:21:51 GMT
From: kfox@ford.com (Ken Fox)
Subject: ANNOUNCE: X11::Motif 1.1 beta
Message-Id: <6avfif$9ne$1@news1.teleport.com>
Keywords: X11, Motif, X Toolkit, Perl module

The first beta release of the X11::Motif module has been added
to CPAN today.  (Please allow some time for it to be mirrored.)
The module is available as:

  file: $CPAN/authors/id/KENFOX/X11-Motif-1.1b1.tar.gz
  size: 111643 bytes
   md5: 5f2bc908bf14c831ece4e006070b6c30

The X11::Motif distribution includes X11::Lib and X11::Toolkit.
Taken together, these modules provide a nearly complete
interface to the standard X libraries.  The modules have both
object oriented and function call style interfaces.  The object
interface is similar to the Tk module.  The function call
interface is strongly modeled after the standard X library
documentation and will be familiar to someone with X Toolkit or
Motif experience.

I've included two versions of the classic "hello world" example
at the end of this announcement.  Even if you don't grab the module,
I'd appreciate feedback on whether the example is understandable.

To build the modules, you will need:

  * Perl version 5.004 or higher
  * X11R5 or higher (X11R4 should work but hasn't been tested)
  * Motif 1.2.4 or higher (CDE Motif works.  Motif 2.0 is reported
    to work.  LessTif is also reported to work, but with reduced
    functionality.)
  * An ANSI C compiler

I would appreciate being notified of any changes necessary to
support other environments and/or widget sets.

The modules work well in both stand-alone scripts and when embedded
in a larger C-based Motif application.

Any questions or comments?  Please send them to <fox@vulpes.com>.

- Ken

# ----------------------------------------------------------------------
# -- Example #1: The object style

use X11::Motif;

my $toplevel = X::Toolkit::initialize("Example");

my $form = give $toplevel -Form;
my $hello = give $form -Label, -text => 'Hello, world!';
my $ok = give $form -Button, -text => 'OK', -command => sub { exit };

arrange $form -fill => 'xy', -bottom => [ $ok, $hello ];

handle $toplevel;

# ----------------------------------------------------------------------
# -- Example #2: The function call style (i.e. "traditional" Motif)

use X11::Motif qw(:Xt :Xm);

my $toplevel = X::Toolkit::initialize("Example");

my $form = XtCreateManagedWidget("form", xmFormWidgetClass, $toplevel);

my $hello = XtCreateManagedWidget("hello", xmLabelWidgetClass, $form,
				    XmNlabelString, "Hello, world!",
				    XmNlabelType, XmSTRING);

my $ok = XtCreateManagedWidget("ok", xmPushButtonWidgetClass, $form,
				    XmNlabelString, "OK",
				    XmNlabelType, XmSTRING);

XtAddCallback($ok, XmNactivateCallback, sub { exit }, 0);

XtSetValues($hello,
		XmNrightAttachment, XmATTACH_FORM,
		XmNleftAttachment, XmATTACH_FORM,
		XmNtopAttachment, XmATTACH_FORM,
		XmNbottomAttachment, XmATTACH_WIDGET,
		XmNbottomWidget, $ok);

XtSetValues($ok,
		XmNrightAttachment, XmATTACH_FORM,
		XmNleftAttachment, XmATTACH_FORM,
		XmNtopAttachment, XmATTACH_NONE,
		XmNbottomAttachment, XmATTACH_FORM);

XtRealizeWidget($toplevel);
XtAppMainLoop(XtWidgetToApplicationContext($toplevel));




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

Date: Sat, 31 Jan 1998 10:34:24 -0500
From: Bob Trieger <corky@ultranet.com>
To: Cathi Miller <singah@netutah.com>
Subject: Re: Beginner needs help...
Message-Id: <34D34480.2EC4@ultranet.com>

Cathi Miller wrote:
> 
> Hi there.
> I would like to learn perl, but I'm a bit confused.
> If I understand correctly, I need a compiler and stuff.
> I downloaded a "kit" from perl.com, but it is in a file format (.gz)
> that I can't use. Downloaded a zipped version twice with no better luck.
> 
> I could really use some help aquiring the components I need to start
> learning and writing perl.
> I had intended to get "Perl Cookbook" too. Also having a hard time
> finding a newsgroup that posts in english.
> Can anyone point me in the right direction?
> Sure appreciate any help.


You forgot to mention that you were using Win95.
You can get the latest Win32 perl port on www.perl.com or by clicking
the link below:

http://www.perl.com/CPAN-local/ports/win32/Standard/x86/perl5.00402-bindist04-bc.zip

Unzip that into a temporary directory and run the setup/install
executable. It comes with quite a few of the modules already installed
and all the documentation in html format you could ever ask for.

HTH
Bob Trieger
corky@ma.ultranet.com


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

Date: Sat, 31 Jan 1998 09:27:06 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: boston.pm.org
Message-Id: <pudge-3101980927070001@ppp-21.ts-1.kin.idt.net>

In article <pudge-3001980908270001@ppp-9.ts-1.kin.idt.net>,
pudge@pobox.com (Chris Nandor) wrote:

# All Boston-area people ... I don't have many tuits lying around, but I
# think it would be cool to get a Boston Perl Mongers group going.  If
# anyone is interested, drop me a line.  See http://ny.pm.org/ for an
# example of how NY is doing it.  They will give us the boston.pm.org name
# if we want it, too.

Here are the needs as I seem them:

* Web site
* Mailing list
* Treasurer (to pay for things like web site and mailing list if
necessary, and to cover other things in the future, such as t-shirts and
mouse pads ;-)
* A place to go and have dinner

I might be able to come up with a place to put a web site (and maybe a
mailing list, too) for pretty cheap.  But I am open to suggestions.

Then again, we don't have to do all of this.  We could just meet and have
dinner, and decide from there.  We have six people (including myself) who
have already expressed interest.  That is a good start IMO.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: 31 Jan 1998 15:59:53 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Compiling regexs for efficency
Message-Id: <qz$9801311047@qz.little-neck.ny.us>

Jerome O'Neil  <joneil@cks.ssd.k12.wa.us> wrote:
> So, having said that, can you use /o on a normal expression?  It doesn't
> cause me any grief in my code, but I was curious if it had any effect?

It is only effective in loops *when the RE contains a variable*. Lots of
otherwise pretty good perl programmers seem to overlook that.

foreach (@useful_slash_o) {
  if (/^$Some_Regexp/o) {
     &do_stuff;
  }
}


foreach (@useless_slash_o) {
  if (/^some +[fixed]+\s+pattern* here/o) {
     &do_stuff;
  }
}

Elijah
------
sees useless "/o"s used somewhat often


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

Date: Sat, 31 Jan 1998 13:47:07 GMT
From: awnbreel@panix.com (Michael R Weholt)
Subject: Re: Don't forget the Perl Journal (was Re: Good place to start in Perl 5)
Message-Id: <6ava0r$1cg_006@mrw.panix.com>

In article <34D27AC5.EA7205CE@5sigma.com>, 
joseph@5sigma.com wrote:

>I know how much
>care and attention went into trying to keep errors out of my
>book, and my conclusion is that a few in a first printing are not
>a big deal and, so far as I can see, unavoidable.
>
>A book that has errors lasting into later printings -- now that's
>a different animal.  Or a book that has *lots* of errors, or errors
>that look like lapses in understanding rather than just writing
>or editing goofs.

We all make mistakes and your comments about Trying Hard and so forth 
are apt.  Still, I spend a lot of time with books and tutorials, 
teaching myself this-n-that language, and the problem with a typo in 
these sorts of publications is that it can really cause the 
Self-Learner an enormous amount of grief, frustration, etc. when he 
tries to get a piece of source code to compile or whatever and it 
won't because there is, in fact, a typo in the book's code. The 
Self-Learner is often in the position of not being able to distinguish 
between a typo and a Genuine Weirdism, particular to the language 
being learned.  I assure you, I speak from sad experience here.

Again, we all make mistakes and perfection is very, very difficult, 
but I just wanted to make the point that typoes in code samples in a 
Teach Yourself book are especially onerous.  I don't know that Steps 
Can Be Taken (beyond being as careful as humanly possible), but it 
doesn't hurt for authors and publishers to be reminded of this point 
every once in a while.

-- 
 mrw


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

Date: Sat, 31 Jan 1998 02:58:38 -0800
From: anthony@outshine.com (Anthony Boyd)
Subject: Re: Forcing 7-digit number?
Message-Id: <anthony-3101980258390001@anthony.outshine.com>

abigail@fnx.com wrote:
> Anthony Boyd <anthony@outshine.com> wrote:
>
> ++ Clearly, the time is being used to seed the random number.  I cannot find
> ++ an example of how to get a random number that will vary independent of the
> ++ time, although the man pages and books all say it's possible.  Anyone have
> ++ a pointer?
> 
> Did you actually read the man page? What did the entry on srand say?

Yes, I actually read the man page.  The entry on srand says it can be fed
a "seed" but provides no sample code, which is what I was asking for.

> Either upgrade to perl5.004, or call srand with appropriate arguments.

I cannot upgrade to 5.004 until the IS department approves.  I would use
srand with appropriate arguments if I had some examples to learn from. 
Since that doesn't seem forthcoming, I'll use server-side JavaScript
instead.

Thanks anyway.

-Tony


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

Date: Sat, 31 Jan 1998 03:00:32 -0800
From: anthony@outshine.com (Anthony Boyd)
Subject: Re: Forcing 7-digit number?
Message-Id: <anthony-3101980300330001@anthony.outshine.com>

cberry@cinenet.net (Craig Berry) wrote:
> Anthony Boyd (anthony@outshine.com) wrote:
> 
> : Clearly, the time is being used to seed the random number.  I cannot find
> : an example of how to get a random number that will vary independent of the
> : time, although the man pages and books all say it's possible.  Anyone have
> : a pointer?
> 
> What version are you running?  I believe 5.004_04 (the latest released 
> version) both removes the need for an explicit call to srand and uses a 
> better default seed generator than the current time.

No, I don't have access to the latest version.  We're at 5.003 I think,
and won't upgrade until the IS department obsessively tests 5.004.

-Tony


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

Date: Sat, 31 Jan 1998 11:26:58 -0500
From: dowd-do-not-spam-me@no-spam.flash.net (Sean Dowd)
Subject: Re: Getting mail from a pop3 server with PERL WIN32
Message-Id: <dowd-do-not-spam-me-3101981126580001@dasc3-121.flash.net>

In article <34D1F967.D80F8D67@usa.net>, Sebastian.Probst@usa.net wrote:

> Hello all,
> 
> I am looking for a POP3 modul for PERL for WIN32. I only could find this
> modul for UNIX. Contacting the author of this modul failed, because the
> mail address in the modul description is not valid.
> 
> Does anybody know, if there is such a modul or how I can use the UNIX
> modul with WIN95/NT?

Mail::POP3Client works fine under Win32/NT.  Some win95 versions of perl
have problems with sockets, and so will also have problems with
POP3Client.

If the standfard installation process does not work with the module and
your perl, either get a different perl build or add the module to your
site_perl manually.

sean

(The email address in the module is no longer valid.  I will update it
when I have a more permanent address.  This one is only temporary. 
Sorry.)
-- 
Remove nospam from the email address to reply.


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

Date: 31 Jan 1998 10:08:05 GMT
From: Mike Heins <mike@ns.minivend.com>
Subject: Re: Help in finding Control Characters in a string.
Message-Id: <6aut65$ib7$1@ocoee.iac.net>

milagro <milagro@beanfield.com> wrote:
> Hi 

> I am searching a string for a series of Control Characters (Non-Printing). 
> I need to find the position of the  Control Characters I find in the string. 
> Currently all I can find out is IF the characters are in the  sting. Could
> someone give me some help in how to find WHERE the control Characters are
> found in the string? Thanks very much. Here is the a snip of the code I
> have done already. 


> foreach $rec  (@records)
> {
> $count++;

> if ($rec =~/\000|\001|\002|\003|\004|\005|\006|\007|\008|\009|
> \010|\011|\013|\014|\016|\017|\018|\019|\020|\021|\022|\023|\024|
> \025|\026|\027|\028|\029|\030|\031|\032|\033|\034|\035|\036/)
> {

Whoa!! There are several things wrong with this. First of all,
those character numbers you are generating will not match what
you think they will, for there is no 8 in octal. You probably do
mean octal, though, as it appears you are allowing \r and \n.

I think a simple 

    pos($rec) = 0;
    while ($rec =~ /[\000-\011\013\014\020-\37]/g) {
        warn "Bad char at position " . pos($rec) . " in record $count.\n";
    }

will do.

Regards,
Mike Heins                          http://www.minivend.com/  ___
                                    Internet Robotics        |_ _|____
If you like what you're gettin',    131 Willow Lane, Floor 2  | ||  _ \
keep doin' what you're doin'.       Oxford, OH  45056         | || |_) |
 -- Hector                          <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


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

Date: 31 Jan 98 15:37:48 GMT
From: Klaus Johannes Rusch <KlausRusch@atmedia.net>
Subject: HTTP::is_success not found
Message-Id: <34d3454c.0@news1.ibm.net>

The following simple program fails with an error message
that HTTP::is_success cannot be found on one system but 
works on another, without any obvious difference in
configurations.

use LWP;
$ua = new LWP::UserAgent;
my $req = new HTTP::Request 'GET', "http://localhost/";
$res = $ua -> request($req);
print $res -> is_success;         # failing statement HTTP::is_success

@INC has the following entries:

/opt/gnu/lib/perl5/sun4-solaris
/opt/gnu/lib/perl5/site_perl
/opt/gnu/lib/perl5/site_perl/sun4-solaris
/opt/gnu/lib/perl5
/opt/gnu/lib/perl5/sun4-solaris/5.004

HTTP is actually in /opt/gnu/lib/perl5/site_perl, and the is_success
method is there as well.

Any ideas what still could be wrong?

Klaus Johannes Rusch
--
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/




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

Date: Fri, 30 Jan 1998 21:49:15 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I would like for a field to be variable width in a format stmt
Message-Id: <rv6ua6.lu4.ln@localhost>

Tom Phoenix (rootbeer@teleport.com) wrote:
: On 30 Jan 1998, Terrence Brannon wrote:

: > #!/usr/bin/perl

[snip]

: >        create soma
                  ^^^^
                  ^^^^
: >        access soma
                  ^^^^
                  ^^^^
: > 
: >        insert $mechname

: What version of Perl is this?

[snip]

: Or is it a hoax, just close enough to Perl to make us wonder where it came
: from?

: > 	   $mechname, plotvar, $plotvar, $mechname
: > 	   printf ("%s\n", sc)
: > 	   system (sc)
: > 	   }
: > .

: You know, this seems like that episode of Star Trek where Kirk and Spock
: discover that alternate universe, just like this one except everyone is on
: heroin.


This seems like "Brave New World" to me...

;-)


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


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

Date: 31 Jan 1998 15:22:54 GMT
From: randyr@i2496147.nafohq.hp.com (Randy J. Ray)
Subject: Image::Size 2.6 uploaded to CPAN
Message-Id: <6avfke$9nt$1@news1.teleport.com>

(While the variations on format in XPM and XBM that break earlier releases
are rare, if you are using Image::Size on the formats on a regular basis,
you may want to update just in case.)

Version 2.6 of Image::Size has been uploaded to PAUSE, and will propagate
to all CPAN sites over the next few days.

To build and install, you will need perl 5.002 or later, and sufficient
access to install an extension.

Summary of Changes in 2.6:

* 2.5 did not actually deliver the tests for the new TIFF code. Oops.

* Found some variations of the formats of XPM and XBM that were not
  compatible with the regex's being used. Tricky, flexible little devils,
  especially XPM.

>From the README file for 2.6:

Image::Size is a library based on the image-sizing code in the wwwimagesize
script, a tool that analyzes HTML files and adds HEIGHT and WIDTH tags to
IMG directives. Image::Size has generalized that code to return a raw (X, Y)
pair, and included wrappers to pre-format that output into either HTML or a
set of attribute pairs suitable for the CGI.pm library by Lincoln Stein.
Currently, Image::Size can size images in XPM, XBM, GIF, JPEG, TIFF, PNG and
the PPM family of formats (PPM/PGM/PBM).

I did this because my WWW server generates a lot of documents on demand
rather than keeping them in static files. These documents not only use
directional icons and buttons, but other graphics to annotate and highlight
sections of the text. Without size attributes, browsers cannot render the
text of a page until the image data is loaded and the size known for layout.
This library enables scripts to size their images at run-time and include
that as part of the generated HTML. Or for any other utility that uses and
manipulates graphics. The idea of the basic interface + wrappers is to not
limit the programmer to a certain data format.

Please send any reports of problems or bugs to randy@byz.org. I wouldn't
mind a short note to know that you're using this, just so I can justify its
continued development to my manager :-). (In seriousness, a rough idea of
how many others are using this will help promote its upkeep.)

This package is copyright (c) 1998 by Randy Ray (randy@byz.org) and is
made available to the Perl public under terms of the Artistic License used to
cover Perl itself. See the file Artistic in the distribution  of Perl 5.002 or
later for details of copy and distribution terms.

Perl module interface by Randy J. Ray (randy@byz.org), original
image-sizing code by Alex Knowles (alex@ed.ac.uk) and Andrew Tong
(werdna@ugcs.caltech.edu), used with their joint permission.

Some bug fixes submitted by Bernd Leibing <bernd.leibing@rz.uni-ulm.de>.
PPM/PGM/PBM sizing code contributed by Carsten Dominik
<dominik@strw.LeidenUniv.nl>. Tom Metro <tmetro@vl.com> re-wrote the JPG and
PNG code, and also provided a PNG image for the test suite. Dan Klein
<dvk@lonewolf.com> contributed a re-write of the GIF code. Cloyce Spradling
<cloyce@headgear.org> contributed the TIFF sizing code and test images.
A fix for reading binary data on PC-ish operating systems was contributed by
Silas Dunsmore <silasd@psyber.com>.

-- 
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray                                                       408-343-7578
                                                           randyr@nafohq.hp.com
"Reach up your hand, if your cup be empty/If your cup is full, may it be again"
                                                --Grateful Dead, "Ripple"




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

Date: 31 Jan 1998 15:22:22 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Math::Pari 0.93 released
Message-Id: <6avfje$9nl$1@news1.teleport.com>


Version 0.93 of Math::Pari module is released.  What follows is README
file of the distribution.

Enjoy,
Ilya

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

Package Math::Pari is a Perl interface to famous library PARI for
numerical/scientific/number-theoretic calculations.  It allows use of
most PARI functions (>500) as Perl functions, and (almost) seamless merging
of PARI and Perl data. 

Documentation to this package is contained inside Pari.pm. After
installing it is accessible by standard means, like

  perldoc Math::Pari
  man Math::Pari

and possibly in other forms particular for your system.

A copy of documentation of the PARI library in POD format is provided as 
well, access it as Math::libPARI:

  perldoc Math::libPARI
  man Math::libPARI

If you have a not very old perl (5.003 should do), then uncompress the
archive into a separate directory, find the architecture of your
processor (if it is not known/supported, and recognized automatically, the
slower 'port' code should be used), and do

	perl Makefile.PL 
		or
	perl Makefile.PL machine=hppa

(recognized "processors" are sun3 sparcv7 sparcv8micro sparcv8super
alpha hppa i386 port, the versions starting from 0.92 should autorecognize
them in most situations), then

	make
	make test

(expect several failures from will_fail.t, but Pari.t and Testout.t
should pass). Now

	make install

should make this extension available to the perl programs.

(You can get a better understanding of the translations made by Testout.t by
running it manually:

	perl t/Testout.t

after install, or

	perl -Mblib t/Testout.t

before install.)

The version 0.93 was tested with OS/2 and Solaris.  It uses version 1.37.4+
of the PARI library.




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

Date: Sat, 31 Jan 1998 15:18:46 +0100
From: Terje Bless <link@tss.no>
Subject: p5p mail2news gateway dead? (was: Don't use signal handlers)
Message-Id: <link-3101981518460001@news.uit.no>

[This isn't modules material so Followup-To is set accordingly]

In article <34D27C91.40FD463A@5sigma.com>,
    "Joseph N. Hall" <joseph@5sigma.com> wrote:

>I will also point out that the microprocessor industry gives us
>an average 3% performance improvement in less time than was spent 
>arguing about this on p5p.

Which reminds me; whatever happened to the p5p mail2news gateway at
genetics.upenn.edu? From what I can tell it's dead (and has been for quite
some time).

-- 
For a good time see <URL:http://www.tss.no/%7Elink/NewsWatcher/ya/teaser.gif>.


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

Date: Sat, 31 Jan 1998 13:32:30 GMT
From: bruce@allied.demon.co.uk (Bruce Davidson)
Subject: Perl5 Database
Message-Id: <886253677.2506.0.nnrp-09.9e982204@news.demon.co.uk>

I wrote a small message center which works fine except for;

When a message is input in the text area box (wrap=physical) the input
is written to the database line with all the carriage returns
(paragraphs) correctly implemented.

My script looks at the first field message id and sees blank lines due
the carriage returns and prints ghosts, ie., no message, only the part
up to the first <CR>.

Is there an easy way to ensure that the input remains on one line and
some way of interpreting a <CR> in that line so that output displays
as per the input.

Thanks
Bruce Davidson
bruce@allied.demon.co.uk



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

Date: 31 Jan 1998 10:26:01 -0700
From: lgstarr@primenet.com (Linda Starr)
Subject: Please Help!! Problems with Perl path to browsers
Message-Id: <lgstarr-3101980925300001@ip35-154.bur.primenet.com>

What is the path to load a perl page to Netscape 3 and IE4 using the
Microsoft personal web server in WIN 95. Also what is the path to Netscape
on a Mac. I am not having any problems compiling perl scripts in DOS or
MacPerl. Thanks for your help


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

Date: Sat, 31 Jan 1998 09:37:20 -0800
From: "Gerrard Family" <family@gerrard.org>
Subject: regex to extract text from string variable
Message-Id: <6avnfs$2o0$1@news2.ispnews.com>

Hello,

I am in need of a regex to extract some text from a string variable:

The variable $output holds the output of a external command, the output is a
basic html formatted file, an example is shown below:

$output =

<html>
<body>


<center><PRE>
This is the text I want to extract
and it can be spread across
three or more lines
</PRE>



</body>
</html>
== EOF ==

I would like to use a regex to extract the text that is between the <PRE>
and </PRE> tags and place it into a new variable, say $pretext.

Thanks in advance for a working example of this, if it can be done.  I can
use Perl 4 or 5.





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

Date: Fri, 30 Jan 1998 12:42:50 -0800
From: Chad R Cordero <ccordero@wiley.csusb.edu>
Subject: removing a line from a file
Message-Id: <34D23B49.41C67EA6@wiley.csusb.edu>

I belive the problem is that split is is only looking at one line, but
when I added m (to specify lookin in multiple lines) to the end of the
pattern I get a syntax error.  How should I split a file into an array
by line?  i.e. $array[0] = "line 1"; $array[1] = "line 2"; etc...

I currently have the following

 open(FILE, "+<file");
         @list = split(/^\n/m , <NO_BB>);
         $i = 0;
         while(defined($list[$i]))
         {
                 if($list[$i] eq "$username")
                 {
                         splice(@list, $i, 1);
                 }
                 else
                 {
                         $i++;
                 }
         }
         $line = join("\n", @list);
         print FILE ("$line\n");
 close(FILE);


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

Date: Sat, 31 Jan 1998 13:26:19 +0000
From: Andrew Spiers <andrew.spiers@virgin.net>
Subject: Using -w
Message-Id: <34D32679.4668E34B@virgin.net>

Everyone informs me that I should use '-w' on my scripts but when I do I
get the following error :

[Sat Jan 31 13:21:52 1998 GMT] CGI: Stderr output from CGI program
follows
________________________________________________________________________________

Name "TempFile::MAXTRIES" used only once: possible typo at
c:\perl\lib/CGI.pm line 2845.
_______________________________________________________________________________

CGI program command line is 'perl C:/PI3WEB/Cgi-Bin\soccerbanex.pl '.
[Sat Jan 31 13:21:52 1998 GMT] CGI: Stderr output from CGI program
follows
________________________________________________________________________________

Name "Config::Config" used only once: possible typo at
c:\perl\lib/CGI.pm line 79.
________________________________________________________________________________

CGI program command line is 'perl C:/PI3WEB/Cgi-Bin\soccerbanex.pl '.
[Sat Jan 31 13:21:52 1998 GMT] CGI: Stderr output from CGI program
follows
________________________________________________________________________________

Name "CGI::DEFAULT_DTD" used only once: possible typo at
c:\perl\lib/CGI.pm line 35.
________________________________________________________________________________

CGI program command line is 'perl C:/PI3WEB/Cgi-Bin\soccerbanex.pl '.
[Sat Jan 31 13:21:52 1998 GMT] CGI: Stderr output from CGI program
follows
________________________________________________________________________________

Name "CGI::DISABLE_UPLOADS" used only once: possible typo at
c:\perl\lib/CGI.pm line 60.
________________________________________________________________________________

CGI program command line is 'perl C:/PI3WEB/Cgi-Bin\soccerbanex.pl '.

The code is as follows :

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

use strict;
use CGI qw(:standard);

my $password=param('password');
my $username=param('username');

print header(),
      start_html("Password"),
      h1("Password");

print hr,
      p("The following were entered :"),
      p("<b>Password :</b> $password"),
      p("<b>Username :</b> $username");

print end_html;


Any ideas ? Many thanks.



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

Date: Sat, 31 Jan 1998 10:10:49 -0500
From: "Robert Sample" <robert_sampleNOSPAM@mediaone.net>
Subject: Where Is sub Autoloader?
Message-Id: <6avev1$oir$1@wbnws01.ne.highway1.com>

Hi Folks,

I have written a script which uses Registry.pm.  In the subroutine AUTOLOAD,
there is a call to the subroutine Autoloader, goto &Autoloader::AUTOLOAD.
When I execute the script, I receive the following error: Goto undefined
subroutine &AutoLoader::AUTOLOAD at D:\Perl5\Lib/Win32/Registry.pm line 84.

Any suggestions, comments or clarifications would be greatly appreciated.

TIA...Robert





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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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