Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Micro Mocking: using local to help test subs

by Zaxo (Archbishop)
on Jan 13, 2003 at 01:47 UTC ( #226374=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Errno qw( ENOSPC );
    {
        local *CORE::GLOBAL::print = sub { $! = ENOSPC; return};
        # make test call
        # see what happens when a device is full
    }
    
  2. or download this
    {
        open local(LOG), '>>', '/dev/full' or die $!;
        # /dev/full is a Linux thing
        # call the test
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-03-30 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (74 votes). Check out past polls.

    Notices?