[11440] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5040 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 3 05:07:23 1999

Date: Wed, 3 Mar 99 02:01:27 -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           Wed, 3 Mar 1999     Volume: 8 Number: 5040

Today's topics:
    Re: method overriden! <emschwar@mail.uccs.edu>
    Re: method overriden! <ekkis@arix.com>
    Re: method overriden! <ekkis@arix.com>
    Re: method overriden! <ekkis@arix.com>
    Re: method overriden! (Martien Verbruggen)
    Re: method overriden! (Abigail)
    Re: method overriden! <ekkis@arix.com>
    Re: method overriden! <zenin@bawdycaste.org>
    Re: method overriden! <ekkis@arix.com>
    Re: method overriden! <ekkis@arix.com>
    Re: multiline write <coyote38@pacbell.net>
        newbe looking for perl script <oscka@yahoo.com>
    Re: newbe looking for perl script <staffan@ngb.se>
    Re: Odd Experience <mpersico@erols.com>
    Re: Please, An example of win32::NetResourse. (Gareth Jones)
        Q: How to run perl on WindowsNT without a window? <alonz@cs.technion.ac.il>
    Re: The millennium cometh -- eventually charlottekane@hotmail.com
    Re: The truth about the Pentium III chip and ID --- **b <doug@eng.auburn.edu>
    Re: Urgent Help Please!? -->  Multiline Reading of data <rick.delaney@home.com>
    Re: URGENT help required!! <mpersico@erols.com>
    Re: y2k and 4-digit dates (was Re: foreach and while) <staffan@ngb.se>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 02 Mar 1999 17:06:56 -0700
From: Eric The Read <emschwar@mail.uccs.edu>
Subject: Re: method overriden!
Message-Id: <xkfn21vl9lr.fsf@valdemar.col.hp.com>

"Ekkis" <ekkis@arix.com> writes:

You know, if you keep snipping who you're replying to, then it's
impossible for the rest of us to tell.  Please follow standard
netiquette, and quote who you're replying to, as I do above.

> But why should calls in a base class resolve to code defined in derived
> classes?  that is callback behaviour, not virtual functions.

One begins to get the feeling you don't understand what is meant by
"virtual functions", as that's *exactly* what is meant by that phrase.  

I don't know why you insist on contrasting it with "callback behaviour";
a callback may or may not be a virtual function, but its behaviour is
identical, regardless of what type of function is referenced.

-=Eric


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

Date: Tue, 2 Mar 1999 16:31:11 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: method overriden!
Message-Id: <Go%C2.6603$8N5.71131@typhoon-sf.pbi.net>

>> >$self->init(@_) calls the init method for the object $self; since $self
>> >is of class c2, this is the subroutine c2::init.
>>
>> but, doesn't $self resolve differently depending on the scope of usage?
>
>No.  That would defeat one of the main purposes of OO, after all.  That's
>what lets me define a derived class that changes the behaviour of
>base-class functions.


