bigdatageek has asked for the wisdom of the Perl Monks concerning the following question:
Here is a sample of a Dumper output. See what I mean? Does it matter that there are brackets here instead of parentheses?#!/usr/bin/perl use warnings; use strict; use diagnostics; use WWW::Salesforce; use Data::Dumper; my $sforce = eval { WWW::Salesforce->login( username => 'xxxxxxx', password => 'xxxxxxx', serverurl=> 'https://xxxxxxx.salesforce.com/servic +es/Soap/u/34.0'); }; die "Could not login to SFDC: $@" if $@; my @tableattribute_ref=$sforce->describeGlobal()->result->{sobjects};
I need to pull the names out of this to create an array. Here's an alternative, I can pull the names just fine 1 by 1.[ { 'custom' => 'true', 'deletable' => 'false', 'retrieveable' => 'true', 'layoutable' => 'true', 'queryable' => 'true', 'createable' => 'false', 'customSetting' => 'false', 'deprecatedAndHidden' => 'false', 'undeletable' => 'false', 'triggerable' => 'true', 'keyPrefix' => 'a0k', 'name' => 'x1', 'updateable' => 'false', 'feedEnabled' => 'false', 'mergeable' => 'false', 'searchable' => 'true', 'replicateable' => 'true', 'labelPlural' => 'x1s', 'activateable' => 'false', 'label' => 'x1' }, { 'custom' => 'true', 'deletable' => 'false', 'retrieveable' => 'true', 'layoutable' => 'true', 'queryable' => 'true', 'createable' => 'false', 'customSetting' => 'true', 'deprecatedAndHidden' => 'false', 'undeletable' => 'false', 'triggerable' => 'false', 'keyPrefix' => 'a16', 'name' => 'x2', 'updateable' => 'false', 'feedEnabled' => 'false', 'mergeable' => 'false', 'searchable' => 'true', 'replicateable' => 'true', 'labelPlural' => 'x2s', 'activateable' => 'false', 'label' => 'x2' }, { 'custom' => 'false', 'deletable' => 'true', 'retrieveable' => 'true', 'layoutable' => 'false', 'queryable' => 'true', 'createable' => 'true', 'customSetting' => 'false', 'deprecatedAndHidden' => 'false', 'undeletable' => 'false', 'triggerable' => 'false', 'keyPrefix' => '083', 'name' => 'x3', 'updateable' => 'false', 'feedEnabled' => 'false', 'mergeable' => 'false', 'searchable' => 'false', 'replicateable' => 'true', 'labelPlural' => 'x3s', 'activateable' => 'false', 'label' => 'x3' } ];
Then I can add it to a loop... I haven't added the piece that will kill the loop yet, just testing it out.my $tableattribute_ref=$sforce->describeGlobal()->result->{sobjects}[# +]{name};
Problem is this solution takes forever... (like 10 minutes). I already have an alternative where I bypass WWW::Salesforce completely and just use WWW::Curl::Share. It runs super fast but there's a lot more lines of code because I'm continually creating and submitting XML forms via Curl. I'd much rather use a packaged approach like WWW::Salesforce. Any advice would be much appreciated! Thank you so much for your time. -bigdatageekmy $count; $count = 0; while ($count >= 0) { $tableattribute_ref=$sforce->describeGlobal()->result->{sobjects}[$cou +nt]{name}; #This is where I can push names to an array $count++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Salesforce Data Parser
by stevieb (Canon) on Aug 06, 2015 at 16:08 UTC | |
by bigdatageek (Novice) on Aug 06, 2015 at 16:13 UTC | |
by stevieb (Canon) on Aug 06, 2015 at 16:23 UTC | |
by bigdatageek (Novice) on Aug 06, 2015 at 17:11 UTC | |
by stevieb (Canon) on Aug 06, 2015 at 17:47 UTC | |
| |
|
Re: Salesforce Data Parser
by 1nickt (Canon) on Aug 06, 2015 at 17:47 UTC | |
by ali0sha (Sexton) on Aug 26, 2015 at 15:42 UTC | |
by bigdatageek (Novice) on Aug 06, 2015 at 19:13 UTC | |
by 1nickt (Canon) on Aug 06, 2015 at 20:08 UTC | |
by bigdatageek (Novice) on Aug 16, 2015 at 13:50 UTC |