in reply to How do I read an entire file into a variable?

Use something like this:
open FOO,"myfile"; $data = join('',<FOO>); close FOO;
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.

Replies are listed 'Best First'.
RE: Tic Tac Toe program
by vroom (His Eminence) on Dec 30, 1999 at 21:46 UTC
    I'd like to see that tic tac toe program.