Hi,
I am trying to simply write the results of my grep etc to a file.
According to what I read in books, I need to open the ouput file with ">" to overwrite or ">>" to append. And then use that filehandle in the print command
open (IN , "$file") or die "unable to open file";
	I am gettng following error. 
Use of uninitialized value in concatenation (.) or string at search_IP_02.pl x for line in BOLD
unable to open output file at search_IP_02.pl x line for line in BOLD
Any comments?
M
					I am trying to simply write the results of my grep etc to a file.
According to what I read in books, I need to open the ouput file with ">" to overwrite or ">>" to append. And then use that filehandle in the print command
open (IN , "$file") or die "unable to open file";
Code:
	#Find the lines in the file containing word 'hardware' #
while (<IN>) {
        if ($num < 30 ) {
        @hardware_line = grep (/hardware/, $_);
        print "@hardware_line\n";
    }
#-----------------------------------------------------#
# Get just the hardware address from the whole line in the file
#-----------------------------------------------------#
     foreach my $word (@hardware_line) {
         @hardware1 = split /\s+/, $word;
[B]         $hardware = $hardware1[3];[/B]
         open (OUT, ">$out_file1") or die "unable to open output file";
         print OUT $hardware;
         close OUT or die "$!";
     }
Use of uninitialized value in concatenation (.) or string at search_IP_02.pl x for line in BOLD
unable to open output file at search_IP_02.pl x line for line in BOLD
Any comments?
M
Comment