Hello Jonathan,

JS> Okay I am getting this to almost work.  However I get an error on this line in the 
code you gave:

JS>     &SortListItem(/%data,/%sortonly);

        Sorry about this, but that is typo on my part.  The line of
code you are getting an error on should actually look like this:

        &SortListItem(\%data,\%sortonly);

        To make a long story short you are passing references to the
variables, not the actually data.  This is because when you pass data
to a sub-routine it becomes one big long list.  When you pass 2 or
most lists (arrays or hashes) Perl won't assign the data correctly to
your new local varaibles within the sub-routine.  That is why you have
the following lines of code inside the subroutine:

## Perl Code Segment Begins

sub SortListItem {
       ## I found another error, you don't need to include the
       ## $section in the first line of code for SortListItem
       ## It should look like this

       my ($data,$sortonly) = @_; ## Assign references to strings
       my $check;
       my %data = %$data;         ## A new hash from the reference
       my %sortonly = %$sortonly; ## Same as above

## Perl Code Segment Ends

       You pass references to string variables, and then create new
local hashes (in this case %data, %sortonly) from those references.
Sorry about the typo.  Cheers.

-- 
Best regards,
 Cam                            mailto:[EMAIL PROTECTED]



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


Reply via email to