RE: effect of while on filehandle

2001-07-17 Thread Mooney Christophe-CMOONEY1
t: Tuesday, July 17, 2001 8:49 AM To: Perl Discuss Subject: effect of while on filehandle 1:#!/usr/bin/perl -w 2: 3:use strict; 4: 5:my $host; 6: 7:open FH, "lunarmedia"; 8: 9:while () { 10: $host = $_; 11: if ( $host =~ /^host/ ) { 12:$host =~ s/^hostname\s(.*)/$1/; 13:chomp $

effect of while on filehandle

2001-07-17 Thread charles
1:#!/usr/bin/perl -w 2: 3:use strict; 4: 5:my $host; 6: 7:open FH, "lunarmedia"; 8: 9:while () { 10: $host = $_; 11: if ( $host =~ /^host/ ) { 12:$host =~ s/^hostname\s(.*)/$1/; 13:chomp $host; 14: } 15:} 16:open NFH, ">$host"; 17: print NFH ; 18:close NFH; 19:close FH; this script i