Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Perl6::Form 0.04

    Download button

    No screenshots available
    Downloads: 332  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Poor (1.6/5)
    3 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Damian Conway | More programs
    Perl Artistic License / FREE
    December 18th, 2007, 21:14 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Perl6::Form description

    Perl6::Form module implements the Perl 6 'form' built-in.

    Perl6::Form module implements the Perl 6 'form' built-in.

    SYNOPSIS

    use Perl6::Form;

    $text = form " =================================== ",
    "| NAME | AGE | ID NUMBER |",
    "|----------+------------+-----------|",
    "| {>} |",
    $name, $age, $ID,
    "|===================================|",
    "| COMMENTS |",
    "|-----------------------------------|",
    "| {[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[} |",
    $comments,
    " =================================== ";

    Formats are Perl 5's mechanism for creating text templates with fixed-width fields. Those fields are then filled in using values from prespecified package variables.

    Unlike Perl 5, Perl 6 doesn't have a format keyword. Or the associated built-in formatting mechanism. Instead it has a Form.pm module. And a form function.

    Like a Perl 5 format statement, the form function takes a series of format (or "picture") strings, each of which is immediately followed by a suitable set of replacement values. It interpolates those values into the placeholders specified within each picture string, and returns the result:

    $text = form
    $format_f1,
    $datum1, $datum2, $datum3,
    $format_f2,
    $datum4,
    $format_f3,
    $datum5;

    So, whereas in Perl 5 we might write:

    # Perl 5 code...

    our ($name, $age, $ID, $comments);

    format STDOUT
    ===================================
    | NAME | AGE | ID NUMBER |
    |----------+------------+-----------|
    | @>> |
    $name, $age, $ID,
    |===================================|
    | COMMENTS |
    |-----------------------------------|
    | ^

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    form built-in | Perl6 form | Perl module | Perl6 | form | built-in

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM