Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The input of a file can be#!/usr/bin/perl open ( NAMES, "name.txt") or die "Could not open names.txt.\n"; @list = <NAMES>; print "@list"; while ($list[$y]) { open (OUT, ">$list[$y].txt") or die "cannot open file for writing: $!\ +n"; print " hello"; $y=$y+1 }
Here 3 files should be created as john.txt , peter.txt and outer.txt and i want to do some calculation on this. But the code i have written does not give the output.john peter outer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: creating a text file at run time and writing to it.
by phenom (Chaplain) on Jul 20, 2006 at 11:22 UTC | |
by Anonymous Monk on Jul 20, 2006 at 11:33 UTC | |
| |
|
Re: creating a text file at run time and writing to it.
by zigdon (Deacon) on Jul 20, 2006 at 11:47 UTC | |
by zigdon (Deacon) on Jul 20, 2006 at 12:08 UTC | |
| |
|
Re: creating a text file at run time and writing to it.
by Hofmator (Curate) on Jul 20, 2006 at 11:16 UTC | |
by Anonymous Monk on Jul 20, 2006 at 11:28 UTC | |
by CountZero (Bishop) on Jul 20, 2006 at 11:49 UTC | |
|
Re: creating a text file at run time and writing to it.
by davido (Cardinal) on Jul 20, 2006 at 16:21 UTC | |
|
Re: creating a text file at run time and writing to it.
by Moron (Curate) on Jul 20, 2006 at 14:56 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |