And an explanation, as you're a newbie:
while(<>) {
This bit reads every line from your file (if you've specified your file name on the command line, e.g. "./myscript.pl filename.txt")
push @array,(split /~/)[1];
split /~/ takes the current line, and splits it into an array on the ~ character.
(split /~/)[1] takes the second element of that array. That's staffid, the bit you want. Similarly print( ('a','n','d')[1] ) would print "n".
push @array, ... just adds this to your array.
dave hj~ |