phazelwood has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl print "Content-Type: text/html\n\n"; print "<html> <head>\n"; print "<title>Hello, world!</title>"; print "</head>\n"; print "<body>\n"; print "<h1>Hello, world!</h1>\n"; print "</body> </html>\n"; $append = 0; if ($append) { open(MYOUTFILE, ">filename.out"); } else { open(MYOUTFILE, ">>filename.out"); #open for write, append } print MYOUTFILE "Testing 1 2 3"; #write text, no newline print MYOUTFILE "\n"; #write newline close(MYOUTFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl text file writing
by samtregar (Abbot) on May 25, 2006 at 20:38 UTC | |
|
Re: Perl text file writing
by VSarkiss (Monsignor) on May 25, 2006 at 20:39 UTC | |
|
Re: Perl text file writing
by duckyd (Hermit) on May 26, 2006 at 04:44 UTC | |
|
Re: Perl text file writing
by sithsasquatch (Scribe) on May 25, 2006 at 20:49 UTC | |
by chromatic (Archbishop) on May 25, 2006 at 21:15 UTC | |
by sithsasquatch (Scribe) on May 25, 2006 at 21:44 UTC |