Google Sheets API Data Structure

--00000000000027245105902965b2
Content-Type: text/plain; charset="UTF-8"

Hi All,

I managed to get the Google Sheets API Perl module working.

I'm currently investigating a data structure that it gives me to see what
values I can get from it. Through random experimentation I've managed to
find that it had "title" and "id".

I wrote this to get the data structure containing the worksheets:

my @ws = $spreadsheet->worksheets;


Now if I do:

print $ws[1]->id;

print $ws[1]->title;


I get the value in the id and the title for the specific item in the array.
I want to know what other information is in there.

If I do this:

for my $href (@ws) {

    print "{ ";

    for my $role (keys %{ $href }) {

        print "$role=$href->{$role} ";

    }

    print "}\n";

}

I get:

{ atom=XML::Atom::Entry=HASH(0x1b81928)
container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) }

{ atom=XML::Atom::Entry=HASH(0x1bbbe98)
container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) }

{ container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80)
atom=XML::Atom::Entry=HASH(0x1b86ca0) }

{ container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80)
atom=XML::Atom::Entry=HASH(0x1b86988) }

{ container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80)
atom=XML::Atom::Entry=HASH(0x1b8c958) }

If I use Dumper it just seems to output SO MUCH information that I can't
see the wood for the trees. Maybe I'm just tired after a dramatic day in
Perl land.

Can anyone help me untangle this? My spreadsheet has five worksheets and
there are five lines in my output so my assumption is that each line
represents a sheet.

Any advice/help/guidance would be greatly appreciated.

Thanks,
James

--00000000000027245105902965b2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi All,<br><div><br></div><div>I managed to get the Google=
 Sheets API Perl module working.</div><div><br></div><div>I&#39;m currently=
 investigating a data structure that it gives me to see what values I can g=
et from it. Through random experimentation I&#39;ve managed to find that it=
 had &quot;title&quot; and &quot;id&quot;.</div><div><br></div><div>I wrote=
 this to get the data structure containing the worksheets:<br><br></div><bl=
ockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote st=
yle=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"marg=
in:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40=
px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:n=
one;padding:0px"><div>my @ws =3D $spreadsheet-&gt;worksheets;</div></blockq=
uote></blockquote></blockquote></blockquote></blockquote><div><br></div><di=
v>Now if I do:</div><div><br></div><blockquote style=3D"margin:0 0 0 40px;b=
order:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;=
padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px=
"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquo=
te style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>print $ws[1]-&g=
t;id;</div></blockquote></blockquote></blockquote></blockquote><blockquote =
style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"ma=
rgin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 =
40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border=
:none;padding:0px"><div>print $ws[1]-&gt;title;</div></blockquote></blockqu=
ote></blockquote></blockquote></blockquote><div><br></div><div>I get the va=
lue in the id and the title for the specific item in the array. I want to k=
now what other information is in there.</div><div><br></div><div>If I do th=
is:</div><div><br></div><blockquote style=3D"margin:0 0 0 40px;border:none;=
padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px=
"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquo=
te style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D=
"margin:0 0 0 40px;border:none;padding:0px"><div>for my $href (@ws) {</div>=
</blockquote></blockquote></blockquote></blockquote><blockquote style=3D"ma=
rgin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 =
40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border=
:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;paddi=
ng:0px"><div>=C2=A0 =C2=A0 print &quot;{ &quot;;</div></blockquote></blockq=
uote></blockquote></blockquote><blockquote style=3D"margin:0 0 0 40px;borde=
r:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padd=
ing:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><b=
lockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =
=C2=A0 for my $role (keys %{ $href }) {</div></blockquote></blockquote></bl=
ockquote></blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;pa=
dding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">=
<blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote=
 style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 print &quot;$role=3D$href-&gt;{$role} &quot;;</div></blockquote>=
</blockquote></blockquote></blockquote><blockquote style=3D"margin:0 0 0 40=
px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:n=
one;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding=
:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>=
=C2=A0 =C2=A0 }</div></blockquote></blockquote></blockquote></blockquote><b=
lockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote s=
tyle=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"mar=
gin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 4=
0px;border:none;padding:0px"><div>=C2=A0 =C2=A0 print &quot;}\n&quot;;</div=
></blockquote></blockquote></blockquote></blockquote><blockquote style=3D"m=
argin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0=
 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;borde=
r:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padd=
ing:0px"><div>}</div><div><br></div></blockquote></blockquote></blockquote>=
</blockquote></blockquote>I get:<div><br></div><blockquote style=3D"margin:=
0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;=
border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none=
;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0p=
x"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><div>{ a=
tom=3DXML::Atom::Entry=3DHASH(0x1b81928) container=3DNet::Google::Spreadshe=
ets::Spreadsheet=3DHASH(0x1bbdb80) }</div></blockquote></blockquote></block=
quote></blockquote><blockquote style=3D"margin:0 0 0 40px;border:none;paddi=
ng:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><bl=
ockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote st=
yle=3D"margin:0 0 0 40px;border:none;padding:0px"><div>{ atom=3DXML::Atom::=
Entry=3DHASH(0x1bbbe98) container=3DNet::Google::Spreadsheets::Spreadsheet=
=3DHASH(0x1bbdb80) }</div></blockquote></blockquote></blockquote></blockquo=
te><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockqu=
ote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=
=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:=
0 0 0 40px;border:none;padding:0px"><div>{ container=3DNet::Google::Spreads=
heets::Spreadsheet=3DHASH(0x1bbdb80) atom=3DXML::Atom::Entry=3DHASH(0x1b86c=
a0) }</div></blockquote></blockquote></blockquote></blockquote><blockquote =
style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"ma=
rgin:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 =
40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border=
:none;padding:0px"><div>{ container=3DNet::Google::Spreadsheets::Spreadshee=
t=3DHASH(0x1bbdb80) atom=3DXML::Atom::Entry=3DHASH(0x1b86988) }</div></bloc=
kquote></blockquote></blockquote></blockquote><blockquote style=3D"margin:0=
 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;b=
