Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Supressing zero values in formatted reports

by robin (Chaplain)
on Dec 28, 2001 at 15:41 UTC ( #134853=note: print w/replies, xml ) Need Help??


in reply to Supressing zero values in formatted reports

From the perlform manpage:
Picture fields that begin with ^ rather than @ are treated specially. With a # field, the field is blanked out if the value is undefined. For other field types, the caret enables a kind of fill mode.
So change your @#### to ^####, and make sure the values you want to suppress are undefined.

The second problem is that using an undefined value when warnings are enabled will generate several warning messages. I suggest disabling warnings within the format, like this:

{ no warnings; format STDOUT = @<<<<<<<<<<<<< ^#### @#####.## $output[$i], $output[$i+1], $output[$i+2]/1024 . }

Replies are listed 'Best First'.
Re: Re: Supressing zero values in formatted reports
by Fengor (Pilgrim) on Dec 28, 2001 at 15:50 UTC
    hmm guess i should read more carefully next time ;-)

    thx
    fengor

    --
    "WHAT CAN THE HARVEST HOPE FOR IF NOT THE CARE OF THE REAPER MAN"
    -- Terry Pratchett, "Reaper Man"

Re: Supressing zero values in formatted reports
by ryan (Pilgrim) on Dec 28, 2001 at 15:50 UTC
    That works, thanks for that, I must try to search more for the answers for these things. I did a lot of searching in the wrong places :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2022-05-28 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (99 votes). Check out past polls.

    Notices?