Skip to content

Instantly share code, notes, and snippets.

@richardplatel
richardplatel / MyFoo.pm
Created October 3, 2012 01:20
Perl operator overloading
#!/usr/bin/perl
use strict;
use warnings;
package MyFoo;
use Data::Dumper;
use overload
'""' => "stringify",
@richardplatel
richardplatel / fsh.rb
Created June 18, 2013 03:43
Fake shell in Ruby
require 'fileutils'
class Fsh
def cmd(c)
# parse a command line and call appropriate function, returning output
c.match /^(\w+)\s*(.*)/ # only handles one argument
cmd = $1
arg = $2
case cmd