in reply to Controlling Running Perl Scripts

maybe something like ...?
our @sequence = ( "path1", "path2", # ... ); sub nextpath { for ( my $i=0; $i<=$#sequence; $i++ ) { ( $PATH_INFO eq $sequence[$i] ) or next; ( $i < $#sequence ) ? return( $sequence[$i+1]); : return( $sequence[0]); } undef(); }
(updated with thx to shigetsu)
__________________________________________________________________________________

^M Free your mind!

Replies are listed 'Best First'.
Re^2: Controlling Running Perl Scripts
by shigetsu (Hermit) on Apr 25, 2007 at 16:12 UTC
    There's a minor typo:
    our $sequence = ( "path1", "path2", # ... );
    should probably read
    our @sequence = ...
    instead.
      I am going to test with something like that!Thanks!
        Of course, modularize it so you can easily share it across all your scripts... if you only have one sequence then an array works... if you have multiple or may have multiple then I would either use files or a hash of arrays and pass the hash key or the file name between the CGIs that contains the proper sequence.

                        - Ant
                        - Some of my best work - (1 2 3)