order:none;padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;=
padding:0px"><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px=
"><div>{ container=3DNet::Google::Spreadsheets::Spreadsheet=3DHASH(0x1bbdb8=
0) atom=3DXML::Atom::Entry=3DHASH(0x1b8c958) }</div><div><br></div></blockq=
uote></blockquote></blockquote></blockquote></blockquote>If I use Dumper it=
 just seems to output SO MUCH information that I can&#39;t see the wood for=
 the trees. Maybe I&#39;m just tired after a dramatic day in Perl land.<div=
><br></div><div>Can anyone help me untangle this? My spreadsheet has five w=
orksheets and there are five lines in my output so my assumption is that ea=
ch line represents a sheet.</div><div><br></div><div>Any advice/help/guidan=
ce would be greatly appreciated.</div><div><br></div><div>Thanks,</div><div=
>James</div></div>

--00000000000027245105902965b2--
0
jkerwin2101
8/15/2019 3:18:57 PM
perl.beginners 29360 articles. 3 followers. Follow

4 Replies
26 Views

Similar Articles

[PageSpeed] 28

--------------1763882008CE0081ED5B966C
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable


Please state the exact module name.
Is it this one:
https://metacpan.org/pod/Net::Google::Spreadsheets::V4

My guess is no.


Mike


