[8305] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1922 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 17 14:17:59 1998

Date: Tue, 17 Feb 98 11:00:35 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 17 Feb 1998     Volume: 8 Number: 1922

Today's topics:
    Re: .rc file parser, anyone? <*@qz.to>
        Client / Server package is need. <yovavm@amdocs.com>
    Re: Expand hash elements in string? (Rick Freeman)
    Re: Expand hash elements in string? (Rick Freeman)
    Re: Finding name of current directory in Perl (I R A Aggie)
    Re: Finding name of current directory in Perl <tchrist@mox.perl.com>
    Re: HELP!  My ISP claims that Perl access is a serious  (I R A Aggie)
    Re: Help: Why does sysread give false end of file? (Will Morse)
    Re: Interpeter For The PC (Andrew M. Langmead)
    Re: non-polling way to detect new files? (Andrew M. Langmead)
    Re: on reading FAQs and gurus answering questions (Mark-Jason Dominus)
    Re: Question on multipart/mixed. Pls Help! (Andrew M. Langmead)
    Re: Quick Reg Expression help <dboorstein@shopcfn.com>
    Re: RFC about ``Matt's Script Archive'' (Nathan V. Patwardhan)
    Re: RFC about ``Matt's Script Archive'' <tchrist@mox.perl.com>
    Re: script won't run...displays script text (I R A Aggie)
    Re: T.H.I.N.G.Y. [was: Being Nice 2 Nice Beings [Was: R <merlyn@stonehenge.com>
    Re: use of conditional op in striphtml (by tchrist) uri@sysarch.com
    Re: what does "deprecate" mean? <jdporter@min.net>
    Re: XS help? <eriko@austin.ibm.com>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl <jdporter@min.net>
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Steve Summit)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (John Winters)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 17 Feb 1998 18:40:35 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: .rc file parser, anyone?
Message-Id: <qz$9802171141@qz.little-neck.ny.us>

<tobez@plab.ku.dk> wrote:
> Grant Totten (EXCHANGE:CAR:5J42) wrote:
> > Has anyone written a 'run command' file parser?  Are there any libraries
> > availabe to do this?
> Have you tried IniConf module from CPAN?

Hmmm, I haven't but I will look into it. It seems I rewrite such things
every year or two as I want different features. Some of my shell script
ones before I used perl are an exercise in strange parsing rules.

Early perl version:

	#(username,passwd,uid, gid, quota,comment,gcos,homedir, shell)
	($username,undef,undef,undef,undef,undef,undef,$homedir,undef) =
			getpwuid($<);

	die "username not defined" unless defined($username);
	die "homedir not defined" unless defined($homedir);

	$rctext=&read_file("$homedir/.foorc");
	eval $rctext;

	sub read_file
	{
	    local($fname) = @_;
	    local($r) = "";
	    local($/) = undef;

	    if( ! open(RC,"$fname") ) {
		return $r;
	    }
	    $r = <RC>;
	    close(RC);
	    return $r;
	}

The next generation included a &checkvars that approximates the
functionality of "use strict;" If more than N variables were left
undefinded, it would refuse to run. That also included a function
to generate a rc file with all variables set. Any which were set
by an existing rc file would keep their values and the others 
would get reasonable defaults. Very nice, but rather slow.

Since then I have been studiously avoiding .rc files...

Elijah
------
has also reinvented arguments parsing several times


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

Date: Tue, 17 Feb 1998 18:39:26 +0200
From: "Yovav Meydad" <yovavm@amdocs.com>
Subject: Client / Server package is need.
Message-Id: <6ccegb$brq@speedy.amdocs.com>

I am using Perl 5.004 and Perl\Tk 400.202.
I have some scripts written already which operates on a local host (UNIX and
NT).

I would like to write a Client\Server application which needs to perform the
following:

1. Send a command to execute from a client to the remote server (all
executables resides on the remote - just need to tell which command to
execute). Execution should be done with the Remote's privileges.
2. Remote should recognize the client - only authorized users can perform
actions.
3. Remote need to return the output (stdout and stderr) back to the client.

Does any one know of a package that support all those needs.

P.S
I checked the Penguin package - it sends the whole file to execute, and this
is not appropriate for my needs.


Thanks in advance.

~~~~~~~~~~~~~~~~~
Yovav Meydad
yovavm@amdocs.com
~~~~~~~~~~~~~~~~~




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

Date: Tue, 17 Feb 1998 17:16:35 GMT
From: rick@marinweb.com (Rick Freeman)
Subject: Re: Expand hash elements in string?
Message-Id: <34edc5eb.1280730@nntp2.ba.best.com>

On 17 Feb 1998 00:46:03 GMT, in comp.lang.perl.misc you wrote:
>Perl does variable interpolation just fine as it is. Why rebuild the
>wheel?

Sorry.  My fault.  I should have been clearer about what we are trying
to do here.

You'll find the answer in my post, above.

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: Tue, 17 Feb 1998 17:17:05 GMT
From: rick@marinweb.com (Rick Freeman)
Subject: Re: Expand hash elements in string?
Message-Id: <34efc605.1306627@nntp2.ba.best.com>

On 16 Feb 1998 01:53:17 GMT, in comp.lang.perl.misc you wrote:
>You will notice that lexical scoping of variables breaks your method.

But it does work without all those pesky "my"s.  And if I turn off
strict.  No?

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

The text with the variables is stored as a file.  Basically a
template.  The template is read into memory, variables are inserted
where necessary, whole thing is saved as an html file.

This general scheme is important because the template must be
modifiable by an html hack who doesn't speak perl, and isn't cleared
to fool with the scripts anyhow.  Of course we still run the risk of
the htmler messign with the variables, but that's another story.

What we're doing is basically creating a page with markup "tags,"
which just happen to be perl variables.


>#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.

Maybe for your purposes.  Not mine.  Thanks, though.

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: Tue, 17 Feb 1998 11:58:27 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Finding name of current directory in Perl
Message-Id: <fl_aggie-1702981158270001@aggie.coaps.fsu.edu>

In article <01bd3bae$7d427ea0$10791fc4@finley>, "GreyRider"
<lloyd@vwv.com> wrote:

+ #!/usr/bin/perl
+ $currdir=`pwd`;
+ print $currdir;
+ 
+ works for me ;)

