[15474] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2884 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 18:15:36 2000

Date: Thu, 27 Apr 2000 15:15:26 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956873725-v9-i2884@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 27 Apr 2000     Volume: 9 Number: 2884

Today's topics:
        Question about Warnings <DNess@Home.Com>
    Re: Question about Warnings <sariq@texas.net>
    Re: Question about Warnings <DNess@Home.Com>
    Re: Question about Warnings <tony_curtis32@yahoo.com>
    Re: Question about Warnings <sariq@texas.net>
    Re: Question about Warnings nobull@mail.com
    Re: Question about Warnings (Andrew Johnson)
    Re: Question about Warnings <DNess@Home.Com>
    Re: Question about Warnings <andrew.mcguire@walgreens.com>
    Re: Question about Warnings <DNess@Home.Com>
    Re: Question about Warnings <lr@hpl.hp.com>
    Re: Regular Expression Newbie <red_orc@my-deja.com>
    Re: script help! (Tad McClellan)
    Re: SDBM and tie schnurmann@my-deja.com
    Re: SDBM and tie schnurmann@my-deja.com
    Re: SDBM and tie <rootbeer@redcat.com>
    Re: SDBM and tie <rootbeer@redcat.com>
        STDIN <mrsparkle@gamerzuniverse.com>
    Re: STDIN <mjcarman@home.com>
    Re: STDIN <mrsparkle@gamerzuniverse.com>
    Re: STDIN <bmb@ginger.libs.uga.edu>
    Re: TCP/IP transfer timeout <akihabara@denno.gumi.com>
    Re: TCP/IP transfer timeout <flavell@mail.cern.ch>
    Re: using CPAN: what's all this junk!? jlamport@calarts.edu
    Re: Value of Reference <aqumsieh@hyperchip.com>
    Re: Value of Reference <rootbeer@redcat.com>
    Re: Value of Reference nobull@mail.com
    Re: Value of Reference <uri@sysarch.com>
    Re: Value of Reference <rootbeer@redcat.com>
    Re: Value of Reference nobull@mail.com
    Re: Value of Reference <rootbeer@redcat.com>
    Re: Value of Reference nobull@mail.com
    Re: Value of Reference (Andrew Johnson)
    Re: Windows Script Component using PerlScript goodjob666@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 27 Apr 2000 18:26:54 GMT
From: David Ness <DNess@Home.Com>
Subject: Question about Warnings
Message-Id: <39088675.F70E7D3B@Home.Com>

I am trying to be good and learn how to use `-w' effectively. Mostly this
has been an edifying learning experience. However, I do find that my
-w lists are `cluttered' with `used only once' warnings about variables
introduced to hold (properly unused) values returned from systems functions.
I assume there is something I should be doing instead. Can some one point
me in the appropriate direction to help me clean this up?


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

Date: Thu, 27 Apr 2000 13:31:46 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Question about Warnings
Message-Id: <39088792.26D595A1@texas.net>

David Ness wrote:
> 
> I am trying to be good and learn how to use `-w' effectively. Mostly this
> has been an edifying learning experience. However, I do find that my
> -w lists are `cluttered' with `used only once' warnings about variables
> introduced to hold (properly unused) values returned from systems functions.
> I assume there is something I should be doing instead. Can some one point
> me in the appropriate direction to help me clean this up?

Are you saying that you capture the exit status, then never look at it?

That doesn't make much sense to me.

- Tom


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

Date: Thu, 27 Apr 2000 18:44:08 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Question about Warnings
Message-Id: <39088A7E.EB438F17@Home.Com>

Tom Briles wrote:
> 
> David Ness wrote:
> >
> > I am trying to be good and learn how to use `-w' effectively. Mostly this
> > has been an edifying learning experience. However, I do find that my
> > -w lists are `cluttered' with `used only once' warnings about variables
> > introduced to hold (properly unused) values returned from systems functions.
> > I assume there is something I should be doing instead. Can some one point
> > me in the appropriate direction to help me clean this up?
> 
> Are you saying that you capture the exit status, then never look at it?
> 
> That doesn't make much sense to me.
> 
> - Tom
>

Um, no. I'm saying that when I `perl -w' lots of my long functioning code,
one thing I get a lot of is `xxx used only once' warnings. This is generally
on variables `xxx' that are variables returned from function calls like 
`stat(...)' on particular variables that I don't happen to need, but which
are a part of the function's normal return value.


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

Date: 27 Apr 2000 13:48:19 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Question about Warnings
Message-Id: <871z3rfki3.fsf@shleppie.uh.edu>

>> On Thu, 27 Apr 2000 18:44:08 GMT,
>> David Ness <DNess@Home.Com> said:

> Um, no. I'm saying that when I `perl -w' lots of my long
> functioning code, one thing I get a lot of is `xxx used
> only once' warnings. This is generally on variables
> `xxx' that are variables returned from function calls
> like `stat(...)' on particular variables that I don't
> happen to need, but which are a part of the function's
> normal return value.

Could you show a real example of this in action, or
possibly craft a small example to show the behaviour you're
referring to?

I think that would make things clearer.

hth
t


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

Date: Thu, 27 Apr 2000 13:53:40 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Question about Warnings
Message-Id: <39088CB4.62A47EB@texas.net>

David Ness wrote:
> 
> Tom Briles wrote:
> >
> > David Ness wrote:
> > >
> > > I am trying to be good and learn how to use `-w' effectively. Mostly this
> > > has been an edifying learning experience. However, I do find that my
> > > -w lists are `cluttered' with `used only once' warnings about variables
> > > introduced to hold (properly unused) values returned from systems functions.
> > > I assume there is something I should be doing instead. Can some one point
> > > me in the appropriate direction to help me clean this up?
> >
> > Are you saying that you capture the exit status, then never look at it?
> >
> > That doesn't make much sense to me.
> >
> > - Tom
> >
> 
> Um, no. I'm saying that when I `perl -w' lots of my long functioning code,

I have no idea what that clause means...

> one thing I get a lot of is `xxx used only once' warnings. This is generally
> on variables `xxx' that are variables returned from function calls like
> `stat(...)' on particular variables that I don't happen to need, but which
> are a part of the function's normal return value.

Hmmm...that's confusing.  An example would have helped, but I'm guessing
that you're looking for something like:

my ($mday, $mon, $year) = (localtime)[3..5];

You can also use 'undef' for values you don't need.

- Tom


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

Date: 27 Apr 2000 19:55:17 +0100
From: nobull@mail.com
Subject: Re: Question about Warnings
Message-Id: <u9snw71ii2.fsf@wcl-l.bham.ac.uk>

David Ness <DNess@Home.Com> writes:

> > Are you saying that you capture the exit status, then never look at it?
> > 
> > That doesn't make much sense to me.
> > 
> > - Tom
> >
> 
> Um, no. I'm saying that when I `perl -w' lots of my long functioning code,
> one thing I get a lot of is `xxx used only once' warnings. This is generally
> on variables `xxx' that are variables returned from function calls like 
> `stat(...)' on particular variables that I don't happen to need, but which
> are a part of the function's normal return value.

You can use undef in an lvalue context to avoid these errors.

  (undef,undef,$mode) = stat;

In recent versions of perl you can even use it with a my() on the LHS.
I got caught out the other day when I discovered that that didn't work
on older versions (may have been 5.4, not sure).

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 27 Apr 2000 19:18:23 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Question about Warnings
Message-Id: <3o0O4.8856$95.71198@news1.rdc1.mb.home.com>

In article <39088A7E.EB438F17@Home.Com>,
 David Ness <DNess@Home.Com> wrote:
[snip] 

> Um, no. I'm saying that when I `perl -w' lots of my long functioning code,
> one thing I get a lot of is `xxx used only once' warnings. This is generally
> on variables `xxx' that are variables returned from function calls like 
> `stat(...)' on particular variables that I don't happen to need, but which
> are a part of the function's normal return value.

I suspect you mean that you are doing something like:

#!/usr/bin/perl -w
$_ = 'firstname:middlename:lastname';
($fname, $mname, $lname) = split /:/;
print "$fname $lname\n";
__END__

Which warns that $mname is used only once. TMTOWTDI. First, you
needn't use a variable to hold something you aren't going to use, in
the above case you could use undef in place of $mname:

#!/usr/bin/perl -w
$_ = 'firstname:middlename:lastname';
($fname, undef, $lname) = split /:/;
print "$fname $lname\n";
__END__

Or, you can slice the list into just the elements you want prior
to assignment:

#!/usr/bin/perl -w
$_ = 'firstname:middlename:lastname';
($fname, $lname) = (split /:/)[0,2];
print "$fname $lname\n";
__END__

You can also declare your variables with my():

#!/usr/bin/perl -w
my($fname, $mname, $lname);
$_ = 'firstname:middlename:lastname';
($fname, $mname, $lname) = split /:/;
print "$fname $lname\n";
__END__

This doesn't produce a warning because $mname is seen twice -- once
in the declaration and once in the assignment. But that's still no
reason to actually create $mname and then not really use it -- think
about using one of the first two solutions AND declaring your
variables with my() and then you can add the 'strict' pragma to you
programs:

#!/usr/bin/perl -w
use strict;
my($fname, $lname);
$_ = 'firstname:middlename:lastname';
($fname, undef, $lname) = split /:/;
print "$fname $lname\n";
__END__

The strict pragma may well tell you about other questinable code in
your programs that you will have to fix. See the documentation on
strict via: perldoc strict. You'll also want to look up warnings and
errors in the perldiag manpage.

regards,
andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/epwp.html
      well, take it from an old hand: the only reason it would be easier
      to program in C is that you can't easily express complex problems 
      in C, so you don't.          -- Erik Naggum, on comp.lang.lisp


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

Date: Thu, 27 Apr 2000 19:24:44 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Question about Warnings
Message-Id: <39089403.400B41E@Home.Com>

nobull@mail.com wrote:
> 
> You can use undef in an lvalue context to avoid these errors.
> 
>   (undef,undef,$mode) = stat;
> 
> In recent versions of perl you can even use it with a my() on the LHS.
> I got caught out the other day when I discovered that that didn't work
> on older versions (may have been 5.4, not sure).
> 

That is a helpful answer. My only qualm about it is that I have a long
standing habit of `borrowing' old code to use as a basis for some piece
of new code, and that therefore there is some useful information in
   ($dev,$ino,$mode) = stat; 
