in reply to creating a text file at run time and writing to it.

Is it possible you're running on windows? Since you don't chomp your input, you're going to try to create a file called 'john\n.txt', which might blow up on a windows filesystem. What is the exact error you get when you try to create the file? Try this:
#!/usr/bin/perl -w use strict; open (NAMES, "names.txt") or die "Failed to read names: $!"; while my $name (<NAMES>) { chomp $name; open(OUT, ">$name.txt") or die "Failed to write $name.txt: $!"; print OUT " hellow"; close OUT; } close NAMES;

-- zigdon

Replies are listed 'Best First'.
Re^2: creating a text file at run time and writing to it.
by zigdon (Deacon) on Jul 20, 2006 at 12:08 UTC
    Absolutly correct - updated. That's what I get for switching to a named var from $_ :)

    -- zigdon

A reply falls below the community's threshold of quality. You may see it by logging in.