#!/usr/bin/perl # fit.pl - Don Yang (uguu.org) # # Fitting perl script to a layout is so easy, oh so easy ^_^ # # 07/10/03 @s = (); open SOURCE, "< $ARGV[0]" or die; for($i = 0; $i < (-s $ARGV[0]); $i++) { read SOURCE, $d, 1; push @s, $d unless( $d =~ /\s/ ); } close SOURCE; @t = (); open TEMPLATE, "< $ARGV[1]" or die; for($i = 0; $i < (-s $ARGV[1]); $i++) { read TEMPLATE, $d, 1; push @t, $d; } close TEMPLATE; foreach $c (@t) { if( $c =~ /\s/ ) { print $c; } else { $c = shift @s; print $c; } }