in reply to net::netmask issue in Strawberry PERL

It is "Perl" (the language) or "perl" (the executable program that runs your scripts), but never ever "PERL".

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re: net::netmask issue in Strawberry PERL

Replies are listed 'Best First'.
Re^2: net::netmask issue in Strawberry PERL
by TechUser245 (Novice) on Sep 11, 2011 at 01:41 UTC
    Being a system admin, I am trying to learn this language to see where I can use it.

    Now, i thought lets try to find out the IP address of a computer using this script and try to change it later on. I was able to figure out the script to find the IP address.

    Is there a way I can ping that IP and if packets received is more than or eq 1, I can increase the IP by 1, do the same process and once i get the correct IP , change it using a script ?? I am using the following code now ::--

    use strict; use warnings; use diagnostics; use Net::Netmask; my $result = `ipconfig | find "IPv4 Address"`; ($result) = $result =~ m/(\d+\.\d+\.\d+\.\d+)/; print "OLD IP: $result\n";
    and getting following expected result ::-- OLD IP: 10.0.0.11
      Your script does not work on my version of Windows XP, so I cannot help you here.

      Perl is a great language for automating sys-admin tasks.

      Have a look at the Automating System Administration with Perl book (aka "The Otter Book") website.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James