even if $dev and $ino are not used in the current program. I will
try your `my()' suggestion, as that would be a good answer if it works
for my version of perl.

And particular thanks for understanding my question. I was beginning to
wonder ...


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

Date: Thu, 27 Apr 2000 14:31:33 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Question about Warnings
Message-Id: <39089595.614B8DBB@walgreens.com>

nobull@mail.com wrote:
> 
> David Ness <DNess@Home.Com> writes:
> 
> > > Are you saying that you capture the exit status, then never look at it?
> > >
> > > That doesn't make much sense to me.
> > >
> > > - Tom
> > >
> >
> > Um, no. I'm saying that when I `perl -w' lots of my long functioning code,
> > one thing I get a lot of is `xxx used only once' warnings. This is generally
> > on variables `xxx' that are variables returned from function calls like
> > `stat(...)' on particular variables that I don't happen to need, but which
> > are a part of the function's normal return value.
> 
> You can use undef in an lvalue context to avoid these errors.
> 
>   (undef,undef,$mode) = stat;

[ snip ]

If I understand what is going on here ( for some reason I cant see
the OP's reply to Tom ), why not just:

my $mday = (localtime)[3];

No messy undefing, just grab only what you need to begin with.

Regards,

anm
-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com


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

Date: Thu, 27 Apr 2000 20:08:20 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Question about Warnings
Message-Id: <39089E3A.BF56D927@Home.Com>

Andrew Johnson wrote:
>
[snip of a long and _very educational_ answer to my question]
> 
> This doesn't produce a warning because $mname is seen twice -- once
> in the declaration and once in the assignment. But that's still no
> reason to actually create $mname and then not really use it -- think
> about using one of the first two solutions AND declaring your
> variables with my() and then you can add the 'strict' pragma to you
> programs:
> 

As I have explained in my response to another helpful poster, I have
the habit (it may be a bad one, admittedly) of leaving the name there
as it avoids me having to re-look up the calling sequence if I reuse
the code. I hate to think about how many times a particular couple of
lines that I originally stole from an ascii copy of an ancient perl
document has been reproduced in my various programs over the years
(it was, of course, a call on `stat()').

> 
> regards,
> andrew
> 

