[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] Dec 16 mtg notes



Ooops, I never did post this. These were my notes from Ron and I messing w/ Tie::STDERR and Handler during our Dec 16 mtg.

j


-----------------------------

use Tie::STDERR \&func;

warn "Ack!";

sub func {
   print "Trapped: [@_]\n";
}


------------------------------------

use Tie::STDERR \&func;

warn "Ack!";

sub func {
   print "Trapped: [@_]\n";
}

         use Net::FTP;
           $ftp = Net::FTP->new("ftp.microsoft.com", Debug => 0)
             or die "Cannot connect to some.host.name: $@";

       $ftp->login("anonymous",'blah@jays.net')
             or die "Cannot login ", $ftp->message;

        $ftp->put("that.file")
           ; # or die "put failed ", $ftp->message;


-------------------------------


package Handler;

sub TIEHANDLE { print "<shout>\n"; my $i; bless \$i, shift }
sub PRINT { print "Handled: [", shift, "]\n" }

package main;

tie(*STDOUT, 'Handler');
tie(*STDERR, 'Handler');

print "boo!";
#warn "BOO!";