G
Guest
Consider the following almost pseudo example:
# main.pl
package main;
require other;
sub mysort() {
#* 1. sort algo
}
# other.pm
package other;
# an object in a class
sub new() { # etc }
sub setusersort() {
my $this = shift( @_ );
$this->{ 'UserSort' } = shift( @_ );
}
sub sort_input()
{
#* 2. call $this->{ 'UserSort' }
}
k so now considering all that. I'm am perplexed. I can pragmatically get my
examples (I've performed various mutations on code) to compile without
warning (-w) and use strict shows no errors. My output is not sorted
however. The parameters (instead of the globals $a and $b) are passed to
mysort(). How do I 'return' the appropriate value? I've tried implicitly and
explicitly defining a return value. 99% of the time the function returns
'1'. I don't get it and my mission to find an example that does kinda what I
have has been fruitless.
Much thanks to any light one can shed... bring halogen or indiglo!
# main.pl
package main;
require other;
sub mysort() {
#* 1. sort algo
}
# other.pm
package other;
# an object in a class
sub new() { # etc }
sub setusersort() {
my $this = shift( @_ );
$this->{ 'UserSort' } = shift( @_ );
}
sub sort_input()
{
#* 2. call $this->{ 'UserSort' }
}
k so now considering all that. I'm am perplexed. I can pragmatically get my
examples (I've performed various mutations on code) to compile without
warning (-w) and use strict shows no errors. My output is not sorted
however. The parameters (instead of the globals $a and $b) are passed to
mysort(). How do I 'return' the appropriate value? I've tried implicitly and
explicitly defining a return value. 99% of the time the function returns
'1'. I don't get it and my mission to find an example that does kinda what I
have has been fruitless.
Much thanks to any light one can shed... bring halogen or indiglo!