Thank you for taking the time to write such a helpful and educational
response.


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

Date: Thu, 27 Apr 2000 13:20:43 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Question about Warnings
Message-Id: <MPG.137240f6b4d16b0398a999@nntp.hpl.hp.com>

In article <39089403.400B41E@Home.Com> on Thu, 27 Apr 2000 19:24:44 GMT, 
David Ness <DNess@Home.Com> says...

 ...

> That is a helpful answer. My only qualm about it is that I have a long
> standing habit of `borrowing' old code to use as a basis for some piece
> of new code, and that therefore there is some useful information in
>    ($dev,$ino,$mode) = stat; 
> even if $dev and $ino are not used in the current program. I will
> try your `my()' suggestion, as that would be a good answer if it works
> for my version of perl.

Ah.  You are using the '-w' flag but not using 'use strict;', so your 
variables are being assigned to but not referred to elsewhere.

Two possible solutions:

    Refer to them elsewhere.  For example, immediately ahead of the 
above line, insert this:

     ($dev,$ino,$mode) = ();

But that is gross!

   Much sounder, in the long run:  Declare your variables, as would be 
required if you used 'use strict;', as you should be doing in any case.  
For example, immediately ahead of the above line, insert this:

     my

Now the scope of the variables will be limited to the block in which 
they appear, which may be a Good Thing in itself.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 27 Apr 2000 18:18:38 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Regular Expression Newbie
Message-Id: <8ea09c$fr6$1@nnrp1.deja.com>

In article <0cc72f2a.121ad2c8@usw-ex0105-034.remarq.com>,
  Groman <gromanNOgrSPAM@thehelm.com.invalid> wrote:
> Hi!
> I know a little perl(been doing some basic scripts), but
> have never used regular expressions. I have The Little Black
> Book of perl, but it didn't really help me.
>
> Is there a tutorial on the net that will help me, understand
> regular expressions at least partially(to do some basic pattern
> matching).
>
> My current problem is the following:
>
> I have a file, that is structured this way:
> Number:Name:Text
> ..
> Number:Name:Text
>
> and I want to parse it with perl, the following way.
> I want to isolate all entries from the file with Number
> bigger than $maxnum
> Later, I want to neutralize all the \n /n \t /t and HTML tags in
> them.
> and print them to STDOUT.
>
> I can understand how to open a file. And dump it into an array
> of scalars. (or something)
> I can understand how to print it.
>
> But how the hell do I parse it???
>

have you looked at split?

perl -le 'print join(", ", split(/:/, "52:George Shaw:Caesar and
Cleopatra"))'

prints:

52, George Shaw, Caesar and Cleopatra



> Thanx.
>
> Groman.
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion
Network *
> The fastest and easiest way to search and participate in Usenet -
Free!
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 27 Apr 2000 16:21:07 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: script help!
Message-Id: <slrn8gh89j.rn.tadmc@magna.metronet.com>

On Wed, 26 Apr 2000 12:41:35 GMT, Someone Special <info@nowhere.com> wrote:
>On Tue, 25 Apr 2000 14:52:04 -0700, Tom Phoenix <rootbeer@redcat.com>
>wrote:
>
>>On Tue, 25 Apr 2000 dreiger@rnci.com wrote:
>>
>>> Subject: script help!
>>
>>> I am NOT any kind of programmer
>>
>>So, do you want to become a programmer, or to hire one? If you're looking
>>to become one, perhaps you should search for an introductory course on
>>programming. If you'd like to hire one, there are many newsgroups with
>>'jobs' in their names, or you could just visit your local Perl Mongers.
>>
>I think you missed the point - 


No, *you* have missed the point!

If we do your work for you, then you should send us your paycheck.

I missed where you agreed to do that.


>I don't plan to ever be a programmer,
>and have had this project dumped on me, with no options but to write
>this, or job hunt.  


Something has to give.

You cannot be "not a programmer" and modify programs.

If you modify programs, you _are_ a programmer, whether you
want to be one or not.



So your options reduce to:

   1) become enough of a programmer to get through the assigned job

or

   2) start mailing resumes


Good luck.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 27 Apr 2000 18:24:49 GMT
From: schnurmann@my-deja.com
Subject: Re: SDBM and tie
Message-Id: <8ea0ku$ge1$1@nnrp1.deja.com>

I see the error....

No, the docs do not make it clear at all.  In fact, the docs suck.  The
O'Reilly book "Programming in perl" is even worse.

I sure do miss the days when docs were well written and actually made
sense.....

In article <Pine.GSO.4.10.10004270927190.21722-
100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@redcat.com> wrote:
> On Thu, 27 Apr 2000 schnurmann@my-deja.com wrote:
>
> > If I tie a hash to an sdbm file, do I have to do anything beyond
> >
> > $myhash->{'key]} = value;
> >
> > to store the data?
>
> Well, I'm sure you see the syntax error in your line, so I won't
point it
> out to you. :-)
>
> But don't the docs make this clear? Is something not working as you
think
> it should?
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 27 Apr 2000 18:30:33 GMT
From: schnurmann@my-deja.com
Subject: Re: SDBM and tie
Message-Id: <8ea10a$gr4$1@nnrp1.deja.com>

And this doesn't even create the file...

use fcntl;
use SDBM_File;

print "Start\n";

tie %hash, "SDBM_File", "NewsDB", O_RDWR|O_CREAT, 0644;

$hash{'Key1'} = 'asdasd';

untie %hash;
print "End\n";


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 27 Apr 2000 11:50:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: SDBM and tie
Message-Id: <Pine.GSO.4.10.10004271148410.21722-100000@user2.teleport.com>

On Thu, 27 Apr 2000 schnurmann@my-deja.com wrote:

> No, the docs do not make it clear at all.  In fact, the docs suck.  
> The O'Reilly book "Programming in perl" is even worse.

Well, you're entitled to your opinion; I won't try to argue the point.

So, have you contributed your documentation patches to perlbug yet?

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 27 Apr 2000 12:06:54 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: SDBM and tie
Message-Id: <Pine.GSO.4.10.10004271204350.21722-100000@user2.teleport.com>

On Thu, 27 Apr 2000 schnurmann@my-deja.com wrote:

> And this doesn't even create the file...
> 
> use fcntl;

Doesn't your copy of perl give you a helpful error message when you use
this line? Mine says:

    Can't locate fcntl.pm in @INC ....

Fixing that line to have a capital letter in the right place does let your
program create a file on my machine. In fact, it creates a pair of them.

Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 27 Apr 2000 14:06:42 -0400
From: "Brian Smith" <mrsparkle@gamerzuniverse.com>
Subject: STDIN
Message-Id: <sgh0bedjqtj97@corp.supernews.com>

Is <STDIN>  a real thing or just a thing in perl books to tell you to inert
html field? Sorry, Im  "newbie"...

--
================================
Brian Smith                                                    =
News Correspondent                                     =
eMail: Brian@GlideUnderground.com            =
ICQ: 36232576                                             =
www.GlideUnderground.com                          =
================================




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

Date: Thu, 27 Apr 2000 13:22:40 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: STDIN
Message-Id: <39088570.39DD0C95@home.com>

Brian Smith wrote:
> 
> Is <STDIN>  a real thing or just a thing in perl books to tell you 
> to inert html field? Sorry, Im  "newbie"...

Yes, STDIN is real. It's the filehandle used to read from standard
input. (Typically the keyboard, but not necessarily so.) Cf. STDOUT
(standard output, typically your terminal) and STDERR (standard error,
again usually your terminal).

These all have nothing inherently to do with "inert html." (?)

-mjc


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

Date: Thu, 27 Apr 2000 15:14:49 -0400
From: "Brian Smith" <mrsparkle@gamerzuniverse.com>
Subject: Re: STDIN
Message-Id: <sgh4b9uaqtj80@corp.supernews.com>

I ment to type insert html field.. like a form field.. I'm just a little
tense today.. For some reason my server is not liking my test scripts..
Michael Carman <mjcarman@home.com> wrote in message
news:39088570.39DD0C95@home.com...
> Brian Smith wrote:
> >
> > Is <STDIN>  a real thing or just a thing in perl books to tell you
> > to inert html field? Sorry, Im  "newbie"...
>
> Yes, STDIN is real. It's the filehandle used to read from standard
> input. (Typically the keyboard, but not necessarily so.) Cf. STDOUT
> (standard output, typically your terminal) and STDERR (standard error,
> again usually your terminal).
>
> These all have nothing inherently to do with "inert html." (?)
>
> -mjc




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

