PDA

View Full Version : Tk: gettags (arrays)


vietboy505
03-10-2006, 12:08 AM
Why arrays in Unix is different from Windows?


## Grab x & y location of the graph
@stuff = $info->gettags(current);

foreach (@stuff) {
print("$_ \n");
}

In UNIX shows:
2 5
current

In Windows shows:
2
5
current

How can I fix so in Unix it will grab:
2
5
current

or fix it to work in windows like:
2 5
current



And I don't want to check the OS such as:

##check which version of OS
if($^O =~ /Win/) {
$x=$stuff[0];
$y=$stuff[1];
} else {
##work for unix
($x, $y) = split(/ /, $stuff[0]);
}