Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^6: A Perl aptitude test

by marinersk (Priest)
on Jul 16, 2013 at 16:37 UTC ( [id://1044634]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: A Perl aptitude test
in thread A Perl aptitude test

I am saddened to see I never got around to thanking you for this post.

As a consequence of your reply, I learned that strict was lexically scoped, as well as the syntax for how to release its iron grip, as well as the idea that one could reduce only pertinent portion of its iron grip and the synxtax thereto, resulting in this snippet which was no longer relegated to its "quarantine module":

# If it's our last lock, release it. if (!$lckcnt) { # It's our last lock. Release the lock token file. my $lckfnm = &_getLockFilename($filfnm); { # Must disable warnings and strict for this no warnings; no strict; close $Lckhan{$KEY_LCKHAN}{$filfnm}; } }

So, as many times before, thanks for having taken the time to write this -- OMG -- ten years ago.

Replies are listed 'Best First'.
Re^7: A Perl aptitude test
by BrowserUk (Patriarch) on Jul 16, 2013 at 18:46 UTC

    I'm glad you found it useful :)

    But, I still don't get your problem with using file handles stored in hash elements with close when strict and warnings are enabled?

    C:\test>perl -mstrict -wE" open $f{w},'<words.txt'; print ~~readline($ +f{w}); close $f{w}" aa

    I can never work out how to use them with the angle bracket (<>) form of readline, but no problem with open or close.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      In my current version of Perl, I cannot reproduce the problem.

      Gut says your first guess a decade ago was right -- perhaps an old version of Perl (even for then). Seems a likely culprit.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-25 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found