[8295] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1912 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 16 22:07:47 1998

Date: Mon, 16 Feb 98 19:00:33 -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           Mon, 16 Feb 1998     Volume: 8 Number: 1912

Today's topics:
    Re: .rc file parser, anyone? (Michael Stillwell)
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et <ebohlman@netcom.com>
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et <metcher@spider.herston.uq.edu.au>
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et (Jeffrey Bird)
    Re: Can't use string ("") as a subroutine ref while "st (Jonathan Feinberg)
    Re: Can't use string ("") as a subroutine ref while "st <agr30@uni-koeln.de>
        Courtesy Emails (was Re: A Pubilc Apology.) (Jonathan Feinberg)
        Error Code 1 in compiling Perl 5.004 <edwinr@icanect.net>
        Expand hash elements in string? (Rick Freeman)
    Re: Expand hash elements in string? (Rick Freeman)
    Re: Expand hash elements in string? (Martien Verbruggen)
    Re: Expand hash elements in string? (Martien Verbruggen)
    Re: FAQless Forays (was: Code Example Needed) uri@sysarch.com
        File Permission/Ownership <msomers@hendco.com>
    Re: File question (Hunter Johnson)
    Re: Forgery => Killfile (Bart Lateur)
    Re: Help wanted with loop problem. Please.  (Martin Vorlaender)
    Re: How can I read Novell DOS Environment-variables in  (Jonathan Feinberg)
    Re: Killfile Triage (Seymour J.)
    Re: Newbie Regexp question! <kramsey@worldnet.att.net>
    Re: PGP - Perl puzzle <devnull@nvg.ntnu.no>
    Re: Q: XSUB/Perl Performance (long) <eriko@austin.ibm.com>
    Re: RFC about "Matt's Script Archive" <dannyman@arh0300.urh.uiuc.edu>
    Re: Running Perl (Jonathan Feinberg)
    Re: So what about last summer's RFD?  Let's go moderate <rjk@coos.dartmouth.edu>
    Re: sockets to webservers <tchrist@mox.perl.com>
    Re: Sorting Strings With Delimited Characters - Advice  <merlyn@stonehenge.com>
        System function to variable <michael@datahost.com>
    Re: The Young Man and the Beach <rjk@coos.dartmouth.edu>
    Re: Tom Christiansen (Lars Gregersen)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Bart Lateur)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 16 Feb 1998 08:43:37 GMT
From: mist@yoyo.cc.monash.edu.au (Michael Stillwell)
Subject: Re: .rc file parser, anyone?
Message-Id: <slrn46efv1p.cuf.mist@silas.cc.monash.edu.au>

On 15 Feb 1998 16:54:55 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
:  [courtesy cc of this posting sent to cited author via email]
: 
: In comp.lang.perl.misc, 
:     "Grant Totten (EXCHANGE:CAR:5J42)" <grantt@americasm01.nt.com> writes:
: :Has anyone written a 'run command' file parser?  Are there any libraries
: :availabe to do this?
: 
: I've always found that there is nothing so simple, powerful,
: and flexible as using a simple require.

Whenever I try this, perl complains unless I use the "use vars
qw(...)" construction.  Is there another way of doing things?

e.g p2 contains:

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

    use strict;
    use vars qw($foo);

    require 'p1';

    print $foo, "\n";
    
p1 is:

    $foo = "bar";

This setup works fine, printing "bar\n" without any warnings, but the
"use vars qw($foo)" needs to be there which is annoying. 

Also, is there any way to get away with writing 'my $foo = "bar";' in
p1?  I'd like to include the "my" there, for consistency.

Michael

-- 
 .. ABSOLUT .SIG. ..
 .. Michael Stillwell ..
 .. mist@yoyo.cc.monash.edu.au ..
 .. http://yoyo.cc.monash.edu.au/~mist/ ..


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

Date: Mon, 16 Feb 1998 22:21:24 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <ebohlmanEoHsro.C1D@netcom.com>

Nathan V. Patwardhan <nvp@shore.net> wrote:
: Jaime Metcher (metcher@spider.herston.uq.edu.au) wrote:

: : Secondly, as it was explained to me, the "F" stands for a particularly
: : aggressive word and carries an implied "you moron" or worse - although,
: : as with most acronyms, there is more than one expansion.

: The 'F', as it were, can mean just about anything that you want it to:
: - freakin'
: - freaking
: - fargin'
: - the offensive word
: - flippin
: - etc etc etc

