Re: Bug in How to Build a Netboot Server PERL Code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Paul!

On Fri, 2019-03-08 at 13:16 -0500, Paul Frields wrote:
> I went ahead and fixed it.
> 
> On Thu, Mar 7, 2019 at 4:03 PM Gregory Lee Bartholomew
> <gregory.lee.bartholomew@xxxxxxxxx> wrote:
> > Hi Paul,
> > 
> > I found a bug in my PERL code in part 4 of the netboot series that I wrote.
> > 
> > In https://fedoramagazine.org/how-to-build-a-netboot-server-part-4/, the line:
> > 
> > my @ids = (0, sort keys %{$targets});
> > 
> > should have been:
> > 
> > my @ids = (0, sort {$a <=> $b} keys %{$targets});
> > 
> > By default, PERL's sort function sorts lexicographically, so after the 10th
> > target, it returns (0, 1, 10, 2, 3, etc.). The added text forces the sort
> > function to sort numerically (0, 1, 2, 3, etc.).
> > 
> > I understand if you don't want to revise such an old post. In case you chose not
> > to, I've CC'd the mail list so there is a chance that someone who encounters the
> > bug can find the solution.
> > 
> > --
> > Gregory Lee Bartholomew
> > PGP Key ID: 3B67510E
> > 

_______________________________________________
Fedora Magazine mailing list -- magazine@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to magazine-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/magazine@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Devel]     [EPEL Announce]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Review]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [ET Management Tools]     [Yum Users]     [Fedora Art]     [Fedora ARM]

  Powered by Linux