Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How to route a format into a variable

by physi (Friar)
on Feb 12, 2003 at 17:43 UTC ( [id://234761]=note: print w/replies, xml ) Need Help??


in reply to How to route a format into a variable

Just a question,
if you want your formated output alltogether in on variable, why don't you use  sprintf and concat all the lines together in one string, or maybe one array ?

-----------------------------------
--the good, the bad and the physi--
-----------------------------------

Replies are listed 'Best First'.
Re: Re: How to route a format into a variable
by ppm (Novice) on Feb 12, 2003 at 17:51 UTC
    >> why don't you use sprintf

    i don't know how to do this with formats ;o) do you have a solution?

      There is an example of a sprintf-like function emulating write in the Perl Formats documentation, reproduced below for convenience.

      use Carp; sub swrite { croak "usage: swrite PICTURE ARGS" unless @_; my $format = shift; $^A = ""; formline($format,@_); return $^A; } $string = swrite(<<'END', 1, 2, 3); Check me out @<<< @||| @>>> END print $string;

          --k.


        @Kanji:

        yes, i saw this topic .. but i don't understand how to use this for my e.g. any help?

        @Kanji:

        yes, i saw this topic . but i've no idea how to do this for my e.g. do you have any ideas?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://234761]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-19 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found