Hi All,

I am trying to use Text::Autoformat as opposed to perls built in format stuff (based on the recommendation of Dave Rolsky).

Using the example provided in the docs for Text::Autoformat (version 1.04 by the way) I tried to setup a print form bit.

The form I setup is a bit complicated so I will refrain from posting it unless you all feel it is necessary. I am not sure it is since I could very well just be making a simple mistake here.

The problem is that when I try to run the print form bit I get this error.

/usr/local/lib/perl5/site_perl/5.6.1/Text/Autoformat.pm line 132: Can't use string ("") as a SCALAR ref while "strict refs" in use

128: my $text = ''; 129: my $rem = $_[1]; 130: my $config = $_[3]; 131: 132: $$ref =~ s/\A\s*//; 133: my $fmtnum = length $_[0];

None of the variables I am passing in to the print form are currently set (and in production some may be set and some may not be) I just want to see if the format is right by printing one without the variable data on it. Just the lines and such. Does Text::Autoformat not support doing this with empty variables? Will they all have to be set to have a blank space in them? Like, " " instead of ""? Any help with this matter would be appreciated. Thanks all.


In reply to Using Text::Autoformat by slvr_dagger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.