On Fri, 10 Oct 2003 12:53:48 -0700 (PDT), Jeff Westman <[EMAIL PROTECTED]> wrote:
> Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Fri, 10 Oct 2003 09:11:28 -0700 (PDT), Jeff Westman <[
Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
>
>
> On Fri, 10 Oct 2003 09:11:28 -0700 (PDT), Jeff Westman <[EMAIL PROTECTED]>
> wrote:
>
>
> >
> > I know perl returns the last value (statement?) by default, but doesn't
> it
> > make it more reada
On Fri, 10 Oct 2003 09:11:28 -0700 (PDT), Jeff Westman <[EMAIL PROTECTED]> wrote:
>
> I know perl returns the last value (statement?) by default, but doesn't it
> make it more readable (or self-documenting) to the next person who may come
> along
Jeff Westman wrote:
>
> Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> > [...snip...]
> > > > >return (exists $myHash{$val1} ) ? $Hash{$val2} : undef;
> > > > Likewise, 'delete' returns either the element deleted or 'undef' if
> > > > it didn't exist.
> > [...snip...]
> > > I didn't know 'delete'
Rob Dixon <[EMAIL PROTECTED]> wrote:
> [...snip...]
> > > >return (exists $myHash{$val1} ) ? $Hash{$val2} : undef;
> > > Likewise, 'delete' returns either the element deleted or 'undef' if
> > > it didn't exist.
> [...snip...]
> > I didn't know 'delete' returned the value as well. Simple an
Jeff Westman wrote:
>
> Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> > Jeff Westman wrote:
> > >
> > > If I have an array and want to take the first element off and return it,
> > I
> > > would do it like this:
> > >
> > >return (@myArray) ? shift(@myArray) : undef;
> > >
> > > How would I do simil
Paul Kraus <[EMAIL PROTECTED]> wrote:
> Why wouldn't you just return(shift(@myarray)
Yes, this works for a normal(?) array, but I was asking about hashes.
> As far as the hash why are you trying to remove it? I would assume it
> because you don't have a use for it outside of the scope of the
> s
Rob Dixon <[EMAIL PROTECTED]> wrote:
> Jeff Westman wrote:
> >
> > If I have an array and want to take the first element off and return it,
> I
> > would do it like this:
> >
> >return (@myArray) ? shift(@myArray) : undef;
> >
> > How would I do similarly with a hash? I have something like th
Jeff Westman wrote:
>
> If I have an array and want to take the first element off and return it, I
> would do it like this:
>
>return (@myArray) ? shift(@myArray) : undef;
>
> How would I do similarly with a hash? I have something like this:
>
>
>return (exists $myHash{$val1} ) ? $Hash{$va
Opps type return(shift(@myarray))
-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]
Sent: Friday, October 10, 2003 11:46 AM
To: 'Jeff Westman'; 'beginners'
Subject: RE: Hash Print and Delete
Why wouldn't you just return(shift(@myarray)
As far as th
It was Friday, October 10, 2003 when Jeff Westman took the soap box, saying:
: Question:
:
: If I have an array and want to take the first element off and return it, I
: would do it like this:
:
:return (@myArray) ? shift(@myArray) : undef;
:
: How would I do similarly with a hash? I have s
:40 AM
To: beginners
Subject: Hash Print and Delete
Question:
If I have an array and want to take the first element off and return it,
I would do it like this:
return (@myArray) ? shift(@myArray) : undef;
How would I do similarly with a hash? I have something like this:
return (exists $myH
Question:
If I have an array and want to take the first element off and return it, I
would do it like this:
return (@myArray) ? shift(@myArray) : undef;
How would I do similarly with a hash? I have something like this:
return (exists $myHash{$val1} ) ? $Hash{$val2} : undef;
But these l
13 matches
Mail list logo