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

Re: [PBML] problem in reading data from file (file handling )

Expand Messages
  • merlyn@stonehenge.com
    ... KalyanRaj Yes, you can use different filehandlers to read and write to a file. KalyanRaj #!/usr/local/bin/perl KalyanRaj open (MYFILE, file_me.txt );
    Message 1 of 5 , May 3, 2006
    • 0 Attachment
      >>>>> "KalyanRaj" == KalyanRaj <kalyanrajs@...> writes:

      KalyanRaj> Yes, you can use different filehandlers to read and write to a file.
      KalyanRaj> #!/usr/local/bin/perl

      KalyanRaj> open (MYFILE, 'file_me.txt');
      KalyanRaj> open (OUTFILE,'>>out_me.txt');

      Always check the return value of open.

      open MYFILE, "file_me.txt" or die "Cannot open file_me.txt: $!";

      and so on.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.