Date: Thu, 27 Apr 2000 16:33:00 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: STDIN
Message-Id: <Pine.A41.4.10.10004271631210.14050-100000@ginger.libs.uga.edu>

On Thu, 27 Apr 2000, Brian Smith wrote:

> I ment to type insert html field.. like a form field.. I'm just a little
> tense today.. For some reason my server is not liking my test scripts..
> Michael Carman <mjcarman@home.com> wrote in message
> news:39088570.39DD0C95@home.com...
> > Brian Smith wrote:
> > >
> > > Is <STDIN>  a real thing or just a thing in perl books to tell you
> > > to inert html field? Sorry, Im  "newbie"...
> >
> > Yes, STDIN is real. It's the filehandle used to read from standard
> > input. (Typically the keyboard, but not necessarily so.) Cf. STDOUT
> > (standard output, typically your terminal) and STDERR (standard error,
> > again usually your terminal).
> >
> > These all have nothing inherently to do with "inert html." (?)
> >
> > -mjc

While you're at it, be sure not to confuse the Perl "diamond operator",
<>, or <STDIN>, etc., with the html/sgml <TAG> construct.  They are not
related in any way.

--
Brad



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

Date: Fri, 28 Apr 2000 02:50:39 +0900
From: "Akihabara" <akihabara@denno.gumi.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <8e9ulg$21c4$1@news1.md.xaxon.ne.jp>

> Sure! Look in section eight for "How do I timeout a slow event?". Enjoy!

OK.I'll read it carefully.

Thank you for all!





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

Date: Thu, 27 Apr 2000 19:54:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: TCP/IP transfer timeout
Message-Id: <Pine.GHP.4.21.0004271954250.28438-100000@hpplus01.cern.ch>

On Fri, 28 Apr 2000, Akihabara wrote:

> please answer my question not by show faq but by concrete answer.

Please develop a more appropriate attitude to usenet resources.



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

Date: Thu, 27 Apr 2000 21:24:42 GMT
From: jlamport@calarts.edu
Subject: Re: using CPAN: what's all this junk!?
Message-Id: <8eab68$sr6$1@nnrp1.deja.com>

In article <slrn8gbmrp.5pk.tadmc@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
>
> That might imply that your Question is Asked Frequently.
>
>    perldoc -q module
>
>    "How do I keep my own module/library directory?"
>

perldoc doesn't understand the -q switch on my system.  Can you point me
to some other resource for locating relevant entries in the FAQ?  I spent
nearly twenty minutes trying to find something useful in that rat's nest
they call a FAQ over at www.perl.com -- to no avail.  I, of all people,
would *much* rather RTFM than post questions to a newsgroup, but first I
need to *find* TFM...

-jason


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 27 Apr 2000 18:08:28 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Value of Reference
Message-Id: <7ad7nb8lic.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>


Samay <samay1NOsaSPAM@hotmail.com.invalid> writes:

> try this print statements
> 
> $\="\n";
> print eval ([]+0);
> print eval({}+0);
> print eval(sub {}+0);
> 
> When evaluated in 'numerical context' it gives some number..
> It may have something to do with memory address converted from
> hex into decimal.

That is true.

> Anyone can explain this behavior?
> Is it reference anywhere in Perl documents, books??

I think I saw it somewhere before, but I can't seem to find it now.

> How we can 'use' this behavior in the program. Any ideas?

Actually, IIRC this was introduced as a way to enhance the comparison
of whether two references are referring to the same thingy or
not. This allows you to do something like:

	if ($ref1 == $ref2) {
		print "YOOHOO";
	}

instead of comparing the string representation of the references
(which look something like: SCALAR(0x80e167c) ):

	if ($ref1 eq $ref2) {
		print "YEEHAA";
	}

I believe the former solution is much faster.

--Ala


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

Date: Thu, 27 Apr 2000 11:11:51 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Value of Reference
Message-Id: <Pine.GSO.4.10.10004271108390.21722-100000@user2.teleport.com>

On 27 Apr 2000 nobull@mail.com wrote:

> What logical sequence of steps starting at perlfunc will lead to the
> documentation of the behaviour of a reference in a numeric context?

I was trying to refer the OP to the entry on eval of a string. Perhaps
that was the wrong thing to do, but it seemed appropriate.

> Please note: every time you "cry wolf" with an RTFM that directs
> someone to a manual that doesn't answer their question you increase
> the chance that valid RTFM responses will be ignored or resented.

Of course, the behavior of a reference in a numeric context is in the
docs, even if you won't find it in perlfunc. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 27 Apr 2000 19:30:44 +0100
From: nobull@mail.com
Subject: Re: Value of Reference
Message-Id: <u9vh131jmz.fsf@wcl-l.bham.ac.uk>

nobull@mail.com writes:

> Tom Phoenix <rootbeer@redcat.com> writes:
> 
> > On Thu, 27 Apr 2000, Samay wrote:
> > > Anyone can explain this behavior?
> > > Is it reference anywhere in Perl documents, books??
> > 
> > Yes. Start with perlfunc.
> 
> OK Tom, I call your bluff.
> 
> What logical sequence of steps starting at perlfunc will lead to the
> documentation of the behaviour of a reference in a numeric context?

BTW, I've now found a parenthetic reference to this behaviour in
"perlreftut" but as far as I know that's it, no mention in the perlref
manpage (and certainly none in the perlfunc manpage).

                                                  ...you can
           use eq to see if two references refer to the same
           thing.  (But you should usually use == instead because
           it's much faster.)

So this clearly(?!) states that two references will have the same
numeric value iff they are references to the same thing.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 27 Apr 2000 18:50:13 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Value of Reference
Message-Id: <x766t32xaz.fsf@home.sysarch.com>

>>>>> "n" == nobull  <nobull@mail.com> writes:

  n> Samay <samay1NOsaSPAM@hotmail.com.invalid> writes:

  >> When evaluated in 'numerical context' it gives some number..
  >> It may have something to do with memory address converted from
  >> hex into decimal.

  >> How we can 'use' this behavior in the program. Any ideas?

very simple, it is used to compare refs. previously all refs were
converted to strings and then they could be compared. by converting to a
number instead, the conversion and subsequent comparison is much faster.

as a side effect, you can now get inside perl internal data (with the
pack p format) and do VERY UGLY BLACK MAGIC. a while back on p5p,
someone showed how to hide data inside perl scalars and get it back
later. nasty evil code.

now you may ask why you compare refs but that is another question and has
a much more complex answer which i can't fit into this small emacs
email buffer. :-)

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 27 Apr 2000 12:09:15 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Value of Reference
Message-Id: <Pine.GSO.4.10.10004271208030.21722-100000@user2.teleport.com>

On 27 Apr 2000 nobull@mail.com wrote:

> BTW, I've now found a parenthetic reference to this behaviour in
> "perlreftut" but as far as I know that's it, no mention in the perlref
> manpage (and certainly none in the perlfunc manpage).
> 
>                                                   ...you can
>            use eq to see if two references refer to the same
>            thing.  (But you should usually use == instead because
>            it's much faster.)

I've got to agree with you; this is an under-documented feature. Have you
submitted the documentation patch to perlbug yet? Thanks!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 27 Apr 2000 20:10:39 +0100
From: nobull@mail.com
Subject: Re: Value of Reference
Message-Id: <u9r9br1hsg.fsf@wcl-l.bham.ac.uk>

Tom Phoenix <rootbeer@redcat.com> writes:
> On 27 Apr 2000 nobull@mail.com wrote:
> 
> I was trying to refer the OP to the entry on eval of a string. Perhaps
> that was the wrong thing to do, but it seemed appropriate.

It is appropriate to point out when an example put forward to
illustrate one question indicates a misunderstanding of another
unrelated matter.  It is, however, inappropriate to represent this
as the answer to the question.

> > Please note: every time you "cry wolf" with an RTFM that directs
> > someone to a manual that doesn't answer their question you increase
> > the chance that valid RTFM responses will be ignored or resented.
> 
> Of course, the behavior of a reference in a numeric context is in the
> docs, even if you won't find it in perlfunc. Cheers!

I call your bluff again.

I've found one parenthetic reference in perlreftut but IMNSHO stuff
mentioned only in tutorials and not the reference manuals counts as
undocumented.

Where is this formally documented in the standard 5.5 documentation?

Cheers!

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 27 Apr 2000 12:47:46 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Value of Reference
Message-Id: <Pine.GSO.4.10.10004271244190.21722-100000@user2.teleport.com>

On 27 Apr 2000 nobull@mail.com wrote:

> It is appropriate to point out when an example put forward to
> illustrate one question indicates a misunderstanding of another
> unrelated matter.  It is, however, inappropriate to represent this as
> the answer to the question.

Fair enough. I apologize if my response seemed to be doing that, as that
was not my intention.

> > Of course, the behavior of a reference in a numeric context is in the
> > docs, even if you won't find it in perlfunc. Cheers!
> 
> I call your bluff again.
> 
> I've found one parenthetic reference in perlreftut but IMNSHO stuff
> mentioned only in tutorials and not the reference manuals counts as
> undocumented.

I humbly disagree. In that case, it counts as being _under_documented. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 27 Apr 2000 20:30:43 +0100
From: nobull@mail.com
Subject: Re: Value of Reference
Message-Id: <u9purb1gv0.fsf@wcl-l.bham.ac.uk>

Tom Phoenix <rootbeer@redcat.com> writes:

> I've got to agree with you; this is an under-documented feature. Have you
> submitted the documentation patch to perlbug yet?

Yes.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 27 Apr 2000 20:55:40 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Value of Reference
Message-Id: <gP1O4.9067$95.71444@news1.rdc1.mb.home.com>

In article <Pine.GSO.4.10.10004271208030.21722-100000@user2.teleport.com>,
 Tom Phoenix <rootbeer@redcat.com> wrote:
> On 27 Apr 2000 nobull@mail.com wrote:
> 
> > BTW, I've now found a parenthetic reference to this behaviour in
> > "perlreftut" but as far as I know that's it, no mention in the perlref
> > manpage (and certainly none in the perlfunc manpage).
> > 
> >                                                   ...you can
> >            use eq to see if two references refer to the same
> >            thing.  (But you should usually use == instead because
> >            it's much faster.)
> 
> I've got to agree with you; this is an under-documented feature. Have you
> submitted the documentation patch to perlbug yet? Thanks!

FYI, this is in 5.6.0's perlref manpage:

       Using a string or number as a reference produces a sym-
       bolic reference, as explained above.  Using a reference as
       a number produces an integer representing its storage
       location in memory.  The only useful thing to be done with
       this is to compare two references numerically to see
       whether they refer to the same location.

           if ($ref1 == $ref2) {  # cheap numeric compare of references
               print "refs 1 and 2 refer to the same thing\n";
           }

       Using a reference as a string produces both its referent's
       type, including any package blessing as described in the
       perlobj manpage, as well as the numeric address expressed
       in hex.  The ref() operator returns just the type of thing
       the reference is pointing to, without the address.  See
       the ref entry in the perlfunc manpage for details and
       examples of its use.

andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/epwp.html
      They're not soaking, they're rusting!
          -- my wife on my dishwashing habits
      


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

Date: Thu, 27 Apr 2000 18:33:21 GMT
From: goodjob666@my-deja.com
Subject: Re: Windows Script Component using PerlScript
Message-Id: <8ea15h$h3l$1@nnrp1.deja.com>


> I'm trying to implement a Windows Script component using PerlScript.
> When I attempt to register the component, I get a runtime error from
> regsvr32.exe of:  abnormal program termination.  This happens even
> when I try the "SayHello" example in the ActiveState documentation.
> If I remove the part having to do with PerlScript, it will register
> successfully.

Are you using build 613?

> Does anyone know if regsvr32 on Windows2000 can actually register a
> PerlScript?

It should work with 613. It does not work with 522. Try regsvr32 on
PerlSE.dll in the Perl/bin/ directory first, then register the Windows
Script Component. It is used like this in an XML page, right?

<%@Language=PerlScript%>
<%
    $obj = $Server->CreateObject('Easy.WSC');
    $retval = $obj->SayHello("Hello World");

    $Response->Write($retval);
%>

If it fails to work, file a bug report with http://bugs.ActiveState.com.


Jon


Sent via Deja.com http://www.deja.com/
Before you buy.


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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


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


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