Acme-Machi
view release on metacpan or search on metacpan
lib/Acme/Machi.pm view on Meta::CPAN
package Acme::Machi v1.00.1 {
use v5.16.2;
use strict;
use warnings;
use IO::Dir;
use File::Spec;
use File::Basename;
use Data::Dumper;
use Cwd;
use Carp;
#import CPAN libs
use namespace::autoclean;
=head1 NAME
Machi - Awesome Machi here!
=head1 VERSION
Version v1.00.1
=cut
=head1 SYNOPSIS
Quick summary of what the module does.
Exactly a little code snippet.
use Acme::Machi;
my $loli = Acme::Machi->new( $name ); # Give birth to a person; accept an optional argument to set the person's name.
$loli->named( $name ); # Name the person. Default name is 'Machi'.
$loli->name(); # Get person's name.
$loli->have_the_habit_of( $habit ); # Person gets into certain searching habit.
$loli->habit(); # Get one's searching habit.
$loli->learning( @words ); # Teach the person saying something endearing.
$loli->affectionate( $file_handle ); # The person shall randomly tell about what you previously teached her/him to say.
$loli->search_file_from( $target, $dir, $RESP ); # Search file/dir from certain spcified directory using BFS or DFS.
# The third argument $RESP representing 'Responsible', which means she/he will
# stop searching and come back in a moment when finding the target one.
# In case $RESP is in zero state or $RESP is set but the target isn't found,
# she/he will finally print out the tree-like structure of your file system
# before coming back in despair.
=head1 METHODS
=head2 new
Create a Machi-type instance.
=cut
sub new {
(ref $_[0]) && croak "Oops! Cannot use instance method to construt an object!";
bless {
Name => $_[1] // "Machi",
Words => ["I am starving!!"], # In general, creatures always know how to express their hunger.
SRCH_Habit => 'BFS',
}, $_[0];
}
=head2 named
Assign a new value to scalar-type instance variable, 'Name', in the object.
( run in 2.378 seconds using v1.01-cache-2.11-cpan-524268b4103 )