http://www.perlmonks.org?node_id=699408


in reply to How to generate files based on some special character?

If you are very lazy, you could run this:
$ perl -lane '$F[0] eq "<" and open O, "> $F[1]" or print O $_' large_ +file

Obviously, I wouldn't use this at home, as it could burn it down ;-)

...because there are no error checks (on "file name", open and print) and because of the sloppy 2-arguments usage of open

--
altblue.

Replies are listed 'Best First'.
Re^2: How to generate files based on some special character?
by AltBlue (Chaplain) on Jul 22, 2008 at 20:00 UTC
    Or be even more reckless and drop a few more keys ;-)
    $ perl -ne '/^< (.+)/ and open STDOUT, "> $1" or print' large_file
    God help you if you ever try to use such dumb code against some wild input ;-)

    --
    altblue.