in reply to 2-strange side effect with FH
#!/usr/local/bin/perl -w use strict; open TEMP, "+>file.txt" or die "Error message here: $!\n"; # Write to the file print TEMP "aba uba\niba seba\njak yuk\n"; # Rewind the file for reading seek(TEMP, 0, 0); while (<TEMP>) { print; } close TEMP;
The fact that some of your code is printed out must be related to not using seek() on Windows. I don't see this behaviour on Linux.
--
John.
|
|---|