When the M is Perl's documentation, the F stands for "free."  This is a
point that cannot be overemphasized.  The idea that needs to be conveyed
is "somebody else *already* put in the time and effort to answer your
question, and put in *even more* time and effort to make that answer easy
to find, and that somebody didn't even expect to be paid for all that time
and effort.  Please put all that time and effort to good use." 




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

Date: Mon, 16 Feb 1998 15:44:50 +1100
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <34E7C442.BBDE6D98@spider.herston.uq.edu.au>

Ben Coleman wrote:
> 
> On Sun, 08 Feb 1998 14:38:07 -0800, Denis Goddard wrote:
> 
> >When a Wizard says, "RTFM, you moron"
> 
> Note that there are two parts to this:
> 
> "RTFM" - there's nothing wrong with this.  When the answer is already
> in the FAQ, or the distributed docs, etc, there's no need to require
> the Wizard to spend time composing Yet Another Rehashing Of The
> Answer.
snip

I agree with the basic sentiment but, IMHO, there are two things wrong
with this.  
Firstly, newcomers may not know what RTFM means.  Replying in jargon to
a plea for help from someone who may be already overwhelmed with
tech-talk could be read as sadistic.
Secondly, as it was explained to me, the "F" stands for a particularly
aggressive word and carries an implied "you moron" or worse - although,
as with most acronyms, there is more than one expansion.

This might be an appropriate place to cast my vote for Tom Phoenix for
the "c.l.p.m Timely, Helpful Information - Nice Guy of the Year" award
(THINGY).  His posts are often a model of brevity and helpfulness, and I
can't remember any (explicit) RTFM's from him.

--
Jaime Metcher


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

Date: 16 Feb 98 23:18:16 GMT
From: ccjjb@cuda.jcu.edu.au (Jeffrey Bird)
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <34e8c938.0@ase-news.jcu.edu.au>

Eric Bohlman (ebohlman@netcom.com) wrote:

: When the M is Perl's documentation, the F stands for "free."  This is a
: point that cannot be overemphasized.  The idea that needs to be conveyed
: is "somebody else *already* put in the time and effort to answer your
: question, and put in *even more* time and effort to make that answer easy
: to find, and that somebody didn't even expect to be paid for all that time
: and effort.  Please put all that time and effort to good use." 

In the case of Perl, the F could also stand for "fine".

			Jeff Bird



--

---
Jeffrey Bird    Email: Jeffrey.Bird@jcu.edu.au
Computer Systems Officer, Computer Centre
James Cook University


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

Date: Sun, 15 Feb 1998 18:38:43 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Can't use string ("") as a subroutine ref while "strict refs" in use
Message-Id: <MPG.f51468ee1147f809896d7@news.concentric.net>

[This followup was posted to comp.lang.perl.misc and a copy was sent to the 
cited author.]

