[13826] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1236 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 31 09:05:34 1999

Date: Sun, 31 Oct 1999 06:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941378710-v9-i1236@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 31 Oct 1999     Volume: 9 Number: 1236

Today's topics:
    Re: #!perl like <gellyfish@gellyfish.com>
    Re: comparing text with words (Bart Lateur)
        EPOCH'S Halloween? <_ncc1701d@storage2000.com_>
    Re: EPOCH'S Halloween? <_ncc1701d@storage2000.com_>
    Re: EPOCH'S Halloween? (Abigail)
    Re: EPOCH'S Halloween? <_ncc1701d@storage2000.com_>
    Re: EPOCH'S Halloween? <gellyfish@gellyfish.com>
        fork() <tjudd@teleport.com>
    Re: help with Text:ParseWords (Eric Bohlman)
    Re: How can I show a page-visitor his IP on my homepage <flavell@mail.cern.ch>
        HOWTO connect to BaaN Server???? <thomas.frei@erp-solutions.de>
    Re: HOWTO connect to BaaN Server???? <gellyfish@gellyfish.com>
        ip address <Floyd@NewWebSite.com>
    Re: ip address <Floyd@NewWebSite.com>
    Re: ip address <wyzelli@yahoo.com>
    Re: ip address <Floyd@NewWebSite.com>
    Re: Just to get rid of dos prompt window. <gellyfish@gellyfish.com>
    Re: pass file handle <gellyfish@gellyfish.com>
    Re: Perl disallowed at ACM programming contests? (Bart Lateur)
        please help speed this up (Mike Collins)
    Re: please help speed this up <gellyfish@gellyfish.com>
    Re: Quick Question (Abigail)
    Re: Quick Question <meowing@banet.net>
        regsrv32 <MATTHIAS.DRESCHER@mchr2.siemens.de>
    Re: regsrv32 <gellyfish@gellyfish.com>
    Re: sendmail question <gellyfish@gellyfish.com>
    Re: Trying to work this regex out.... (Bart Lateur)
    Re: Whoa. This shouldn't work... (Bart Lateur)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 31 Oct 1999 08:27:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: #!perl like
Message-Id: <7vguho$h9$1@gellyfish.btinternet.com>

On Sat, 30 Oct 1999 12:47:21 -0400 * Tong * wrote:
> Hi,
> 
> I want to find a way to let sh pick perl for me instead of my hard
> coding perl path into my perl script. 
> 
> I read the man page, and the "Why we use eval 'exec perl $0 -S
> ${1+"$@"}' " from FMTEYEWTK but still can't get it going:
> 
> Here is my version:
> 
> #!/bin/sh -- # -*- perl -*- 
> eval 'exec perl $0 -S ${1+"$@"}';
> 
> and the result I got:
> 
> Argument "" isn't numeric in add at (eval 1) line 1.
> Use of uninitialized value at (eval 1) line 1.
> Use of uninitialized value at (eval 1) line 1.
> Use of uninitialized value at (eval 1) line 1.
> 
> My questions are:
> 
> - How to make it works.
> 
  put the 'if 0;' on the next line Perl wont execute it.

> - what the -S mean? shouldn't it before $0?
> 

It cause perl to look for the script in the path - read the perlrun
manpage to find out about command line switches.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 31 Oct 1999 11:44:26 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: comparing text with words
Message-Id: <381d2b49.2901028@news.skynet.be>

Abigail wrote:

>Only a problem if you don't use "use strict". Autostringifying barewords
>is sometimes useful in one-liners.
>
>// Ban those damn' barewords. They're just bugs waiting to happen. *At
>// runtime*.
>
>use strict; catches them *at compiletime*. If you don't use use strict;
>you're on your own anyway.

It is just one example of a more general gripe: I hate it if the same
code behaves differently under slightly different circumstances. It
takes away the control of what happens, away from the programmer, and
the program goes off leading it's own life.

This is another example:

  %foo = ( b => 'xyz' );
  foreach (qw(a b c)) {
      push @{$foo{$_}}, "pushed onto $_";
  }

  print @xyz;

-->

  pushed onto b


