[30406] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1649 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 17 09:14:33 2008

Date: Tue, 17 Jun 2008 06:14:20 -0700 (PDT)
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 Jun 2008     Volume: 11 Number: 1649

Today's topics:
    Re: Learning Perl <gremoveord.c.e@gmail.com>
    Re: Learning Perl <g....c.e@gmail.com>
    Re: Learning Perl <szrRE@szromanMO.comVE>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <g....c.e@gmail.com>
    Re: Learning Perl <allergic-to-spam@no-spam-allowed.org>
    Re: Learning Perl <allergic-to-spam@no-spam-allowed.org>
    Re: Learning Perl <allergic-to-spam@no-spam-allowed.org>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <allergic-to-spam@no-spam-allowed.org>
    Re: Learning Perl <whynot@pozharski.name>
    Re: Learning Perl <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 16 Jun 2008 20:24:24 -0700
From: "Gordon Corbin Etly" <gremoveord.c.e@gmail.com>
Subject: Re: Learning Perl
Message-Id: <6bop3aF3d73cfU1@mid.individual.net>

Uri Guttman wrote:
>>>>>> "GCE" == Gordon Corbin Etly <gord.REMOVE.c.e@gmail.com> writes:

> > > C:\> perl -we "my @arr; print int(defined(@arr)), qq{\n}"
> > > defined(@array) is deprecated at -e line 1.
> > > (Maybe you should just omit the defined()?)
> > > 0

> > Maybe it's depreciated, but it still serves to illustrate the
> > point that the array or hash, before being initialized, are
> > undefined in any sense of the word. So maybe it's not literally
> > "undef", it might as well be.

> do you know what DEPRECATED means? it ain't depreciated. caps were
> used to help the learning handicapped.

Do you really have to insult people over a silly typo? Is it possible 
for you to carry a civil conversation?


> > Why are they removing this behavior? It seems logical that defined()
> > should return false on anything that hasn't yet be defined, no?

> you don't get it. perhaps you never will. will you google and learn?
> will you learn to google? or do you need goggles? or do you gurgle?

What get what? You seem to be scared to stick to the actual points and 
generate an actual constructive response, rather than insulting the 
other party because you either don't agree with or you're incapable of 
seeing a differing point of view on something you may be knowledgeable 
about.

Oh, and I gurgle Listerine in the morning. Google is for the rest of the 
day.


> > I really think you need some anger management classes; this is not
> > how one conducts a civil conversation.

> you need learning glasses (sic).

So much for civil discussion.... I see you are not capable of that... 
*sigh*


-- 
G. C. Etly 




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

Date: Mon, 16 Jun 2008 20:49:29 -0700
From: "Gordon Corbin Etly" <g....c.e@gmail.com>
Subject: Re: Learning Perl
Message-Id: <6boqiaF3cvl1bU1@mid.individual.net>

Uri Guttman wrote:
>>>>>> "GCE" == Gordon Corbin Etly <gremoveord.c.e@gmail.com> writes:
> > Uri Guttman wrote:
> >>>>>>> "GCE" == Gordon Corbin Etly <gord.c.e@gmail.com> writes:
> > > > Uri Guttman wrote:

> > > you on the other hand just flame about other posters and their
> > > posting

> > This is a bold faced lie. I have made comments, as anyone has the
> > right to do, but it's the likes of you that do any flaming in
> > retaliation like a child having a tantrum after being criticized
> > or his friend being criticized. Is it any wonder that any time I
> > enter a conversation it's people like you who turn anything I say
> > upside down when all I was doing was attempting to conduct civil
> > conversation?

> nyah! nyah! nyah!

Thank you for the mature and caring response. I wish everyone was just 
like you...


> > > style and the few times you talk perl, you are just as likely to
> > > be wrong as right.

> > Another false generalization. You do not know me nor my knowledge
> > of Perl. I really wish you'd stop with your personal vendetta and
> > character assassination attempts just because you don't agree
> > with the way I write things.

> it isn't personal. it is a professional vendetta. i help get people
> perl jobs. i need to know perl and people. you are neither a perl nor
> a people.

"a perl" ??!

Why are you making blind assumptions? I happen to know Perl quite well, 
and I hope that when you get someone a job you at least write the name 
of the language as a proper noun.


> > > just some musings as i crash and burn at yapc. why aren't you here
> > > learning more perl?

> > Like many people I've been using Perl for many many years and
> > learning is something I never stop doing.

> years of perl and you didn't know about arrays and undef? or defined?

Why are you assuming I didn't know about that? I was attempting to make 
civil discussion about a point stemming from Ben Bullock's comments 
which I still believe has some validity.


> you might want to find a better teacher. of course i won't be
> that one as i teach those that want to learn.

My university didn't have Perl in it's curriculum, and most of my 
technical and programing knowledge came from good old fashioned self 
learning by using documnetation, online resources, man/info/help etc, 
trial and error, testing things out, building my own systems and 
applications, using avilable tools. Also, reading various message boards 
and groups and occasionally asking questions, and when I did go through 
colledge I was quite a ways ahead of most people because of it.

Oh yeah, If I didn't want to learn, I wouldn't be where I am right now - 
I do lots of technical contract work, am financially independent. I have 
the complete freedom to make up my own schedules rather be tied to a 5-9 
schedule. Does this sound like someone who doesn't want to learn?

Or maybe you should stop pretending you know someone and make an ass of 
your self by insulting them every chance you get.


-- 
G. C. Etly 




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

Date: Mon, 16 Jun 2008 20:58:27 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Learning Perl
Message-Id: <g37cp4011uv@news4.newsguy.com>

Uri Guttman wrote:
>>>>>> "s" == szr  <szrRE@szromanMO.comVE> writes:
>
>  s> Uri Guttman wrote:
[...]
>  >>> See above; scalar, array, hash, they are defined until they are,
>  >>> well, defined, so until then, they are undef. I'm not sure when
>  >>> this uddenly became a lost mystery.
>  >>
>  >> @array = () is defined but empty. defined on aggregates is
>  >> meaningless >> and useless.
>
>  s> I disagree that it's useless. To me it behaves as expected; if was
>  s> defined in any way since the point from which it was declared,
>  s> then I would expect defined to return true, else false if it
>  s> hasn't been defined yet, or explicitly undefined by using undef().
>
> as i said, google for threads on agregates and defined. plenty said
> already and i won't repeat it again.

But you didn't really address my reply. I will look up that thread, but 
could you at least comment on why that behavior is not what one would 
expect? Like I said, defined() returning false for any array or hash 
that hasn't been yet defined makes sense to me. I just don't see why 
that behavior is being removed if it isn't hurting anything.

-- 
szr 




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

Date: Tue, 17 Jun 2008 04:48:06 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7k5goacqh.fsf@mail.sysarch.com>

>>>>> "GCE" == Gordon Corbin Etly <g....c.e@gmail.com> writes:

  GCE> Why are you making blind assumptions? I happen to know Perl quite well, 
  GCE> and I hope that when you get someone a job you at least write the name 
  GCE> of the language as a proper noun.

my cat knows perl better than you. and she is a dumb cat!

  >> years of perl and you didn't know about arrays and undef? or defined?

  GCE> Why are you assuming I didn't know about that? I was attempting to make 
  GCE> civil discussion about a point stemming from Ben Bullock's comments 
  GCE> which I still believe has some validity.

nope. you made wrong statements about arrays and defined. then you tried
to back them up when the docs said you were wrong. not only don't you
know perl, you don't know when to stop babbling on when you are wrong.

tell me what this will print before you run it. and after you run it
please come back and beg forgiveness for your thickheadedness on why
defined makes no sense on arrays.

use strict ;
use warnings ;