webmaster@fccj.cc.fl.us said...
:                 $vSub = 'Admin'   if (substr($vFlag, 1, 5) eq 'ADMIN');
:                 $vSub = 'Reports' if (substr($vFlag, 1, 7) eq 'REPORTS');
:                 $vSub = 'Logs'     if (substr($vFlag, 1, 4) eq 'LOGS');
:                 $vSub = 'Targets' if (substr($vFlag, 1, 7) eq 'TARGETS');
:                 $vSub = 'Usenet'  if (substr($vFlag, 1, 6) eq 'USENET');
: 
:                 # Perform data-biased subroutine...
:                 &$vSub;
:
: Gives the following error -
: 
: Can't use string ("") as a subroutine ref while "strict refs" in use at
:         Filebase_Tabs.pl line 230, <prjCF> chunk 1 (#1)
                                     ^^^^^^^ ^^^^^ ^
Well, then, I'd guess that the first line of whatever file is referenced by 
the filehandle prjCF (is that hungarian, or just obscure?) does not match any 
of the words you're expecting, and you're trying to call a non-existant 
subroutine whose name is the empty string.  Do you really mean "the substring 
starting at the second character" for all of those comparisons?  If not, then 
IMHO $vFlag =~ /^admin/i is a bit clearer.  There's another obvious way to 
shorten your code, come to think of it...

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 16 Feb 1998 00:26:43 +0100
From: Martin Bialasinski <agr30@uni-koeln.de>
Subject: Re: Can't use string ("") as a subroutine ref while "strict refs" in use
Message-Id: <87afbs30wc.fsf@haitech.internet-treff.de>

Bill Jones <webmaster@fccj.cc.fl.us> writes:

> The following code -
> 
>                 $vSub = 'Admin'   if (substr($vFlag, 1, 5) eq 'ADMIN');

[...]

>                 $vSub = 'Usenet'  if (substr($vFlag, 1, 6) eq 'USENET');
> 
>                 # Perform data-biased subroutine...
>                 &$vSub;
> 
> Can't use string ("") as a subroutine ref while "strict refs" in use at
>         Filebase_Tabs.pl line 230, <prjCF> chunk 1 (#1)
> 
>     (F) Only hard references are allowed by "strict refs".  Symbolic
> references are disallowed.  See perlref.
> 
> Uncaught exception from user code:
>         Can't use string ("") as a subroutine ref while "strict refs" in
> use at. main::readCF() called at Filebase_Tabs.pl line 108
> 
> I thought I can have the data truly drive the application by assigning
> $vSub the subroutine it should call during execution.  It would allow
> the program to process the data depending upon where it was in reading
> the data file...

Two things:

1. All tests fail, so $vSub is empty, thous you get 
     Can't use string ("")
                      ^^^^
Beware:

$ perldoc -f substr
=item substr EXPR,OFFSET,LEN

=item substr EXPR,OFFSET

Extracts a substring out of EXPR and returns it.  First character is at
offset 0, or whatever you've set C<$[> to (but don't do that).      
^^^^^^^^^
You maybe want to use a regexp to test $vFlag for the various strings.

2. You use the strict pragma. This is a good thing. But prevents symbolic
references, thous you get the error

>  Can't use string ("") as a subroutine ref while "strict refs" in use at
>         Filebase_Tabs.pl line 230, <prjCF> chunk 1 (#1)
> 
>     (F) Only hard references are allowed by "strict refs".  Symbolic
>          references are disallowed.  See perlref.

Use a hard reference instead:

 $vSub = \&Admin   if (substr($vFlag, 1, 5) eq 'ADMIN');

(You can allow symbolic references for a block, but it is not necessary
when you can use hard references).

Ciao,
	Martin


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

Date: Sun, 15 Feb 1998 18:48:10 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Courtesy Emails (was Re: A Pubilc Apology.)
Message-Id: <MPG.f5148c8adba37559896d8@news.concentric.net>

schuerig@acm.org said...
: 3) The sender isn't being curteous at all. Rather he or she is trying to
: tell me what an idiot I am -- and want's to stick their opinion right
: into my face. There's no arguing with this kind of people.

Do you mean to say that every piece of email you receive in response to a 
newsgroup question contains a personal insult?  Why, no wonder you're so 
riled.  I'd be mad, too.  On the other hand, I've been getting a fairly steady 
stream of letters from folks saying "thanks for your help" in response to my 
mail to them.  Maybe I'm not insulting enough.  Maybe they're more receptive 
to correction, guidance, and encouragement.  I don't really know.

[This message was posted to c.s.p.m, and a copy was NOT sent to the cited 
author.]

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Mon, 16 Feb 1998 14:14:06 -0500
From: Edwin Rivera <edwinr@icanect.net>
Subject: Error Code 1 in compiling Perl 5.004
Message-Id: <34E88FFE.2BE6@icanect.net>

Perl Gurus,

I am running an Intel CPU Box w/ BSDI 3.1.

When I try to compile perl, I get the following error, I've tried
everything I can think of.  Can anyone offer any suggestions?  

Thanks In Advance

below is error =
=================
`sh  cflags libperl.a doio.o`  doio.c
          CCCMD =  cc -DPERL_CORE -c  -O2   
doio.c: In function Perl_do_ipcctl:
doio.c:1381: argument #4: incompatible types in argument passing
doio.c:1432: argument #4: incompatible types in argument passing
*** Error code 1

end error
=========


Thanks,

Edwin Rivera
Webmaster / Developer / Programmer - Icanect
http://www.icanect.net


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

Date: Mon, 16 Feb 1998 00:26:33 GMT
From: rick@marinweb.com (Rick Freeman)
Subject: Expand hash elements in string?
Message-Id: <34e980d5.27531852@nntp2.ba.best.com>

I know I can expand the variables in a string like this:
s/\$(\w+)/${$1}/g

How can I expand hash elements...
$text = 'this has a $foo{bar} in it';

I've tried many things that seemed logical to me, but none worked.
(No, I won't show you what I tried, cause I don't want to look silly,
but I did add {} to the \w+.

Am I missing something simple, or is this just something that can't be
done?

TIT
Rick

M a r i n W e b

Marin's Home on the World Wide Web
http://www.marinweb.com/

98 Main Street #453
Tiburon CA 94920
415-458-3201


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

Date: Mon, 16 Feb 1998 00:50:41 GMT
From: rick@marinweb.com (Rick Freeman)
Subject: Re: Expand hash elements in string?
Message-Id: <34ec8cf4.30635333@nntp2.ba.best.com>

On Mon, 16 Feb 1998 00:45:02 GMT, rick@marinweb.com (Rick Freeman)
wrote:
>On Mon, 16 Feb 1998 00:26:33 GMT, I wrote:
>>I know I can expand the variables in a string like this:
>>s/\$(\w+)/${$1}/g
>>
>>How can I expand hash elements...
>>$text = 'this has a $foo{bar} in it';
>
>OK, I know I can make it work if I know in advance the name if the
>hash:
>s/\$jobdata{(\w+)}/$jobdata{$1}/g
>
>That's not exactly what I want, though.  I'd like to be able to do it
>all at once (for multiple hashes, that is).

This works:
s/\$(\w+){(\w+)}/${$1}{$2}/g

Does anyone see any problem with doing it this way?

And no, I don't usually talk to myself.  Sorry to the community for
sucking bandwidth!

Rick

M a r i n W e b

Marin's Home on the World Wide Web
http://www.marinweb.com/

98 Main Street #453
Tiburon CA 94920
415-458-3201


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

Date: 16 Feb 1998 01:44:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Expand hash elements in string?
Message-Id: <6c85m7$se6$1@comdyn.comdyn.com.au>

In article <34e980d5.27531852@nntp2.ba.best.com>,
	rick@marinweb.com (Rick Freeman) writes:
> I know I can expand the variables in a string like this:
> s/\$(\w+)/${$1}/g

Not under use strict. Not with scoped variables.

I am not entirely sure why you'd want to do that... But I suppose you
have good reasons.

> How can I expand hash elements...
> $text = 'this has a $foo{bar} in it';

Use double quotes.
$text = "this has a $foo{bar} in it";

That will get rid of the need to do it with regexps that will break as
soon as you use my() on a variable.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: 16 Feb 1998 01:53:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Expand hash elements in string?
Message-Id: <6c866d$se6$2@comdyn.comdyn.com.au>

In article <34ec8cf4.30635333@nntp2.ba.best.com>,
	rick@marinweb.com (Rick Freeman) writes:

> This works:
> s/\$(\w+){(\w+)}/${$1}{$2}/g

Ok, just try this:

# perl -w
my %foo;
$foo{bar} = 'some stuff';
my $aa = 'this has $foo{bar} in it';
$aa =~ s/\$(\w+){(\w+)}/${$1}{$2}/g;
print $aa, "\n";
__END__
Use of uninitialized value at - line 4.
this has  in it

# perl -w
use strict;
my %foo;
$foo{bar} = 'some stuff';
my $aa = 'this has $foo{bar} in it';
$aa =~ s/\$(\w+){(\w+)}/${$1}{$2}/g;
print $aa, "\n";
__END__
Can't use string ("foo") as a HASH ref while "strict refs" in use at - line 5.

You will notice that lexical scoping of variables breaks your method.

You run into the same problems when you use the regex from your first
post, using flat variables.

Is there any reason that you need to do this? Can't you just expand
the variables when you need them?

#perl -w
my %foo;
$foo{bar} = 'some stuff';
my $aa = "this has $foo{bar} in it";
print $aa, "\n";
__END__
this has some stuff in it

You'll notice that that works perfectly.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: 15 Feb 1998 21:33:02 -0500
From: uri@sysarch.com
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <x7wwewjn35.fsf@sysarch.com>

bart.mediamind@tornado.be (Bart Lateur) writes:

> Tom Christiansen <tchrist@mox.perl.com> wrote:
> 
> >Then you get bitten by other things instead: the ones where list
> >context versus scalar context is a concern:
> >
> >    my ($x) = @array;
> >    my  $x  = @array;
> 
> etc.
> 
> Sure. But if that's what I want, I can still resort to "scalar".
> 
>     my($x) = scalar @array;
> 
> which problably is clearer also.

my take is i never assign in a declaration in perl (or C)(except for @_
in a sub). i have always separated them since i think of them as
different operations. i am not of the "if it legal sytax it must be good
code" school. perl (and C) allow many syntax shortcuts i find too easily
abused so i prefer more explicitly fleshed out style like

so i use:

my ( $x, $other, $another ) ;

$x = @array ;


uri

-- 
Uri Guttman		        SYStems ARCHitecture and Software Engineering
uri@sysarch.com			                         Have Perl, Will Hack
http://www.sysarch.com		                        "Your Web Specialist"
(617) 643-7504 x*2  FAX: (617) 643-2710    These ARE the opinions of Sysarch!


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

Date: Mon, 16 Feb 1998 09:32:22 +0000
From: Matt Somers <msomers@hendco.com>
Subject: File Permission/Ownership
Message-Id: <34E80796.36ED@hendco.com>

I have a (hopefully) quick question about creating and editing
files on the fly.

Whenever I try to create a file on the fly, it has an owner of
nobody.  How do I make it so that this file belongs to users
and can be accessed and altered later in the program?

M. Somers
chak@crinos.com


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

Date: 16 Feb 1998 22:29:04 GMT
From: jhunterj@lexis-nexis.com (Hunter Johnson)
Subject: Re: File question
Message-Id: <6caejg$p58@mailgate.lexis-nexis.com>

In article <6c9foq$pfe$1@news.ibm.net.il>,
Gil Steiner <orange19@rocketmail.com> wrote:

> How do I open a file, read each line, process it, and return it to
> the same file ?  what I do now is open the file, read the lines and
> write them to a different file.

Have you looked at the -i switch?  It will handle this for you.

Hunter
--
J. Hunter Johnson        | "A little consistent wholesome modeling and
jhunterj@lexis-nexis.com |   costly servanthood are worth millions of
(937) 865-6800 x5385     |    true words harshly spoken."
Lexis-Nexis, Dayton, OH  |                               -- Ron Sider


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

Date: Mon, 16 Feb 1998 09:32:20 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Forgery => Killfile
Message-Id: <34ebfa6a.3688103@news.tornado.be>

meo@qld.mim.com.au.SPAMMERGOHOME (Martin Oakley) wrote:

>Sorry, perhaps I wasn't clear. I am using the M$ mail client, because
>we use M$ MAIL Post office. This isn't POP-3 or IMAP, it is built on
>the very lame principle of a shared directory.
>Incoming mail will be delivered to the M$ Post office, and will need to
>be read by a compatible mail client.

Talk about a PoB!

Cases like this show why MS having a virtual monopoly over PC software
is a horrible prospect.

Says another PoB. Urm. But it's not (yet) nearly as bad for me.

If I were you, I would try to write a conversion program, so I could use
any e-mail client I like.

	Bart.


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

Date: Sun, 15 Feb 1998 10:08:06 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Help wanted with loop problem. Please. 
Message-Id: <34e6b076.524144494f47414741@radiogaga.harz.de>

User (networks@skynet.co.uk) wrote:
: I've got a couple more problems I'd like some help with.

: open (DATAFILE, "textfile.txt");

How would you know there's a problem if you don't mind to check the
return value of open()?

  open (DATAFILE, "textfile.txt") or die "Unable to open textfile.txt: $!";

: or $e eq $find)	{	push @url, $name, $link;	}

I'd suggest push()ing an anonymous hash:

push @url, {text => $name, url => $link};

: what I'd like to happen is this:
: <A HREF="a url">some text</A></BR>
: 'a url' being $link and 'some text' being $name

: How can I construct, if at all, the foreach loop to do this?

foreach $found (@url)
{print qq(<a href="$found->{url}">$found->{text}</a><BR>);}

: I hope you can advice me :)

Use the CGI.pm, Luke.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Sun, 15 Feb 1998 19:01:56 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: How can I read Novell DOS Environment-variables in Perl?
Message-Id: <MPG.f514bfd499423ae9896d9@news.concentric.net>

[This followup was posted to comp.lang.perl.misc and a copy was sent to the 
cited author.]

gert-jan.lee@dataweb.nl said...
: How can I read Novell Dos systemvariables in Perl?

What you refer to as "systemvariables" are generally known as "the 
environment," or "environment variables."  If you search your Perl 
documentation for the word "environment," you'll find several references to 
the magic %ENV hash.  You refer to the environment variable VARNAME by 
referring, in Perl, to $ENV{VARNAME}.  Hope this helps.

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Sun, 15 Feb 98 20:40:07 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org>
Subject: Re: Killfile Triage
Message-Id: <34e798f7$3$fuzhry$mr2ice@news1.mnsinc.com>

In <34e4f579.27781921@newsvr>, on 02/14/1998
   at 02:00 AM, a-bnc@microsoft.com (Nicholas Carey) said:

>When return addresses, such as those in your posts, are doctored so
>as to be non-mailable, it ceases to be authentic. Ergo, such messages
>are illegal according to both RFC 1036 and RFC 822, and belong in a
>killfile.

Eyes have they, but see they not! My address is mailable. There is
nothing in either RFC 822 or RFC 1036 that says that anyone has to
actually read responses sent to the address in from, nor is there any
prohibittion against generating bounces sent to such addresses. The
address fits the definition that you quoted; it is not false or
imitation, it is real, it is actual. 

If I hire an answering service and instruct them to refuse all
telephone calls from you, my telephone number remains authentic. An
E-mail address is no different; authenticity has nothing to do with
what messages, if any, will be accepted.


--
-----------------------------------------------------------
     Shmuel (Seymour J.) Metz, SysProg and JOAT
     Atid/2
     Team OS/2
     Team PL/I

Any unsolicited commercial junk E-mail will be subject to legal
action.  I reserve the right to publicly post or ridicule any abusive
E-mail.

I mangled my E-mail address to foil automated spammers; reply to
domain acm dot org user shmuel to contact me.  Do not reply to
spamtrap@library.lspace.org
-----------------------------------------------------------



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

Date: Sun, 15 Feb 1998 23:55:56 -0500
From: "Kathleen Ramsey" <kramsey@worldnet.att.net>
Subject: Re: Newbie Regexp question!
Message-Id: <6c8gtp$rbe@bgtnsc03.worldnet.att.net>

Karl,
you can use \c@ or chr(0).