Argh! $foo{b} is used as a *symbolic* reference, while for 'a', and 'c',
an anonymous array is created!

True, "use strict" will eventually catch this too, but only at
*runtime*.

-- 
	Bart.


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

Date: Sun, 31 Oct 1999 02:54:42 -0600
From: "Jason D" <_ncc1701d@storage2000.com_>
Subject: EPOCH'S Halloween?
Message-Id: <5sTS3.1228$n7.8078@news2.randori.com>

Hi,
I'm a beginner programmer in PERL, and I had a program that was ripping
apart files with dates in them just fine.  Then all of a sudden a file with
the date of October 31, 1999 came up and my program just stopped.  I
debugged for a while and was able to figure out why.  When I run this
program:

#!/usr/bin/perl

use Time::Local;

$time = timelocal($seconds, $minutes, $hours+10, (localtime)[3,4,5]);
if ($ARGV[0] > 0){$epoch=$ARGV[0]}else{$epoch=$time};

@asdf=localtime($epoch);

print "$time\n";
print "@asdf\n";

with these arguments separately 944027999, 944028000, I get a date reported
back to me as Oct 30th for the first one and Nov 1st for the second one.
They both appear in the same year and everything else looks good.  Why is it
that PERL isn't recognizing Halloween?  Is this normal?

I'm still looking for answers on FAQ/NEWSGROUPS but as I'm desperate to get
this up and running I thought posting the message might spur an answer or a
place to look before finding a solution.  If you know the answer can someone
please help me out?

Thanks in advance!

Jason




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

Date: Sun, 31 Oct 1999 03:14:11 -0600
From: "Jason D" <_ncc1701d@storage2000.com_>
Subject: Re: EPOCH'S Halloween?
Message-Id: <lKTS3.1231$n7.7994@news2.randori.com>

I forgot to mention.  Just so I'm not imagining things I ran this program on
a Redhat Linux 5.0 system with perl 5.005_02 and a Redhat Linux 6.1 with
perl 5.005_03 on it.  They both report the exact same dates.

Jason D

Jason D <_ncc1701d@storage2000.com_> wrote in message
news:5sTS3.1228$n7.8078@news2.randori.com...
> Hi,
> I'm a beginner programmer in PERL, and I had a program that was ripping
> apart files with dates in them just fine.  Then all of a sudden a file
with
> the date of October 31, 1999 came up and my program just stopped.  I
> debugged for a while and was able to figure out why.  When I run this
> program:
>
> #!/usr/bin/perl
>
> use Time::Local;
>
> $time = timelocal($seconds, $minutes, $hours+10, (localtime)[3,4,5]);
> if ($ARGV[0] > 0){$epoch=$ARGV[0]}else{$epoch=$time};
>
> @asdf=localtime($epoch);
>
> print "$time\n";
> print "@asdf\n";
>
> with these arguments separately 944027999, 944028000, I get a date
reported
> back to me as Oct 30th for the first one and Nov 1st for the second one.
> They both appear in the same year and everything else looks good.  Why is
it
> that PERL isn't recognizing Halloween?  Is this normal?
>
> I'm still looking for answers on FAQ/NEWSGROUPS but as I'm desperate to
get
> this up and running I thought posting the message might spur an answer or
a
> place to look before finding a solution.  If you know the answer can
someone
> please help me out?
>
> Thanks in advance!
>
> Jason
>
>
>




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

Date: 31 Oct 1999 03:32:04 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: EPOCH'S Halloween?
Message-Id: <slrn81o33i.66b.abigail@alexandra.delanet.com>

Jason D (_ncc1701d@storage2000.com_) wrote on MMCCLII September MCMXCIII
in <URL:news:5sTS3.1228$n7.8078@news2.randori.com>:
** Hi,
** I'm a beginner programmer in PERL, and I had a program that was ripping
** apart files with dates in them just fine.  Then all of a sudden a file with
** the date of October 31, 1999 came up and my program just stopped.  I
** debugged for a while and was able to figure out why.  When I run this
** program:
** 
** #!/usr/bin/perl
** 
** use Time::Local;
** 
** $time = timelocal($seconds, $minutes, $hours+10, (localtime)[3,4,5]);
** if ($ARGV[0] > 0){$epoch=$ARGV[0]}else{$epoch=$time};
** 
** @asdf=localtime($epoch);
** 
** print "$time\n";
** print "@asdf\n";
** 
** with these arguments separately 944027999, 944028000, I get a date reported
** back to me as Oct 30th for the first one and Nov 1st for the second one.
** They both appear in the same year and everything else looks good.  Why is it
** that PERL isn't recognizing Halloween?  Is this normal?

Forget about Halloween. It looks your Perl is a month off! For me, it
report Dec 1, 1999.

Or perhaps you are a month off? Did you read the first sentence of the
description section in the Time::Local manpage?



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


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 31 Oct 1999 03:51:03 -0600
From: "Jason D" <_ncc1701d@storage2000.com_>
Subject: Re: EPOCH'S Halloween?
Message-Id: <XgUS3.1234$n7.8224@news2.randori.com>

I read it.  And now that I read it again I realize that I really messed up
with this post.  Although you are correct in assuming that I'm a month off,
I'm still having a problem with my original code.  That code is correcting
for the (1 off) month that perl does.  I've been at this way to long right
now.... and I feel stupid for posting the post :)

Thanks for pointing it out Abigail.  I'll try and further define the problem
once I get some shuteye :O)

Jason

Abigail <abigail@delanet.com> wrote in message
news:slrn81o33i.66b.abigail@alexandra.delanet.com...
> Jason D (_ncc1701d@storage2000.com_) wrote on MMCCLII September MCMXCIII
> in <URL:news:5sTS3.1228$n7.8078@news2.randori.com>:
> ** Hi,
> ** I'm a beginner programmer in PERL, and I had a program that was ripping
> ** apart files with dates in them just fine.  Then all of a sudden a file
with
> ** the date of October 31, 1999 came up and my program just stopped.  I
> ** debugged for a while and was able to figure out why.  When I run this
> ** program:
> **
> ** #!/usr/bin/perl
> **
> ** use Time::Local;
> **
> ** $time = timelocal($seconds, $minutes, $hours+10, (localtime)[3,4,5]);
> ** if ($ARGV[0] > 0){$epoch=$ARGV[0]}else{$epoch=$time};
> **
> ** @asdf=localtime($epoch);
> **
> ** print "$time\n";
> ** print "@asdf\n";
> **
> ** with these arguments separately 944027999, 944028000, I get a date
reported
> ** back to me as Oct 30th for the first one and Nov 1st for the second
one.
> ** They both appear in the same year and everything else looks good.  Why
is it
> ** that PERL isn't recognizing Halloween?  Is this normal?
>
> Forget about Halloween. It looks your Perl is a month off! For me, it
> report Dec 1, 1999.
>
> Or perhaps you are a month off? Did you read the first sentence of the
> description section in the Time::Local manpage?
>
>
>
> Abigail
> --
> perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
>
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers
==-----
>




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

Date: 31 Oct 1999 12:31:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: EPOCH'S Halloween?
Message-Id: <7vhcqd$1g5$1@gellyfish.btinternet.com>

On Sun, 31 Oct 1999 02:54:42 -0600 Jason D wrote:
> Hi,
> I'm a beginner programmer in PERL, and I had a program that was ripping
> apart files with dates in them just fine.  Then all of a sudden a file with
> the date of October 31, 1999 came up and my program just stopped.  I
> debugged for a while and was able to figure out why.  When I run this
> program:
> 
> #!/usr/bin/perl
> 
> use Time::Local;
> 
> $time = timelocal($seconds, $minutes, $hours+10, (localtime)[3,4,5]);
> if ($ARGV[0] > 0){$epoch=$ARGV[0]}else{$epoch=$time};
> 
> @asdf=localtime($epoch);
> 
> print "$time\n";
> print "@asdf\n";
> 
> with these arguments separately 944027999, 944028000, I get a date reported
> back to me as Oct 30th for the first one and Nov 1st for the second one.
> They both appear in the same year and everything else looks good.  Why is it
> that PERL isn't recognizing Halloween?  Is this normal?
> 

