in reply to print line to file on win32
$x = int(rand(65535)); my $in; open($in, '<', "somefile") or die $!; for $line (<$in>) { my $out; open($out, '>', "prefix$x.txt") or die $!; print $out $line; $x++; }
Update:: Changed to work exactly like the shell version (as far as I can tell without being arsed to test it). Didn't try to optimize it or golf it further, so you can see the relative syntaxes involved.
And this has nothing to do with Win32, by the way.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print line to file on win32
by sans-clue (Beadle) on Oct 29, 2007 at 19:32 UTC | |
by ikegami (Patriarch) on Oct 29, 2007 at 19:50 UTC |