CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Print with auto indent



Jan 15, 2015, 5:43 AM

Post #1 of 2 (1241 views)
Print with auto indent Can't Post

Perl 5.8.8 on Linux

This is something I've never done but would come in handy for debugging. I'd like to print a statement but with auto indent for long lines. Thus I'd like to print "Stored key: with long data" and the auto indent would be after the colon and space. I.e. the auto ident would align with the space after the colon but I wouldn't have to do any manual alignment in the program itself.

Is this even possible with Perl?


Stored key: very long line blah blah blah say ignore extra spaces here 
wrap starts here and goes from here this is auto indent


Veteran / Moderator

Jan 15, 2015, 6:27 AM

Post #2 of 2 (1239 views)
Re: [bulrush] Print with auto indent [In reply to] Can't Post

Text::Wrap - line wrapping to form simple paragraphs

Text::Wrapper - Word wrap text by breaking long lines

perldoc -f format


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives