in reply to Basic rest service help

read perlintro, and use diagnostics;, then fix the typo
# This is a helper to slurp up files, I could have just used File::Slu +rp sub slurp($) { my $filename = shift; # Slurp up the contents of the given filename open my $slurpy, '<', $file or die "Cannot open $file: $!"; return do { local $/; <$slurpy> }; }
$filename is not $file

Replies are listed 'Best First'.
Re^2: Basic rest service help
by tilly (Archbishop) on Jan 24, 2011 at 14:54 UTC
Re^2: Basic rest service help
by Anonymous Monk on Jan 24, 2011 at 09:36 UTC

    hi thanks for your response... i did correct the mistake. while creating the file(./book create treasury.yml) it gives "Cannot open treasury.yml: No such file or directory at ./book line 68." when i create a file with treasury.yml and run it gives "ERROR I Only Do Hashes: The submitted YAML data is not a HASH." .. what is the correct way to do this...

      what is the correct way to do this...

      As described in the article? What exactly did you do?

        i created the file treasury.yml by using the following.

        #file name yaml.pl use YAML qw(Dump Bless); $hash = {isbn => '0-7852-1155-1', title => 'The New Strong Exhaustive +Concordance of the Bible', author => 'James Strong, LL.D., S.T.D.', p +ublisher => 'Thomas Nelson Publishers', city => 'Nashville, Tennessee +', year => '1995'}; print Dump $hash;

        perl yaml.pl > treasury.yml

        then i used ./book list.. not working