473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can't locate object method "open" via package "PDF::API2"

Hi All,
I am trying to use PDF::API2 module . Since i do not have the root access, I installed the above module locally at ~/some_dir/lib.

The contents of ~/some_dir/lib are :
~/some_dir/lib/PDF/API2/
~/some_dir/lib/PDF/API2.pm
~/some_dir/lib/sun4-solaris

I am using the "use lib" pragma in script.The exact syntax is as below
use lib "~/some_dir/lib/PDF";

Later i do the following :
my $pdf = PDF::API2->open(~/some_pdf_file.pdf);

I am getting the following error :
Can't locate object method "open" via package "PDF::API2" (perhaps you forgot to load PDF:API2) at line 12

I Can see the extra path to search for the locally installed PDF::API2 module getting added to @INC.

Kindly suggest what could be the problem.

Thanks in advance.

Thanks
Kapil
Sep 1 '10 #1
4 3304
Try adding manually to @INC.

push(@INC, "/some_dir/lib");
Sep 1 '10 #2
I hope you have included package PDF::API2 after lib,

use lib "/some_dir/lib/PDF";
use PDF::API2;
Sep 1 '10 #3
toolic
70 Expert
The tilde character does not get expanded as expected. This works for me:

Expand|Select|Wrap|Line Numbers
  1. use lib "$ENV{HOME}/some_dir/lib";
The drawback is that it requires the HOME environment variable to be set.
Sep 1 '10 #4
Oralloy
988 Expert 512MB
kalpisri22,

Did you remember to require the module in your code?

Cheers!
Sep 1 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: nukiboy | last post by:
========= test.js =================== function Test() { this.temp = "hehehehe" ; this.method1 = method1 ;
2
by: sonu | last post by:
I am tring to create activexobject like var Fo =new ActiveXObject("Scripting.FileSystemObject"); but i am finding error that automation server cant create object any help
4
by: BBFrost | last post by:
I want to build a generic application that runs one of a set of class methods depending on data extracted from a database table. For example if I extract value X from the database table I also...
1
by: RA | last post by:
Hi Is there a way to serialize an object method to a soap message? I need to pass a soap message through a queue and have a .net object. I wonder if I can serialize the proxy class method so...
3
by: Steve Richter | last post by:
running a simple vbscript in an .htm page that starts excel and loads the spreadsheet with the contents of a <table> ... </table> getting an "Error: ActiveX component cant create object....
1
by: erotikaboi | last post by:
Guys, Firstly let me say I am a photographer so if you can offer me a solution I will really appreciate it in simple english not techiespeak as I wont understand it. Thanks. Ok, I am using Access...
5
ronnil
by: ronnil | last post by:
Hi I'm sitting here making a method in a object. The method doesn't really require instatiation of the object, and then i started wondering.... is this correct, and what is the best way to call...
1
by: perlvasu | last post by:
6 jobs are running at the same time and accessing same dbm file for writing and reading. These are daily jobs and failing only some times not regularly. So i thought of this is just because of dead...
12
by: Jordi | last post by:
I'm getting the following error: Software error: Can't locate object method "new" via package "A::B" at /path/file.cgi line 5. My code is basically this: #!/usr/bin/perl -w use strict; use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.