I have no problem with overriding functions.  If I want to inherit a bunch
of functionality but want to change certain behaviour, yes, I get to call
the base class's original function only if I want to.  This means that when
my derived class's implementation calls the function, it really refers to
the new function i.e. its own (the one at the derived class's level) and not
the original one (the one at the base class level).  The derived function
obscures the base function which is the desired behaviour.  But why should
function calls in the base class's code all of a sudden start calling
functions it doesn't know anything about??

Suppose Person and Employee both define method sleep() except
Person::sleep() means "go to bed, close eyes, etc." while Employee::sleep()
means "check that coast is clear, hide in a corner, etc."

If method nightynight() were only implemented at the Person level (since
Employee typically doesn't work 24hrs/day) and it called sleep(), why should
it call Employee:sleep() and check for the boss??  shouldn't it call
Person::sleep() instead?





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

Date: Tue, 2 Mar 1999 16:44:46 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: method overriden!
Message-Id: <rB%C2.6609$8N5.69181@typhoon-sf.pbi.net>

>> I'm not building it right, but I can't figure out quite how.
>
>It sounds like you want the equivalent of C++'s 'private' scope.  As far
>as I can tell, my (admittedly out-of-date) perltoot page says you can't
>get there from here:


hmm... there's an idea.  maybe I can declare init() inside of new()...  that
might do it!




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

Date: Tue, 2 Mar 1999 16:01:39 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: method overriden!
Message-Id: <1Z_C2.6597$8N5.70518@typhoon-sf.pbi.net>

> When a method is called against an object, it will find the
> first method in the inheritance tree that fits, and it starts at the
> class level the object was blessed into. If you call a method against
> a class, it will start looking at the class you explicitly mention.

when you say "an object" you really mean the thing returned by c2->new() so
I can understand that if I say:

$o = c2->new();
$o->init();

the call to the object $o's init() will resolve to c2::init(). But why
should calls in a base class resolve to code defined in derived classes?
that is callback behaviour, not virtual functions.

according to perltoot: "proper OO design dictates that a subclass be allowed
to know about its immediate superclass, but never vice-versa."  ...however
it seems to me that when $self->init() is called in the c1->new() function,
the base class (super-class: c1) is calling it's derived class (subclass:
c2)'s methods!  I just don't get it.

> This is the whole point of inheritance.
>
> I think you probably don't understand fully how OO is supposed to
> work. Have you read the perltoot documentation? It explains all of
> this quite well.

hmm... I've looked at it a lot but I don't get it.  It seems to me that when
I call:

 my $self = $class->SUPER::new();

the base (super) class's constructor should get c1 as its first argument
since calling

 my $self = $class->new();

would pass it c2 as the 1st argument and that's the whole point of SUPER,
that I want to call the superclass's (base class) method.

- e





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

Date: Wed, 03 Mar 1999 01:50:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: method overriden!
Message-Id: <mz0D2.117$hc3.755@nswpull.telstra.net>

In article <1Z_C2.6597$8N5.70518@typhoon-sf.pbi.net>,
	"Ekkis" <ekkis@arix.com> writes:

> the call to the object $o's init() will resolve to c2::init(). But why
> should calls in a base class resolve to code defined in derived classes?
> that is callback behaviour, not virtual functions.

You're not calling init in the class c1 (in the c1::new() method). You
are calling $self->init(). $self has been blessed into class c2, so it
will call c2::init().

If you explicitly want to call c1::init(), you could do something
like:

	init($self, @_);

instead of

	$self->init(@_);

in the c1::new() method. It's not nice, but it will call the init
function in the class that the method is in, instead of method in the
class that the _object_ $self has been blessed into.

I wouldn't do it that way though (see my other post in another branch
of this thread), because it breaks proper inheritance, and you cannot
code your subclasses without knowing the internals of your superclass
anymore. It is much better to call SUPER in the method that needs the
SUPER's functionality. 

Again: Perl's OO model here is correct, and it behaves as it should. 

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


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

Date: 3 Mar 1999 03:23:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: method overriden!
Message-Id: <7bi9vl$1qi$2@client2.news.psi.net>

Ekkis (ekkis@arix.com) wrote on MMX September MCMXCIII in
<URL:news:1Z_C2.6597$8N5.70518@typhoon-sf.pbi.net>:
"" > When a method is called against an object, it will find the
"" > first method in the inheritance tree that fits, and it starts at the
"" > class level the object was blessed into. If you call a method against
"" > a class, it will start looking at the class you explicitly mention.
"" 
"" when you say "an object" you really mean the thing returned by c2->new() so
"" I can understand that if I say:
"" 
"" $o = c2->new();
"" $o->init();
"" 
"" the call to the object $o's init() will resolve to c2::init(). But why
"" should calls in a base class resolve to code defined in derived classes?
"" that is callback behaviour, not virtual functions.
"" 
"" according to perltoot: "proper OO design dictates that a subclass be allowed
"" to know about its immediate superclass, but never vice-versa."  ...however
"" it seems to me that when $self->init() is called in the c1->new() function,
"" the base class (super-class: c1) is calling it's derived class (subclass:
"" c2)'s methods!  I just don't get it.

The class isn't calling anything. '$self' is an object, and the fact
that '$self' is of a class that is a derived class of the current class
is totally irrelevant. You are calling the method 'init' in the object
$self. $self is of class 'c2'. Hence, c2::init () called.




Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: Tue, 2 Mar 1999 19:08:33 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: method overriden!
Message-Id: <fI1D2.6989$8N5.71936@typhoon-sf.pbi.net>

forgive me but I don't understand (a pattern that has recently begun to
emerge in my life - the more I know, the less I understand).

if I "snip" to whom I'm replying does that somehow affect your newsreader's
ability to thread the messages?  or how do you mean?  does it matter to whom
I'm rep;ying? am I not replying to the newsgroup?

> Please follow standard netiquette

could you point me to a FAQ where I can learn about this netiquette, I've
long been reading newsgroups and posting to them but have never consulted
such a reference, nor had anyone complain about my postings!

> and quote who you're replying to, as I do above.

maybe its a reader thing.  My newsreader puts the message being replied to
below the place where one writes (I'm leaving it untouched this time so you
see what I mean).  I clip this off since I extract only the pieces I want to
make reference to and since I don't want to compound the size of the text
with every new posting.  does that make sense?


Eric The Read wrote in message ...
>"Ekkis" <ekkis@arix.com> writes:
>
>You know, if you keep snipping who you're replying to, then it's
>impossible for the rest of us to tell.  Please follow standard
>netiquette, and quote who you're replying to, as I do above.
>
>> But why should calls in a base class resolve to code defined in derived
>> classes?  that is callback behaviour, not virtual functions.
>
>One begins to get the feeling you don't understand what is meant by
>"virtual functions", as that's *exactly* what is meant by that phrase.
>
>I don't know why you insist on contrasting it with "callback behaviour";
>a callback may or may not be a virtual function, but its behaviour is
>identical, regardless of what type of function is referenced.
>
>-=Eric




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

Date: 03 Mar 1999 04:41:10 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: method overriden!
Message-Id: <920436331.386740@thrush.omix.com>

[posted & mailed]

Ekkis <ekkis@arix.com> wrote:
	>snip<
: if I "snip" to whom I'm replying does that somehow affect your newsreader's
: ability to thread the messages?  or how do you mean?  does it matter to whom
: I'm rep;ying? am I not replying to the newsgroup?

	See how the first line of this message is "Ekkis <ekkis@arix.com>
	wrote:"?  That lets everyone know that all the lines with (in my
	case) ": " at the start of them are things you wrote.

: > Please follow standard netiquette
:

	This line was written by Eric The Read, but since you removed his
	name from your quoting no one would have been able to tell that.

: could you point me to a FAQ where I can learn about this netiquette,

	Everything in the group, "news.announce.newusers"

: I've long been reading newsgroups and posting to them but have never
: consulted such a reference, nor had anyone complain about my postings!

	No one should be allowed to post anything to USENET before reading
	every message in news.announce.newusers.

: > and quote who you're replying to, as I do above.
:
: maybe its a reader thing.

	Sorry to tell you this, but it's user error.

: My newsreader puts the message being replied to below the place where one
: writes (I'm leaving it untouched this time so you see what I mean).  I
: clip this off since I extract only the pieces I want to make reference to
: and since I don't want to compound the size of the text with every new
: posting.  does that make sense?

	Yes, it makes sense.  We only ask that you never remove the
	leading parts that look like this:

		Eric The Read wrote in message ...
		> "Ekkis" <ekkis@arix.com> writes:

	Thanks.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Tue, 2 Mar 1999 19:35:18 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: method overriden!
Message-Id: <k52D2.7004$8N5.72801@typhoon-sf.pbi.net>

Abigail wrote in message <7bi9vl$1qi$2@client2.news.psi.net>...
>Ekkis (ekkis@arix.com) wrote on MMX September MCMXCIII in
><URL:news:1Z_C2.6597$8N5.70518@typhoon-sf.pbi.net>:
>"" > When a method is called against an object, it will find the
>"" > first method in the inheritance tree that fits, and it starts at the
>"" > class level the object was blessed into. If you call a method against
>"" > a class, it will start looking at the class you explicitly mention.
>""
>"" when you say "an object" you really mean the thing returned by c2->new()
so
>"" I can understand that if I say:
>""
>"" $o = c2->new();
>"" $o->init();
>""
>"" the call to the object $o's init() will resolve to c2::init(). But why
>"" should calls in a base class resolve to code defined in derived classes?
>"" that is callback behaviour, not virtual functions.
>""
>"" according to perltoot: "proper OO design dictates that a subclass be
allowed
>"" to know about its immediate superclass, but never vice-versa."
 ...however
>"" it seems to me that when $self->init() is called in the c1->new()
function,
>"" the base class (super-class: c1) is calling it's derived class
(subclass:
>"" c2)'s methods!  I just don't get it.
>
>The class isn't calling anything. '$self' is an object, and the fact
>that '$self' is of a class that is a derived class of the current class
>is totally irrelevant. You are calling the method 'init' in the object
>$self. $self is of class 'c2'. Hence, c2::init () called.


Thank you Abigail. with everyone's help here on this group (and having had
to have my hand held through the process) I did figure it out.

- e




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

Date: Tue, 2 Mar 1999 18:47:54 -0800
From: "Ekkis" <ekkis@arix.com>
Subject: Re: method overriden!
Message-Id: <Wo1D2.6980$8N5.71975@typhoon-sf.pbi.net>

Martien,

thank you so very much for the time you've spent to walk me through this.  I
believe I'm starting to see the light!

what I want is something that Perl doesn't provide, a private function, but
as Eric pointed out, I can accomplish what I want via explicit scoping
syntax.

- e

Martien Verbruggen wrote in message ...
>In article <KNZC2.6463$8N5.70114@typhoon-sf.pbi.net>,
> "Ekkis" <ekkis@arix.com> writes:
>>>That's the point of objects! The object is of class 'c2', so for
>>>finding methods, it will first look in 'c2'. It finds init in the
>>>class 'c2', so c2::init is called, *not* c1::init.
>>
>>
>> when you say "the object" you really mean the thing returned by c2->new()
so
>> I can understand that if I say:
>>
>>     $o = c2->new();
>>     $o->init();
>>
>> the call will resolve to c2::init().  But why should calls in a base
class
>> resolve to code defined in derived classes?  that is callback behaviour,
not
>> virtual functions.
>
>I think your main problem exists in not realising what $self means in
>the c1::new sub. Let's look at the code:
>
>package c1;
>
>sub new {
>        my $proto = shift;
>        my $class = ref($proto) || $proto;
>        my $self = {};
>        bless($self, $class);
>        $self->init(@_);
>        return $self;
>        }
>
># rest of code omitted, see original article.
>
>When you do
> $o = c2->new();
>
>It calls the new method against the c2 class. The $proto in that new
>method is set to the class name, $class therefore is also set to the
>class (c2). You then call $class->SUPER->new(); The proto (the first
>argument passed to this method) will be 'c2', which is the value of
>$class. This means that you bless $self there, into the class c2, and
>the init method from c2 will be called.
>
>Proper inheritance should probably be done in a different way. Both
>classes should use the same constructor, and the inheriting classes
>don't define it. Any method that needs to call its SUPER's method does
>that explicitly. Something like:
>
>package c1;
>use strict;
>use Carp;
>
>sub new {
>        my $proto = shift;
> print "c1: Proto $proto\n";
>        my $class = ref($proto) || $proto;
> print "c1: Class $class\n";
>        my $self = {};
>        bless($self, $class);
> print "c1: self " . ref($self), "\n";
>        $self->init(@_);
>        return $self;
>        }
>
>sub init {
>        my $self = shift;
>
>        # init stuff
>        print "Class I: init()\n";
>        }
>
>1;
>
>package c2;
>use strict;
>
>@c2::ISA = ("c1");
>
>sub init {
>        my $self = shift;
> $self->SUPER::init();
>
>        # init stuff
>        print "Class II: init()\n";
>        }
>
>1;
>
>package main;
>
>my $o = c2->new();
>__END__
>c1: Proto c2
>c1: Class c2
>c1: self c2
>Class I: init()
>Class II: init()
>
>I believe that this is what you really want, and you just are trying
>to achieve it in a way that cannot be used for this without hardcoding
>class names. Proper inheritance shouldn't rely on that.
>
>Martien
>--
>Martien Verbruggen                      |
>Webmaster www.tradingpost.com.au        | "In a world without fences,
>Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
>NSW, Australia                          |




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

Date: Wed, 3 Mar 1999 01:14:54 -0800
From: "coyote38" <coyote38@pacbell.net>
Subject: Re: multiline write
Message-Id: <Y47D2.7093$8N5.76993@typhoon-sf.pbi.net>


I was learning about this myself, today.  If I understand your
problem correctly, you want to use several different formats for
a single output channel.  The name you give a format is not
necessarily the same as the name of the output channel
filehandle.  The variable $~ holds the name of the current
format and you specify the output filehandle in the write
command.  Here is a simple script to illustrate the fact.


################################
format LEFTFORMAT =
@<<<<<<<<<<<<<<<<<<  @<<<<<<<<<<<<<<<<<<  @<<<<<<<<<<<<<<<<<<
$value1,             $value2,             $value3
 .
################################
format RIGHTFORMAT =
@>>>>>>>>>>>>>>>>>>  @>>>>>>>>>>>>>>>>>>  @>>>>>>>>>>>>>>>>>>
$value1,             $value2,             $value3
 .
################################

$value1 = "Junk";
$value2 = "Crap";
$value3 = "Stuff";

$oldFileHandle = select(STDOUT);

$~ = "LEFTFORMAT";
write STDOUT;

$~ = "RIGHTFORMAT";
write STDOUT;

select($oldFileHandle);

################################

The output is:

Junk                 Crap                 Stuff
               Junk                 Crap                Stuff

This isn't explained very clearly in the Camel book nor in the
perdocs, but you can get a rough idea about this from perlform.

coyote38@pacbell.net







anna@water.ca.gov wrote in message <7bhpnc$kvn$1@nnrp1.dejanews.com>...
>I'm still trying to find my way around using formats for report output.
Any
>help would be appreciated.
>
>I have a format for each "paragraph" of the report, but I want to modify it
so
>there is a subtotal line for each paragraph.  I'm not certain how to do
that.
>
>Here's what the format looks like now:
>--------------------------------------
>
>format FLOW = ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  ~  $area2print
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  @<  @<<<<<<<<<<<<<<<<<<<<<<@>>  @>>>>>>>
>@>>>>>>>>  @>>>>>>>  @>>> $past,  $pstrm,  $pnote,  $pmonmflow,
>$pmonfiftyave,$pmonurun,$pmonper
>
>
>Excerpt from report:
>-------------------
>
>
>  SAN FRANCISCO BAY AREA  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  NAPA NEAR ST
>HELENA 38.0  18.9  38.0  201
>
>
>  CENTRAL COASTAL AREA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ARROYO SECO NEAR
>SOLEDAD  12.0  24.0  12.0  50  NACIMIENTO BELOW NACIMIENTO DAM 1.6  47.5
>41.9  88
>
>
>
>What I want the report to look like:
>-----------------------------------
>
>
>  SAN FRANCISCO BAY AREA  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  NAPA NEAR ST
>HELENA 38.0  18.9  38.0  201
>
>  =====  ===== =====  ===
>
>  38.0 18.9  38.0  201
>
>  CENTRAL COASTAL AREA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ARROYO SECO NEAR
>SOLEDAD  12.0  24.0  12.0  50  NACIMIENTO BELOW NACIMIENTO DAM 1.6  47.5
>41.9  88
>
>  =====  ===== =====  ===
>
>  13.6 71.5  53.9  75
>
>
>Thanks in advance for your reply,
>Anna
>
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: 2 Mar 1999 23:57:11 GMT
From: "oscka" <oscka@yahoo.com>
Subject: newbe looking for perl script
Message-Id: <01be6507$543b4720$57e5869f@epson>

hello there

I hope I am in the right place.

 I am looking for a perl script to send a html form to email and the form
whould appear on the users email client as a html form with form filled in
as same , rather than mailform which displays
name: erdt
address: users address

on the users email client.

I have read about sendmail -t doc.html but i cant seem to apply it.

Anybody know where I can get scripts which do this and will it be possable
to use/modify the script for a clients web page?

thanks in advance




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

Date: Wed, 03 Mar 1999 01:31:34 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: newbe looking for perl script
Message-Id: <36DC82E6.E418DDCA@ngb.se>

oscka wrote:
> 
> hello there
> 
> I hope I am in the right place.
> 
>  I am looking for a perl script to send a html form to email and the
> form whould appear on the users email client as a html form with form
> filled in as same , rather than mailform which displays 
> name: erdt
> address: users address

Well, the problem isn't mailform, it's you... No, that was mean. As has
been previously stated in the newsgroup, sendmail and mail in general
doesn't care what you send it. So if you send it html, you get html in
the mail client. 

So what you need to do is to modify mailform to output what you want it
to output. 

If you would like me to do it for you (at a reasonable fee), you can
contact me over email. Otherwise, I think it's a nice excercise, and
wish you good luck.

HTH
Staffan


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

Date: Tue, 02 Mar 1999 22:27:31 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Odd Experience
Message-Id: <36DCAC23.B46D4A47@erols.com>



Wally wrote:
> Perl is *not* write-only, I tell myself. But it LOOKS that way! :)

Well, here's a frightening experience. After coding C and C++ for ten
years, I have been using Perl exclusively for about nine months. I had
occasion the other day to start scanning 'C' code.

I was lost.

No information. Just no information. "What's a var, what's a function,"
I kept asking myself. I read a hundred lines of code and I just didn't
grok what was going on. It was so..., so...
BLAND!

Perl is hardly write-only. The more and more I use it, the more I
realize Larry's linguistics background is probably the most important
part of Perl.

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Wed, 03 Mar 1999 00:30:46 GMT
From: gareth@ibis.demon.co.uk (Gareth Jones)
Subject: Re: Please, An example of win32::NetResourse.
Message-Id: <36e9813a.9448812@news.demon.co.uk>

"Dave Roth" <xrxoxtxhxdx@xrxoxtxhx.xnxextx> wrote:

>RemoteName.
>There really is no need to use the other fields. If you wanted to specify a
>userid
>and password you would fill out both the Password and User parameters.
>Typically
>these parameters are left as empty strings so the connection is made using
>the current user's id and password. 

Dave,

Do you happen to know why AddConnection is implemented like this? If
you call it with zero length strings for the password / username, it
translates  them to nulls before invoking the api call. This seems to
me to be unnecessary (without the translation, I could just give nulls
for the username and password), and it prevents the use of
AddConnection for creating a null session. 

Gareth


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

Date: Wed, 3 Mar 1999 02:00:45 +0200
From: Alon Ziv <alonz@cs.technion.ac.il>
Subject: Q: How to run perl on WindowsNT without a window?
Message-Id: <Pine.SOL.4.05.9903030152080.15528-100000@csa.cs.technion.ac.il>

I'm trying to write a Perl script that will be invoked (indirectly) by the
Windows NT Explorer; this means it will not have a console when it's
invoked.  Some experimentation has shown that in this situation it will
open its own console window for STDIN and STDOUT.  Now, I know the script
will never use STDIN and STDOUT; is there any way I can get perl (or
WindowsNT) to *not* open this console window?

And a related question: I'd still would like my script to get user input,
either from STDIN *if it exists* (i.e., the script was run from the
command prompt) or by opening a window.  Does anyone have an idea how to
(a) detect if I have a real STDIN and (b) get user input using a window?
(currently I get user input by invoking an external utility which will
open an input window).

Thanks,
	--Alon Ziv

