Perl Programming/Keywords/format

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: foreach Keywords Next: formline

The format keyword[edit | edit source]

The format command declares a picture format for use by the write function.

Syntax[edit | edit source]

  format

Examples[edit | edit source]

    format Something =
        Test: @<<<<<<<< @||||| @>>>>>
              $str,     $%,    '$' . int($num)
    .
    $str = "widget";
    $num = $cost/$quantity;
    $~ = 'Something';
    write;
Previous: foreach Keywords Next: formline