in reply to weird file write problem
If I put some driver code in front of your sample and remove the cat calls (which are sub optimum on Windows) I get the following:
use strict; use warnings; my @inserts = ( [1, 1, 1], [2, 2, 2] ); my $outfile = 'delme.txt'; my $ins = 0; open OUTFILE, '>', $outfile; print OUTFILE <<DATA; first second third 1 2 3 x y z DATA close OUTFILE; insert (@$_) for @inserts; @ARGV = $outfile; $/ = undef; print <>; # OP's sub sans cat calls follows
Prints:
insert called:0 insert called:1 first second third 1 2 1 2 3 1 2 x y z 1 2
Where's the problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: weird file write problem
by monkeyking (Initiate) on Mar 29, 2007 at 03:22 UTC | |
by GrandFather (Saint) on Mar 29, 2007 at 04:14 UTC |