Daylight Saving Time ?

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 31 Oct 1999 02:38:32 -0800
From: Tim Judd <tjudd@teleport.com>
Subject: fork()
Message-Id: <Pine.GSO.4.10.9910310235260.29665-100000@user2.teleport.com>

I'm using a single perl script to run on a webserver as a cgi.  within
this cgi, i'm trying to open a second "edition" of this perl executable.
running off of unix, path to perl /usr/local/lib/perl

i've tried:

`/usr/local/lib/perl ...`

open(RSLT,"/usr/local/lib/perl -switches.... |")

and I heard about fork, but I don't know how to work it..  can i get some
syntax?

i'd ultimately like to:

/usr/local/lib/perl -cw file.pl

as a HTTP protocol to check file syntax.



Thanks!

--T J



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

Date: 31 Oct 1999 07:08:50 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: help with Text:ParseWords
Message-Id: <7vgpu2$kks$1@nntp6.atl.mindspring.net>

Troy Lachinski (yordestine@earthlink.net) wrote:
: I have tried MANY things including:
: 
: use Text::ParseWords;
: @new = quotewords(",",0,$_);
: 
: $new[0] = $memory_location_counter;
: $new[1] = $plu_number;
: $new[2] = $shift_type;
: etc...
: 
: but this does not seem to put any values into $new[0] and also no values
: into $memory_location_counter.

I think you've been working on this problem so long your mind is starting 
to work backwards.  You're filling up @new, allright, but then you're 
assigning *to* it instead of *from* it, and you're assigning to it from 
empty variables.  Try something along the lines of:

$memory_location_counter = $new[0];

or go back to your original form of list assignment, replacing the call 
to split() with the call to quotewords().



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

Date: Sun, 31 Oct 1999 11:25:24 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How can I show a page-visitor his IP on my homepage ?
Message-Id: <Pine.HPP.3.95a.991031112134.16562D-100000@hpplus01.cern.ch>

On Sun, 31 Oct 1999, G. Jesse Kuhnert wrote:

> I'm not sure how the proxy server's work, 

In fact your posting shows you don't know much about anything, not even
where to put apostrophes.

Maybe it would be better for all concerned if you were to go back into
read-only mode until you have gained a few more clues.

> but I guess 

STOP THAT.


Oh, good: a Jeopardy-style quote.  Thank goodness for the bogosity
alert, although there _are_ more network-efficient ways to announce "I
am clueless". 



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

Date: Sun, 31 Oct 1999 13:00:44 +0100
From: Thomas Frei <thomas.frei@erp-solutions.de>
Subject: HOWTO connect to BaaN Server????
Message-Id: <381C2F6C.5FACE405@erp-solutions.de>

how can I connect to erp-system BaaN within perl ???
Server 10.1.7.2
BSE: /ban_bse
user: user
password: pw

Database : Oracle 7.3.3!
and how to retrieve all tables and their fields???

Thanks

Thomas


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

Date: 31 Oct 1999 12:54:07 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HOWTO connect to BaaN Server????
Message-Id: <7vhe5f$1gf$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Thomas Frei <thomas.frei@erp-solutions.de> wrote:
> how can I connect to erp-system BaaN within perl ???
> Server 10.1.7.2
> BSE: /ban_bse
> user: user
> password: pw
> 
> Database : Oracle 7.3.3!
> and how to retrieve all tables and their fields???
> 

You can use the module DBD::Oracle to access the database .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 31 Oct 1999 08:02:14 -0500
From: Floyd Morrissette <Floyd@NewWebSite.com>
Subject: ip address
Message-Id: <381C3DD6.4BC4099F@NewWebSite.com>

I know this is not the right newsgroup fro this question but I am having trouble
finding the right group and the other group I asked has still not responded.

How can I get a permanent ip address with using an isp? Where do isp's get them?


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

Date: Sun, 31 Oct 1999 08:03:10 -0500
From: Floyd Morrissette <Floyd@NewWebSite.com>
Subject: Re: ip address
Message-Id: <381C3E0E.2ECEEBB6@NewWebSite.com>

I meant withOUT an isp.


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

Date: Sun, 31 Oct 1999 22:44:35 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: ip address
Message-Id: <_gXS3.6$f23.1039@vic.nntp.telstra.net>

