<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl, write format vars $= and $- problems, in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-write-format-vars-and-problems/m-p/4617751#M60639</link>
    <description>&lt;!--!*#--&gt;Hi Trent,&lt;BR /&gt;&lt;BR /&gt;I haven't used Perl's formats for ages&lt;BR /&gt;so I would have to reiterate over it myself again.&lt;BR /&gt;Maybe you find an answer in "perldoc perlform"?&lt;BR /&gt;&lt;BR /&gt;Btw. as for reassigning globals, &lt;BR /&gt;just localize them within a code block,&lt;BR /&gt;would this work?&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;  local ${=}=20;&lt;BR /&gt;  ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;What I also remember when I worked with formats that within them you sometimes would have to use some arcane dereferencing on variables to access their value,&lt;BR /&gt;like&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;format NAME =&lt;BR /&gt;FORMLIST&lt;BR /&gt;@{[$var1, $var2]}&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;But I my memory may misguide me here.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 15 Apr 2010 12:30:02 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2010-04-15T12:30:02Z</dc:date>
    <item>
      <title>Perl, write format vars $= and $- problems,</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-write-format-vars-and-problems/m-p/4617750#M60638</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I'm using perl program with &amp;lt; write FORMAT&amp;gt; to generate some reports and having problems to to deal with page break and line-per-page-no. &lt;BR /&gt;I can't manipulate $= and $- (which are global?), no matter what I do after wanted page break (if break $- =0;) or how I set number of lines on page ($= = 33) I still have defaulted 60 lines per page and don't have wanted page breaks. &lt;BR /&gt;&lt;BR /&gt;I tried to refer to them both as $= / $FORMAT_LINES_PER_PAGE, or $- / $FORMAT_LINES_LEFT , &lt;BR /&gt;in fact if I let say $FORMAT_LINES_PER_PAGE =33, then $= still shows 60 . I have  &lt;USE strict=""&gt;. I see that $- doesn't get changed &lt;BR /&gt;during the execution, it's alwayse = 0. and I see that var $% (page#) works just fine, get incremented by 1 after each 60 lines page break. &lt;BR /&gt;&lt;BR /&gt;Appreciate your help, is any package I'm missing, I'm using most recent ActivePErl on Wxp. Final destination will be Linux box. In worst I can probably turn off auto write format_TOP? so I will switch to my local vars. &lt;BR /&gt;But dying to crack this puzzle what is wrong with this vars?&lt;BR /&gt;&lt;BR /&gt;Tx &lt;BR /&gt;&lt;BR /&gt;Trent &lt;BR /&gt;Please don't send me somewhere else from Perl, in my situation I don't have other choice.&lt;BR /&gt;&lt;/USE&gt;</description>
      <pubDate>Wed, 14 Apr 2010 17:37:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-write-format-vars-and-problems/m-p/4617750#M60638</guid>
      <dc:creator>JianW</dc:creator>
      <dc:date>2010-04-14T17:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Perl, write format vars $= and $- problems,</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-write-format-vars-and-problems/m-p/4617751#M60639</link>
      <description>&lt;!--!*#--&gt;Hi Trent,&lt;BR /&gt;&lt;BR /&gt;I haven't used Perl's formats for ages&lt;BR /&gt;so I would have to reiterate over it myself again.&lt;BR /&gt;Maybe you find an answer in "perldoc perlform"?&lt;BR /&gt;&lt;BR /&gt;Btw. as for reassigning globals, &lt;BR /&gt;just localize them within a code block,&lt;BR /&gt;would this work?&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;  local ${=}=20;&lt;BR /&gt;  ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;What I also remember when I worked with formats that within them you sometimes would have to use some arcane dereferencing on variables to access their value,&lt;BR /&gt;like&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;format NAME =&lt;BR /&gt;FORMLIST&lt;BR /&gt;@{[$var1, $var2]}&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;But I my memory may misguide me here.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Apr 2010 12:30:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-write-format-vars-and-problems/m-p/4617751#M60639</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2010-04-15T12:30:02Z</dc:date>
    </item>
  </channel>
</rss>

