CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Laurent_R] simple subroutine call: Edit Log



user4592357
New User

Sep 21, 2017, 5:37 AM


Views: 3741
Re: [Laurent_R] simple subroutine call

hi thanks for the reply

actually i do have perl installed on my computer and the code works fine. i was just asking what could be wrong with the codefights code.

i got it working after some modifications and using hints. what i don't understand is why we use @$statues? haven't seen such code when learning and practicing. what does it mean?

Code
sub makeArrayConsecutive2 { 
my ($statues) = @_;
my @statues = sort {$a <=> $b}(@$statues);

return $statues[-1] - $statues[0] - (scalar @statues) + 1;
}

p.s. i noticed that i could not use indices later, after i had posted the question. thanks for the notice though


(This post was edited by user4592357 on Sep 21, 2017, 5:38 AM)


Edit Log:
Post edited by user4592357 (New User) on Sep 21, 2017, 5:38 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives