App-Navegante

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN


my $MY_YAPP = `which yapp`;
chomp $MY_YAPP;
$MY_YAPP eq '' and die "install Parse::Yapp";

my $MY_PERL = `which perl`;
chomp $MY_PERL;
my $bin = 'bin/navegante';

`$MY_YAPP -b $MY_PERL -o $bin lib/App/Navegante.yp`;
`chmod 755 $bin`;

WriteMakefile(
    NAME                => 'App::Navegante',
    AUTHOR              => 'Nuno Carvalho <smash@cpan.org>',
    VERSION_FROM        => 'lib/App/Navegante.pm',
    ABSTRACT_FROM       => 'lib/App/Navegante.pm',
    EXE_FILES           => [ $bin ],
    PL_FILES            => {},
    PREREQ_PM => {
        'Test::More'     => 0,

bin/navegante  view on Meta::CPAN


preparafiles($t->{action}) if $t->{action};
geraCgi($t);

sub preparafiles{
  my $a= shift;
  if($a->{save} && !-e $a->{save}{arg}){
      open(F,">$a->{save}{arg}") or die ("cant create $a->{save}{arg}\n");
      print F "##Created by FormLang\n";
      close F;
      chmod (0666,$a->{save}{arg})
  }
}

sub geraCgi{
    my %args = (%{$_[0]{action}}, PERL=>$_[0]{perl});
    my $t = App::Navegante::CGI->new(%args);

    if( defined $_[0]{action}{filename}) {
        open(F,">$_[0]{action}{filename}") or die ("cant create $_[0]{action}{filename}");
        print F $t->createCGI();
        close(F);
        chmod(0755,$_[0]{action}{filename});
    }
    else {
        print $t->createCGI();
    }
}

sub yyerror {
  if ($_[0]->YYCurtok) {
      printf STDERR ('Error: a "%s" (%s) was fond where %s was expected'."\n",
         $_[0]->YYCurtok, $_[0]->YYCurval, $_[0]->YYExpect)

lib/App/Navegante.yp  view on Meta::CPAN


preparafiles($t->{action}) if $t->{action};
geraCgi($t);

sub preparafiles{
  my $a= shift;
  if($a->{save} && !-e $a->{save}{arg}){
      open(F,">$a->{save}{arg}") or die ("cant create $a->{save}{arg}\n");
      print F "##Created by FormLang\n";
      close F;
      chmod (0666,$a->{save}{arg})
  }
}

sub geraCgi{
    my %args = (%{$_[0]{action}}, PERL=>$_[0]{perl});
    my $t = App::Navegante::CGI->new(%args);

    if( defined $_[0]{action}{filename}) {
        open(F,">$_[0]{action}{filename}") or die ("cant create $_[0]{action}{filename}");
        print F $t->createCGI();
        close(F);
        chmod(0755,$_[0]{action}{filename});
    }
    else {
        print $t->createCGI();
    }
}

sub yyerror {
  if ($_[0]->YYCurtok) {
      printf STDERR ('Error: a "%s" (%s) was fond where %s was expected'."\n",
         $_[0]->YYCurtok, $_[0]->YYCurval, $_[0]->YYExpect)



( run in 0.611 second using v1.01-cache-2.11-cpan-8d75d55dd25 )