Thanks Rob Its working Fine, Now when I am using the below code to write something to file "messages" the below code is not writing the text "write some text " to the file messages.
############################################## #!/usr/bin/perl use strict; use warnings; open(LOGFILE, "messages") || warn "Could not open messages.\n"; open(DATA, ">/tmp/data") || die "Could not create /tmp/data\n."; print LOGFILE "write some text "; ############################################## when i do a less messages, i see there is no text "write some text" at the end of the file. what I am doing wrong. Thanks and Regards Kaushal On 11/1/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Kaushal Shriyan wrote: > > Hi > > > > I am using FileHandle, Below is my code > > ######################################## > > > > #!/usr/bin/perl > > > > use warnings; > > use strict; > > > > open(LOGFILE, "messages") > > || warn "Could not open messages"; > > open(DATA, ">/tmp/data") || die "Could not create /tmp/data\n." > > > > while (<LOGFILE>) { > > print "$_\n" if /MARK/; > > } > > ####################################### > > > > I am getting syntax error > > > > I know i am doing wrong, please let me know whats causing the issue. > > You have missed the semicolon from the end of your second 'open' > statement. > > Rob >