On 8/15/2019 10:18 AM, James Kerwin wrote:
> Hi All,
>
> I managed to get the Google Sheets API Perl module working.
>
> I'm currently investigating a data structure that it gives me to see=20
> what values I can get from it. Through random experimentation I've=20
> managed to find that it had "title" and "id".
>
> I wrote this to get the data structure containing the worksheets:
>
>                     my @ws =3D $spreadsheet->worksheets;
>
>
> Now if I do:
>
>                     print $ws[1]->id;
>
>                     print $ws[1]->title;
>
>
> I get the value in the id and the title for the specific item in the=20
> array. I want to know what other information is in there.
>
> If I do this:
>
>                     for my $href (@ws) {
>
>                     =C2=A0 =C2=A0 print "{ ";
>
>                     =C2=A0 =C2=A0 for my $role (keys %{ $href }) {
>
>                     =C2=A0 =C2=A0 =C2=A0 =C2=A0 print "$role=3D$href->{=
$role} ";
>
>                     =C2=A0 =C2=A0 }
>
>                     =C2=A0 =C2=A0 print "}\n";
>
>                     }
>
> I get:
>
>                     { atom=3DXML::Atom::Entry=3DHASH(0x1b81928)
>                     container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
>                     }
>
>                     { atom=3DXML::Atom::Entry=3DHASH(0x1bbbe98)
>                     container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
>                     }
>
>                     {
>                     container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
>                     atom=3DXML::Atom::Entry=3DHASH(0x1b86ca0) }
>
>                     {
>                     container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
>                     atom=3DXML::Atom::Entry=3DHASH(0x1b86988) }
>
>                     {
>                     container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
>                     atom=3DXML::Atom::Entry=3DHASH(0x1b8c958) }
>
> If I use Dumper it just seems to output SO MUCH information that I=20
> can't see the wood for the trees. Maybe I'm just tired after a=20
> dramatic day in Perl land.
>
> Can anyone help me untangle this? My spreadsheet has five worksheets=20
> and there are five lines in my output so my assumption is that each=20
> line represents a sheet.
>
> Any advice/help/guidance would be greatly appreciated.
>
> Thanks,
> James


--------------1763882008CE0081ED5B966C
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8">
  </head>
  <body text=3D"#000000" bgcolor=3D"#FFFFFF">
    <br>
    Please state the exact module name.<br>
    Is it this one:<br>
    <a class=3D"moz-txt-link-freetext" href=3D"https://metacpan.org/pod/N=
et::Google::Spreadsheets::V4">https://metacpan.org/pod/Net::Google::Sprea=
dsheets::V4</a><br>
    <br>
    My guess is no.<br>
    <br>
    <br>
    Mike<br>
    <br>
    <br>
    <div class=3D"moz-cite-prefix">On 8/15/2019 10:18 AM, James Kerwin
      wrote:<br>
    </div>
    <blockquote type=3D"cite"
cite=3D"mid:CAKkNZ9CfMnJ3JhAR6pCnmZjypkGj6U9Ho5-c5JVqUpspbA9Dgg@mail.gmai=
l.com">
      <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DU=
TF-8">
      <div dir=3D"ltr">Hi All,<br>
        <div><br>
        </div>
        <div>I managed to get the Google Sheets API Perl module working.<=
/div>
        <div><br>
        </div>
        <div>I'm currently investigating a data structure that it gives
          me to see what values I can get from it. Through random
          experimentation I've managed to find that it had "title" and
          "id".</div>
        <div><br>
        </div>
        <div>I wrote this to get the data structure containing the
          worksheets:<br>
          <br>
        </div>
        <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>my @ws =3D $spreadsheet-&gt;worksheets;</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
        <div><br>
        </div>
        <div>Now if I do:</div>
        <div><br>
        </div>
        <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>print $ws[1]-&gt;id;</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>print $ws[1]-&gt;title;</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
        <div><br>
        </div>
        <div>I get the value in the id and the title for the specific
          item in the array. I want to know what other information is in
          there.</div>
        <div><br>
        </div>
        <div>If I do this:</div>
        <div><br>
        </div>
        <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>for my $href (@ws) {</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>=C2=A0 =C2=A0 print "{ ";</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>=C2=A0 =C2=A0 for my $role (keys %{ $href }) {</di=
v>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 print "$role=3D$href-&=
gt;{$role} ";</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>=C2=A0 =C2=A0 }</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>=C2=A0 =C2=A0 print "}\n";</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>}</div>
                  <div><br>
                  </div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
        I get:
        <div><br>
        </div>
        <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px">
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>{ atom=3DXML::Atom::Entry=3DHASH(0x1b81928)
                    container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
                    }</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>{ atom=3DXML::Atom::Entry=3DHASH(0x1bbbe98)
                    container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
                    }</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>{
                    container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
                    atom=3DXML::Atom::Entry=3DHASH(0x1b86ca0) }</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>{
                    container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
                    atom=3DXML::Atom::Entry=3DHASH(0x1b86988) }</div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"=
>
            <blockquote style=3D"margin:0 0 0
              40px;border:none;padding:0px">
              <blockquote style=3D"margin:0 0 0
                40px;border:none;padding:0px">
                <blockquote style=3D"margin:0 0 0
                  40px;border:none;padding:0px">
                  <div>{
                    container=3DNet::Google::Spreadsheets::Spreadsheet=3D=
HASH(0x1bbdb80)
                    atom=3DXML::Atom::Entry=3DHASH(0x1b8c958) }</div>
                  <div><br>
                  </div>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
        </blockquote>
        If I use Dumper it just seems to output SO MUCH information that
        I can't see the wood for the trees. Maybe I'm just tired after a
        dramatic day in Perl land.
        <div><br>
        </div>
        <div>Can anyone help me untangle this? My spreadsheet has five
          worksheets and there are five lines in my output so my
          assumption is that each line represents a sheet.</div>
        <div><br>
        </div>
        <div>Any advice/help/guidance would be greatly appreciated.</div>=

        <div><br>
        </div>
        <div>Thanks,</div>
        <div>James</div>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------1763882008CE0081ED5B966C--
0
temp4
8/16/2019 9:36:21 AM
On Thu, 15 Aug 2019 16:18:57 +0100
James Kerwin <jkerwin2101@gmail.com> wrote:
> I'm currently investigating a data structure that it gives me to see
> what values I can get from it. Through random experimentation I've
> managed to find that it had "title" and "id".
> 
> I wrote this to get the data structure containing the worksheets:
> 
> my @ws = $spreadsheet->worksheets;
[...]
> If I do this:
[...]
> I get:
> 
> { atom=XML::Atom::Entry=HASH(0x1b81928)
> container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) }
[...]

Right, from that class name it sounds like you're working with
Net::Google::Spreadsheets -
https://metacpan.org/pod/Net::Google::Spreadsheets

Given that you're talking about $spreadsheet->worksheets I assume that
the bit of code you omitted before your example finds the appropriate
spreadsheet using the spreadsheets() / spreadsheet(%cond) methods, so
$spreadsheet will be a Net::Google::Spreadsheets::Spreadsheet object.

Rather than trying to poke around in the guts of the objects you got,
look at the documentation.  The worksheets() method gives you a list of 
Net::Google::Spreadsheets::Worksheet objects, so have a look at the
documentation for that class:

https://metacpan.org/pod/Net::Google::Spreadsheets::Worksheet

For e.g. you'll see that $worksheet->rows will give you a list of rows,
as Net::Google::Spreadsheets::Row objects, so you could then look at
the documentation for that ::Row class:

https://metacpan.org/pod/Net::Google::Spreadsheets::Row

All in all, you're dealing with objects here, so you're better off
looking at their documentation to see what methods they provide rather
than digging around in their guts - both because it should be easier for
you, but also because your code should be cleaner and more robust, and
less likely to break on future updates to the modules you're using.

Most CPAN authors will try to keep the exposed methods they've
documented consistent as far as possible or do deprecations as cleanly
as possible, but if you've been digging around "under the hood" treating
the object as a hashref, that internal implementation may well change
without notice and that's on you.

Cheers

Dave P (BIGPRESH)
0
davidp
8/16/2019 10:41:50 AM
--00000000000094267205903a2681
Content-Type: text/plain; charset="UTF-8"

Thanks Dave and Mike,

I am using Net::Google::Spreadsheets and all the associated modules and
yeah there

I slept on this and then managed to see what could be seen this morning:

print Dumper($ws[0]{atom});
print Dumper($ws[0]{container});

I should have been a bit clearer on what I was hoping to do (although I
think it can't be easily done) by digging around for what was there and
you're right that I should use the methods provided. I did start with a
method that allowed me to grab a list of the worksheet names, so I thought
if I looked around I might find a list of worksheet "gid's"

It's just that the methods provided don't seem to do what I want. Each
worksheet within a spreadsheet has its own "gid" in the URL of that
particular worksheet. I was trying to find either the URL or gid value in
order to provide a link directly to a newly created worksheet. At the
moment I've used a link to the spreadsheet and the user must navigate to
the new worksheet. It's not a huge issue, but it would have been a nice
finish for what I was doing.

It's already better than it was. Previously a user had to log on via the
command line. Run a series of scripts, mv/cp files around, then download a
csv file from the server and then copy the content to the Google Sheet. Now
a user goes to the website, clicks a button and then a few seconds later
receives a link to the spreadsheet.

I'm currently looking around Worksheet.pm to see if there's any
module/function I could create that could get help me, but I think I may
need to admit that it's quite a bit beyond me.

Thanks,
James

--00000000000094267205903a2681
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks Dave and Mike,<div><br></div><div>I am using=C2=A0N=
et::Google::Spreadsheets and all the associated modules and yeah there=C2=
=A0</div><div><br></div><div>I slept on this and then managed to see what c=
ould be seen this morning:</div><div><br></div><div>print Dumper($ws[0]{ato=
m});<br></div><div>print Dumper($ws[0]{container});<br></div><div><br></div=
><div>I should have been a bit clearer on what I was hoping to do (although=
 I think it can&#39;t be easily done) by digging around for what was there =
and you&#39;re right that I should use the methods provided. I did start wi=
th a method that allowed me to grab a list of the worksheet names, so I tho=
ught if I looked around I might find a list of worksheet &quot;gid&#39;s&qu=
ot;</div><div><br></div><div>It&#39;s just that the methods provided don&#3=
9;t seem to do what I want. Each worksheet within a spreadsheet has its own=
 &quot;gid&quot; in the URL of that particular worksheet. I was trying to f=
ind either the URL or gid value in order to provide a link directly to a ne=
wly created worksheet. At the moment I&#39;ve used a link to the spreadshee=
t and the user must navigate to the new worksheet. It&#39;s not a huge issu=
e, but it would have been a nice finish for what I was doing.=C2=A0</div><d=
iv><br></div><div>It&#39;s already better than it was. Previously a user ha=
d to log on via the command line. Run a series of scripts, mv/cp files arou=
nd, then download a csv file from the server and then copy the content to t=
he Google Sheet. Now a user goes to the website, clicks a button and then a=
 few seconds later receives a link to the spreadsheet.<br><br>I&#39;m curre=
ntly looking around Worksheet.pm to see if there&#39;s any module/function =
I could create that could get help me, but I think I may need to admit that=
 it&#39;s quite a bit beyond me.</div><div><br></div><div>Thanks,</div><div=
>James</div></div>

--00000000000094267205903a2681--
0
jkerwin2101
8/16/2019 11:18:22 AM
Hi!

Have you looked on https://metacpan.org/pod/Net::Google::Spreadsheets::V4?

It's newer, so probably It can give you a bit more data from modern 
Google API

On 16/08/2019 14:18, James Kerwin wrote:
> Thanks Dave and Mike,
>
> I am using Net::Google::Spreadsheets and all the associated modules 
> and yeah there
>
> I slept on this and then managed to see what could be seen this morning:
>
> print Dumper($ws[0]{atom});
> print Dumper($ws[0]{container});
>
> I should have been a bit clearer on what I was hoping to do (although 
> I think it can't be easily done) by digging around for what was there 
> and you're right that I should use the methods provided. I did start 
> with a method that allowed me to grab a list of the worksheet names, 
> so I thought if I looked around I might find a list of worksheet "gid's"
>
> It's just that the methods provided don't seem to do what I want. Each 
> worksheet within a spreadsheet has its own "gid" in the URL of that 
> particular worksheet. I was trying to find either the URL or gid value 
> in order to provide a link directly to a newly created worksheet. At 
> the moment I've used a link to the spreadsheet and the user must 
> navigate to the new worksheet. It's not a huge issue, but it would 
> have been a nice finish for what I was doing.
>
> It's already better than it was. Previously a user had to log on via 
> the command line. Run a series of scripts, mv/cp files around, then 
> download a csv file from the server and then copy the content to the 
> Google Sheet. Now a user goes to the website, clicks a button and then 
> a few seconds later receives a link to the spreadsheet.
>
> I'm currently looking around Worksheet.pm to see if there's any 
> module/function I could create that could get help me, but I think I 
> may need to admit that it's quite a bit beyond me.
>
> Thanks,
> James
0
elcamlost
8/16/2019 11:31:27 AM
Reply: