Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I recently asked this on stackoverflow.com, and nobody could figure it out.

I am using Perl in Eclipse. In the same directory, I have one .pl file and two .pm files (pmFile1.pm, pmFile2.pm). At the top of the .pl file, I use the command:

use pmFile1; use pmFile2;

I get an error: "Compilation failed in require". This is the entire warning. When I type into command line the following command:

perl -Mlib=/Desktop/code -e'use pmFile1;'

I get the following warning in my terminal: "syntax error at -e line 1, near "use pmFile1." Execution of -e aborted due to compilation errors"

I also tried right-clicking on the project directory in Project Explorer, selecting "Properties", selecting "Perl Include Path", and then adding the directory that contains the two files. Still, even after restarting Eclipse, and checking that the directory path is still there, the error remains.

I would be grateful to hear any advice on this! I have been stumped for days. Thank you.


In reply to Error "Compilation failed in require" with "use" syntax by SuzuBell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found