May
22

you know you're deep in code

Published: Wednesday, May 22, 2002, at 11:27AM

You know you're deep in code when you sit down to write a little test script to see how something works and it comes out like the following... (Click to see)

The code:

#!/usr/bin/perl

use Symbol;

my $obj = foobar->init();
my $a = $obj->can("foo");
*{qualify_to_ref("foobar::foo")} = \&foo;
$obj->foo($a);

sub foo { print "bar\n"; &{$_[1]}; }

#----------

package foobar;
sub init { return bless({},shift); }
sub foo { print "foo\n"; }

Like usual, this is code for eThreads. It plays with fun Perl globs and coderefs.

Comments

No comments yet.

Your Comment:

YOUR INFORMATION:
Name:
Email:
URL:
  • Comments should be on the topic of the post or they will be removed.
  • Use the live preview below to see how your comment will look before posting.
  • Keep it civil. If you're attacking people instead of arguments, or being overly profane, expect your comment to get deleted.

FORMATTING BASICS:

eWorld uses Markdown formatting.

_Italics_
__Bold__
<http://url.to.link>
[link text](http://url)

COMMENT:

Preview

Start typing...