www.webdeveloper.com
Results 1 to 2 of 2

Thread: Problem: Writing into files on LINUX vs Windows

  1. #1
    Join Date
    Mar 2008
    Posts
    49

    Problem: Writing into files on LINUX vs Windows

    Hi Gurus!!

    A strange problem I am facing here .... I m writing an output in files..

    Code:
    $str= $phrase."   ".$subj[$q]."\n";
    push(@output, $str);
    and then later on after end of loops, I write this array to a file
    Code:
    print OUT @output
    When I executed this program on Windows, output was like

    Code:
    rotation   0
    29   0
    wait   0.375
    cornballer   0
    favor   0.5625
    viewers   0
    satisfying   0.5
    and same program working on Linux gives this in putput
    Code:
    rotation   0
    29   0
    wait   0
    cornballer   0.375
    favor   0
    viewers   0.5625
    satisfying   0.5
    Similarly, another excerpt from this output file:

    on Linux
    Code:
    fresh   0
    figured   0.5
    6th   0
    rocks   0
    editing   0
    em   0
    final   0
    surprise   0
    same excerpt on Windows:

    Code:
    fresh   0.75
    figured   0
    6th   0
    rocks   0
    editing   0
    em   0
    final   0
    surprise   0.25
    I cannot understand whats the problem .. if someone can identify please.

    Thanks

  2. #2
    Join Date
    Oct 2007
    Location
    Vienna, Austria
    Posts
    387
    I guess the problem will be somewhere else than in printing the arrays -- double check if the sources are identical and if the array always contains the same thing before being printed (obviously they don't). I think it will be somewhere in the program before the print statement.

    So please 1) make sure you run the very same script on both platform and if so 2) paste the complete code here.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles