Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Getting a list of ipaddress from the array using perl

This is a discussion on Getting a list of ipaddress from the array using perl within the Scripting forums, part of the Web Development category; Hi, I want to display the ipaddress lists from the array using perl. The arrays can be like this : @list1 = (1..10) or @list2 = ('A'..'Z'). It can be ...

Go Back   Geeks Talk > Web Development > Scripting
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Scripting Discuss Issues and Problems related to VB Script, Java Script and other Client Side Scripting

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-09-2006
Contributing Member
 
Join Date: Oct 2006
Location: India, TamilNadu, Chennai
Posts: 79
Thanks: 9
Thanked 9 Times in 7 Posts
anushya is on a distinguished road
Getting a list of ipaddress from the array using perl

Hi,

I want to display the ipaddress lists from the array using perl.
The arrays can be like this : @list1 = (1..10) or @list2 = ('A'..'Z'). It can be printed as: list1 will be from 1 to 10 and list2 will be from A to Z.

Like this, i want to print the set of ipaddress.
The ipaddr array is: @ipaddr = ('192.168.30.1' .. '192.168.30.10').

How to print the ipaddresses from 192.168.30.1 to 192.168.30.10?
This is not the same approach followed in printing the numbers and chars. Regular expressions can be used. I tried my best. Anybody please help me.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-10-2007
Expert Member
 
Join Date: Apr 2006
Location: India, Hyderabad
Posts: 130
Thanks: 19
Thanked 48 Times in 18 Posts
bvani will become famous soon enough
Re: Getting a list of ipaddress from the array using perl

Hi,

check this
@ipaddr = ("192.168.30.1","192.168.30.2","192.168.30.3","192.168.30.4","192.168.30.5","192.168.30.6","192.168.30.7","192.168.30.8","192.168.30.9","192.168.30.10");

foreach my $key(@ipaddr) {
print "the ipaddr is $key \n";
}
Reply With Quote
Reply

  Geeks Talk > Web Development > Scripting

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Help on Dynamic Array nancyphilips C and C++ 8 12-25-2007 09:59 AM
ADO.NET 2.0 : Check Box and Dropdown List in a Datagrid Srikanth VB.NET 2 02-19-2007 02:14 PM
Microsoft CRM : Create a price list to use for a sales promotion Jim.Anderson Microsoft CRM 0 09-27-2006 07:39 AM
PC Essentials - Check List Lokesh M Geeks Lounge 0 09-23-2006 05:53 AM
List of Overiding Methods RyanJames ASP.NET 0 09-04-2006 01:27 PM


All times are GMT -4. The time now is 10:20 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved