in reply to snmpwalk in perl

I need a snmpwalk script in Perl without using modules

... and I really, really need a mammoth to ride to work, right now, ASAP!

Are you aware that Perlmonks is not a code writing service? Show some effort. Start writing the script, show us where you are stuck, and we will gladly help you. Or make it a job and post it at

Here's a starter:

#!/usr/bin/perl use strict; use warnings; #### your code here ####


Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: snmpwalk in perl
by Nouhira (Initiate) on May 17, 2019 at 08:51 UTC
    yes, so sorry for that. Im still in learning phase in perl, i wanted to snmpwalk for 3 to 4 IP's using snmpwalk command and store the result in an array, After that i want to use a 'for' loop to iterate that array and print the output for one IP at a time. I hope u understood my query. I will staring writing the script for one IP. Please correct it
    #!/usr/bin/perl use strict; use warnings; my $ip = ""; my $community = "public"; my $oid = ""; my @arr = `snmpwalk _v2c _$community _$ip _$oid`; print "@arr";

      Hello again Nouhira,

      On your sample of code you are not using _ (underscores) why on your sample of code you use?

      Does this code compile?

      On my LinuxOS test box your code gives me this error:

      $ perl _public: Unknown Object Identifier (Sub-id not found: (top) -> _public +)

      Please test your code before posting.

      Hope this helps, Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!