#!/usr/bin/perl # $Header: perldb,v 1.0.1.5 88/03/02 12:42:34 root Exp $ # # $Log: perldb,v $ # Revision 1.0.1.5 88/03/02 12:42:34 root # patch24: / was treated like operator when it should have been match delim # patch24: "standard" directory changed from /bin to /usr/bin # # Revision 1.0.1.4 88/02/25 11:46:57 root # patch23: perldb doesn't correctly handle "else" and "continue". # # Revision 1.0.1.3 88/02/04 00:24:05 root # dummy checkin to get around RCS bug. # # Revision 1.0.1.2 88/02/04 00:12:23 root # patch16: no line in tokener to handle `cmd` construct. # # Revision 1.0.1.1 88/01/28 10:27:16 root # patch8: created this file. # # $tmp = "/tmp/pdb$$"; # default temporary file, -o overrides. # parse any switches while ($ARGV[0] =~ /^-/) { $_ = shift; /^-o$/ && ($tmp = shift,next); die "Unrecognized switch: $_"; } $filename = shift; die "Usage: perldb [-o output] scriptname arguments" unless $filename; open(script,$filename) || die "Can't find $filename"; open(tmp, ">$tmp") || die "Can't make temp script"; $perl = '/usr/bin/perl'; $init = 1; $state = 'statement'; # now translate script to contain DB calls at the appropriate places while (