------------------------+----------------------------------------------------
  . __			| Phone: +972 3 5340753 (home), +972 3 9685882 (work)
 _|  /			| email: alonz@usa.net
/ | /_	Alon Ziv	| smail: 33 Ha-Rama St., Ganey Tiqwah 55900, Israel
------------------------+----------------------------------------------------
<<<(((this place reserved for that ultra-wise oneliner I haven't found.)))>>>



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

Date: Wed, 03 Mar 1999 00:21:18 GMT
From: charlottekane@hotmail.com
Subject: Re: The millennium cometh -- eventually
Message-Id: <7bhv9k$q1f$1@nnrp1.dejanews.com>

In article <19990302.105510.8E6.rnr.w164w@locutus.ofB.ORG>,
  Russell Schulz <Russell_Schulz@locutus.ofB.ORG> wrote:

[snip]

>   STOP USING A REPRESENTATION THAT IS UNNATURAL AND HARD TO UNDERSTAND
>   (as evidenced by people getting it wrong) AND JUST SAY THE NINETEEN
>   HUNDREDS!  THE NINETEEN HUNDREDS _are_ A CENTURY.  THE YEARS FROM
>   1000 THROUGH 1999 _are_ A MILLENIUM.  THEY'RE JUST NOT ONE THAT FIT
>   WELL INTO THE UNNATURAL AND HARD TO UNDERSTAND (as evidenced by
>   people getting it wrong) CENTURY SPLITS.
>
> stop writing functions that return year-1900.  stop saying `20th
> Century'.  stop whining about 2000 not being a change into a new
> millennium (because it is, though not one that's on the split between
> the 20th Century and the 21st Century).
>
> there.  is _my_ point clear?
>
> have you _ever_ seen anyone think 2000 is part of the 1900s?
> --
> Russell_Schulz@locutus.ofB.ORG  Shad 86c
>

Thank God!

I thought I was alone in trying to get through to people that 2000-2999 = 1000
years = a millennium.

I can't believe the emotional resistance such a simple concept runs up
against.

Keep fighting the good fight!

Charlotte Kane

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 2 Mar 1999 21:15:30 -0600
From: Doug Hughes <doug@eng.auburn.edu>
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <Pine.SOL.3.96.990302211205.9578A-100000@nexus.eng.auburn.edu>

On Tue, 2 Mar 1999, Bill Frisbee wrote:

> 
> John Kenyon <etljwk@etl.x.dmx.ericsson.se> wrote in message
> news:36DC1106.5DCDC5A9@etl.x.dmx.ericsson.se...
> >George Bonser wrote:
> >>
> >> Oh, give it a break. Every Sun SPARC or UltraSPARC machine ever built has
> a
> >> CPU serial number. So do most other brands of high-end machines. This is
> >> nothing new.
> >
> >You mean the host id, which is held in NVRAM, (which can be modified),
> >which was designed to allow licensing of software, rather than the
> >tracking of the person who was using it.
> >
> >The fact is that host id's existed a longtime before the Internet
> >went "mainstream". Given the current rate of "dumbing down" of
> >functionality, it is only a matter of time until this "host id"
> >techology gets misused.
> 
> Bah... Sun knows EVERYTIME I turn my system on tracked by that host id which
> is PART of the CPU and hardcoded to the CPU.
> 
> BTW it is a Ultra5 not really a high end machine, yet the cpu ID is easily
> retrieved by Sun. Intel is doing nothing new.
> 
You've been watching too many X-files, my poor deluded friend. The hostid
is stored in NVRAM which is easily changed if you know how. In fact, when
that little battery expires, your hostid goes bye-bye, which can be a
problem for people running licensing software like flexlm. You can swap
the NVRAM with another machine even (but I wouldn't do it with one of
a different architecture or things become quite dicey).  Oh, and how is
it that you believe that Sun gets this from you? (this should be quite
an enjoyable response).

-d



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

Date: Wed, 03 Mar 1999 00:06:03 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Urgent Help Please!? -->  Multiline Reading of data files...
Message-Id: <36DC7EC5.8C69E8DD@home.com>

[posted & mailed]

theo jones wrote:
> 
> I"m trying to munge a whole lotat data files of this nature:
> 
> bioFilename{first_m.html}
> bioFirst{FirstName}
> bioMiddle{M. }
> bioLast{LastName}
> bioContent{La La La La La, Yadda Yadda Yadda La La La La La, Yadda
> Yadda YaddaLa La La La La, Yadda Yadda YaddaLa La La La La, Yadda
> Yadda YaddaLa La La La La, Yadda Yadda YaddaLa La La La La, Yadda
> Yadda YaddaLa La La La La, Yadda Yadda YaddaLa La La La La, Yadda
> Yadda YaddaLa La La La La, Yadda Yadda Yadda}
> 
> I am experiencing extreme frustration however with the PERL script I
> was given to modify for this new set of data files.

I can see why.  Please use strict and -w in scripts that *you* write.

> 
> Here is the script, it does fine until it reaches the last field-value
> pair (which is multiline and contains html code sometimes), then will
> only read until it hits a \n character I am guessing:

It's too painful to study this code in detail but assuming that there
are no nested braces you could try a different record separator.

Based on what you've given as data, try "}\n".

    use strict;
    $/ = "}\n";

    while(<DATA>) {
        chomp;
        my ($fieldname, $content) = split /{/;
        # Do whatever processing here
    }

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Tue, 02 Mar 1999 22:18:46 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: URGENT help required!!
Message-Id: <36DCAA16.2459DE53@erols.com>

This is URGENT?

URGENT is a piece of code in production that has failed and is costing
you downtime and therefore money. But if you put this in production, you
get what you deserve and verce-visa.

URGENT is a programming assignment due next day that you haven't
started. See above about getting what you deserve.

URGENT is the need to pee as you pass the sign that says "Next Rest
Station, 50 miles."

This is not urgent.

Rich wrote:
> 
> On Mon, 1 Mar 1999 13:15:42 -0000, Richard Partridge <r.partridge@dewynters.com> wrote:
> >
> >I want my perl script to open a data file on a seperate webserver...
> >so I thought I could use something like
> >
> >(filehandle,">> http://www.somewhere.com/cgi-bin/datafile.txt");
> >
> >Is this legal perl as it doesn't seem to be working for me.....
> >
> 
>    Well, the first thing to do is learn the difference between a URL
> and a file name...
> 
> - Rich
> 
> --
> Rich Mulvey
> http://mulvey.dyndns.com
> Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Wed, 03 Mar 1999 01:23:32 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: y2k and 4-digit dates (was Re: foreach and while)
Message-Id: <36DC8104.3969549B@ngb.se>

Abigail wrote:
> Staffan Liljas (staffan@ngb.se) wrote on MMIX September MCMXCIII in
> <URL:news:36DC283A.4E261E27@ngb.se>:
> .. 4-digit years are appropriate where you have programs that you
> .. expect to deal with timespans around 1E3 years, and 2-digit years
> .. are fine when you're dealing with timespans of 1E1 years. The rest
> .. is implementation.
> 
> I would say 1E4 and 1E2 (10000 and 100) years.

I wouldn't. I was talking in magnitudes (note the 'around') if you have
a timespan that might be even the slightest bit over 1E2, you shouldn't
use two digit years. If you have timespans of magnitude 1E2 (100), you
should at least use three digits. If you have timespans of magnitude 1E4
(10000), you should at least use five digits. I'm sorry if I was
unclear.

> And a third and important case is when data is moved from an
> environment where the context is available, to one where it's not.

Agreed. That's why you shouldn't try to access the way the dates are
stored, but rather provide methods for the outside world to reach them.
That way the internal representation isn't of any importance. And if
such a method isn't written, you shouldn't take _anything_ for granted.
You'd need to study _really_ carefully what the program seems to do when
it stores the dates, and what dates come into the question. 

If we need to send the data to some other application, we should try to
use a format that is very independant of context, as a string containing
information of the type "AD 10893" or perhaps "Stardate 2046.4". Then
the other process has to convert this into its internal representation.

Staffan


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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