[18331] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 499 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 15 21:10:33 2001

Date: Thu, 15 Mar 2001 18:10:16 -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: <984708616-v10-i499@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 15 Mar 2001     Volume: 10 Number: 499

Today's topics:
    Re: perl hacker wanted <elijah@workspot.net>
    Re: perl hacker wanted (David H. Adler)
    Re: perl hacker wanted (Randal L. Schwartz)
    Re: perl hacker wanted <bart.lateur@skynet.be>
    Re: perl hacker wanted <juex@deja.com>
    Re: perl hacker wanted (Abigail)
    Re: perl hacker wanted <mischief@velma.motion.net>
        Perlxstut on Win 98 <kalinabears@hdc.com.au>
    Re: Pipe delimited string parsing or Newbie needs a clu <graham.wood@iona.com>
    Re: Pipe delimited string parsing or Newbie needs a clu <mischief@velma.motion.net>
    Re: Print own "die" message <bart.lateur@skynet.be>
    Re: Print own "die" message <mischief@velma.motion.net>
    Re: Print own "die" message (Abigail)
    Re: Print own "die" message <mischief@velma.motion.net>
    Re: Print own "die" message <mischief@velma.motion.net>
    Re: Re: problem passing dir names to glob <kimmfc@mydeja.com>
    Re: Read to : <graham.wood@iona.com>
        Return code variable michael.e.grimes@fritolay.com
    Re: Return code variable <Jonathan.L.Ericson@jpl.nasa.gov>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 15 Mar 2001 23:09:40 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: perl hacker wanted
Message-Id: <eli$0103151806@qz.little-neck.ny.us>

In comp.lang.perl.misc, Uri Guttman  <uri@sysarch.com> wrote:
> this is a test of the dha no jobs posting responder system. we are

Since this is not a real job offer, how do you know it will trigger
the system? Perhaps you just wanted to see some JAPH code.

Elijah
------
sub S(){@s=caller($/);$s[3]=~s s\w+:+ss&&print$s[3].q. .}$/=$^=~s/\S+/\n/;
$_="Just (eli) Another (the) Perl (bearded) Hacker";sub s($){eval$_[0];$/}
while(s&&&&& &s(qq&sub$^&.$&.q&{\&S}&)&& &{$&}&&s&&&){$/}$\=$^;print"\b,";
# JAPH with closures, to tie into another thread


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

Date: 15 Mar 2001 23:26:52 GMT
From: dha@panix6.panix.com (David H. Adler)
Subject: Re: perl hacker wanted
Message-Id: <slrn9b2jts.6lh.dha@panix6.panix.com>

On Thu, 15 Mar 2001 22:37:15 GMT, Uri Guttman <uri@sysarch.com> wrote:
>
>this is a test of the dha no jobs posting responder system.

You think we are so easily fooled!  Ha!  I say Ha!

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
[Insert Angus Prune Tune here]


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

Date: 15 Mar 2001 15:35:44 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: perl hacker wanted
Message-Id: <m17l1q7ghb.fsf@halfdome.holdit.com>

>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:

Uri> this is a test of the dha no jobs posting responder system. we are
Uri> trying to see if dha has updated his responder text to reflect the new
Uri> location and addresses of the perl jobs list. if this was a real jobs
Uri> post it would have been off topic and excused by the clueless author as
Uri> why not post a perl job where the perl hackers hang out. remember, this
Uri> is only a test. if you see a real perl jobs post in this newsgroup,
Uri> please duck and cover and wait for the dhabot to followup. if you
Uri> interfere you may get caught in a nasty flame war (hence the duck and
Uri> cover warning).

This is a test of the "get a clue LART" directed in Uri's general
direction.

:-)

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


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

Date: Fri, 16 Mar 2001 00:09:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: perl hacker wanted
Message-Id: <scm2btoo7gcsnm3p3sq3t10kpamdlpjua9@4ax.com>

