cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
opendir( DIR, '.' );
    my @files = readdir(DIR);
closedir( DIR );
my $findbin = q#BEGIN {
    use FindBin qw ($RealBin $RealScript);
    my ($binpath) = $FindBin::RealBin =~ /^(.*)$/;
    chdir $binpath;
}
#;
foreach my $file ( @files ) {
    next if $file !~ /\.pl$/;
    local $/;
    open( INF, $file );
        my $contents = <INF>;
    close( INF );
    $contents =~ s/^(.*?\n)/$1$findbin/;
    open( OUTF, ">$file" );
        print OUTF $contents;
    close( OUTF );
    print "Updated $file\n";
}
print "Complete";
my $read = <STDIN>;

Save and execute with Perl in the foswiki/bin folder.

-- CosmicNet - 16 May 2011
Topic revision: r1 - 16 May 2011, CosmicNet - This page was cached on 21 Aug 2018 - 15:49.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy