Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Text::Autoformat

by Andrew_Levenson (Hermit)
on Apr 28, 2006 at 20:23 UTC ( [id://546388]=note: print w/replies, xml ) Need Help??


in reply to Re: Text::Autoformat
in thread Text::Autoformat

Aha! That was interesting. I failed to notice that when figuring it out initially, but... huh. Thanks for your help!
use strict; use warnings; use Text::Autoformat; my $str=qw/@/; for my $i(1..11){ my $newStr = autoformat ($str, { justify => 'center' }); print "$newStr\n"; $str .= '@@' if $i <= 5; substr $str, -2, 2, '' if $i > 5; }

Replies are listed 'Best First'.
Re^3: Text::Autoformat
by GrandFather (Saint) on Apr 28, 2006 at 20:39 UTC

    The trouble now is that the output is triple spaced. You can improve it to double spaced by removing the new line from the print. At the end of the day however Autoformat is not doing a good job for you. Nice idea, but no banana.

    I suspect in general that competitions don't expect you to have access to a full range of CPAN modules and that there is generally a reasonable way of solving the problem without resorting to a module such as Text::Autoformat.

    The single print version can be done without much modification of your current code and not using Text::Autoformat.


    DWIM is Perl's answer to Gödel
      In the competition, we can't use any modules that are not already on our system. (Unless we write our own, they have to come with the language initially.) So until I get this over with, i'm going to stick to what I know and what works. Then I figure out how to do it better. Thanks for all of your help and insight.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found