home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_e65c7ba6650fc2e090b03ccf04197e78
< prev
next >
Wrap
Text File
|
2000-03-15
|
678b
|
31 lines
use B::Assembler qw(assemble_fh);
use FileHandle;
my ($filename, $fh, $out);
if ($ARGV[0] eq "-d") {
B::Assembler::debug(1);
shift;
}
$out = \*STDOUT;
if (@ARGV == 0) {
$fh = \*STDIN;
$filename = "-";
} elsif (@ARGV == 1) {
$filename = $ARGV[0];
$fh = new FileHandle "<$filename";
} elsif (@ARGV == 2) {
$filename = $ARGV[0];
$fh = new FileHandle "<$filename";
$out = new FileHandle ">$ARGV[1]";
} else {
die "Usage: assemble [filename] [outfilename]\n";
}
binmode $out;
$SIG{__WARN__} = sub { warn "$filename:@_" };
$SIG{__DIE__} = sub { die "$filename: @_" };
assemble_fh($fh, sub { print $out @_ });