in reply to Getting wierd results when looping through file contents
Also, there's no reason to slurp the entire input file here.foreach $table (@tables) { chomp $table; print OUTFILE <<"EOT"; BEGIN DBMS_REPCAT.CREATE_MASTER_REPOBJECT ( gname => 'beastdb_mstr_grp', type => 'TABLE', oname => '$table', sname => '$schema', use_existing_object => TRUE, copy_rows => FALSE); END; / EOT }
Update: If that looks too strange, you might want to do something like:open (INFILE, "< $infile") or die "Couldn't open $infile: $!"; open (OUTFILE, "> $outfile") or die "Couldn't open $outfile: $!"; chomp, print OUTFILE <<"EOT" while <INFILE>; # shorter version BEGIN DBMS_REPCAT.CREATE_MASTER_REPOBJECT ( gname => 'beastdb_mstr_grp', type => 'TABLE', oname => '$_', sname => '$schema', use_existing_object => TRUE, copy_rows => FALSE); END; / EOT close (INFILE); close (OUTFILE);
____________foreach $table (@tables) { print OUTFILE (map "$_\n", "BEGIN", " DBMS_REPCAT.CREATE_MASTER_REPOBJECT (", " gname => 'beastdb_mstr_grp',", " type => 'TABLE',", " oname => '$table',", " sname => '$schema',", " use_existing_object => TRUE,", " copy_rows => FALSE);", "END;", "/\n", ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting wierd results when looping through file contents
by Anonymous Monk on Jun 26, 2002 at 16:41 UTC | |
|