develooper Front page | perl.beginners | Postings from February 2009

Re: objects regarding

Thread Next
From:
suresh kumar
Date:
February 12, 2009 05:45
Subject:
Re: objects regarding
Message ID:
f31bafff0902120058u12b9a235p4b4416af4c5d7f71@mail.gmail.com
Hi all
>
> This is my code :
>
> $::dev2->getvalue($x,$y);
> $::dev3->getvalue($x,$y);
> $::dev4->getvalue($x,$y);
> $::dev5->getvalue($x,$y);
> $::dev6->getvalue($x,$y);
> $::dev7->getvalue($x,$y);
> $::dev8->getvalue($x,$y);
> $::dev9->getvalue($x,$y);
> $::dev10->getvalue($x,$y);
> $::dev11->getvalue($x,$y);
> .
> .
> .
> .
> .
> $::dev29->getvalue($x,$y);
> $::dev30->getvalue($x,$y);
>
> Here $::dev1 to $::dev30 are my objects, using that i am calling the
> function getvalue();
> I want to make it like this,
> @dev = ($::dev2,$::dev3,$::dev4,$::dev5,........$::dev30)
> foreach my $devref (@dev) {
>     $devref->getvalue($x,$y);
> }
>
> But this is not working. can anyone help me in this, so that using a common
> variable i want to rotate the objects.
>
> Thx
> suresh
>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About