Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

> Where can I read about functions that have comma and non-comma parsings?

in my own words:

BLOCK means { code } in curlies, like map { $_ +1 } 1..3, so no comma

DB<124> map { $_ +1 } 1..3 => (2, 3, 4)

EXPR can be any "atomar" code-snippet.

DB<128> map sqrt , 1..3 => (1, "1.4142135623731", "1.73205080756888") DB<129> map 5 , 1..3 => (5, 5, 5)

in both cases the list values are passed by setting a special variable (aka default variable) $_

according to perlglossary

BLOCK A syntactic construct consisting of a sequence of Perl stat +ements that is delimited by braces. The "if" and "while" statemen +ts are defined in terms of BLOCKs, for instance. Sometimes we als +o say "block" to mean a lexical scope; that is, a sequence of sta +tements that act like a "BLOCK", such as within an eval or a file, +even though the statements arenít delimited by braces. ... expression Anything you can legally say in a spot where a "value" is required. Typically composed of literals, variables, opera +tors, functions, and "subroutine" calls, not necessarily in that +order.

Cheers Rolf

( addicted to the Perl Programming Language)


In reply to Re^5: map sub to list? (glossary) by LanX
in thread map sub to list? by pldanutz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2022-11-28 10:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?