1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WriteFile Equivalent in perl

Discussion in 'Perl' started by rag84dec, Mar 15, 2009.

  1. rag84dec

    rag84dec New Member

    Joined:
    Jul 17, 2007
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    HI all,
    I want to write some data to a tape drive through perl.. one idea
    is to use scsi commands to send data.But i want to write it through
    filesystem with the usage of something like "WriteFile" in c++.Can
    anyone help me ??..Is there something equivalent to "WriteFile"
    in perl??...Any other idea to write data into Tape drive???

    THanks
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Code:
    #!/usr/local/bin/perl
    open (MYFILE, 'abc.txt');
    while (<MYFILE>) {
      chomp;
      print "$_\n";
    }
    close (MYFILE); 
    Not a PERL Expert but knows very little
     

Share This Page