Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: (Partial answers to) Barstool Trivia

by tilly (Archbishop)
on Dec 16, 2000 at 03:45 UTC ( #46977=note: print w/replies, xml ) Need Help??

in reply to (Partial answers to) Barstool Trivia
in thread Barstool Trivia

Do you count the fact that a loop starts two scopes, not one?
for (my $x = 0; $x < 10; ++$x) { # stuff my $y = $x; # more stuff }
Note that $x and $y are in different scopes. $y is local to the body of the loop. $x is global to the loop.

Also for some definition of scope, <package> starts a new scope.

And if we want the source differing, an if starts a scope and is different from either a block or a loop - try to do redo and it ignores the enclosing if for the enclosing block or loop.

I have also had occasion to run Perl code in a different process by opening a pipe to it, writing my code on the pipe, and then sending __END__. Does that count?

What about running code using reval from Safe? Does that count as different from eval?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://46977]
[Corion]: Nicholas Clark++ # read for a multichar block-delimiter by scanning for the last char, and only then check whether the whole delimiter was read.
[Corion]: At least if you're appending the data read to a larger buffer, this means you avoid the situation of "a delimiter was found but the other half has not been read yet"

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2016-12-06 14:56 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (107 votes). Check out past polls.