#!/usr/bin/env perl $spli = $ARGV[0]; $incl = $ARGV[1]; $wrap = $ARGV[2]; if ("$incl" eq "-") { open(INCL, "<&=STDIN") or die "Couldn't alias STDIN: $!"; } else { open (INCL, "$incl") || die "$!"; } open (WRAP, "$wrap") || die "$!"; while () { s!\$\{BASE_URL\}!\${BASE_URL#./}!g; #s!\$BASE_URL!\${BASE_URL#./}!g; if ( m/^.*${spli}.*/ ) { while () { print; } } else { print; } } close INCL; close WRAP;