There are two syntaxes for calling map. If you are passing a block of code, there is no comma between the block and the list. If you are passing an expression, there is a comma. In this case, since it's just a string, I'd recommend the expression form.
Watch out if your expression is surrounded by parentheses, though, because map will think they enclose all of its arguments. You either need two sets of parens (one around your expression, and one around all of map's args), or you don't need any. In your case, you don't need any.
return map "$url/$_\n", @list;
Caution: Contents may have been coded under pressure.
-
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.
|