[8184] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1802 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 3 22:12:19 1998

Date: Tue, 3 Feb 98 19:00:26 -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           Tue, 3 Feb 1998     Volume: 8 Number: 1802

Today's topics:
        **SEARCH**ing for an answer <vbmike@usa.net>
    Re: A Question <corky@ultranet.com>
    Re: beyond my abilities <corky@ultranet.com>
    Re: beyond my abilities <branning@access.digex.net>
        Capturing file output <pbanks@ix.netcom.com>
    Re: clarifying error messages <joseph@5sigma.com>
        Compiling Perl with sfio under Irix <ahayes@ingenia.com>
    Re: Debuggin w/o shell (Devin L. Ganger)
        Determine if machine is connected to the Net? (David Efflandt)
    Re: How to sort data from a file <joseph@5sigma.com>
    Re: I am female, blonde and stupid! <joseph@5sigma.com>
    Re: I am female, blonde and stupid! (Jeffrey Drumm)
    Re: Is file locking necessary? <joseph@5sigma.com>
    Re: keyboard INPUT (Martien Verbruggen)
    Re: Looking Vor Binary Compiler (Martien Verbruggen)
        Method Invocation: non-intuitive behaviour or is it me? (Paul David Fardy)
    Re: Monitoring a file <pbanks@ix.netcom.com>
    Re: NAWK to PERL conversion (Martien Verbruggen)
    Re: Need help with editing @INC (David Efflandt)
    Re: New core dump on long-working troff2html <joseph@5sigma.com>
        Pattern Match Question <curt@vphos.net>
    Re: Pattern Match Question <joseph@5sigma.com>
    Re: perl and file system (Martien Verbruggen)
    Re: PERL2EXE (Martien Verbruggen)
    Re: PROBLEM WITH gifs (David Efflandt)
    Re: Quickie: regexp for valid e-mail addresses (Craig Berry)
    Re: Quickie: regexp for valid e-mail addresses (Abigail)
        sending mail from html-form? <totalrel@hrz1.hrz.tu-darmstadt.de>
    Re: sending mail from html-form? (Martien Verbruggen)
        Server Error? <rxt117@psu.edu>
        Timeout socket write on Win32 <w.stanton@auckland.ac.nz>
    Re: using unix commands in perl (David Efflandt)
    Re: Win32 CGI compiler ? (Troy Denkinger)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 3 Feb 1998 19:22:57 -0500
From: "Mike" <vbmike@usa.net>
Subject: **SEARCH**ing for an answer
Message-Id: <6b8chg$79b@enews2.newsguy.com>

Oh, help me, all mighty Perl Gods (and goddesses)...
I'm in need of a way to search a web site consisting of 5000+ documents in
ONE directory.  How can I do so?  I tried using SWISH, but got an 'Out of
Memory!' error when creating the index.  I tried Xav, and it created the
index (a mere 13MB), but gave me a couldn't allocate enough memory error
when attempting to search it.  I'm very open to any ideas.  It may be
helpful to note that the documents that I'm trying to search are all
numbered, i.e. 1001.html, 1002.html, 1003.html..... 4999.html, 5000.html.
Can I have SWISH create, for instance, five different indexes and then merge
them?  How can I have it build indexes for the equivilent of 1*.html,
2*.html, etc?  Thanks for any help, or and ideas as where to continue my
quest.

Please send a copy of your reply to vbmike@usa.net

-Mike




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

Date: Tue, 03 Feb 1998 20:34:44 -0500
From: Bob Trieger <corky@ultranet.com>
To: "V. Chandrasekhar" <vchandra@mail.delcoelect.com>
Subject: Re: A Question
Message-Id: <34D7C5B4.58D7@ultranet.com>

V. Chandrasekhar wrote:
> 
> I am running Version 5.004 of Perl.
> 
> I have format statements such as the following, in a program:
> 
> format Line1 =
> @<<<<<<<<   @<<< KPH (@<<<MPH)  @<<<<<<<<<<<<<<<<<<<<<<<<
> $testNumber,$kmh,     $mph,     $testDescription
> .


I suggest you use the printf function instead. The above line would be
as simple as:

printf "%9s  %4s KPH  (%4s MPH) 
%25s\n",$testNumber,$kmh,$mph,$testDescription;


HTH
Bob Trieger
crky@ma.ultranet.com


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

Date: Tue, 03 Feb 1998 19:49:14 -0500
From: Bob Trieger <corky@ultranet.com>
To: branning@access.digex.net
Subject: Re: beyond my abilities
Message-Id: <34D7BB0A.2133@ultranet.com>

Daniel Branning wrote:
> 
> I was very excited to see the following post to this newsgroup, as it
> solves a problem which I have been struggling with for some time -- and
> so I got the Sort::Fields module and installed it on my Linux box at
> home with no problems.
> 
> At work, however, I am using the ActiveWare port to Win32 (5.003_7 Build
> 315 - with an MKS Toolkit shell), and I've stumbled into several issues
> which are beyond my abilities at this point.


Go to  http://www.perl.com and get Gurusamy Sarathy's perl port for
win32. It is about 6mb and contains many of the modules already ported
to win32.

It solved many of my headaches with NT. Gurusamy is an angel.


Bob Trieger
corky@ma.ultranet.com


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

Date: Wed, 04 Feb 1998 01:05:31 +0000
From: Daniel Branning <branning@access.digex.net>
Subject: Re: beyond my abilities
Message-Id: <34D7BEDB.BF825698@access.digex.net>

Bob Trieger wrote:

> Daniel Branning wrote:
> >
> > I was very excited to see the following post to this newsgroup, as it
> > solves a problem which I have been struggling with for some time -- and
> > so I got the Sort::Fields module and installed it on my Linux box at
> > home with no problems.
> >
> > At work, however, I am using the ActiveWare port to Win32 (5.003_7 Build
> > 315 - with an MKS Toolkit shell), and I've stumbled into several issues
> > which are beyond my abilities at this point.
>
> Go to  http://www.perl.com and get Gurusamy Sarathy's perl port for
> win32. It is about 6mb and contains many of the modules already ported
> to win32.
>
> It solved many of my headaches with NT. Gurusamy is an angel.
>
> Bob Trieger
> corky@ma.ultranet.com

  Thanks very much. I will try it.



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

Date: Tue, 03 Feb 1998 16:16:54 -0800
From: Paul Banks <pbanks@ix.netcom.com>
Subject: Capturing file output
Message-Id: <34D7B376.9D0E904F@ix.netcom.com>

I have a small script which forks several tasks.
Each task does an open to a system utility such as iostat or vmstat and
writes the output to a file.
At least it is supposed to write the output to the file.  If the task is
killed then all output is lost.

I can save the output by reopening the file every n writes.  What I
really want to do is force each line of output to be written to disk
without doing a reopen of the file.

In c I would use fflush to flush the output, but that feature appears to
be missing from perl.

Any suggestions would be appreciated.

Paul Banks
pbanks@ix.netcom.com



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

Date: Tue, 03 Feb 1998 19:15:51 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: clarifying error messages
Message-Id: <34D7CEFC.12150BC7@5sigma.com>

It means pretty much what it says.  There wasn't an acceptable
DBM package installed.  It looks for one of:

  NDBM_File DB_File GDBM_File SDBM_File ODBM_File

	-joseph

Lynchqvctc wrote:
> 
> I have a program now running on a win95 system-- a searchable database of
> historical pictures. In trying to set the same program up on another win95
> machine, with the same file structure etc., the program does not run. The
> generated error message reads:
> 
> "No DBM package was successfully found or installed at
> C:\Sambar4\perl\lib/AnyDBM_File.pm line 11. BEGIN failed--compilation aborted
> at pictutil.pl line 5."

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: Tue, 03 Feb 1998 19:12:02 -0600
From: Amos Hayes <ahayes@ingenia.com>
Subject: Compiling Perl with sfio under Irix
Message-Id: <886554096.1274937346@dejanews.com>

Hi all.

I have tried/read docs/played with variables for a day and
a half now and I am truly stumped. My goal is to get Perl
compiled *with sfio* on an Irix 6.2 box using the IDO cc.

I suppose compiling isn't even the issue. It compiles fine
without sfio. It's the Configure script that seems to have
the problem.

Here is where I'm guessing the Configure script runs into
problems:
----------------------------------------------------------
<sfio.h> found.

sfreserve() NOT found.
Sorry, cannot find sfio on this machine
Ignoring your setting of usesfio=define
----------------------------------------------------------