Uri Guttman wrote:

>if this was a real jobs
>post it would have been off topic and excused by the clueless author as
>why not post a perl job where the perl hackers hang out.

I've been searching all over the Net today, for over an hour, looking
for a site with the rules that say that job offerings are indeed not
allowed in the comp.* or comp.lang.* hierarchy. It came out zilch. Does
anybody have an URL?

-- 
	Bart.


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

Date: Thu, 15 Mar 2001 16:35:20 -0800
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: perl hacker wanted
Message-Id: <3ab15fc8$1@news.microsoft.com>

"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:scm2btoo7gcsnm3p3sq3t10kpamdlpjua9@4ax.com...
> I've been searching all over the Net today, for over an hour, looking
> for a site with the rules that say that job offerings are indeed not
> allowed in the comp.* or comp.lang.* hierarchy. It came out zilch. Does
> anybody have an URL?

Does the charta of any individual comp.* or comp.lang.* group allows job
postings?
If not, then you don't need to search further.

Job posting in USENET are not allowed unless specifically authorized by the
group charta. It's as easy as that.

jue




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

Date: 16 Mar 2001 00:38:53 GMT
From: abigail@foad.org (Abigail)
Subject: Re: perl hacker wanted
Message-Id: <slrn9b2o4t.p0e.abigail@tsathoggua.rlyeh.net>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCLIV September MCMXCIII
in <URL:news:scm2btoo7gcsnm3p3sq3t10kpamdlpjua9@4ax.com>:
][ Uri Guttman wrote:
][ 
][ >if this was a real jobs
][ >post it would have been off topic and excused by the clueless author as
][ >why not post a perl job where the perl hackers hang out.
][ 
][ I've been searching all over the Net today, for over an hour, looking
][ for a site with the rules that say that job offerings are indeed not
][ allowed in the comp.* or comp.lang.* hierarchy. It came out zilch. Does
][ anybody have an URL?


Usenet is an organized anarchy, and you are looking for rules cast in stone?

Mind boggling.



Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


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

Date: Fri, 16 Mar 2001 01:36:12 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: perl hacker wanted
Message-Id: <tb2rgcnc54k800@corp.supernews.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Uri Guttman wrote:

>>if this was a real jobs
>>post it would have been off topic and excused by the clueless author as
>>why not post a perl job where the perl hackers hang out.

> I've been searching all over the Net today, for over an hour, looking
> for a site with the rules that say that job offerings are indeed not
> allowed in the comp.* or comp.lang.* hierarchy. It came out zilch. Does
> anybody have an URL?

One of the best URLs for a Usenet primer is
http://www.faqs.org/faqs/usenet/primer/part1/
although that doesn't explicitly say `no job
postings in comp groups'.

One of the nicer ones is
http://users.lmi.net/ennui/usenet001.htm
which has a section on advertising. It
describes only product ads, but it says
not to advertise anything on Usenet at all.
I must say, I really like this site. It
even has a button that says,' q{Plonk!!}.

Chris

-- 
Christopher E. Stith
Try not. Do, or do not. The Force is binary. -- Yoda,
The Empire Strikes Back (paraphrased)



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

Date: Fri, 16 Mar 2001 10:53:59 +1100
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Perlxstut on Win 98
Message-Id: <bKcs6.2$em.6384@vic.nntp.telstra.net>

Hi,
I'm trying to work through the perlxstut in the perl docs - running active
state perl ( 5.6.0 ) build 613, MS VC++6.0.
Whenever I run 'perl makefile.pl' I get the following three error messages.

One:
Running 'C:\Apache\Perl\bin\Perl.exe -IC:\Apache\Perl\lib
C:\Apache\Perl\lib\Ext
Utils\xsubpp -v 2>&1' exits with status 16777215 at (eval 25) line 17.

Two:
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumb
ers] [-nooptimize] [-noinout] [-noargtypes] [-s pattern] [-typemap
typemap]... f
ile.xs

