Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
hi,

I've got -3 of reputation for my contribution here.   As the update mentions my use of map in void context, i started searching about map function : i first used SuperSearch and found this.   I read "use of map in void context is deprecated" ..

Then I go on searching through usenet, and in a french newsgroup archives ( fr.comp.lang.perl ) i could read this piece of code showing the use of map in void context is still valid :

on the one hand :
$ perl -wle 'map { print } qw(d c a b)'
d
c
a
b
$ perl -wle 'sort { print "$a<=>$b"; $a cmp $b } qw(e d c a b)'
Useless use of sort in void context at -e line 1.

In perldoc -f map there's no use in a void context and they don't mention it at all.   I hope you can tell me more about it

Thanks in advance,
Arnaud

janitored by ybiC: Convert <a href="http://www.perlmonks.org/index.pl...">dis and dat</a> links to [id://foo|and dem] PM style to not log out monks with cookie set to other domains.


In reply to is the use of map in a void context deprecated ? by arno

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?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-29 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found