Here is the output from myconfig:
----------------------------------------------------------

Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=irix, osvers=6.2, archname=IP19-irix
    uname='irix64 devel 6.2 03131016 ip19 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=define d_sfio=undef
  Compiler:
    cc='cc -n32', optimize='-O3', gccversion=
    cppflags='-D_BSD_TYPES -D_BSD_TIME -OPT:Olimit=0 -I/usr/local/include
-DLANGUAGE_C'
    ccflags ='-D_BSD_TYPES -D_BSD_TIME -woff 1009,1110,1184 -OPT:Olimit=0
-I/usr/local/include -DLANGUAGE_C'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib -L/usr/lib32 -L/lib32'
    libpth=/usr/local/lib /usr/lib32 /lib32 /lib /usr/lib
    libs=-lsfio -lm -lc
    libc=/usr/lib32/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-n32 -shared -L/usr/local/lib -L/usr/lib32
-L/lib32'

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


Now, I'm quite certain that I've included all the path bits
that need including. I've gone over the recipe (for FastCGI)
several times and am quite certain I've covered all the bases.

I untarred/compiled sfio97 in /usr/local. The following files
exist in /usr/local/lib:

libsfdisc.a  libsfio.a    libstdio.a

And under /usr/local/include:

sfdisc.h      sfio.h        sfio_t.h


I used "./Configure -Duseperlio -Dusesfio" to run Configure and
since the sfio stuff was in /usr/local, the paths "/usr/local/lib"
and "/usr/local/include" in the library searches & include searches
should have worked.

According to this, they did:
-----------------------------------------------------------------
Checking for optional libraries...
Found -lsfio.
No -lnet.
No -linet.
No -lnm.
No -lndbm.
No -lgdbm.
No -ldbm.
No -ldb.
Found -lmalloc (shared).
No -ldld.
No -lld.
Found -lm (shared).
Found -lc (shared).
No -lcposix.
No -lposix.
No -lndir.
No -ldir.
No -lucb.
No -lBSD.
No -lx.
------------------------------------------------------------------

So... wondering what was wrong with me, I tried compiling with/without
5.003 binary support. I tried using and not using "nm". I tried
copying the sfio libraries and headers to other places where the
compiler might have better luck. I searched USENET and found one other
poor soul with the exact same problem. I sent him a sympathy email. I
did a hoola dance in front of my terminal. You get the idea.


Thanks for reading this far. I will be *very* grateful to any kind
soul(s) that attempt(s) to help. I am going to go home now. It's been
a long day.

BTW... If I've missed/muddled an important piece of info, please let
me know and I'll report back on it.

--
Amos Hayes
ahayes@ingenia.com                          Ingenia Communications Corp.
http://smurf.ingenia.com                      http://www.ingenia.com

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 4 Feb 98 00:16:08 GMT
From: devin@premier1.net (Devin L. Ganger)
Subject: Re: Debuggin w/o shell
Message-Id: <slrn6dfcpk.dmv.devin@blacktower.premier1.net>

<flashy-thing!>  Remember only that on Tue, 03 Feb 1998 18:06:18 -0500,
in comp.lang.perl.misc Paul Mone wrote:

> Due to the elitest nature of the body of programmers who reside here, I
> am forced to both use a proper subject and be as specific as I can.

You are forced to do nothing.

If you'd like your messages to be read and responded to, however, it
behooves you to follow some basics of common courtesy to allow already
busy people to find and comprehend your posting with minimal effort.

-- 
Devin L. Ganger <devin@premier1.net>
Chief Systems Administrator
Premier1 Internet Services


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

Date: Wed, 04 Feb 1998 01:26:33 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Determine if machine is connected to the Net?
Message-Id: <34dabc31.4516437@flood.xnet.com>

Is there a generic method that a perl script can tell if the machine
it is running on is connected to the Internet (Linux)?  I am going
through a list of gethostbyname in an eval alarm loop to drop slow or
invalid entries (so it does not take forever).  But if the machine is
not connected, all hostnames will drop.  With autoconnect
(request-route), a bunch at the beginning will drop until the
connection is established.

I could do a gethostbyname outside of the timeout loop, but then the
question is what hostname to use for a portable script (they might
have a local nameserver), or is there a quicker way to tell?

