in reply to How do I read an entire file into a variable?
Then you can manipulate it: $data =~ s/foo/bar/g; In most cases you would be better off processing each line by itself, but this is helpful for multi-line constructs, and for magical things like 15-line tic-tac-toe AI programs.open FOO,"myfile"; $data = join('',<FOO>); close FOO;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Tic Tac Toe program
by vroom (His Eminence) on Dec 30, 1999 at 21:46 UTC |