1:#!/usr/bin/perl -w
2:
3:use strict;
4:
5:my $host;
6:
7:open FH, "lunarmedia";
8:
9:while (<FH>) {
10: $host = $_;
11: if ( $host =~ /^host/ ) {
12: $host =~ s/^hostname\s(.*)/$1/;
13: chomp $host;
14: }
15:}
16:open NFH, ">$host";
17: print NFH <FH>;
18:close NFH;
19:close FH;
this script is just a test of sorts for a snippet of code to go into a
larger script. my issue is that the print statement on line 17 doesnt seem
to work. the file referenced by $host in line 16 gets created, however
none of FH's contents are placed in NFH. do i need to re-open FH after the
while statement in order for this print to work? and if so, why is it
automagically being closed?
thanks -charles
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]