This is for a Linux console Quake2 server browser/launcher and I am
just trying to clean up the data before I feed qstat and save it for
quicker future use (see:  http://www.xnet.com/~efflandt/quickspy2/).


David Efflandt/Elgin, IL USA
efflandt@xnet.com    http://www.xnet.com/~efflandt/


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

Date: Tue, 03 Feb 1998 19:11:12 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
To: davidh@wwwpromote.com
Subject: Re: How to sort data from a file
Message-Id: <34D7CDE6.94C0E231@5sigma.com>

use Sort::Fields;

while (<DATA>) {
    s/#.*//;
    next unless /\S/;
    push @lines, $_;
}
print fieldsort [1, 4], @lines;

__END__
#LastName | FirstName | Age | Unique ID
Hasbrouck | David | 25 | 001.002
Strong | Paul | 21 | 001.001
Anderson | James | 23 | 001.003
Johnson | Sam | 29 | 001.006
Tucker | Sara | 26 | 001.005

 .......

% tryme1
Anderson | James | 23 | 001.003
Hasbrouck | David | 25 | 001.002
Johnson | Sam | 29 | 001.006
Strong | Paul | 21 | 001.001
Tucker | Sara | 26 | 001.005

David Hasbrouck wrote:
> 
> I need some help sorting the contents of a file by a certain field on
> each line.  Example file:
-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: Tue, 03 Feb 1998 19:19:57 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
To: kati@purestar.com
Subject: Re: I am female, blonde and stupid!
Message-Id: <34D7CFF2.3253BB26@5sigma.com>

I am male, brunette, and that is a lousy subject line.

Kati Gaebler wrote:
> 
> Hello,

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: Wed, 04 Feb 1998 02:38:57 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: I am female, blonde and stupid!
Message-Id: <34d7cb01.613953465@news.mmc.org>

On Tue, 03 Feb 1998 22:26:18 GMT, bart.mediamind@tornado.be (Bart Lateur)
wrote:

>Kati Gaebler <dont@mailmehere.com> wrote:
>
>>Subject: I am female, blonde and stupid!
>
>If that is your opinion about yourself, I'm not in the least inclined to
>help you.
>
>	Bart.

Hmm. Maybe she should've stayed a virgin[1]. She got plenty of help then .
 . . and it wasn't even a Perl question.


[1] "I am still a virgin" thread started by katigaebler@hotmail.com . . .
1/18/1997 or thereabouts.

-- 
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center Information Services
420 Cumberland Ave, Portland, ME 04101
drummj@mail.mmc.org


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

Date: Tue, 03 Feb 1998 19:13:35 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Is file locking necessary?
Message-Id: <34D7CE75.F13318BB@5sigma.com>

If a CGI script writes to a shared file, yes, locking is necessary.

See the man pages for flock, fcntl, etc., and also the Web Techniques
article(s) under http://www.stonehenge.com/merlyn.

	-joseph

Bill Genzer wrote:
> 
> I am very new at PERL and I have just started writing my own CGI scripts
> (really editing other scripts).  I have to admit it seems very simple and
> easy to learn.  My question is if it is necessary to lock files before
> reading or writing to files?  [...]

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: 4 Feb 1998 01:28:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: keyboard INPUT
Message-Id: <6b8g87$41j$1@comdyn.comdyn.com.au>

In article <34d7357a.0@npnews.newpaltz.edu>,
	russo02@sunserv.eelab.newpaltz.edu (Michael Russo) writes:
> Does anybody have any insight on how to process keyboard input without
> having to wait for the '\n' (carriage return, in the vernacular)?  Getc and
> read STDIN aren't cutting it.

What is it today? keyboard input day? You're the 3rd one to ask this question,
that is answered in the FAQ, today. Please, read the FAQ.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: 4 Feb 1998 00:16:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Looking Vor Binary Compiler
Message-Id: <6b8c1h$3iq$3@comdyn.comdyn.com.au>

In article <34D5DEA1.3CEA0097@rpimail.mdacc.tmc.edu>,
	Eddie Gonzalez <egonzalez@rpimail.mdacc.tmc.edu> writes:
> I am about to install Perl and need a compiler.  I need a binary
> compiler to download
> for free because there is no current compiler for the server.  Thanks...

Hmm.. I read that as: 'I need to compile perl, but I don't have a C
compiler on my system. Where can I get one?'

This of course, is not a perl question, or perl issue. You might want
to have a look at gcc. Go to yahoo and find links to it from there.
Ask on a gcc specific group, like comp.gcc.help or something like that.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd.       | excuse - Lazarus Long
NSW, Australia                      | 


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

Date: 3 Feb 1998 22:24:55 GMT
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Method Invocation: non-intuitive behaviour or is it me?
Message-Id: <6b85fn$am2$1@coranto.ucs.mun.ca>
Keywords: method, invocation, subroutine, declaration, syntax, parsing

The Perl code below generates a syntax error that's easily fixed by
rearranging the function declarations.  Why?

$ perl -wc test.pl
syntax error at junk line 55, near "$obj_class $obj"
test.pl had compilation errors.

Okay, the error occurs while parsing subroutine Container::set.
The line that generates the error is:

	$self->{$obj} ||= new $obj_class $obj;

Yet this line is pretty much the same as the following line from
Container::new:

	$self->{$obj} = new $obj_class $obj;

If I declare Container::set BEFORE Container::new, the syntax
error disappears and the program runs as expected.

It's apparent to me that Perl parses the expression 

	new $obj_class $obj

differently when it appears after the subroutine Container::new
has been declared.

Is there something wrong with declaring Container::set after
Container::new?  How can I write Container::set so that it can
follow Container::new?  Is there something wrong with Perl's
parser?

I'd appreciate a response via e-mail.

Thanks,

Paul Fardy

-- cut here -- cut here --
package Base;

sub new {
	my $class = shift;
	my $self = bless {}, $class;
	$self->{name} = shift;
	$self;
}

sub set {
	my ($self, $value) = @_;
	$self->{value} = $value;
}

sub show {
	my $self = shift;
	$value = $self->{value} || "undef";
	print "  $self->{name} = $value\n";
}

package Foo;
@ISA = qw(Base);

package Bar;
@ISA = qw(Base);

package Container;

%class = (a => "Foo", b => "Bar", c => "Foo");

sub new {
	my $class = shift;
	my @obj = @_;
	my $self = bless {}, $class;

	foreach $obj (@obj) {
		unless (defined $class{$obj}) {
			$ERR = "unrecognized class: $obj";
			return undef;
		}
		$obj_class = $class{$obj};
		$self->{$obj} = new $obj_class $obj;
	}
	bless $self, $class;
}

sub set {
	my $self = shift;
	my ($obj, $value) = @_;
	unless (defined $class{$obj}) {
		$ERR = "unrecognized field: $obj";
		return undef;
	}
	$obj_class = $class{$obj};
	$self->{$obj} ||= new $obj_class $obj;
	$self->{$obj}->set($value);
}

sub show {
	my $self = shift;
	foreach $obj (values %$self) {
		$obj->show;
	}
}

package main;

@obj = qw(a b);

$bag = new Container @obj;

print "Initial contents\n";
$bag->show;

$bag->set('a', 2);  # changes value of hash

print "Set a = 2\n";
$bag->show;

$bag->set('b', 3);  # changes value in hash
print "Set b = 3\n";
$bag->show;

$bag->set('c', 1);  # creates new entry in hash
print "Set c = 1\n";
$bag->show;


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

Date: Tue, 03 Feb 1998 16:28:25 -0800
From: Paul Banks <pbanks@ix.netcom.com>
To: Tony.Curtis@vcpc.univie.ac.at
Subject: Re: Monitoring a file
Message-Id: <34D7B629.5DE488F6@ix.netcom.com>

Tony:

You may want to take a look at seek.
Save the current eof then seek to the new eof.
If the two eof values are not equal, the file has expanded.
At least this technique works in c.  I am not sure about perl

Here is a problem for you to watch out for.
If someone moves (renames the current file) and then opens a new file,
you will never see the new one until you close and reopen the new file.
I am still working on how to solve that nasty little problem without
doing constant stats or opens or ???? to determine the file status.

Paul Banks
pbanks@ix.netcom.com

Remove xx to reply wrote:

> Re: Monitoring a file, Anthony <anthonyl@kodak.com> said:
>
> Anthony> Has anyone written or know of a simple way to
> Anthony> monitor a file, sleep for a few seconds and then
> Anthony> check to see if the file has increased in length
> Anthony> and if so, to read the newly added lines and pipe
> Anthony> them into another file????!??
>
> Try some things here:
>
>     http://reference.perl.com/query.cgi?sysadmin
>
> tony
> (another one :-)





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

Date: 4 Feb 1998 00:11:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: NAWK to PERL conversion
Message-Id: <6b8bo0$3iq$1@comdyn.comdyn.com.au>

In article <34d5ef14.6796683@news.packet.net>,
	rclift@riscman.com writes:
> I have a nawk script that I am trying to convert to perl.  The script

You might try the a2p translator that comes with perl (awk to perl). I
don't know if there are any differences between your specific nawk
script and the way a2p interprets awk, but you can always give it a
try.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | You can't have everything, where would
Commercial Dynamics Pty. Ltd.       | you put it?
NSW, Australia                      | 


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

Date: Wed, 04 Feb 1998 02:07:41 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Need help with editing @INC
Message-Id: <34dcc89a.7693984@flood.xnet.com>

slsorrels@aol.com (SLSorrels) wrote:

>I downloaded a module for Internet stuff... like FTP... I ran the "install.bat"
>to let it make the appropriate Registry modifications and drop the files where
>they need to go...  (yes... I'm using Perl on Win95  :-))
>
>BUT...  when I try to run my tiny little perl program, I get an error message
>saying "Can't load 'c:\Perl\lib/auto/win32/internet/internet.pll' for Module
>Win32::Internet..........."

Just one question, does Win32 perl care which way the slashes lean?
Since I progressed to Linux some time ago, I don't recall exactly how
to handle DOS backslashes.

>I can see "internet.pll" in that path but can't figure out why Perl thinks it's
>not there...  someone suggested I edit the @INC and push the info...

You cannot push or unshift @INC unless inside of a BEGIN statement
since regular statements are not processed until the modules are
already loaded.  Instead simply:

use lib LIST;	# where LIST is extra search paths

>How do I push the info? I know about the "push function" but am unsure of the
>proper syntax to use...
>
>Anyone???  hheeelllppp  :-)
>
>-SLSorrels


David Efflandt/Elgin, IL USA
efflandt@xnet.com    http://www.xnet.com/~efflandt/


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

Date: Tue, 03 Feb 1998 19:17:53 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: New core dump on long-working troff2html
Message-Id: <34D7CF77.1450D8DF@5sigma.com>

Build a debugging version of perl, then debug the core dump.  Mail
a stack trace and the offending script and input to the perl 5 
porters using perlbug.  This is assuming you're using some 
Unix-like box.

	-joseph

Jim Spath wrote:
> 
> I've been using a troff to html converter for a couple years and it has
> started dumping core on fairly benign input. The perl code has been at:
> http://www.cmpharm.ucsf.edu/~troyer/troff2html/ since October 1994.
> 
> A 400-line troff file core dumps under the current perl (5.004) on two
> systems I've tried but doesn't under 5.003.  Can someone give me some
> tips as to how to debug this other than simply "-w"?

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: Tue, 03 Feb 1998 17:06:06 -0800
From: Curt Cranfield <curt@vphos.net>
Subject: Pattern Match Question
Message-Id: <34D7BEFE.7FDE@vphos.net>

This a pretty newbie question but it has bothered me for sometime.  How
do I a pattern match without using $_ as the string being search.  I am
tired of always have to set my searched string to $_ before I can do a
pattern match on it.  I have looked through the perl book and can't find
anything.

ie. 
$_ = "foo is for you";
if (/foo/) {
	# This works
}

But what I want to do is something like this - where I say what string I
want to search on:
$dog = "big brown";
if (/big/$dog)	{
}
This does not work!!  

Is it possible to do something like this? Does it even make sense?


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

Date: Tue, 03 Feb 1998 19:12:18 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Pattern Match Question
Message-Id: <34D7CE28.DE370E28@5sigma.com>

=~

Curt Cranfield wrote:
> 
> This a pretty newbie question but it has bothered me for sometime.  How
> do I a pattern match without using $_ as the string being search. 

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: 4 Feb 1998 00:13:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl and file system
Message-Id: <6b8brl$3iq$2@comdyn.comdyn.com.au>

In article <ra5muho6.fsf@aigf.sncf.fr>,
	Fabrice Gonton <fabrice.gonton@aigf.sncf.fr> writes:
[snip]

> Is there a simple way to determine the fs ?

Where is the perl question?

try df .

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: 4 Feb 1998 02:05:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PERL2EXE
Message-Id: <6b8ics$41j$4@comdyn.comdyn.com.au>

In article <34D75F38.1D54@mci.com>,
	Lakshmanan Suryanarayanan <Lakshmanan.Suryanarayanan@MCI.COM> writes:

[Snip of double headers]

Fix your news reader. It outputs crap.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Wed, 04 Feb 1998 01:42:33 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: PROBLEM WITH gifs
Message-Id: <34dbc42c.6560150@flood.xnet.com>

Stephan Carydakis <steph@hotkey.net.au> wrote:

>I wrote a very simple script to send HTML back to browser.  The HTML all
>loads, but the images dont. Instead, the Windows default viewer for gifs
>is spawned, and the images load there????
>
>I had a friend access the script and the same happened. The images
>loaded my end in the default viewer.
>
>ANY SUGGESTIONS ????????

Sure, try using image links just like on a normal page instead of
trying to push html and binary data at the same time.  Just be sure to
escape or otherwise handle quotes within quotes.  Images are requested
by the browser as a separate process after it has the page contents,
only if the browser wants them.  However, you can use a perl CGI as an
image source.

>I'm using Win95[a] and a Netscape Fast Trak Server for my developing.
>
>thanks!!!
>________________________________
>
>Stephan Carydakis
>steph@hotkey.net.au
>________________________________


David Efflandt/Elgin, IL USA
efflandt@xnet.com    http://www.xnet.com/~efflandt/


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

Date: 3 Feb 1998 23:48:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <6b8aca$o8s$2@marina.cinenet.net>

Dan Sanderson (dsanders@u.washington.edu) wrote:
: I know it's been done before, so I thought I'd ask before trying to compile my
: own.

Only about 3,700 times so far this month...

: What's a good regexp that will only match valid e-mail addresses (i.e.
: name@subdomain.whatever.domain), that includes all the valid characters that
: can be seen in the domain name, etc., and requires the @ symbol?

