Programming Wiki: Copy contents of one file into another

Programming Wiki : PerlCopyFile

WikiHomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2006-04-16 20:18:03 by ScottRippee

Additions:

Perl



Deletions:
back>>

Perl





Edited on 2006-04-16 20:17:43 by ScottRippee

Additions:
back>>

Perl



Deletions:

Perl





Edited on 2006-04-16 20:17:10 by ScottRippee

No differences.


Edited on 2006-04-16 19:23:06 by ScottRippee

Additions:

Perl



Deletions:

Perl





Edited on 2006-04-16 19:22:46 by ScottRippee

Additions:
This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use >> to append to a file.

Deletions:
This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use <pre
></pre> to append to a file.




Edited on 2006-04-16 19:22:14 by ScottRippee

Additions:
This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use <pre
></pre> to append to a file.


Deletions:
This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use <code
></code> to append to a file.




Edited on 2006-04-16 19:21:54 by ScottRippee

Additions:
This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use <code
></code> to append to a file.


Deletions:
This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use
to append to a file. Don't forget to close your output file handles!




Oldest known version of this page was edited on 2006-04-16 19:21:16 by ScottRippee []
Page view:

Perl

Copy contents of one file into another


This block of code basically copies the contents of file.in into file.out line by line. Notice the > symbol to signify a write-clobber. You can use
to append to a file. Don't forget to close your output file handles!

  open(infile, "/some/directory/file.in");
  open(outfile, ">/some/directory/file.out");
  while () {
    print outfile "$_\n";
  }
  close(outfile);
Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0447 seconds