in reply to Array::Compare issues

Um, so am I!

I take it you want Array::Compare to return the ACTUAL differences between the two arrays? If that is so then you are out of luck, but I am likely to be wrong! According to the module docs:

So it will return either the number of differences in a SCALAR contect or a list of the elements which differ, whioch in my reading would be a list of the element references. It seems that you are seeing the flattened list and you should treat the return value as a list and see what it contains.

Of course this would be vastly easier if you gave us two small test arays to look at! Could you perhaps include the input array data in a DATA block so we can play with it?

jdtoronto

Replies are listed 'Best First'.
Re: Re: Array::Compare issues
by sunadmn (Curate) on Oct 03, 2003 at 19:48 UTC
    here you go this is a sample of my array contents for @array1
    /usr/share/release_info/Solaris_8/C/S8FCSreleasenotes /usr/share/lib/pub/UTF-8 /usr/share/lib/pub/ascii /usr/share/lib/pub/eqnchar /usr/share/lib/pub/greek /usr/share/lib/pub/iso /usr/share/lib/setterm/en_US.UTF-8/conf.file /usr/share/lib/mailx/mailx.help /usr/share/lib/mailx/mailx.help.~ /usr/share/lib/tabset/3101 /usr/share/lib/tabset/beehive /usr/share/lib/tabset/hds /usr/share/lib/tabset/hds3 /usr/share/lib/tabset/std /usr/share/lib/tabset/stdcrt /usr/share/lib/tabset/teleray /usr/share/lib/tabset/vt100 /usr/share/lib/tabset/wyse-adds /usr/share/lib/tabset/xerox1720 /usr/share/lib/terminfo/3/386AT /usr/share/lib/terminfo/3/386AT-M /usr/share/lib/terminfo/3/386at /usr/share/lib/terminfo/3/386at-m /usr/share/lib/terminfo/3/300 /usr/share/lib/terminfo/3/3045 /usr/share/lib/terminfo/3/31 /usr/share/lib/terminfo/3/3101
    And here is @file2 sample content.
    /usr/share/release_info/Solaris_8/C/S8FCSreleasenotes /usr/share/lib/pub/UTF-8 /usr/share/lib/pub/ascii /usr/share/lib/pub/eqnchar /usr/share/lib/pub/greek /usr/share/lib/pub/iso /usr/share/lib/setterm/en_US.UTF-8/conf.file /usr/share/lib/mailx/mailx.help /usr/share/lib/mailx/mailx.help.~ /usr/share/lib/tabset/3101 /usr/share/lib/tabset/beehive /usr/share/lib/tabset/hds /usr/share/lib/tabset/hds3 /usr/share/lib/tabset/std /usr/share/lib/tabset/stdcrt /usr/share/lib/tabset/teleray /usr/share/lib/tabset/vt100 /usr/share/lib/tabset/wyse-adds /usr/share/lib/tabset/xerox1720 /usr/share/lib/terminfo/3/386AT /usr/share/lib/terminfo/3/386AT-M
    Basiclly what I am trying to get out of this is a quicker way to build packages for Solaris boxes. With that said the output we want is just the differences in the two files. @file1 is an array of what was in /usr prior to the compile and make install of the software. @file2 is a list of /usr after the compile ad make install. Now it would sound easier to just use "sdiff" , but the issue I have ran into is that when you run sdiff you get output that looks like this
    /usr/local/lib/security/libgcj.security /us +r/local/lib/security/libgcj.security > /us +r/local/lib/libisc.so.7.0.0 > /us +r/local/lib/libisc.la > /us +r/local/lib/libisc.a > /us +r/local/lib/libisccc.so.0.1.0 > /us +r/local/lib/libisccc.la > /us +r/local/lib/libisccc.a > /us +r/local/lib/libdns.so.11.0.1 > /us +r/local/lib/libdns.la > /us +r/local/lib/libdns.a > /us +r/local/lib/libisccfg.so.0.0.7
    And with long file names they get cut off, this sounds like it should be easy to get around, but when you are packaging large apps that have a lot of file like Perl and ISC's Bind this take a lot of leg work. I hope that helps with what I want to do here please let me know if you need any more info.