Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi Team, I am getting output as difference links values ARRAY(0x34276a0) intersect links values union links values ARRAY(0x34276a0). Please please help me why and where to do changes to make correct values appeared on difference ,intersection and union. Actaully after finding the difference I want to remove it from dataset ..Firstly I have tried a lot to find correct answers on different sites and finally landed here...please helppp meee..

sub updatedevice() { my $n = {}; my $Device_LINK = $server->object("ICF_PersistentDataSet",$devicelinks +); my $Temp_Device_LINK = $server->object("ICF_PersistentDataSet",$tempde +vicelinks); my @current_devicelist = @{ $Device_LINK->invoke("get") }; my @temp_devicelist = @{ $Temp_Device_LINK->invoke("get") }; my %temp_list; my %current_list; my $size = @current_list; for ($n=0; $n < $size; $n++) { our $device=$current_list[$n][0]; DEBUG( "DEBUG: - devicelinks values $device " ); --- > abl +e to print this value of device "ABC-DCFE41->90" my $size = @temp_list; for ($n=0; $n < $size; $n++) { our $tempdevicelinks=$temp_list[$n][0]; DEBUG( "DEBUG: - temp plc links values $tempdevicelinks " ); --- > abl +e to print this value of device "GHJKL-poiu->78" my %count = (); foreach my $device (@current_list, @temp_devicelist) { $count{$device}++; } my @difference = grep { $count{$_} == 1 } keys %count; my @intersect = grep { $count{$_} == 2 } keys %count; my @union = keys %count; DEBUG( "DEBUG: - difference links values $difference[0] " ); DEBUG( "DEBUG: - intersect links values $intersect[0] " ); DEBUG( "DEBUG: - union links values $union[0] " ); } } }

In reply to compare 2 arrays for intersect diff and commmon values by rasgolla

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found