Floyd Morrissette <Floyd@NewWebSite.com> wrote in message
news:381C3DD6.4BC4099F@NewWebSite.com...
> I know this is not the right newsgroup fro this question but I am having
trouble
> finding the right group and the other group I asked has still not
responded.
>
> How can I get a permanent ip address with using an isp? Where do isp's get
them?

Become an ISP

Wyzelli




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

Date: Sun, 31 Oct 1999 08:28:15 -0500
From: Floyd Morrissette <Floyd@NewWebSite.com>
Subject: Re: ip address
Message-Id: <381C43EF.21A9664B@NewWebSite.com>

That is what I am doing. I need to know where to look to get a permanent ip.

Wyzelli wrote:
> 
> Become an ISP
> 
> Wyzelli


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

Date: 31 Oct 1999 09:35:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Just to get rid of dos prompt window.
Message-Id: <7vh2gl$q5$1@gellyfish.btinternet.com>

On Thu, 28 Oct 1999 16:31:14 -0700 David Cassell wrote:
> Matthew David Zimmerman wrote:
>> 
>> In article <380640CC.FB326CA6@sympatico.ca>,
>> Guo Quin  <cau.quach@sympatico.ca> wrote:
>> >Hello. Please answer one of following questions.
>> >
>> >1/How can I add --more-- to "perldoc -f xxxx and/or perdoc -q xxxx"
>> >(MSWindows) ?
>> 
>> perldoc -f xxxx | more
>> perldoc -q xxxx | more
> 
> I'm sorry, but you really should have tried these in
> win95/98 before posting.  They don't work.  Pipes _et_al._
> are too broken. 

Too right - I've found that if you type a '|' in a DOS window then what
you get looks similar to a '|' (it has a tiny gap in the middle) but will
actually be rendered in another (windows) program as a Yen sign bizarre.

Of course this could be a config issue but I just cant be arsed to find
out ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 31 Oct 1999 09:10:53 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: pass file handle
Message-Id: <7vh12t$q0$1@gellyfish.btinternet.com>

On Sat, 30 Oct 1999 10:40:53 -0700 Larry Rosler wrote:
> [Posted and a copy sent to perlfaq-suggestions@perl.com.]
> 
> In article <MPG.128493efa3268231989829@nntp1.ba.best.com> on Sat, 30 Oct 
> 1999 06:35:17 -0700, Bill Moseley <moseley@best.com> says...
>> Larry Rosler (lr@hpl.hp.com) seems to say...
> 
> [quoting perlfaq7: "How can I pass/return a {Function, FileHandle, 
> Array, Hash, Method, Regexp}?"]
> 
>> > If you're passing around filehandles, you could usually just use the 
>> > bare typeglob, like *STDOUT, but typeglobs references would be better 
>> > because they'll still work properly under use strict 'refs'. For 
>> > example: 
>> 
>> >     splutter(\*STDOUT);
>> >     sub splutter {
>> >         my $fh = shift;
>> >         print $fh "her um well a hmmm\n";
>> >     }
>> 
>> This didn't generate any errors under strict.  Or do you mean something 
>> else?
>> 
>> #! perl -w
>> use strict;
>> 
>>     splutter(*STDOUT);
>>     sub splutter {
>>         my $fh = shift;
>>         print $fh "her um well a hmmm\n";
>>     }
> 
> her um well a hmmm
> 
> Have all the backslashes I've used over the years, in accordance with 
> the FAQ, been superfluous?  What a waste of good keystrokes.
> 
> Maybe the author of the FAQ can tell us what he meant.
> 

I have a feeling that the behaviour may have changed at some point as I
can definitely remember *needing* to put the slash there to shut strict up.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 31 Oct 1999 10:25:09 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl disallowed at ACM programming contests?
Message-Id: <381c11f7.328396@news.skynet.be>

Mark W. Schumann wrote:

>This is just killing me.  ACM is now handing out Visual C++ as a
>"prize"?

They probably got it somewhere for free.

-- 
	Bart.


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

