convert simple perl tools to compilable c code for linux systems

IN PROGRESS
Bids
7
Avg Bid (USD)
$136
Project Budget (USD)
$30 - $250

Project Description:
small and simple perl tool need to be migrated to executables binaries, 'make'able c++ code should do it, mainly to be run on linux type OS...
perl version attached

perl piece:
----------------------------------------------------------------------
#!/usr/bin/perl

use strict;
use Socket;

my $me = $0;
my $input = $ARGV[0];

if ($me =~ /ip2int/) {
my $ipnumber = ip2num( "$input" );
if ( $ipnumber ) {
print "$ipnumber\n";
}
} elsif ($me =~ /int2ip/) {
my $ip = num2ip( $input );
if ( $ip ) {
print "$ip\n";
}
} elsif ($me =~ /mac2int/) {
my $num = mac2num( "$input" );
if ( $num ) {
print "$num\n";
}
} elsif ($me =~ /int2mac/) {
my $mac = num2mac( "$input" );
if ( $mac ) {
print "$mac\n";
}
}

sub ip2num {
return unpack 'N', inet_aton(shift);
}

sub num2ip {
return inet_ntoa( pack 'N', shift );
}

sub mac2num {
my $mac_hex = shift;

$mac_hex =~ s/://g;

$mac_hex = substr(('0'x12).$mac_hex, -12);
my @mac_bytes = unpack("A2"x6, $mac_hex);

my $mac_num = 0;
foreach (@mac_bytes) {
$mac_num = $mac_num * (2**8) + hex($_);
}
return $mac_num;
}

sub num2mac {
my $mac_num = shift;

my @mac_bytes;
for (1..6) {
unshift(@mac_bytes, sprintf("%02x", $mac_num % (2**8)));
$mac_num = int($mac_num / (2**8));
}
return join(':', @mac_bytes);
}
----------------------------------------------------------------------

Skills required:
C++ Programming, Perl
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


Hire idleswell
$ 93
in 3 days
Hire damirmarkovic
$ 60
in 1 days
$ 412
in 4 days
Hire hddh
$ 80
in 2 days
$ 100
in 1 days
$ 99
in 3 days
Hire krvenkat
$ 110
in 2 days