[index] [text page] [<<start] [<prev] [next>] [last>>]
Page 32: List form for open

Page 32

  
  List form for open
  Perl's open function can open files or processes:
    open TR, "zcat -c $filename |";
    while (<TR>) {
         print "Line from compressed file: $_";
    }
  Open can take a list as well on UNIX platforms.
    open TR, "-|", "zcat", "-c", $filename;
    while (<TR>) {
         print "Line from compressed file: $_";
    }

Copyright 2003, Bri Hatch of Onsight, Inc.

Presented at SPUG, 2003.

Presentation created using vim and MagicPoint.