Short answer:

  Don't bother.  There isn't a good one.  Give up.

Longer answer:

  Buy Freidl's _Mastering Regular Expressions_.  Read his brilliant
  discussion on this very topic.  Marvel at his 4,000+ character
  valid-email-matching regex which still doesn't handle every possible
  case.  Give up.

Extra answer:

  Though some violently disagreed with me when we discussed this
  here recently, I see no problem with warning users, or requesting
  their confirmation, if an 'unusual' email address is entered (say,
  one without @ where a non-local address is expected).  Simply refrain
  from rejecting an address if the user says it's correct.  No matter
  how weird it looks, the only sure way to test an address's validity
  (with respect to your mailer) is to try sending it and watch for
  either a bounce or a friendly reply from the recipient.

HTH!

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 4 Feb 1998 02:07:25 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <6b8igt$ao0$1@client2.news.psi.net>

Dan Sanderson (dsanders@u.washington.edu) wrote on 1617 September 1993 in
<URL: news:34D7A332.A23634B2@u.washington.edu>:
++ I know it's been done before, so I thought I'd ask before trying to compile my
++ own.
++ 
++ What's a good regexp that will only match valid e-mail addresses (i.e.
++ name@subdomain.whatever.domain), that includes all the valid characters that
++ can be seen in the domain name, etc., and requires the @ symbol?

/[\x00-\x7f]+@[\x00-\x7f]+/;


There isn't any symbol from ASCII set that is *not* allowed in an
email address. Read RFC822 for details.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Wed, 04 Feb 1998 01:12:23 +0100
From: Raphael Breiting <totalrel@hrz1.hrz.tu-darmstadt.de>
Subject: sending mail from html-form?
Message-Id: <34D7B267.EC2F2F6E@hrz1.hrz.tu-darmstadt.de>

Hi all,

is there a way to send an email from a html-form without using unix4s
sendmail. I need to do this on a win nt server.

--
***************************************************************
* VNW Virtual Net Worlds               V   V N  N W     W     *
* Raphael Breiting, TotalReflexion     V   V NN N W  W  W     *
* fon: +49 (0) 6151-47027               V V  N NN  W W W      *
* fax: +49 (0) 6151-47027                V   N  N   W W       *
* eMail 1: vnw@mail.com                                       *
* eMail 2: vnw@premiumservice.com                             *
* eMail 3: totalrel@hrz1.hrz.tu-darmstadt.de                  *
* http: http://www.tu-darmstadt.de/~totalrel/index.html       *
***************************************************************




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

Date: 4 Feb 1998 02:01:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: sending mail from html-form?
Message-Id: <6b8i4t$41j$3@comdyn.comdyn.com.au>

