By a naked block, I think you mean a block of code surrounded by braces that stands by itself and isn't part of an if, while, do, etc. You use these to limit scope. You can declare lexical variables inside that block. Once you reach the end of the block, those variables go away. You can exit the block with next.
There are certain things to use regex's for and certain things that are easier in other ways. There are also some things that you should avoid within regex's like .* (see Death to Dot Star! for the gorey details).
next brings you to bottom of an iteration loop. It does not bring you to the bottom iteration of the loop. It kind of jumps to the closing brace. Actually, it goes to the continue action of the loop. You can have more than one next in your loop but only one of them can execuate on any given iteration.
---
print map { my ($m)=1<<hex($_)&11?' ':'';
$m.=substr('AHJPacehklnorstu',hex($_),1) }
split //,'2fde0abe76c36c914586c';
-
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.
|