use IO::All;
# Let the madness begin...
# Some of the many ways to read a whole file into a scalar
io('file.txt') > $contents;
# Overloaded "arrow"
$contents < io 'file.txt';
# Flipped but same operation
$io = io 'file.txt';
# Create a new IO::All object
$contents = $$io;
# Overloaded scalar dereference $contents =
$io->all;
# A method to read everything
$contents = $io->slurp;
# Another method for that
$contents = join '', $io->getlines;
# Join the separate lines
$contents = join '', map "$_\n", @$io;
# Same. Overloaded array deref
$io->tie;
# Tie the object as a handle
$contents = join '', <$io>;
# And use it in builtins # and the list goes on ...
Super neat lib.