I'd really prefer to be able to use a format declaration, because the formats I'll need to use are usually multiline and I don't want to have to go into all that complicated stuff when I decided to use format to simplify things to begin with.

I've been experementing with pipe, but it keeps locking up... Any suggestions?

This code seems to work:
pipe(TESTOUT,TEST) or die($!); my $t1 = '1'; my $t2 = '2'; my $t3 = '3'; select(TEST); $|=1; print "Testing..."; write(); close(TEST); select(STDOUT); my @temp = <TESTOUT>; print join('',@temp); format TEST= @||| @||| @||| $t1,$t2,$t3 @||| @||| @||| $t3,$t2,$t1 .


However, when I try a longer format, it tends to freeze:

my $GMS = new GMS; my $sitename = $GMS->getsetting('GUILD','SITENAMET'); my($name,$email,$icq) = ('Iron','flame@berkshire.rr.com','16307443'); my @stats = (100,100,25); my $skills = [ {'SKILL' => 'Anatomy','VALUE' => 100}, {'SKILL' => 'Swordsmanship','VALUE' => 100}, {'SKILL' => 'Tactics','VALUE' => 100} ]; my $notes = "This is a long test string.\n\n" x 10; pipe(GMMAILO,GMMAIL) or die($!); select(GMMAIL); $|=1; print "Testing..."; write();# or die($!); close(GMMAIL); select(STDOUT); my @temp = <GMMAILO>; print join('',@temp);




"Weird things happen, get used to it."

Flame ~ Lead Programmer: GMS


In reply to Re: Re: format and IO::String by Flame
in thread format and IO::String by Flame

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.