Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Getting wierd results when looping through file contents

by mfriedman (Monk)
on Jun 26, 2002 at 16:16 UTC ( [id://177424]=note: print w/replies, xml ) Need Help??


in reply to Getting wierd results when looping through file contents

Each line of the tables file does have a newline at the end, and that newline is at the end of each $table as you go through the loop. The reason the chomp didn't work is because it "returns the total number of characters removed from all its arguments." That's why you're getting a 1.

Thus, all you need to do is change your foreach loop to:

foreach $table (@tables) { chomp $table; print OUTFILE "BEGIN\n"; print OUTFILE " DBMS_REPCAT.CREATE_MASTER_REPOBJECT (\n"; print OUTFILE " gname => 'beastdb_mstr_grp',\n"; print OUTFILE " type => 'TABLE',\n"; print OUTFILE " oname => '$table',\n"; print OUTFILE " sname => '$schema',\n"; print OUTFILE " use_existing_object => TRUE,\n"; print OUTFILE " copy_rows => FALSE);\n"; print OUTFILE "END;\n"; print OUTFILE "/\n\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://177424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-04-23 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found