NikhilRangaraju has asked for the wisdom of the Perl Monks concerning the following question:
When i compiled it, "Product Legalcraft is not implemented for Platform " is shown as error and i couldnot understand what is the logic behind Diapatch() function.#!/usr/bin/perl use File::Basename; #--------------------------------------------------------------------- +--------- my $Product = 'LegalCraft'; my $Options = ''; my %Win32 = ( 'checkout' => Checkout, 'co' => Checkout, 'clean' => Clean, 'build' => Build ); my %Linux = ( 'checkout' => Checkout, 'co' => Checkout, 'clean' => Clean, 'build' => Build ); my %Platforms = ( 'win32' => \%Win32, 'linux' => \%Linux ); Dispatch(); #--------------------------------------------------------------------- +--------- sub Dispatch { if ( exists( $Platforms{ lc( $ENV{PLATFORM} ) } ) ) { print "\nProduct $Product - Platform $ENV{PLATFORM} supported!\n +"; } else { print "\nProduct $Product - Not implemented ". "for platform $ENV{PLATFORM}\n"; return; } my $FnTable = $Platforms{ lc( $ENV{PLATFORM} ) }; for ( @ARGV ) { if ( exists( $FnTable->{ lc( $_ ) } ) ) { print "\nProduct $Product - Platform $ENV{PLATFORM} - Functio +n $_\n"; $FnTable->{ lc( $_ ) }(); $Options = ''; } else { $Options .= " $_"; } } print "\n"; } sub ChProdDir { $_ = __FILE__; tr/\\/\//; chdir dirname $_; chdir '..'; } BEGIN { ChProdDir(); } sub Checkout { system "./cvs $Options checkout"; chdir '..'; system "cvs co $ENV{IMCOOPT} $Options viewer"; ChProdDir(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error with my perl script when i generate a script to cvs checkout
by Corion (Patriarch) on Feb 20, 2006 at 12:37 UTC |