Archive-TarGzip

 view release on metacpan or  search on metacpan

t/Archive/TarGzip/expected/t/Data/Str2Num.d  view on Meta::CPAN

#
# UUT: Data::Str2Num
#
# The module Test::STDmaker generated this demo script from the contents of
#
# t::Data::Str2Num 
#
# Don't edit this test script file, edit instead
#
# t::Data::Str2Num
#
#	ANY CHANGES MADE HERE TO THIS SCRIPT FILE WILL BE LOST
#
#       the next time Test::STDmaker generates this script file.
#
#

######
#
# The working directory is the directory of the generated file
#
use vars qw($__restore_dir__ @__restore_inc__ );

BEGIN {
    use Cwd;
    use File::Spec;
    use File::TestPath;
    use Test::Tech qw(tech_config plan demo skip_tests);

    ########
    # Working directory is that of the script file
    #
    $__restore_dir__ = cwd();
    my ($vol, $dirs, undef) = File::Spec->splitpath(__FILE__);
    chdir $vol if $vol;
    chdir $dirs if $dirs;

    #######
    # Add the library of the unit under test (UUT) to @INC
    #
    @__restore_inc__ = File::TestPath->test_lib2inc();

    unshift @INC, File::Spec->catdir( cwd(), 'lib' ); 

}

END {

   #########
   # Restore working directory and @INC back to when enter script
   #
   @INC = @__restore_inc__;
   chdir $__restore_dir__;

}

print << 'MSG';

 ~~~~~~ Demonstration overview ~~~~~
 
Perl code begins with the prompt

 =>

The selected results from executing the Perl Code 
follow on the next lines. For example,

 => 2 + 2
 4

 ~~~~~~ The demonstration follows ~~~~~

MSG

demo( "\ \ \ \ use\ File\:\:Package\;\
\ \ \ \ my\ \$fp\ \=\ \'File\:\:Package\'\;\
\
\ \ \ \ my\ \$s2n\ \=\ \'Data\:\:Str2Num\'\;\
\ \ \ \ my\ \$loaded\;"); # typed in command           
          use File::Package;
    my $fp = 'File::Package';

    my $s2n = 'Data::Str2Num';
    my $loaded;; # execution

demo( "my\ \$errors\ \=\ \$fp\-\>load_package\(\$s2n\)"); # typed in command           
      my $errors = $fp->load_package($s2n); # execution

demo( "\$errors", # typed in command           
      $errors # execution
) unless     $loaded; # condition for execution                            

demo( "\$s2n\-\>str2int\(\'033\'\)", # typed in command           
      $s2n->str2int('033')); # execution


demo( "\$s2n\-\>str2int\(\'0xFF\'\)", # typed in command           
      $s2n->str2int('0xFF')); # execution


demo( "\$s2n\-\>str2int\(\'0b1010\'\)", # typed in command           
      $s2n->str2int('0b1010')); # execution


demo( "\$s2n\-\>str2int\(\'255\'\)", # typed in command           
      $s2n->str2int('255')); # execution


demo( "\$s2n\-\>str2int\(\'hello\'\)", # typed in command           
      $s2n->str2int('hello')); # execution



=head1 NAME

Str2Num.d - demostration script for Data::Str2Num

=head1 SYNOPSIS

 Str2Num.d



( run in 1.019 second using v1.01-cache-2.11-cpan-0b5f733616e )