Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: A few random questions from Learning Perl 3

by pfaut (Priest)
on Jan 06, 2003 at 04:48 UTC ( #224540=note: print w/replies, xml ) Need Help??


in reply to A few random questions from Learning Perl 3

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';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://224540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-02-17 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?