foreach ( 1 .. 3 ) {

	my @array ;
	print "defined $_\n" if defined @array ;
	print "empty $_\n" unless @array ;
	@array = (1) ;
}
  GCE> My university didn't have Perl in it's curriculum, and most of my
  GCE> technical and programing knowledge came from good old fashioned
  GCE> self learning by using documnetation, online resources,
  GCE> man/info/help etc, trial and error, testing things out, building
  GCE> my own systems and applications, using avilable tools. Also,
  GCE> reading various message boards and groups and occasionally asking
  GCE> questions, and when I did go through colledge I was quite a ways
  GCE> ahead of most people because of it.

and i went to college before perl was created. so what?? i was also self
taught in perl. so what? i haven't take a programming class in 30 years?
so what? i train perl developers. that's what. 

  GCE> Oh yeah, If I didn't want to learn, I wouldn't be where I am
  GCE> right now - I do lots of technical contract work, am financially
  GCE> independent. I have the complete freedom to make up my own
  GCE> schedules rather be tied to a 5-9 schedule. Does this sound like
  GCE> someone who doesn't want to learn?

your act is of someone who thinks they know more than they do. that is
obnoxious to an extreme. you make mistakes here (which isn't the
problem) but you don't accept feedback nor own up to them. that is the
problem. if the p5p think defined is bad enough on aggregates to
deprecate it (NOT DEPRECIATE IT! did you learn english in college?) then
you would think they know more about perl than you do. yet you defend a
broken concept without even understanding it well. let's see the result
you think you get from the above code.
 
  GCE> Or maybe you should stop pretending you know someone and make an
  GCE> ass of your self by insulting them every chance you get.

i don't pretend to know you. you are clear by your actions and poor perl
skills here. how about you paste some of your best paid perl work. i
won't have to work hard to shred it. go ahead, i triple dog dare ya!!
and if you want shred mine, be my guest. i always am open to
constructive feedback. my cpan id is URI and there is plenty of code there.

i will be waiting in the center of town at high noon!

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 04:48:46 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7fxrcacpd.fsf@mail.sysarch.com>

>>>>> "s" == szr  <szrRE@szromanMO.comVE> writes:

  >> as i said, google for threads on agregates and defined. plenty said
  >> already and i won't repeat it again.

  s> But you didn't really address my reply. I will look up that thread, but 
  s> could you at least comment on why that behavior is not what one would 
  s> expect? Like I said, defined() returning false for any array or hash 
  s> that hasn't been yet defined makes sense to me. I just don't see why 
  s> that behavior is being removed if it isn't hurting anything.

see my example in a reply to the gordon troll. it will show you why.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 04:50:51 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7bq20aclw.fsf@mail.sysarch.com>

>>>>> "GCE" == Gordon Corbin Etly <gremoveord.c.e@gmail.com> writes:

  GCE> Uri Guttman wrote:
  >>>>>>> "GCE" == Gordon Corbin Etly <gord.REMOVE.c.e@gmail.com> writes:

  >> > > C:\> perl -we "my @arr; print int(defined(@arr)), qq{\n}"
  >> > > defined(@array) is deprecated at -e line 1.
  >> > > (Maybe you should just omit the defined()?)
  >> > > 0

  >> > Maybe it's depreciated, but it still serves to illustrate the
  >> > point that the array or hash, before being initialized, are
  >> > undefined in any sense of the word. So maybe it's not literally
  >> > "undef", it might as well be.

  >> do you know what DEPRECATED means? it ain't depreciated. caps were
  >> used to help the learning handicapped.

  GCE> Do you really have to insult people over a silly typo? Is it possible 
  GCE> for you to carry a civil conversation?

typo? it is an entirely different word. and you did it again in another
post. this isn't a typo then.

  GCE> So much for civil discussion.... I see you are not capable of that... 
  GCE> *sigh*

i am civil with civil warriors. or with civil lawyers. or with the
civil liberties union. i am not civil with fools.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Mon, 16 Jun 2008 22:02:34 -0700
From: "Gordon Corbin Etly" <g....c.e@gmail.com>
Subject: Re: Learning Perl
Message-Id: <6bourbF3c86a8U1@mid.individual.net>

Uri Guttman wrote:
>>>>>> "GCE" == Gordon Corbin Etly <gremoveord.c.e@gmail.com> writes:

>> Uri Guttman wrote:
>  >>>>>>> "GCE" == Gordon Corbin Etly <gord.REMOVE.c.e@gmail.com>
> writes:

> > > > > C:\> perl -we "my @arr; print int(defined(@arr)), qq{\n}"
> > > > > defined(@array) is deprecated at -e line 1.
> > > > > (Maybe you should just omit the defined()?)
> > > > > 0

> > > > Maybe it's depreciated, but it still serves to illustrate the
> > > > point that the array or hash, before being initialized, are
> > > > undefined in any sense of the word. So maybe it's not literally
> > > > "undef", it might as well be.

> > > do you know what DEPRECATED means? it ain't depreciated. caps were
> > > used to help the learning handicapped.

> > Do you really have to insult people over a silly typo? Is it 
> > possible
> > for you to carry a civil conversation?

> typo? it is an entirely different word. and you did it again in
> another post. this isn't a typo then.

So now you're the keeper of what is and isn't a typo? Give it a break.

It was a typo, one I didn't even realize I was making. Why does the fate 
of the world suddenly hinge on it? I have been in and out quote a bit 
today, so excuse me for making such an Earth shattering error.


> > So much for civil discussion.... I see you are not capable of 
> > that...
> > *sigh*

> i am civil with civil warriors. or with civil lawyers. or with the
> civil liberties union. i am not civil with fools.

You're not civil period. You stoop to childish name calling and you're 
not adding anything to the thread. You're a pompous old fool who get see 
passed more than 3 meters in front of them and seems to believe he is 
god's gift to the Perl community.

Grow the bloody hell up, go fly a kite and get laid. Stop waiting 
everyone's time with your pointless insulting drivel that only serves 
your own need to push people down.



-- 
G. C. Etly 




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

Date: Tue, 17 Jun 2008 07:29:41 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: Learning Perl
Message-Id: <slrng5eit1.c4u.allergic-to-spam@no-spam-allowed.org>

On 2008-06-16, Gordon Corbin. Etly <gord.REMOVE.c.e@gmail.com> wrote:
> A. Sinan Unur wrote:
>> "Gordon Corbin Etly" <gord.c.e@gmail.com> wrote in
>> news:6bni5cF3d330cU1 @mid.individual.net:
>
>> > See below for the code I should of used.
>
>> s/should of/should have/
>
>> ...
>
>> > Here is what I should of written:
>
>> Ditto
>
>> >  # perl -e 'my @arr; print int(defined(@arr)), "\n"'
>> >  0
>> >
>> >
>> > Now take this:
>
>> No, you take this:
>
> You seem to have some anger issues. My post was not hostile in any way 
> so I don't know why you are so.
>
>
>> C:\> perl -we "my @arr; print int(defined(@arr)), qq{\n}"
>> defined(@array) is deprecated at -e line 1.
>>        (Maybe you should just omit the defined()?)
>> 0
>
> Maybe it's depreciated, but it still serves to illustrate the point that 
> the array or hash, before being initialized, are undefined in any sense 
> of the word. So maybe it's not literally "undef", it might as well be.

Following along in this thread, I just read the 'defined' manual page,
including the section quoted below.  The way I read it, the implication
is that an array or hash table declared but not explicitly initialized is
implicitly initialized to an empty array (or hash).  E.g.:


#!/usr/bin/perl

use strict;
use warnings;

my @x;

print "The size of array x is: " . scalar @x . "\n";

push @x, 1;

print "The size of array x is: " . scalar @x . "\n";



[output:

The size of array x is: 0
The size of array x is: 1

In other words, it behaves the same as if the declaration of @x was:
my @x = ();
]

If you add this line:

print "The size of undef is: " . scalar (undef) . "\n";
# This, of course, gives you a runtime error - I think 'scalar' is not really
# necessary above - behaves the same either way.

You get (including stderr):

Use of uninitialized value in concatenation (.) or string at /tmp/arr.pl line 14.
The size of array x is: 0
The size of array x is: 1
The size of undef is: 



I.e., if an array in such as case was 'undef', I believe you'd get the same
error as you do trying to print 'undef'.

>> perldoc -f defined
>>
>>
>>   Use of "defined" on aggregates (hashes and arrays) is
>>   deprecated. It used to report whether memory for that aggregate
>>   has ever been allocated. This behavior may disappear in future
>>   versions of Perl. You should instead use a simple test for size:
>>
>>       if (@an_array) { print "has array elements\n" }
>>       if (%a_hash)   { print "has hash members\n"   }
>
> Why are they removing this behavior? It seems logical that defined() 
> should return false on anything that hasn't yet be defined, no?
>
>
>> *Sigh*
>>
>> *PLONK*
>
> I really think you need some anger management classes; this is not how 
> one conducts a civil conversation.
>
>


-- 



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

Date: Tue, 17 Jun 2008 07:31:58 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: Learning Perl
Message-Id: <slrng5ej1a.c4u.allergic-to-spam@no-spam-allowed.org>

On 2008-06-17, Gordon Corbin Etly <gremoveord.c.e@gmail.com> wrote:
> Uri Guttman wrote:
>>>>>>> "GCE" == Gordon Corbin Etly <gord.REMOVE.c.e@gmail.com> writes:
>
>> > > C:\> perl -we "my @arr; print int(defined(@arr)), qq{\n}"
>> > > defined(@array) is deprecated at -e line 1.
>> > > (Maybe you should just omit the defined()?)
>> > > 0
>
>> > Maybe it's depreciated, but it still serves to illustrate the
>> > point that the array or hash, before being initialized, are
>> > undefined in any sense of the word. So maybe it's not literally
>> > "undef", it might as well be.
>
>> do you know what DEPRECATED means? it ain't depreciated. caps were
>> used to help the learning handicapped.
>
> Do you really have to insult people over a silly typo? Is it possible 
> for you to carry a civil conversation?

Sounds like you're new to USENET.  They used to be called "flames"
(maybe still are).


-- 



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

Date: Tue, 17 Jun 2008 07:37:04 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: Learning Perl
Message-Id: <slrng5ejat.c4u.allergic-to-spam@no-spam-allowed.org>

On 2008-06-16, comp.llang.perl.moderated <ced@blv-sam-01.ca.boeing.com> wrote:
> On Jun 16, 9:19 am, "Gordon Corbin Etly" <gord....@gmail.com> wrote:
>> Randal L. Schwartz wrote:
>> >>>>>> "Gordon" == Gordon Corbin Etly <gord....@gmail.com> writes:
>> > Gordon> Actaully, yes they do:
>>
>> > Gordon>  # perl -e 'my @arr; print int(@arr == undef), "\n"'
>> > Gordon>  1
>> > Gordon>  # perl -e 'my %hash; print int(%hash == undef), "\n"'
>> > Gordon>  1
>>
>> > ...
>>
>> Then why does  defined()  return false until the array or hash are
>> defined?
>
> Because defined()'s meaning gets twisty
> when dealing with arrays/hashes.  Until
> memory's  been  allocated, defined() will
> be false but then remain true even if it
>  gets emptied again:

Sounds like it would have been much better if defined had been originally
specified to throw an exception or generate a runtime error if its
argument was not scalar.

>
> $ perl -le '@a=(1);print defined @a;@a=();
>   print defined @a'
> 1
> 1
>
> perldoc -q empty
>
>     Why does defined() return true on empty
>    arrays and hashes?
>
>     The short story is that you should probably
>     only use defined on scalars or functions, not
>     on aggregates (arrays and hashes).  See
>     "defined" in perlfunc in the 5.004 release
>     or later of Perl for more detail.
>
> perldoc -f defined
>
>   Use of "defined" on aggregates (hashes and
>   arrays) is deprecated.  It used to report
>   whether memory for that aggregate has ever
>   been allocated.  This behavior may disappear
>   in future versions of Perl.
>
>
> --
> Charles DeRykus


-- 



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

Date: Tue, 17 Jun 2008 05:37:08 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x74p7saagr.fsf@mail.sysarch.com>

>>>>> "JC" == Jim Cochrane <allergic-to-spam@no-spam-allowed.org> writes:

  JC> On 2008-06-17, Gordon Corbin Etly <gremoveord.c.e@gmail.com> wrote:
  >> Uri Guttman wrote:
  >>>>>>>> "GCE" == Gordon Corbin Etly <gord.REMOVE.c.e@gmail.com> writes:
  >> 
  >>> > > C:\> perl -we "my @arr; print int(defined(@arr)), qq{\n}"
  >>> > > defined(@array) is deprecated at -e line 1.
  >>> > > (Maybe you should just omit the defined()?)
  >>> > > 0
  >> 
  >>> > Maybe it's depreciated, but it still serves to illustrate the
  >>> > point that the array or hash, before being initialized, are
  >>> > undefined in any sense of the word. So maybe it's not literally
  >>> > "undef", it might as well be.
  >> 
  >>> do you know what DEPRECATED means? it ain't depreciated. caps were
  >>> used to help the learning handicapped.
  >> 
  >> Do you really have to insult people over a silly typo? Is it possible 
  >> for you to carry a civil conversation?

  JC> Sounds like you're new to USENET.  They used to be called "flames"
  JC> (maybe still are).

you joined in too late. troll gordon is the one to blame. :)

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 05:38:59 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7zlpk8vt8.fsf@mail.sysarch.com>

>>>>> "GCE" == Gordon Corbin Etly <g....c.e@gmail.com> writes:

  GCE> You're not civil period. You stoop to childish name calling and
  GCE> you're not adding anything to the thread. You're a pompous old
  GCE> fool who get see passed more than 3 meters in front of them and
  GCE> seems to believe he is god's gift to the Perl community.

nah, i $DEITY's punishment for you. you are the one feeling the pain. i
am toying with you like a cat with a mortally wounded mouse. 

  GCE> Grow the bloody hell up, go fly a kite and get laid. Stop waiting 
  GCE> everyone's time with your pointless insulting drivel that only serves 
  GCE> your own need to push people down.

try the code posted. or are ya too chicken?? CLUCK CLUCK!!

and learn some perl. or better yet learn python. they like your type.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 05:48:20 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7ve088vdn.fsf@mail.sysarch.com>


guess what this code prints. or better yet since you won't guess, run it
and explain it. then defend defined on aggregates. pretty simple looking
code!


use strict ;
use warnings ;

foreach ( 1 .. 3 ) {

	my @array ;
	print "defined $_\n" if defined @array ;
	print "empty $_\n" unless @array ;
	@array = (1) ;
}

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 05:48:30 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7r6aw8vdd.fsf@mail.sysarch.com>


guess what this code prints. or better yet since you won't guess, run it
and explain it. then defend defined on aggregates. pretty simple looking
code!


use strict ;
use warnings ;

foreach ( 1 .. 3 ) {

	my @array ;
	print "defined $_\n" if defined @array ;
	print "empty $_\n" unless @array ;
	@array = (1) ;
}

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 05:48:40 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7mylk8vd3.fsf@mail.sysarch.com>

guess what this code prints. or better yet since you won't guess, run it
and explain it. then defend defined on aggregates. pretty simple looking
code!


use strict ;
use warnings ;

