Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: top-of-form w/o formfeed Message-ID: <10500@jpl-devvax.JPL.NASA.GOV> Date: 21 Nov 90 17:49:14 GMT References: <1990Nov20.222930.1152@squirrel.mh.nl> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: comp Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 37 In article <1990Nov20.222930.1152@squirrel.mh.nl> Johan Vromans writes: : Using write: how can I force the $^ format to be printed without a : formfeed character being inserted? Depends on what you mean. If you mean that you want to write the top of form format in the middle of a page, something like { local($~) = $^; write; } should work. If you mean you want to have $^ do top-of-page with line-feeds rather than a form feed (ala nroff), there's no direct way to do that, other than keeping track of the number of lines on the page yourself and printing out a string of newlines at the right moment. Either that, or running it through some output filter: $pid = open(OUT, "|-"); die "Can't fork: $!\n" unless defined $pid; unless ($pid) { # we're the child process $/ = "\f"; while (<>) { # slurp each page chop; # delete form feed $count = tr/\n/\n/; # count newlines print $_, "\n" x (66 - $count); } exit; } ... write OUT; # or dup to STDOUT This latter trick can also be used to massage headers into footers. Larry