Date: Sun, 31 Oct 1999 12:15:25 GMT
From: mike@w3z.com (Mike Collins)
Subject: please help speed this up
Message-Id: <381c3159.154729792@news.hardlink.com>

Hi. Sorry to repost this with a different subject but I'd like to get
some comments on it.

The script shown below checks about 50 fields in 60 records against
2800 lines in another table to change cryptic codes into user friendly
definitions. Processing seems to take way too much time - minutes.

My request is that you look at this and tell me how you'd do it
differently to make it faster.

Thanks,
Mike Collins

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

#!c:\perl\bin\perl.exe
use Text::ParseWords;

open (TESTTXT, "./dat_in/vehicles.txt") || die $!;
@list = <TESTTXT>;
close TESTTXT;

open (CODES, ">./dat_out/codetxt.txt") || die $!;
for $entry (@list) {
	$entry =~ s/\\/XXA/g;

# <snip> several additional fields like line above

	@fields = quotewords(",",0,$entry);
	print CODES "$fields[0]", '|';
	print CODES "$fields[1]", '|';
	$fields[2] =~ s/-//;
	print CODES "$fields[2]", '|';
	if ($fields[4]){$code = $fields[4];decode();}

# decode() is 2800 lines long

	$f5txt = $fields[5];
	$f5txt =~ s/(\w+)/\u\L$1/g;
	print CODES "$f5txt", '|'

# <snip> several additional fields like line above

	#options
	if ($fields[30]){$code = $fields[30];getopt();
	print CODES '|';}else{print CODES '|';}

# <snip> several additional fields like line above

}

