Hello Kind and Wise Monks:
I have tried many ways to de-reference a variable. And yes I looked at http://perldoc.perl.org/perlreftut.html. Specifically where they talk about ->. I have one bit of code that works, but I know it could be simpler.
.
Here is the code that works:
for my $e (@$bbData) {
print Dumper $e;
my $d = $e->[0];
##print Dumper $d;
print "Col Zero: " . $e->[0] . " Col One: " . $e->[1] . " Col F
+our: " . $e->[4] . " \n" ;
##print "Col Zero: " . $d . " \n" ;
#foreach $tmp (@aDim) {
# print $tmp
}
This code prints the variables as expected.
I would like to eliminate the loop, because there is only one element in the outer most array.
This bit of code does not work.
print "Error: " . Win32::OLE->LastError . "\n";
print Dumper $bbData;
$e = $bbdata->[0];
print Dumper $e;
print $SQLUpdate . $SQLUpdateWhere . "\n";
It produces the following output:
Error: 0
$VAR1 = [
[
'VANGUARD TELECOM SERVICE ETF',
'B031NG6',
'92204A884',
'US92204A8844',
'MSCITC'
]
];
$VAR1 = undef;
update security set underlyingbloomberg = where securitykey =
I do not what to use the FOR loop because there is never more than one interior array. There must be a syntax that allows me to directly access the array contained in $bbdate[0].
many thanks for your kind assistance.
kd
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.