Three:
Running 'C:\Apache\Perl\bin\Perl.exe C:\Apache\Perl\lib\ExtUtils\xsubpp
temp000
2>&1' exits with status 16777215 at (eval 25) line 43.

These have been inconsequential regarding examples 1, 2 and 3 in the
tutorial.

I used to get an error message about being 'Unable to find a perl 5....',
but found that could be overcome by adding 'PERL=>"$^X",'
to the WriteMakefile section in the makefile.

In attempting example 4 'perl makefile.pl' produces the following additional
warnings:

Warning (non-fatal): Target 'dynamic' depends on targets in skipped section
'dyn
amic_lib'
Warning (non-fatal): Target 'static' depends on targets in skipped section
'stat
ic_lib'

In spite if these messages, 'perl makefile.pl' runs successfully and creates
the required makefiles.

When I then run 'nmake', all I get is the following fatal message:

makefile(459) : fatal error U1035: syntax error : expected ':' or '='
separator
Stop.

If anyone can shed any light on any means of avoiding any of those messages,
I would be most grateful.

Even a pointer to an faq/doc/tutorial would be helpful - as I don't know how
to find them.

I have searched Google for each error message and turned up plenty of
requests regarding them, but have found no pertinent responses to those
requests.

Feel free to reply by email also.

Cheers,
Rob
--
Visit our website at http://www.kalinabears.com.au




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

Date: Thu, 15 Mar 2001 17:04:21 -0000
From: "Graham Wood" <graham.wood@iona.com>
Subject: Re: Pipe delimited string parsing or Newbie needs a clue
Message-Id: <98qt94$c9q$1@spider.iona.com>


Lawrence Brodeur <lbrodeur@NOSPAMwdconsulting.com> wrote in message
news:wq6s6.16415$R_6.1740398@newsread2.prod.itd.earthlink.net...
> Hi, thanks for taking the time to look at this.
>
> I have a file of pipe delimited records which I need to parse.
>
> I need to modify each field in each record and write that to a new file.
>
> I have been going around in circles with while and split and am at a loss.
>
> While I've never been a strong proponant of spoon feeding, can someone
> please help?
>
> tia
>
>
> larry
>
>
What have you done and with what results?

open(INPUT,"your input filename") || die "Couldn't open file $!\n";
@inputlines=<INPUT>;
close INPUT;

open(OUTPUT,">your filename again") || die "Couldn't open file for output
$!\n";
foreach $record (@inputlines){
    @parts=split('|',$record);
    foreach (@parts){
        # whatever changes you want to make to each field go here
    }
    $newrecord=join('|',@parts); # stick them back together
    print OUTPUT $newrecord;
}
close OUTPUT;

There are more elegant (difficult to read) ways of doing this but this
should get you started.

Graham Wood




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

Date: Fri, 16 Mar 2001 00:56:30 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Pipe delimited string parsing or Newbie needs a clue
Message-Id: <tb2p5u79sn4f8@corp.supernews.com>

Graham Wood <graham.wood@iona.com> wrote:

> Lawrence Brodeur <lbrodeur@NOSPAMwdconsulting.com> wrote in message
> news:wq6s6.16415$R_6.1740398@newsread2.prod.itd.earthlink.net...
>> Hi, thanks for taking the time to look at this.
>>
>> I have a file of pipe delimited records which I need to parse.
>>

>     @parts=split('|',$record);

Is this tested?

Take a look:

    $foo = q{x|y|z};
    @bar = split('|', $foo);
    @baz = split('\|', $foo);
    print "\@bar = @bar\n";
    print "\@baz = @baz\n";

For me, this produces the following on both my installed Perl
versions:

    @bar = x | y | z
    @baz = x y z

Besides, split() operates on a pattern, which except for the
special case of q{' '} should look like a pattern.

    @baz = split(/\|/, $foo);

>     $newrecord=join('|',@parts); # stick them back together

This should be okay, since join() expects a string and not
a pattern.

Chris

-- 
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
  -- Martien Verbruggen in clp.misc



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

Date: Fri, 16 Mar 2001 00:01:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Print own "die" message
Message-Id: <2ul2bt0invdc38uur5du0kt753on6087ed@4ax.com>

Chris Stith wrote:

>Or even execute a block in which your print() your message then
>exit() -- or you can do that inside a die handler... 

The good thing about the __DIE__ handler is taht it also works on fatal
errors that you didn't expect. Assign it in a BEGIN block upfront your
script, and it will even catch syntax errors.

-- 
	Bart.


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

Date: Fri, 16 Mar 2001 00:44:45 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Print own "die" message
Message-Id: <tb2oft11ue6p71@corp.supernews.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Chris Stith wrote:

>>Or even execute a block in which your print() your message then
>>exit() -- or you can do that inside a die handler... 

> The good thing about the __DIE__ handler is taht it also works on fatal
> errors that you didn't expect. Assign it in a BEGIN block upfront your
> script, and it will even catch syntax errors.

True. I hadn't thought about using DIE to catch syntax errors, though.

I wonder... does it work with syntax errors inside evals? Nope, it
doesn't under testing.

It does let me give my own message upon a normal syntax error,
though. That's neat. Gee, ya learn something every day.

Chris

-- 
Christopher E. Stith
Disclaimer: Actual product may not resemble picture in ad in any way.



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

Date: 16 Mar 2001 00:48:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Print own "die" message
Message-Id: <slrn9b2omm.p0e.abigail@tsathoggua.rlyeh.net>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCLIV September MCMXCIII
in <URL:news:2ul2bt0invdc38uur5du0kt753on6087ed@4ax.com>:
$$ Chris Stith wrote:
$$ 
$$ >Or even execute a block in which your print() your message then
$$ >exit() -- or you can do that inside a die handler... 
$$ 
$$ The good thing about the __DIE__ handler is taht it also works on fatal
$$ errors that you didn't expect. Assign it in a BEGIN block upfront your
$$ script, and it will even catch syntax errors.


And then the die handler can open $0 for read-write, fix the syntax
error, and then re-execing itself.

    exec $0 => @ARGV;


Oh joy.



Abigail


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

Date: Fri, 16 Mar 2001 01:14:33 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Print own "die" message
Message-Id: <tb2q7p5kh55p2e@corp.supernews.com>

Abigail <abigail@foad.org> wrote:
> Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCLIV September MCMXCIII
> in <URL:news:2ul2bt0invdc38uur5du0kt753on6087ed@4ax.com>:
> $$ Chris Stith wrote:
> $$ 
> $$ >Or even execute a block in which your print() your message then
> $$ >exit() -- or you can do that inside a die handler... 
> $$ 
> $$ The good thing about the __DIE__ handler is taht it also works on fatal
> $$ errors that you didn't expect. Assign it in a BEGIN block upfront your
> $$ script, and it will even catch syntax errors.


> And then the die handler can open $0 for read-write, fix the syntax
> error, and then re-execing itself.

After all, Perl is on the rise in AI circles. ;-)

>     exec $0 => @ARGV;

> Oh joy.

This should be said carefully, lest someone not realize it is
fecetious.

Chris

-- 
Christopher E. Stith
The purpose of a language is not to help you learn the
language, but to help you learn other things by using the
language. --Larry Wall, The Culture of Perl, August 1997



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

Date: Fri, 16 Mar 2001 01:40:19 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Print own "die" message
Message-Id: <tb2ro3c7npkd93@corp.supernews.com>

