Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Console Output Formatting Help Required

by wjw (Curate)
on Sep 27, 2013 at 07:29 UTC ( #1055940=note: print w/ replies, xml ) Need Help??


in reply to Console Output Formatting Help Required

Stuck my foot in it... should have read the doc myself... guess that is used primarily to write to a file handle. (Tis what I get for being at this hour) Sorry for the chaff...

...figure I might take a gander at Format.

Been a long time since I used it, but seem to recall being able to tune things nicely using it...

But it has been a long time... :-)

  • ...the majority is always wrong, and always the last to know about it...
  • ..by my will, and by will alone.. I set my mind in motion


Comment on Re: Console Output Formatting Help Required
Re^2: Console Output Formatting Help Required
by hippo (Curate) on Sep 27, 2013 at 13:22 UTC

    I see no reason not to use format for this case. eg:

    #!/usr/bin/perl -Tw use strict; use warnings; my @foo = ( "Mapping a drive to build machine 10.211.32.254..\rMapped to V dri +ve", 'Deleting TestHarness_LUA directory..', 'Deleting TestHarness_LUA-distribution.zip file..', 'Copying TestHarness_LUA-distribution.zip from mapped V drive..' ); for (@foo) { my $status = "done."; format STDOUT = ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^<<<<< $_, $status . write while $_; }
Re^2: Console Output Formatting Help Required
by wjw (Curate) on Sep 27, 2013 at 19:28 UTC
    Stuck my other foot in it... I was wrong about being wrong. Thanks for pointing that out!

    Perhaps I should stick with my first instincts... and try them before posting. Lesson learned. And thank for the code. If I had done that to begin with I would be tasting two less samples of shoe leather. Have a great day!

    • ...the majority is always wrong, and always the last to know about it...
    • ..by my will, and by will alone.. I set my mind in motion

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-12-28 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls