Hi, so i need help to remove a selected value from an array. i am using a combobox to display all the values in the array as different selections ans once a selection is chosen a button will then be pressed to disable the combobox and enable the next combobox that will then show all of the values of the same array with the value selected from the previous combobox removed from the array. i have been trying to get this to work for a fair while now and nothing i have really done seems to work, i'm looking for either full help or if there are some commands that someone could point me towards that would work, that would be much appreciated.

this is some things i have been trying, i have also been trying by appending a listing ID onto the array, creating a 2D array.

my ($ids, $attri) = split /,/, $str; splice (@array,$ids, 1); sub refreshdisplay{ $id=0; $arraylist = ""; for($id=0;$id<=$#array;$id++){ if($id == 0){ $arraylist = "$array[0]"; } else{ $arraylist .= "$id,$array[$id]\n"; } } }

$str is the variable name for what is selected within the combobox

for the gui that i am using im not entirely sure about it, but when i use the program to create it i select the perl TKx option


In reply to Need help with removing values from arrays by GrizzlyRizly

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.