Ugly as sin. shells another process. wasteful. may invoke csh. Under unix:

$ perldoc Cwd

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 17 Feb 1998 17:10:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Finding name of current directory in Perl
Message-Id: <6ccgar$5kc$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, fl_aggie@thepentagon.com (I R A Aggie) writes:
:+ $currdir=`pwd`;
:Ugly as sin. shells another process. wasteful. may invoke csh. Under unix:

Not ugly.  Backticks are your friend.  Does not call the shell. 
Would never ever call csh anyway.

Guess how Cwd.pm it really does this?  Using the source
/usr/lib/perl/Cwd.pm:

    # The 'natural and safe form' for UNIX (pwd may be setuid root)
    sub _backtick_pwd {
	my $cwd;
	chop($cwd = `pwd`);
	$cwd;
    }

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

    Perl programming is an *empirical* science!  
	    --Larry Wall in <10226@jpl-devvax.JPL.NASA.GOV>


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

Date: Tue, 17 Feb 1998 11:56:06 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: HELP!  My ISP claims that Perl access is a serious security risk!
Message-Id: <fl_aggie-1702981156060001@aggie.coaps.fsu.edu>

In article <tgooding-ya023580001602982113120001@news2.ibm.net>,
tgooding@millcomm2.com (Tom Gooding) wrote:

+ Personally, I think he's just a BIT paranoid.

Personally, I would find a new ISP. And send a letter to you old one
stating why, with appropriate CC's to the appropriate parties...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 17 Feb 1998 11:26:20 -0600
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Help: Why does sysread give false end of file?
Message-Id: <6cch7s$o0u$1@Starbase.NeoSoft.COM>

Just a thought, but are you anywhere mixing read or <> with sysread?
If you use sysread, that should be your only access to the file
(including, I believe, eof() ).  read and <> do some buffer management
that sysread avoids.

Just a guess.

Will

In article <6calna$nkb$1@nw003t.infi.net>,
Stan Majka <spamblock_majka@richmond.infi.net> wrote:
>Can anyone tell me what's going wrong with sysread?
>
>I'm trying to read a 711 KB file, but a straightforward sysread loop quits 
>after only about 42 KB.  
>
>The file contains variable length records.  Each record starts and ends with a 
>2-byte record length.  I read the length of the first record, then loop, 
>reading each record plus the 2-byte length field for the next record.
>
>I can successfully read 162 records, but on the 163rd, I ask for 280 bytes but 
>only get 10.  If I do another sysread for 270 bytes, I get 0.  If I keep doing 
>sysreads for 999 bytes, I keep getting 0 bytes read.
>
>If I put in an error recovery routine, I can read the entire 711 KB.  Whenever 
>the bytes read is less than the record length, I close the file, re-open it, 
>seek to where the next record is supposed to be, and continue from there.  This 
>gets me through the file, but it seems kludgy; why isn't sysread seeing a 
>continuous file as it appears when I open it with a text editor?
>
>Running Perl for Win32 on NT 4.0.
>
>
>Thanks in advance,
>Stan
>


-- 
# Copyright 1998 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
# 
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas
#              it's the law.       #    will@starbase.neosoft.com
#
#   These are my views and do not necessarly reflect anyone else.


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

Date: Tue, 17 Feb 1998 17:43:13 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Interpeter For The PC
Message-Id: <EoJAK1.CJr@world.std.com>

[a copy of this article was e-mailed to the author of the referenced
article. Unfortunately, the e-mail was not marked as such because
Chris did not note that his message was a courtesy copy.]

Chris_Schoenfeld@sonic.net writes:
> 
> Possible, but unadvisable for several reasons:
> 
> 1. Typing arguments gets old FAST.

Then set up a script or text file that provides the sample input.

> 2. This doesn't help debug your HTML rendering.

Then capture the output and feed it to the browser. How about a
 .perldb file that contains the following:

BEGIN {
  open SAVEOUT, ">&STDOUT" or die "Can't dup STDOUT\n";
  open STDOUT, ">output.txt" or die "Can't open debugging output\n";
}

END {
  open STDOUT, ">&SAVEOUT" or die "Can't re-dup STDOUT\n";
  system("browser output.txt"); # replace "browser" with the desired browser.
}

