Navigation Menu

Skip to content

Commit

Permalink
show slurp and spurt in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 7, 2017
1 parent c3cd577 commit 2468ed8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Mojo/File.pm
Expand Up @@ -120,12 +120,14 @@ Mojo::File - File paths
use Mojo::File;
my $path = Mojo::File->new('/home/sri/.vimrc');
say $path->slurp;
say $path->basename;
say $path->dirname->child('.bashrc');
# Use the alternative constructor
use Mojo::File 'path';
my $path = path('/home/sri/.vimrc')->dirname;
my $path = path('/tmp/foo/bar')->make_path;
$path->child('test.txt')->spurt('Hello Mojo!');
=head1 DESCRIPTION
Expand Down

0 comments on commit 2468ed8

Please sign in to comment.