I am not sure what you mean by "exon Numer" but I guess it is the rank (position of exon in a transcript, starting with 1 for the first one, even if not coding). Bear in mind that the rank is only defined referring to a transcript. Because an exon can have different ranks in different transcripts.
my $registry = 'Bio::EnsEMBL::Registry';
-host => 'ensembldb.ensembl.org', # alternatively 'useastdb.ensembl.org'
-user => 'anonymous'
#get the exon you are interested in:
my $exon_id = "ENSE00003492976";
my $exon_adaptor = $registry->get_adaptor( "human", 'Core', 'Exon' );
my $exon = $exon_adaptor->fetch_by_stable_id($exon_id);
#get the transcript for which you want to know the exons rank:
my $transcript_id = "ENST00000270142";
my $transcript_adaptor = $registry->get_adaptor( "human", 'Core', 'Transcript' );
my $transcript = $transcript_adaptor->fetch_by_stable_id($transcript_id);
#the rank of an exon is only defined on a specific transcript
my $rank = $exon->rank($transcript);
print "rank of $exon_id in $transcript_id is: $rank\n";
I hope that was what you are looking for. But the rank of this exon is 2 for both protein coding transcripts of SOD1. If you ment something else I guess you should clarify what you need.