foreach ( 1 .. 3 ) {

	my @array ;
	print "defined $_\n" if defined @array ;
	print "empty $_\n" unless @array ;
	@array = (1) ;
}

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 05:51:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x7iqw88v96.fsf@mail.sysarch.com>

>>>>> "JC" == Jim Cochrane <allergic-to-spam@no-spam-allowed.org> writes:

  JC> Sounds like it would have been much better if defined had been
  JC> originally specified to throw an exception or generate a runtime
  JC> error if its argument was not scalar.

it wasn't done that way for some reason long lost. it has a very minor
side purpose which isn't really needed. so now it is officially
deprecated and it issues a warning. it will likely be changed to a fatal
error in future versions (which is what usually happens to deprecated
features).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 17 Jun 2008 08:13:22 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: Learning Perl
Message-Id: <slrng5elev.cv4.allergic-to-spam@no-spam-allowed.org>

On 2008-06-17, Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "JC" == Jim Cochrane <allergic-to-spam@no-spam-allowed.org> writes:
>
>  JC> Sounds like it would have been much better if defined had been
>  JC> originally specified to throw an exception or generate a runtime
>  JC> error if its argument was not scalar.
>
> it wasn't done that way for some reason long lost. it has a very minor
> side purpose which isn't really needed. so now it is officially
> deprecated and it issues a warning.

Yes, I assumed that was the case - One can't always make the perfect
choice in the beginning.

> it will likely be changed to a fatal
> error in future versions (which is what usually happens to deprecated
> features).

Yes, deprecating for a while makes sense, of course - don't want to piss
too many people off by breaking old code.


-- 



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

Date: Tue, 17 Jun 2008 10:15:04 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Learning Perl
Message-Id: <os4ki5xndf.ln2@carpet.zombinet>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
*SKIP*
> A hash in scalar context evaluates to 0 (formally: false) if it has no
> elements, and to #used_buckets/#allocated_buckets (formally: true)
> otherwise. (1) The 'formally' bits indicate that those values should
> only be used to est truthness.

At last!  Someone just told me what C<scalar %hash> is!  Thanks, thanks,
thanks...  I was curious on that something about year.  Thanks, thanks,
thanks.

*CUT*
-- 
Torvalds' goal for Linux is very simple: World Domination


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

Date: Tue, 17 Jun 2008 12:13:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Learning Perl
Message-Id: <Xns9AC053ACE17Easu1cornelledu@127.0.0.1>

Eric Pozharski <whynot@pozharski.name> wrote in
news:os4ki5xndf.ln2@carpet.zombinet: 

> Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> *SKIP*
>> A hash in scalar context evaluates to 0 (formally: false) if it has
>> no elements, and to #used_buckets/#allocated_buckets (formally: true)
>> otherwise. (1) The 'formally' bits indicate that those values should
>> only be used to est truthness.
> 
> At last!  Someone just told me what C<scalar %hash> is!  Thanks,
> thanks, thanks...  I was curious on that something about year. 
> Thanks, thanks, thanks.

<blockquote>
perldoc perldata


If you evaluate a hash in scalar context, it returns false if the hash
is empty. If there are any key/value pairs, it returns true; more
precisely, the value returned is a string consisting of the number of
used buckets and the number of allocated buckets, separated by a slash.
This is pretty much useful only to find out whether Perl's internal
hashing algorithm is performing poorly on your data set. For example,
you stick 10,000 things in a hash, but evaluating %HASH in scalar
context reveals "1/16", which means only one out of sixteen buckets has
been touched, and presumably contains all 10,000 of your items. This
isn't supposed to happen. If a tied hash is evaluated in scalar context,
a fatal error will result, since this bucket usage information is
currently not available for tied hashes.

You can preallocate space for a hash by assigning to the keys()
function. This rounds up the allocated buckets to the next power of two:

    keys(%users) = 1000;                # allocate 1024 buckets

</blockquote>

You can always read the documentation for yourself. You don't need
others to do it for you. 

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 1649
***************************************


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