Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8525393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:57:56+00:00 2026-06-11T07:57:56+00:00

I’m updating an old Perl script to Ruby and having a problem with finding

  • 0

I’m updating an old Perl script to Ruby and having a problem with finding a replacement for one Perl library.

In the Perl script we use Net::CIDR::Lite, which takes a start and end ip address range and outputs a CIDR string.

This is a Perl example that shows the functionality:

#!/usr/bin/perl

use Net::CIDR::Lite;
$cidrblocks = Net::CIDR::Lite->new;
$cidrblocks->add_range("109.152.0.0-109.152.7.255");

$coveragezone = "";

@cidrlist = $cidrblocks->list();

$cidrcount=0;
    while ( defined $cidrlist[$cidrcount] ) {
            $coveragezone .= "$cidrlist[$cidrcount]";
    }
    continue {
            $cidrcount++;
    }

print "$coveragezone";

This script returns a string:

=> 109.152.0.0/21

Does anyone know of a Ruby lib or gem I could use to duplicate the functionality of the add_range call?

$cidrblocks = Net::CIDR::Lite->new;
$cidrblocks->add_range("109.152.0.0-109.152.7.255");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:57:58+00:00Added an answer on June 11, 2026 at 7:57 am

    I found a ruby module which does this translation see

    http://wejn.org/stuff/cidr.rb.html

    have included it in my rails app and it’s perfect

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm updating an old ASP.NET MVC application to use the 4.0 framework, and I'm
I'm updating some of our old code to use C++11 features in place of
I've been tasked with updating one of our old programs still in production and
I'm updating a fairly old C extension bound to a ruby gem that I
We are updating an old .net 1.1 website to 2.0. The site currently supports
Updating someone else's old PHP project and I'm unfamiliar with regular expressions. Question one
I am facing a problem with updating my labels.. it doesn't remove the old
I'm new to Perl, and I'm updating an old Perl website. Every .pl file
I'm updating an old ASP/MySql webapp to ASP.NET/MS SQL. We would like to keep
I have an old AGL-based OpenGL windowing system that I am updating to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.