Loading ...
Sorry, an error occurred while loading the content.

Help required

Expand Messages
  • snehal biche
    Hi Group, i am also trying to learn perl my own i stuck to one error please help me to solve this problem i am trying to read one text (fIle is attached) file
    Message 1 of 1 , Jun 1, 2005
    • 0 Attachment
      Hi Group,
       
      i am also trying to learn perl my own i stuck to one error please help me to solve this problem
       
      i am trying to read one text (fIle is attached) file which contains user name and email id on single line seperated by ( ; ). then format that text and write those names and email id to new file program i have written is as follows:-
       
      #! /usr/bin/perl
       
        open (INF, "friends.txt") or die "cannot open input file:$!\n";

        open (OF, ">friends2.txt") or die "cannot open Output file:$!\n";
       
        select (OF);
        $^ = "something";
        write(OF);
        
       
        while (<INF>) {
        foreach ($_) {
        ($Name, $EmailID) = split (/;/, $_);
         select (OF);
         $~ = "contacts";
         write (OF); 
            
         }
        
        }
       
        
        format something =
       
        Email Contact List :
         ----------------------------------------------------------
        |  Name Of Person        |   Email ID                     |
        ----------------------------------------------------------
       .
         format contacts =
       
        | @<<<<<<<<<<<<<<<<<<    :@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<   |
         $Name, $EmailID 
        ------------------------------------------------------------
        .
       
      This is the end of program i am getting following error:-
       
      Format not terminated at C:\PerlPro\for1.pl line 41, at end of line
      syntax error at C:\PerlPro\for1.pl line 41, at EOF
      Execution of C:\PerlPro\for1.pl aborted due to compilation errors.
       
      Please let me know where i am wrong.
       
      Thanking you,
      SnehalB
       


      Discover Yahoo!
      Get on-the-go sports scores, stock quotes, news & more. Check it out!
    Your message has been successfully submitted and would be delivered to recipients shortly.