in reply to Re: sort hash by value
in thread sort hash by value

Anyidea why tis sub is failing...I'm passing it an oid string like so:
my $foo = fmt($oid); print "FOO: $foo\n"; sub fmt($){ join("", map { sprintf "%05d", $_ } split(/./, shift)); }
Thanks!

Replies are listed 'Best First'.
Re: Re: Re: sort hash by value
by RMGir (Prior) on Jul 10, 2003 at 15:39 UTC
    Just a wild guess, but I don't think split /./ is going to do what you want. I think you want split /\./ (note the \, escaping the "match anything" .)
    --
    Mike
      Sure, my fault: the split should be on /\./.