sub decode {
	open (CARPART, "./dat_in/carparts.txt") || die $!;
	while (<CARPART>){
		chomp;
		s/\\/XXA/g; # \
		s/\[/XXB/g; # [

# <snip> several additional fields like line above

		@parts = &quotewords(',', 0, $_);
		if ($parts[0] =~ /$code/){
			$parttxt = $parts[2];
			$parttxt =~ s/(\w+)/\u\L$1/g;
			print CODES "$parttxt", '|';
			last;
		}
		else{next;}
	}
	close CARPART;
}

sub getopt {
	open (GETOPT, "./dat_in/options.txt") || die $!;
	while (<GETOPT>){
		chomp;
		s/\\/XXA/g; # \

# <snip> additional fields like line above

		@opt = &quotewords(',', 0, $_);
		if ($opt[0] =~ /$code/){
			$opttxt = $opt[1];
			$opttxt =~ s/(\w+)/\u\L$1/g;
			print CODES "$opttxt";
			last;
		}
		else{next;}
	}
	close GETOPT;
}
close CODES;


--
Opportunity knocks once. That's a myth. An infinite 
supply exists throughout the universe.


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

Date: 31 Oct 1999 12:52:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: please help speed this up
Message-Id: <7vhe1p$1gc$1@gellyfish.btinternet.com>

On Sun, 31 Oct 1999 12:15:25 GMT Mike Collins wrote:
> Hi. Sorry to repost this with a different subject but I'd like to get
> some comments on it.
> 

Not good - you already had some followups to your original post - if they
didnt answer your question you should have followed up yourself in the
same thread with additional material .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 31 Oct 1999 02:22:53 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Quick Question
Message-Id: <slrn81nv1r.66b.abigail@alexandra.delanet.com>

revjack (revjack@radix.net) wrote on MMCCLII September MCMXCIII in
<URL:news:7vg3mp$5qd$2@news1.Radix.Net>:
// Has anybody ever thought that maybe perl isn't real?
// I mean, like, maybe it's some sort of weird media
// invention, and not, in fact, real?
// 
// I have a friend who was wondering about this.


Your friend is, of course, right.  Perl is an invention by the evil
devilbunnies.  We're just made to belief it exists.



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 31 Oct 1999 06:28:06 -0500
From: meow <meowing@banet.net>
Subject: Re: Quick Question
Message-Id: <874sf793cp.fsf@banet.net>

revjack <revjack@radix.net> wrote:

> Has anybody ever thought that maybe perl isn't real?
> I mean, like, maybe it's some sort of weird media
> invention, and not, in fact, real?

It's possible.  Consider this little-known factoid: lwall is actually
a decoy constructed entirely of pineapples.

> I have a friend who was wondering about this.

Your friend should be careful.  Rumor has it that the last person who
dug too deeply into this matter was turned into a FAQ-spewing
automaton.


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

Date: Fri, 29 Oct 1999 17:21:23 +0200
From: MATTHIAS DRESCHER <MATTHIAS.DRESCHER@mchr2.siemens.de>
Subject: regsrv32
Message-Id: <3819BB73.31B6B925@mchr2.siemens.de>

can anybody tell me what is regsrv32 and where I can find it ?
by the way: itīs not in my system32-dirctory.

is it in a rescourcekit ??

thanks Metty


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

Date: 31 Oct 1999 12:56:56 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: regsrv32
Message-Id: <7vheao$1gj$1@gellyfish.btinternet.com>

On Fri, 29 Oct 1999 17:21:23 +0200 MATTHIAS DRESCHER wrote:
> can anybody tell me what is regsrv32 and where I can find it ?
> by the way: itīs not in my system32-dirctory.
> 

Have you tried asking in a newsgroup that might discuss these things ?

Have you searched for the file on your disk using whatever facilities
your operating system might provide ?

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 31 Oct 1999 12:38:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: sendmail question
Message-Id: <7vhd88$1g8$1@gellyfish.btinternet.com>

On Sat, 30 Oct 1999 21:46:40 +0800 Singapore Fan wrote:
> i want to send password to my users with the following to send: 
> #@records is a list of records of my users.
> 
> foreach  $record (@records){
> ($icq,$pass,$q,$b,$c,$d,$e,$email) = split(/:/,$record);
> 
> $i++;
> open ($i, "|/usr/sbin/sendmail -t") or print "Cannot open sendmail: No email is sent to $email";
> print $i "To: $email\n";
> print $i "From: webmaster\@domain.com\n";
> print $i "Subject: Subject\n";
> print $i "$content";
> close $i;
> }
> 
> The first mail works fine but the second, third .....
> the subject of those mails disappeared and the from address change to "nobody".

Firstly could you explain why you doing that with the filehandles  - you
need only reuse the one filehandle as uou are closing it before you
open another.

Also you need an extra line after the Subject header - you might consider
making this a here-doc to make it more explicit :

open(MAILER,'|/usr/sbin/sendmail -t' ) || die "Wooa - $!\n";
print MAILER <<EIEIO;
To: $email
From: webmaster\@domain.com
Subject: Subject

$content
EIEIO

close MAILER;

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 31 Oct 1999 10:25:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Trying to work this regex out....
Message-Id: <381d1557.1193080@news.skynet.be>

steveatemark@my-deja.com wrote:

>$e = '<font color="#003366">emark</font>';
>$c = 'emark trademark test@emark.co.nz
>www.emark.co.nz emark';
>$c =~ s/\b(emark)\b/$e/ig;
>
>I'd like to replace all occurences of the
>string 'emark' with another string, except in
>words like 'trademark' and email addresses and
>URLs.

and inside tags?

What I would try, is match BOTH what you don't want replaced (first),
and what you want replaced, and distinguish between those two cases
later. Like:


s/(http:[^\s<>]+|www\.[^<>\s]+|[^\@<>\s]+\@[\[\]a-zA-Z0-9\.-]+)|\bemark\b/
		$1 || $e/ge;

It works with your example alright.

That doesn't catch ALL possible e-mail addresses, in particular stuff
between quotes in the local part; but although technically legal, I've
never actually seen such a real-life e-mail address.

-- 
	Bart.


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

Date: Sun, 31 Oct 1999 10:27:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Whoa. This shouldn't work...
Message-Id: <381e1972.2243246@news.skynet.be>

Douglas Garstang wrote:

>#!/usr/bin/perl
>use strict;
>print $a;
>
>Thats a little weird. Here I was thinking I was going crazy. It also works with "$b". I can't
>find any reference in the perldocs to $a or $b being special variables (but I'm sure its there
>somewhere)...

perldoc -f sort

-- 
	Bart.


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

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

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


------------------------------
End of Perl-Users Digest V9 Issue 1236
**************************************


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