Posted on 2006-06-13 10:27:09-07 by cmarbacher
Example: missing right curly bracket on line 15
Line 15 of example contains: my %attribs = odm_attributes(${dev{'devname'}}; There is a missing right curly bracket, the line should look like: my %attribs = odm_attributes(${dev{'devname'}}); But when fixed like this, perl says that it can't modify exit in scala assignment. Any idea?
Direct Responses: 2471 | Write a response
Posted on 2006-06-13 10:31:15-07 by cmarbacher in response to 2470
Re: Example: missing right curly bracket on line 15
Sorry I forgot to describe my environment: - AIX 5.3 ML 3 - Perl 5.8.7
Direct Responses: 2473 | Write a response
Posted on 2006-06-13 12:57:59-07 by cmarbacher in response to 2471
Re: Example: missing right curly bracket on line 15
And here is a version that works in my environment. I simply removed the square brackets on lines 17, 22 and 23. I also modified lines 5 and 12 to ask only current devices (C). I still have a warning that reports an uninitialized value in concatenation (line 8) and an undefined subroutine &main::odm_classes on line 12. --- SOURCE --- use AIX::ODM; my %odm = odm_dump('C'); while ( ($ndx1, $lev2) = each %odm ) { while ( ($ndx2, $val) = each %$lev2 ) { print "odm{${ndx1}}{${ndx2}} = ${odm{${ndx1}}{${ndx2}}}\n"; } } my %dev = odm_classes('C'); foreach ${devname} ( keys %dev ) { print "dev{${devname}} = ${dev{${devname}}}\n"; } my %attribs = odm_attributes($dev{'devname'}); foreach ${attrname} ( keys %attribs ) { print "attribs{${attrname}} = ${attribs{${attrname}}}\n"; } my ${devclass} = odm_class('C|P',$dev{'devname'}); my ${devsubcl} = odm_subclass('C|P',$dev{'devname'});
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.