Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: beginner - can't load a module

by lyklev (Pilgrim)
on Oct 16, 2010 at 23:24 UTC ( [id://865748]=note: print w/replies, xml ) Need Help??


in reply to beginner - can't load a module

As mentioned before, qw( ) will give you three directories, because it splits on space.

Perl was created on Unix-like systems, so to make your life easier on windows:

  • avoid spaces in path names, so create a directory 'c:\bioperl' (or whatever you want) and work there;
  • keep in mind that the backslash '\' works as an escape character to get special characters (like tabs, newlines) and to get a real backslash, you have to use a double backslash. This will make your paths look weird ('c:\\bioperl\\project').
  • when referring to files, you can use a forward slash which you don't need to escape; these are automatically converted, so 'c:/bioperl/somefile.txt' works.

So summarizing: work in 'c:\bioperl' (or similar), put your libraries in, say, 'c:\bioperl\modules', and add the lib-line to your programs:

use lib 'c:/bioperl/modules';
Alternatively, add the directory to your PERL5LIB environment-variable.

Replies are listed 'Best First'.
Re^2: beginner - can't load a module
by JavaFan (Canon) on Oct 17, 2010 at 03:18 UTC
    keep in mind that the backslash '\' works as an escape character to get special characters (like tabs, newlines) and to get a real backslash, you have to use a double backslash. This will make your paths look weird ('c:\\bioperl\\project').
    You do not seem to understand the difference between single and double quoted. What you said is true for double quoted strings, but even in your example you use a single quoted string. No need to escape the backslash there - it would only need to be escaped if it's at the end of the string, or if followed by a backslash. None of that is happening in the OPs path.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://865748]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-25 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found