In article <34D7B267.EC2F2F6E@hrz1.hrz.tu-darmstadt.de>,
	Raphael Breiting <totalrel@hrz1.hrz.tu-darmstadt.de> writes:
> is there a way to send an email from a html-form without using unix4s
> sendmail. I need to do this on a win nt server.

- See the thread with subject 'Email Perl script on NT alpha server'
  on this same newsgroup. 
- Search www.dejanews.com. 
- Read perlfaq9 (perldoc perlfaq9). 
- Read the FAQ for win32:
  http://www.perl.com/CPAN/doc/FAQs/win32/Perl_for_Win32_FAQ.html. 
	
Do you need any more obvious places to look for an answer?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Tue, 03 Feb 1998 19:42:01 -0500
From: Rei <rxt117@psu.edu>
Subject: Server Error?
Message-Id: <34D7B959.9DDCEAAF@psu.edu>

I wrote a script that creates an html file with a form.  This html file
uses another perl script when you submit it.  It works the first time,
but when I try it the second time, I get an error message:

Server Error
This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a misconfiguration.
Please ask the administrator to look for messages in the server's error
log.

Can anyone help?
Rei
rxt117@psu.edu



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

Date: 04 Feb 1998 13:28:35 +1200
From: Worik Macky Stanton <w.stanton@auckland.ac.nz>
Subject: Timeout socket write on Win32
Message-Id: <wkhg6gdupo.fsf@auckland.ac.nz>

