in reply to splitting output to separate files, one per line

use strict; while(<DATA>) { chomp; open FH, ">$..line"; print FH $_; close FH; } __DATA__ this is a file that will be split by line into files.


"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

Replies are listed 'Best First'.
Re^2: splitting output to separate files, one per line
by ikegami (Patriarch) on Feb 17, 2005 at 23:45 UTC

    Update: Nevermind, it works without the curlies. It didn't work a minute ago... The script probably didn't save correctly.

    Change
      open FH, ">$..line";
    to
      open FH, ">${.}.line";
    for your code to work.