in reply to Re: Saving an array to a disk file
in thread Saving an array to a disk file

Dear BrowserUK,

As I'm running in Linux, I enconter problem running your script above. On running it it gave this error
$perl save_disk_to_array_browseruk.pl sh: u:sort: command not found
Then when I tried removing u: into
open my $pipe, "| sort -u > temp.tmp" or die $!;
It gave only:
Array now contains 1 uniq elements
Is there any changes need to be made on your code above, if I'm running on Unix? Sorry to trouble you, I'm new in Perl. Thanks so much and hope to hear from you again.

Replies are listed 'Best First'.
Re^3: Saving an array to a disk file
by BrowserUk (Patriarch) on May 29, 2006 at 03:55 UTC

    Yup. Switching from the win32 command to a unix command in order to run the code on unix is a good idea :)

    With that change made, the code should run correct on any system that has a sort command that takes a -u option. If that is not the case on your system, you will need to investigate the syntax for the command options on your machine, verify that the command is being run correctly, and generally work out why your system is different.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.