Friends

Is it possible to set some sort of timeout on a write to a socket?

I have a situation where I am sending a large ammount of data through
a socket, and despite all care there is a chance that the receiving
end goes down b4 all the data is sent (I do a handshake first to
minimize the risk, but it still exists).

Currently this will hang the transmitter.  

If this was unix I would spawn a process to transmit the data and
monitor it.

But this is not unix, and I do not want the transmitting programme to
hang because of a problem in the receiver.

I do not know what this means (from the docs for IO::Socket)

    timeout([VAL])
        Set or get the timeout value associated with this socket. If
        called without any arguments then the current setting is
        returned. If called with an argument the current setting is
        changed and the previous value returned.

Is it usful to me?  How would it work?

Worik



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

Date: Wed, 04 Feb 1998 02:13:50 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: using unix commands in perl
Message-Id: <34ddcdca.9022392@flood.xnet.com>

Kimbrough Gray <kigray@cs.utexas.edu> wrote:

>I'm trying to copy a file from one directory to another.
>I've been typing in 
>cp help.html fun/help.html;
>And I have been getting an error which reads
>"Search pattern not terminated at add.cgi line 14"
>Line 14 is "cp help.html fun/help.html;"
>I thought I had heard that you could type in Unix commands directly
>into your perl code but maybe I am incorrect.

You may be thinking of shell scripts.  For perl scripts you need to
use `backticks` (upper left of US keyboard) where the tilde (~) is.
Try:

`cp help.html fun/help.html`;


David Efflandt/Elgin, IL USA
efflandt@xnet.com    http://www.xnet.com/~efflandt/


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

Date: Wed, 04 Feb 1998 01:56:24 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: Win32 CGI compiler ?
Message-Id: <6b8ia7$git$1@nntp3.interaccess.com>

[copy NOT cc'ed cuz it wasn't worth the keystroke]

In article <34D78E9D.4F3C@worldnet.fr>, rsgdata@worldnet.fr wrote:
>But everyone can read the source...
>
>In France, your answer is called : "une riponse de charlot" :-)

Yeah, and in Perl-ville we say "Read The FAQ."  Go to 
http://www.perl.com/ and see what you find there.

Regards,

Troy Denkinger


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

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

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