Re: Perl Bug or stupidity on my part? - I looked in FAQs and dejanews prior to posting

From: Eric Amick (eric-amick_at_comcast.net)
Date: 01/11/04


Date: Sun, 11 Jan 2004 13:43:38 -0500

On 10 Jan 2004 21:01:48 -0800, zbuckholz@hotmail.com (Zachary Buckholz)
wrote:

>I am passing a reference to a hash where the key is a scalar and each
>value is a reference to an array to another sub. But unless I use a
>subscript like $_[0] I can not get it in the recieving sub. Typically
>I can just use $_ when passing one variable;

The only way I can picture that working is if $_ happened to have the
same value as the argument you passed. With $_ normally being global,
it would appear to work as you describe. As others have already pointed
out, it certainly doesn't work in general.

-- 
Eric Amick
Columbia, MD


Relevant Pages

  • Re: VB-101: Passing Arrays ByVal vs ByRef
    ... My questions was why the 2nd part of the sub did not change the changes the ... > changes to the array pass it byref. ... > ' new reference ... > ' allocate secondArray and copy its reference ...
    (microsoft.public.dotnet.languages.vb)
  • Array error - why?
    ... Sub that has one argument (dynamic array of pictures) and what I want is to ... arrThumbPictis also an array of pictures but I get a compile error at the ... Public arrThumbPictAs Picture ... Public Sub PreviewThisPage() ...
    (microsoft.public.vb.general.discussion)
  • What is wrong with this array?
    ... Sub that has one argument (dynamic array of pictures) and what I want is to ... arrThumbPictis also an array of pictures but I get a compile error at the ... Public arrThumbPictAs Picture ... Public Sub PreviewThisPage() ...
    (microsoft.public.vb.general.discussion)
  • Array error - why?
    ... Sub that has one argument (dynamic array of pictures) and what I want is to ... arrThumbPictis also an array of pictures but I get a compile error at the ... Public arrThumbPictAs Picture ... Public Sub PreviewThisPage() ...
    (microsoft.public.vb.general.discussion)
  • Re: How to pass function name as a parameter?
    ... > Public Sub operator_index(ByVal index As Integer, ... I'm not sure what you mean by return type of reference, ... want to do is have an object that acts like an array, ... overlook what you can do with Properties, which don't really have a C++ ...
    (microsoft.public.vb.syntax)