Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:31:09+00:00 2026-05-30T09:31:09+00:00

Having an array with dates and names I want to add events to a

  • 0

Having an array with dates and names I want to add events to a google calendar with the following subroutine:

use Net::Google::Calendar;
use Date::Manip;
use Date::Calc qw(Add_Delta_Days);
my $username #removed for stackoverflow
my $password #removed for stackoverflow
my $cal = Net::Google::Calendar->new;
my $from = new Date::Manip::Date;
my $to = new Date::Manip::Date;
my @f;
my @t;
my $year;
my $month;
my $day;
$cal->login($username, $password) or $MESSAGERED = "Google Calendar login failed.";
my $entry;

#[0] name
#[1] from
#[2] to
#[3] hid
for my $i (0 .. $#ALL_HOLIDAYS) { 
    $from->parse($ALL_HOLIDAYS[$i][1]);
    $to->parse($ALL_HOLIDAYS[$i][2]);

    @f = $from->value();
    @t = $to->value(); 

    # a day added in line with our "last day of absence"
    ($year, $month, $day) = Add_Delta_Days($t[0], $t[1], $t[2], 1); 
    $entry = Net::Google::Calendar::Entry->new() or die " 518 ++++++++++ ";
    $entry->when(DateTime->new(year => $f[0], month => $f[1], day => $f[2]), DateTime->new(year => $year, month => $month, day => $day)) or die " 519 ++++++++++ ";
    $entry->title($ALL_HOLIDAYS[$i][0]) or die " 520 ++++++++++ ";
    $entry->content("Holiday") or die " 521 ++++++++++ ";
    $entry->transparency('transparent') or die " 522++++++++++ ";
    $entry->status('confirmed') or die " 523 ++++++++++ ";

    if ($cal->add_entry($entry)) {
        &mark_entry_as_googd($ALL_HOLIDAYS[$i][3]);
    }  else {
        $MESSAGEORANGE = "Unable to submit entry for ".$ALL_HOLIDAYS[$i][0]
    }
}
$MESSAGEGREEN = "Google Calendar populated";
print $MESSAGERED.$MESSAGEGREEN.$MESSAGEORANGE;

Thing is as soon as I take this script off and run it in my console (osx) it runs all right, the events are added to google calendar.
If it executes on the debian server the following error, the reason for me asking this question, is received:

No namespace matches prefix: xmlns at /usr/local/share/perl/5.10.1/XML/XPath/Node/Element.pm line 261.

CPAN reports the same thing on both machines, that both Net::Google::Calendar and its dependencies are installed. None of those dies work either, it’s always that same error. I realise this module is alpha but still, why the discrepancy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:31:10+00:00Added an answer on May 30, 2026 at 9:31 am

    My guess is the Google module is not setting the correct namespace for the entry in the xml response. Its falling back to the default namespace (nothing). Entries may look like < somename:tag > without setting the namespace to somename, the app cannot retrieve that data. The default is ‘xmls’, so the default namespace is looking for tags like < xmls:tag > and cannot find any. (The default namespace may be different on each installation – check the xmlib versions as well, I recall the default was changed to ‘xmlns’ recently to force namespace usage).

    Without seeing the xml response, its hard to answer correctly. Is there a way you can capture or dump the response to a file. Once you see the header, you can see where the problem is. If the xml response is correct, then the module isnt setting the namespace, which would be bug on their end.

    Example of namespaces with xmlns

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fill an array and I want to add some logic in
I am having an NSMutableArray as my original array and I want to filter
i have a multi dimension array with sub array having repeated values of '
In Java, is there a way to truncate an array without having to make
I'm really having trouble with Allocatable array. I have to copy all information from
I am having a problem understanding how array.sort{ |x,y| block } works exactly, hence
I'm having a problem when trying to pass an array back to a COM
I have been having this issue in iterating through an array of keys and
I'm having problems to iterate twice on the same array: <? $indice=0 ?> <?php
I am having a hard time getting the correct data out of an array.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.