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

Re: A few random questions from Learning Perl 3

by pfaut (Priest)
on Jan 06, 2003 at 04:48 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://224540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found