Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks, I am using Text::Autoformat for formatting.When i call, autoformat($rawtext, {left=>0, right=>60},it does the formatting but an additional new line and hypen are also getting created which i dont want.can anyone please tell how to get rid of the newline. my code
my $file = "/home/temp1/temp2/temp3/temp4/temp4/temp5/temp6/temp7/temp +8/temp9.tcl in config.tcl"; my $rawtext = "File not found.setting default $file in config.tcl."; autoformat($rawtext, {left=>0, right=>60}); output: File not found.setting default /home/temp1/temp2/t-emp3/temp4/temp4/te +mp5/temp6/temp7/temp8/temp- 9.tcl in config.tcl. with the above output a newline is also added. but actual output i need is: File not found.setting default /home/temp1/temp2/temp3/temp4/temp4/tem +p5/temp6/temp7/temp8/temp9.tcl in config.tcl. no hypens & no newlines.
I have used dummy names and dummy code (almost similiar to my code)... Thanks in advance

Replies are listed 'Best First'.
Re: question on Text::Autoformat
by jbrugger (Parson) on Jan 27, 2006 at 06:11 UTC
    I'm no expert on Text::Autoformat, but as i read it correctly, your margins aren't correct.
    try: autoformat($rawtext, {left=>0, right=>130}); And see if it suits your needs

    Or if it's only this line, you might ignore it:
    # Reformat all paras except those containing "File not found"... print autoformat { all => 1, ignore => qr/File not found/i }, $rawtext +;


    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.