> > I'm trying to read from a file and based on the some of the > matched info, > print out certain statements. This is probably very easy for > > open(FILE, "< obj.list") or die "can't open file : $! " ; > open(NEW, "> new.list"); > > chomp(@lines = <FILE>); > > foreach my $item (@lines) { > if (/ADB/) { > print "grant select , update, delete, insert on " > $item " user;" > ; > print " grant select on " $item " to tcmesg_select ;" ; > if (/p_/) { > print " grant execute on " $item" to tcmesg_admin; " ; > } > } > > close(FILE); > > close(NEW); first thing, add 'use strict' and 'use warnings' to your script Did you want to print the results to a the new file ? if so your print statements should be like print NEW " grant select on \" $item \" to tcmesg_select ;" ;
can you tells what exactly went wrong. did you have errors or just not output ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]