How To Subdivide An Edge

Hi! im trying to select an edge of a polygon plane and subdivide it while leaving the rest of the edges unmodified. However, when i performed the following MEL script, all the four edges are subdivided.

CODE
polyPlane -n $myPlane -w 0.10 -h 0.10 -sx 1 -sy 1 -ax 0 1 0 -tx 1 -ch 1;
select -r $myPlane.e[0];
polySubdivideEdge -ws 0 -s 0 -dv 3 -ch 1;

Btw, if i replace the variable $myPlane with an absolute name such as myPlane and execute the script directly on the script editor, it will perform as expected. What actually goes wrong?

okay thereaare actaly 2 problems here! not 1

thing is you cant rely that maya named like you said bacuase maya will make sure there are no naming cuplicates, sencondly your not assembling the edgename right.

CODE
//support proc makes reading the script easier, and futher coding too
proc string getSArrayFirst(string $array[]){
return $array[0];
}

{
$myPlane="test";
$myPlane=getSArrayFirst(polyPlane -n $myPlane -w 0.10 -h 0.10 -sx 1 -sy 1 -ax 0 1 0 -tx 1 -ch 1);
select -r ($myPlane+".e[0]"); //the name must be assembled
polySubdivideEdge -ws 0 -s 0 -dv 3 -ch 1;
}

QUOTE(Joojaa @ 12/13/05, 07:22 PM)
okay thereaare actaly 2 problems here! not 1

thing is you cant rely that maya named like you said bacuase maya will make sure there are no naming cuplicates, sencondly your not assembling the edgename right.

CODE
//support proc makes reading the script easier, and futher coding too
proc string getSArrayFirst(string $array[]){
return $array[0];
}

{
$myPlane="test";
$myPlane=getSArrayFirst(polyPlane -n $myPlane -w 0.10 -h 0.10 -sx 1 -sy 1 -ax 0 1 0 -tx 1 -ch 1);
select -r ($myPlane+".e[0]"); //the name must be assembled
polySubdivideEdge -ws 0 -s 0 -dv 3 -ch 1;
}

[snapback]222257[/snapback]

Thanks for pointing out the mistakes. Thanks a lot