Try --

s/\c@/ /g;  (OR if it is one character to one character use tr/\c/ /;  It is
faster than s/ /  /)

or--

$NULL = chr(0);
s/$NULL/ /g;

KMartino1 wrote in message
<19980213163400.LAA03435@ladder03.news.aol.com>...
>Hi,
>I need to replace null chars (ASCII=0) in a string with spaces and can't
quite
>figure out how to do it. I believe I need to use a regexp, but I can't
figure
>out the syntax to find a null and do the replace.  I've been able to use
regexp
>to do all sorts of cool replaces....but nulls elude me.  If someone could
help
>out a newbie... I'd appreciate it.
>BTW I'm using Gurusamy Sarathy's binary version of Perl for Win32
>version 5.004_04.
>Thanks in advance!
>- Karl
>kmartino@bellatlantic.net




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

Date: 16 Feb 1998 22:28:46 GMT
From: Salve J Nilsen <devnull@nvg.ntnu.no>
Subject: Re: PGP - Perl puzzle
Message-Id: <6caeiu$ne9$1@due.unit.no>

And then, Ignacio suddenly uttered...
> Hi,

# Deletia grande

> Any help, ideas?

1. #!/somewhere/bin/perl -w  ... to catch those silly mistakes
2. use strict;
3. use diagnostics;  ... if you need more feedback.
4. open(FOO,"|bar baz) || die 'could not open: '.$!;  ... Always!

HTH,


Salve Nilsen

-- 
Argh, no .sig!


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

Date: 16 Feb 1998 14:55:15 -0600
From: Erik OShaughnessy <eriko@austin.ibm.com>
Subject: Re: Q: XSUB/Perl Performance (long)
Message-Id: <ufra53clsc.fsf@majestic.austin.ibm.com>


ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> [A complimentary Cc of this posting was sent to Erik OShaughnessy 
Complimentary Cc's are irritating, just don't. IMO of course.

> <eriko@austin.ibm.com>],
> who wrote in article <ufsopjcpcp.fsf@majestic.austin.ibm.com>:
> > while( @data = $trace->next_hook() ){
> >     # munge data here
> > }
> 
> > The funtion next_hook() is where I think the most opportunity for
> > improvement lurks since it get's banged on in a really tight loop.  
> 
> Why?  "munge data here" is of the same significance.

Your analysis would be correct if the "munge data here" section
existed.  As it stands I am trying to optimize the module so that most
the overhead of processing *will* be in MDH. 

> 
> > The first XSUB I wrote for next_hook() looks like:
> > 
> > void
> > next_hook(self)
> > 	trace *self;
> > 	PREINIT:
> > 	hook hook;
> > 	PPCODE:
> > 	if( get_hook(self,&hook) != (hook *)NULL ){
> > 	  XPUSHs(sv_2mortal(newSViv(hook.id)));
> > 	  XPUSHs(sv_2mortal(newSViv(hook.type)));
> > 	  XPUSHs(sv_2mortal(newSViv(hook.hkdata)));
> > 	  XPUSHs(sv_2mortal(newSVpv((char *)hook.data,sizeof(int)*hook.dlen)));
> > 	  XPUSHs(sv_2mortal(newSViv(hook.tid)));
> > 	  XPUSHs(sv_2mortal(newSVnv(self->elapsed_seconds)));
> > 	  XPUSHs(sv_2mortal(newSViv(self->delta_nanos)));
> > 	}
> > 
> > I realize that there are XPUSH[inp] functions, but when I tried to
> > call them with in the PPCODE section, they resulted in runtime errors
> > (segfaults).  To get around that it seemed I would need to make new
> > SV's every time, mortalize them, and push them onto the return stack.
> > This is where I suspect the first candidate for speedup lurks.  If I
> > could discover how to avoid the sv_2mortal(newSV*()) calls, I think I
> > could see some real speed up.
> 
> You cannot have more than one XPUSH[inp] per opcode anyway (even if we
> make them working in XSUBs).  

Could you be more clear here?  

> Why not prepare the array to return in ->new, and XPUSHs the reference
> to the same array each time?  

This is an idea that I hadn't considered.  It would force the caller
to do all their work on the data before calling next_hook() again, or
copy off the data.

> Or just take 7 write-arguments, and XPUSHs &sv_undef/sv_true?

This is also a good idea, since it allows the caller the choice
of re-using memory or allocate new memory for each call.  What sort
of XSUB would you need to write to make this happen?

Thanks for the feedback..
ejo

-- 
Erik O'Shaughnessy:eriko at austin.ibm.com:[838|678]-2622:bldg 902/2D014
Performance Tool Development Team:Division Formerly Known As RS/6000:IBM


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

Date: 16 Feb 1998 22:47:06 GMT
From: dannyman <dannyman@arh0300.urh.uiuc.edu>
Subject: Re: RFC about "Matt's Script Archive"
Message-Id: <6cafla$fvk$3@vixen.cso.uiuc.edu>

Chipmunk <rjk@coos.dartmouth.edu> wrote:
> Mark Kramer wrote:
>> 
>> Admit it; if it was someone besides Tom who was complaining that a free
>> piece of software wasn't written the way he liked code to be written,
>> would you you be supporting him or telling him to write his own if he
>> didn't like the free stuff?

> If I give you a free bucket of sh*t, it's still a bucket of sh*t.

Yeah, at least you didn't have to make it yourself. :p

If you don't like my shit, why not make some better shit. Personally, I had a
very nice shit today.

- dan, hoping this will kill the thread

-- 
  //Dan   -=-     This message brought to you by djhoward@uiuc.edu    -=-
\\/yori   -=-    Information - http://www.uiuc.edu/ph/www/djhoward/   -=-
aiokomete -=-   Our Honored Symbol deserves an Honorable Retirement


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

Date: Sun, 15 Feb 1998 18:26:57 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Running Perl
Message-Id: <MPG.f5143ca717887be9896d6@news.concentric.net>

[This followup was posted to comp.lang.perl.misc and a copy was sent to the 
cited author.]

momiji@slip.net said...
: I used the dos PERL program in
: the C:\Perl\bin directory and copied the script it into that. It didn't
: work I then tried some BASIC commands such as run. How do I test my
: script??

Your question is not, in fact, related to Perl, but rather to DOS.  

   C:\Perl\bin\perl.exe -w c:\path\to\hello.pl

I think you'll benefit greatly from two books: one, a primer that teaches you 
how your OS works, particularly one that deals with the MSDOS command 
language;  the other, "Learning Perl," by Randal Schwartz.  Good luck, and 
good learning.

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Mon, 16 Feb 1998 12:52:30 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: So what about last summer's RFD?  Let's go moderated.
Message-Id: <34E87CE1.355D9A55@coos.dartmouth.edu>

John Stanley wrote:
> 
> If this same proposal comes up again, I will be just as opposed to any
> mandate for spammable addresses as I was when it came up the first
> time.  There is no reason this group needs to serve up verified
> addresses to spammers on a silver platter.

If you don't want to use a verified email address, then you'd be free
not to post to the moderated newsgroup.

Chipmunk


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

Date: 16 Feb 1998 23:01:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: sockets to webservers
Message-Id: <6cagh0$89j$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, "Devin P. Anderson" <dev@sgi.net> writes:
:What socket options should one use to connect to a webserver? 

Eh?

:I've done
:socket programming before, but when I try to read from the socket to
:this webserver, it just hangs. Heres the code.
:
:socket(SOCK,PF_INET,SOCK_STREAM,$proto);
:connect(SOCK,$paddr);
:
:And I know that the paddr is fine. I'm stumped!

It won't hang forever.  I don't see you checking the
return value or revealing errno.  See the webget
program in perlipc, but also read perlfaq9.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

You can measure a programmer's perspective by noting his attitude on
the continuing viability of FORTRAN.


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

Date: 15 Feb 1998 19:38:05 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: tkolsen@btinternet.com (Tony K. Olsen)
Subject: Re: Sorting Strings With Delimited Characters - Advice Sought
Message-Id: <8ciuqg2s1e.fsf@gadget.cscaper.com>

>>>>> "Tony" == Tony K Olsen <tkolsen@btinternet.com> writes:

Tony> Hi Everyone,
Tony> 	After having tried numerous things like cmp and <=> etc. I am 
Tony> looking for a little advice on a sort problem I am having with a 
Tony> delimited text file using two colons (::).

Tony> 	Running perl, version 5.003_07 on Windows 98

Tony> Text file begins:

Tony> 1::1997::
Tony> 23::1998::
Tony> 2::1998::
Tony> 14::1998::
Tony> 2::1997::
Tony> 3::1998::

Tony> 	What I want is:

Tony> 1::1997::
Tony> 2::1997::
Tony> 2::1998::
Tony> 3::1998::
Tony> 14::1998::
Tony> 23::1998::

Tony> 	Any advice greatly appreciated.  Thanks in advance.  Cheers.

    use Sort::Fields;
    print fieldsort ':', ['3n','1n'], <>;

Sort::Fields is found in the CPAN, written by my esteemed colleague
Joseph Hall, no doubt after hating typing all those things in the
Schwartzian Transform for one too many advanced classes. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 197 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sun, 15 Feb 1998 18:51:14 -0500
From: Michael Stearns <michael@datahost.com>
Subject: System function to variable
Message-Id: <34E77F60.365D@datahost.com>

I am trying to get the current date and stick it in a variable.

I have tried several things like:


$tempdate ="date '+%A %B %e, %Y'";

$temppath1= "tempfile";

system ($tempdate) >> $temppath1;

open (DATEVAR,"+< tempfile") || die ("Can't Open tempfile\n");

$date=<DATEVAR>;


(I actually started with something simpler - $date= system ($tempdate)
-  but was unsuccessful.


When I run my script, the proper date prints to the screen, but I can't
save it to the variable "$date." In the current iteration above I cannot
even write the date to the file called "tempfile."

Any suggestions would be appreciated.

Thanks,
Michael Stearns


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

Date: Mon, 16 Feb 1998 18:24:23 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: The Young Man and the Beach
Message-Id: <34E8CAA8.CF82FACF@coos.dartmouth.edu>

Nathan V. Patwardhan wrote:
> 
> Mark Kramer (c28f62@world.std.com) wrote:
> 
> : One of those bits of netiquette hapens to involve OS flaming.
> 
> Since the questions relate to a curious "OS", where things often don't
> work correctly (but people still ask for support ... and lots of it),
> I suspect that this is the heart of the problem in the OS Wars.

As opposed to the magical OS you're using, where everything always works
correctly, and you never need help from anyone else to do anything?

I suspect the heart of the problem in the OS Wars is that some people are
so blinded by loyalty to their own OS that they become unable to grasp the
fact that other OSes are in fact useful.

While I prefer certain OSes over others, I don't find it necessary to enter
into foolish debates about which OS is best.

Chipmunk


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

Date: Mon, 16 Feb 1998 09:52:06 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: Tom Christiansen
Message-Id: <34e80ba6.2754873@news.dtu.dk>

On Sat, 14 Feb 1998 17:54:37 +0000, John Olsen <jfo@btinternet.com>
wrote:

>Tom's recent posts don't seen to have had much affect!

This is funny. Try to find an old post by Christiansen himself by
looking up "christiansen affect effect" on www.dejanews.com (old
post). You'll then see something about the use of affect and effect.

  Lars

Lars Gregersen, M.Sc. Chem. Engng.
Department of Chemical Engineering, DTU, Denmark
E-mail:   lg@kt.dtu.dk
Homepage: http://www.gbar.dtu.dk/~matlg/


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

Date: Mon, 16 Feb 1998 09:32:24 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34ecfbda.4056156@news.tornado.be>

John Porter <jdporter@min.net> wrote:

>> after pope Gregory XIII, and the first correction took place in october
>> 1582. Not all countries adopted this at the same time. 
>>
>> So: does "cal" know about his? Does it guess where you are, so that it
>> can take the appropriate correction? Of course not.
>
>Doesn't need to.  I'm in the U.S., cal works for the U.S. (and the U.K.)
>so it is correct for me and my system (which uses GMT ;-).
>
>> At least, I hope it won't even try. 
>
>Why not? That's what locales and timezones are for!

The US didn't even exist in 1752.

But anyway. Say I wanted a French calendar from within Belgium for 1583.
You don't really want me to change my system settings just to get a
correct calendar, do you?

For a bunch of MS bashers, you people do tend to think too much like MS
would. This is the approach MS would take.

A command line switch would make far more sense to me.

HTH,
Bart.


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

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

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