#!/usr/bin/perl -w use strict; # A simple trap handler my $TRAP_FILE = "/tmp/traps.test.log"; # my $host = ;# Read the Hostname - First line of input from STDIN # chomp($host); # my $ip = ;# Read the IP - Second line of input # chomp($ip); my (@vars); while() { chomp($_); push(@vars,$_); } open(TRAPFILE, ">> $TRAP_FILE"); # print(TRAPFILE "HOST: $host\nIP: $ip\n"); foreach(@vars) { print(TRAPFILE "$_\n"); } print(TRAPFILE "\n----------\n"); close(TRAPFILE);