Skip to content

Commit

Permalink
Cookbook.pod : use Dancer ':script' possibly better than use Dancer '…
Browse files Browse the repository at this point in the history
…:syntax' for external script use. Stuff like GetOpt in external script is left intact.
  • Loading branch information
jbarrett committed Dec 15, 2011
1 parent 4e8945d commit 713e154
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Dancer/Cookbook.pod
Expand Up @@ -694,7 +694,7 @@ Use Dancer instead. Without any ado, magic or too big jumps, you can use the
values from config.yml and some additional default values:

# bin/script1.pl
use Dancer ':syntax';
use Dancer ':script';
print "template:".config->{template}."\n"; #simple
print "log:".config->{log}."\n"; #undef

Expand All @@ -709,7 +709,7 @@ deducts where the config.yml file is (typically $webapp/config.yml).
# bin/script2.pl
use FindBin;
use Cwd qw/realpath/;
use Dancer ':syntax';
use Dancer ':script';

#tell the Dancer where the app lives
my $appdir=realpath( "$FindBin::Bin/..");
Expand All @@ -734,7 +734,7 @@ e.g.:
If you want to load an environment other than the default, try this:

# bin/script2.pl
use Dancer ':syntax';
use Dancer ':script';

#tell the Dancer where the app lives
Dancer::Config::setting('appdir','/path/to/app/dir');
Expand Down

0 comments on commit 713e154

Please sign in to comment.