(I do realize that the original discussion revolved around a novice
user, and I don't imaging a novice to be mucking around with a .perldb
file. I just want to point out that it can be done. The novice could
probably just do:

perl -d scriptname.pl >output.txt
browser output.txt

> 3. Some things are best known rather than assumed: such as env. vars.

Are you saying that sometimes the server sets up environment variables
other than to the spec? In that case, then the user should be sure to
use the same server (which implies the same OS) as they will be using
in final deployment. If the server does something different, there is
no reason to assume that every server will.

> 4. You can still run from command-line whenever you want.

Other people can look at it in the reverse. (Run it from the command
line, if you ever want to, you can install a server to run it.)

> 5. Installing a windows webserver is easier to do than not to do - and the
> experience of installing, configuring, and maintaining it is a good skill to
> have.

But is it really the first thing a overwhelmed novice should do?


-- 
Andrew Langmead


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

Date: Tue, 17 Feb 1998 18:19:01 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: non-polling way to detect new files?
Message-Id: <EoJC7p.9Lv@world.std.com>

George Lippert <glipper1@san.rr.com> writes:

>I've tried to do my homework on this question but come up with no
>elegant answer.

>Is there a way to detect when a new file is placed into a directory,
>other than, say, looping on the directory's modification time and then
>comparing new vs. old filename lists? I guess I'm hoping there is
>something like a directory version of select(). Thanks in advance.

It would have to be some service the operating system makes available
to you. In most unix and unix-like operating systems, there is no
service to handle this for you.

It seems to me this would be something that could be trivially
implemented by the Hurd's "translators" functionality. Just make the
directory a translator that performs some notification when it is
written to.


-- 
Andrew Langmead


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

Date: 17 Feb 1998 13:36:03 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6cclaj$5la$1@monet.op.net>
Keywords: demonstrate, existent, fishermen, revival

In article <MPG.f521c31525f67649896dd@news.concentric.net>,
Jonathan Feinberg <jdf@pobox.com> wrote:
>Because I respect your opinion, I'm hoping you'll elaborate on the
>hallmarks of a "stupid, industrious" person.  It seems like you're
>disparaging the dispensation of advice by well-intentioned but
>under-informed people.  Is that the idea?

Some reporter once asked Einstein for the formula for success in life.

Einstein said that he would characterize it as being of the form 
`X + Y + Z', where X was work and Y was play.

What about Z? asked the reporter.

Z, replied Einstein, is keeping your mouth shut.





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

Date: Tue, 17 Feb 1998 18:12:00 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Question on multipart/mixed. Pls Help!
Message-Id: <EoJBw0.8B4@world.std.com>

stevenchan69@hotmail.com (stevenchan) writes:

>the result of the following program is "ok2" in the web browser,
>but i am trying to get "okok2" in the web browser,
>what's wrong with it?

I get the following output:

perl -w tmp/foo
content-type: multipart/mixed ; boundary=end
 
--end
content-type: text/plain
 
ok
 
--end
content-type: text/plain
 
ok2
 
--end--

See, it even passes the "-w" checks. Great job! Since perl seems to be
doing its job correctly, maybe you just aren't implementing whatever
protocol the process receiving the data expects. Maybe there are
newsgroups that discuss the protocol?

-- 
Andrew Langmead


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

Date: Tue, 17 Feb 1998 12:35:18 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: Quick Reg Expression help
Message-Id: <34E9CA56.F92EFCE4@shopcfn.com>

Mike Binkley wrote:
> Second, I'm having some trouble splitting on white space.  I was using:
> 
>       $_=$tokens;
>       @tokens = (split);
> 
> which did exactly what I wanted it to, however when I was looking through
> one of the man pages, I saw that doing a split on / / should have the same
> effects.  So I though that:
> 
>       @tokens = split (/ /, $tokens)
> 
> should have exactly the same effect, but it doesn't always seem to work.
> Particularly, it has a tendency to put an null character in the first
> space in the array.

/ / and ' ' are different here. the former splits on single spaces
while the latter mimics the default split. subtle, but documented.

$_ = ' test  string';
print join '|', split / /;
print "\n";
print join '|', split ' ';
print "\n";

cheers,

-- 
dan boorstein <dboorstein@shopcfn.com>


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

Date: 17 Feb 1998 16:54:55 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <6ccfcv$691@fridge.shore.net>

ssmieja@execpc.com wrote:

: I feel that there is an underlying current of hatred at old Perl 4 code by
: those who believe only in the OO model of Perl 5.  Everyone screams rewrite
: but moving from a process orientation to an OO one ain't easy.

No!  The person who told you this was lying.  OOP is an option that
some people choose to use.

: I use Perl 5 but code in Perl 4.  Guess what, many of those wonderful CPAN
: modules don't build on a Windoze platform because the code isn't perl it is
: Un*x flavored C.

Again, no.  If they're bundled with Makefile.PL, use XS and such, it's
probably the case that your compiler isn't supported.  If you use a
supported compiler for "NT" Perl (Sarathy's port), many, many things
seem to build fine.  If I understand correctly, more and more Win32
compilers will be supported in the near future, but in the meantime
you're a PoB if you're not using one of these.

--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov


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

Date: 17 Feb 1998 16:58:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <6ccfkc$5kc$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, ssmieja@execpc.com writes:
:I feel that there is an underlying current of hatred at old Perl 4 code by
:those who believe only in the OO model of Perl 5.  Everyone screams rewrite
:but moving from a process orientation to an OO one ain't easy.

Gods, no!  At least, I hope not.  Just because I don't want to see crusty
old perl4 codes passed around doesn't mean I want you to change your
religion.  I pretty much agree with you on the OO thing.  I've posted
about this before.  Using v5 shouldn't automatically mean OO madness.

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

"I'd rather have :rofix than const."
	    --Dennis Ritchie


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

Date: Tue, 17 Feb 1998 11:49:12 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: script won't run...displays script text
Message-Id: <fl_aggie-1702981149130001@aggie.coaps.fsu.edu>

In article <MPG.f52ea8315d4f2519896e9@news.concentric.net>, jdf@pobox.com
(Jonathan Feinberg) wrote:

+ tchrist@mox.perl.com said...
+ : In comp.lang.perl.misc, SmallWorks <gameday@uslink.net> writes:
+ : :how do i make my perl script run?

+ : Get up at 91 minutes before dawn, clothe yourself in neon green body

Ummm...Tom? is this is "kinder, gentler" you?? ;)

+ : paint and nothing else, pour a little (blended) scotch out on the ground,
+                                          ^^^^^^^
+ With all due respect, you've misspelled "single-malt."

With all due respect, if I find out you've been pouring single-malt
scotch out on the ground, I'm gonna thump you into next week.

James - I'm buying up stocks of neon green body paint...

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 17 Feb 1998 10:25:17 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: David Adler <dha@panix.com>
Subject: Re: T.H.I.N.G.Y. [was: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <8cra52xhxe.fsf@gadget.cscaper.com>

>>>>> "David" == David Adler <dha@panix.com> writes:

David> Hey, we can delegate this to Tom Phoenix... he's got nothing else to
David> do right? :-)

Hey, hey HEY.... he's teaching for me this week in DC.  Don't be allocating
his time for non-productive details. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 195 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: 17 Feb 1998 12:22:13 -0500
From: uri@sysarch.com
Subject: Re: use of conditional op in striphtml (by tchrist)
Message-Id: <x7k9aujge2.fsf@sysarch.com>

jdudley@access4.digex.net (James Dudley) writes:

> 
>   s{ < (?: [^>'"] | ".*?" | '.*?') + > }{}gsx;
> 
> My question is, what is the ?: doing here?  There is a comment to
> this part of the line, stating that this is a non-backreffing
> grouping paren.  So the ?: makes the parenthesis(es) non-back-
> reffing?  How?

all it does is regex grouping. in this case it lets the trailing '+'
work on the entire () expression. it doesn't save the matcthed sting for
use by \1 or $1 which is back-referencing. this saves time and memory if
you only need the grouping for the expression and not the match string.
so the ?: just turns off the back-ref attribute of the ().

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: Tue, 17 Feb 1998 11:57:32 -0500
From: John Porter <jdporter@min.net>
Subject: Re: what does "deprecate" mean?
Message-Id: <34E9C17C.6127@min.net>

Kevin B Cohen wrote:
> 
> okay, i *know* what it means to "deprecate" in english, but what does
> it mean in perlish?  here are some examples of usage (hope i'm not
> violating any laws of copyright...):
> 
> "This usage is vaguely deprecated, and may be removed in some future
> version of Perl."  (camel, 2nd ed., pg. 72)
> 
> "Use of $* is now deprecated, and is allowed only for maintaining
> backwards compatibility with older versions of Perl."  (camel, 2nd
> ed., pg. 129)
> 
> I can imagine deprecating a novel or a usage in English, but I'm
> having trouble imagining deprecating a variable....
> 
> kevin

>From the Jargon File (Hacker's Dictionary),
http://www.lysator.liu.se/hackdict/split2/deprecated.html --
deprecated adj. Said of a program or feature that is considered
obsolescent and in the process of being phased out, usually in 
favor of a specified replacement. Deprecated features can,
unfortunately, linger on for many years. This term appears with
distressing frequency in standards documents when the committees
writing the documents realize that large amounts of extant (and
presumably happily working) code depend on the feature(s) that
have passed out of favor. See also dusty deck. 

John Porter


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

Date: 17 Feb 1998 11:34:20 -0600
From: Erik OShaughnessy <eriko@austin.ibm.com>
Subject: Re: XS help?
Message-Id: <ufoh06cezn.fsf@majestic.austin.ibm.com>

meet@the.zoo (dave) writes:
> I'm having a hard time understanding XS and the perlxstut, perlxs and
> perlguts man pages are not helping me get the picture.
> 
> I bought Joseph and Randal's "Effective Perl Programming" which has a
> lot of useful stuff but I'd like more about XS.  Where can I get it?
> 
> Thanks,
> Dave

I recently writting XSUBs and I found that while the standard perl
documentation was copious, it assumed a much deeper knowledge of perl
internals than I certainly had.  I found the following to be helpful
in my quest for enlightenment:

Programming Perl, 2nd edition O'Reilly
Advanced Perl Programming, O'Reilly
XS Cookbooks by Dean Roehrich 
 ( check your favorite CPAN mirror under authers/Dean_Roehrich )
FMTYEWTK series by Tom Christiansen 
 ( http://www.perl.com/perl/everything_to_know )

HTH,
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: Tue, 17 Feb 1998 12:01:51 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34E9C27F.5467@min.net>

RandallBart wrote:
> 
> John Porter wrote:
> >
> > Bart Lateur wrote:
> 
> > > So: does "cal" know about his? Does it guess where you are,
> > > so that it
> > > can take the appropriate correction? Of course not.
> > > At least, I hope it won't even try.
> >
> > Why not? That's what locales and timezones are for!
> >
> Does cal correctly handle 1700-03-01 thru 1712-02-30 with a Swedish
> locale?

No, but it could.  You said you hoped it wouldn't even try.
I say, why not?  It has (or might have) enough information to
make a good "guess".

John Porter


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

Date: 17 Feb 1998 17:40:17 GMT
From: scs@eskimo.com (Steve Summit)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6cci21$dll$1@eskinews.eskimo.com>

In article <fl_aggie-1202981344090001@aggie.coaps.fsu.edu>, I R A Aggie writes:
>                int  tm_year;  /* years since 1900 */
> 
> That's fairly obvious that tm_year is an _offset_ from 1900, and that
> four_digit_year=1900+tm_year. If someone with any grasp of English can't 
> deduce from that section of the man page that one has to _add_ 1900
> to the returned value tm_year, then perhaps they shouldn't be programming?

I have seen the equivalent of

	tm.tm_year = yyyy % 100;

in production code, and I've even had problems convincing the
maintainers of such code that it's anything to worry about.

You're right, there are programmers who probably shouldn't be,
but they are, and they just keep doing the most impossibly
boneheaded things.  Working with 2-digit years seems to bring
the boneheadedness out in spades, which is why the y2k problem
is so pervasive...

					Steve Summit
					scs@eskimo.com


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

Date: 17 Feb 1998 16:56:12 -0000
From: john@polo.demon.co.uk (John Winters)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6ccffc$ak2$1@polo.demon.co.uk>

In article <6ccc11$a41$1@eskinews.eskimo.com>,
Steve Summit <scs@eskimo.com> wrote:
>In article <fl_aggie-1202981344090001@aggie.coaps.fsu.edu>, I R A Aggie writes:
>>                int  tm_year;  /* years since 1900 */
>> 
>> That's fairly obvious that tm_year is an _offset_ from 1900, and that
>> four_digit_year=1900+tm_year. If someone with any grasp of English can't 
>> deduce from that section of the man page that one has to _add_ 1900
>> to the returned value tm_year, then perhaps they shouldn't be programming?
>
>I have seen the equivalent of
>
>	tm.tm_hour = yyyy % 100;
>
>in production code, and I've even had problems convincing the
>maintainers of such code that it's anything to worry about.

Fascinating.  How did they calculate the minutes?    :-)

John
(cc:-ed)
-- 
John Winters.  Wallingford, Oxon, England.

The Linux Emporium - a source for Linux CDs in the UK
See <http://www.polo.demon.co.uk/emporium.html>


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

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

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