Chris Stith <mischief@velma.motion.net> wrote:
> Abigail <abigail@foad.org> wrote:
>> Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCLIV September MCMXCIII
>> in <URL:news:2ul2bt0invdc38uur5du0kt753on6087ed@4ax.com>:
>> $$ Chris Stith wrote:
>> $$ 
>> $$ >Or even execute a block in which your print() your message then
>> $$ >exit() -- or you can do that inside a die handler... 
>> $$ 
>> $$ The good thing about the __DIE__ handler is taht it also works on fatal
>> $$ errors that you didn't expect. Assign it in a BEGIN block upfront your
>> $$ script, and it will even catch syntax errors.


>> And then the die handler can open $0 for read-write, fix the syntax
>> error, and then re-execing itself.

> After all, Perl is on the rise in AI circles. ;-)

>>     exec $0 => @ARGV;

>> Oh joy.

> This should be said carefully, lest someone not realize it is
> fecetious.

s/fece/face/;

I guess that could be an interesting pun.

Chris

-- 
Christopher E. Stith
Programming is a tool. A tool is neither good nor evil. It is
the user who determines how it is used and to what ends.



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

Date: Fri, 16 Mar 2001 00:19:13 GMT
From: Kim C <kimmfc@mydeja.com>
Subject: Re: Re: problem passing dir names to glob
Message-Id: <6tm2btguc3pfk05sig7s095p4baor4jahb@4ax.com>

Thats it!

Thank you.


On Thu, 15 Mar 2001 12:03:31 +0100, "Dr. Peter Dintelmann"
<Peter.Dintelmann@dresdner-bank.com> wrote:

>    Hi Kim,
	[...]
>    try
>
>        my $dir = "c:/temp/test space";
>        my @files = glob( "\Q$dir/*.*" );
>        print @files;
>
>    See the perlop page for \Q.
>
>    Regards,
>
>        Peter Dintelmann
>
>



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

Date: Thu, 15 Mar 2001 17:07:37 -0000
From: "Graham Wood" <graham.wood@iona.com>
Subject: Re: Read to :
Message-Id: <98qtf7$ccj$1@spider.iona.com>


MaxyM <mapow@hi.hinet.hr> wrote in message
news:98qrvu$cvfq$1@as121.tel.hr...
>
> Let's say:
>
> my $var1="Adi:2000:yes:res";
>
> question:
>
> how to read $var1 so that the results are:
>
> Adi
> 2000
> yes
> res
>
> sign ":" separates.
>
split the $var1 as in:

@var1parts=split(':',$var1);

gives you an array containing each part of var1 delimited by a ":"

perldoc -f split
perldoc perldata (for what an array is)

Graham Wood




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

Date: 15 Mar 2001 22:57:28 GMT
From: michael.e.grimes@fritolay.com
Subject: Return code variable
Message-Id: <98rhco$gcv$1@news.netmar.com>


Hi,

I have written a perl script that, among other things, runs the system
command:

system("/usr/local/pgp/pgp -a $SendDir/$Id.tar +verbose=2");

PGP issues a return code that I would like to evaluate for a measure of 
success. I am aware that there are some PGP modules available that may 
do what I need, but that is not a good option for me. I have looked around
but can't find a PERL return code variable. Does anyone know 
if there is a variable, like in ksh ($?), that I can access for the PGP
value?

Thanks for your time,
Mike


 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net


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

Date: 16 Mar 2001 01:21:43 +0000
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Return code variable
Message-Id: <86ae6m7bko.fsf@jon_ericson.jpl.nasa.gov>

michael.e.grimes@fritolay.com writes:

> I have written a perl script that, among other things, runs the system
> command:
> 
> system("/usr/local/pgp/pgp -a $SendDir/$Id.tar +verbose=2");
> 
> PGP issues a return code that I would like to evaluate for a measure of 
> success. I am aware that there are some PGP modules available that may 
> do what I need, but that is not a good option for me. I have looked around
> but can't find a PERL return code variable. Does anyone know 
> if there is a variable, like in ksh ($?), that I can access for the PGP
> value?

perldoc perlvar
perldoc -f system

(You practically answered your own question by the way.)

Jon


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

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 V10 Issue 499
**************************************


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