Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The programs are in 'project/PerlCode' as well as the other folders 'test', 'data' and 'report', all of these are in 'project' so if I placed the directory 'project' anywhere it will carry with it the folder 'PerlCode' and the rest.

Assuming that the current working directory is 'project' is a very plausible approach that I have partly implemented. I could probably hard-code the rest of the folders within CWD as they are.

(Oct, 30th) UPDATE: I have implemented this through Cwd. Trying the other suggestions such as File::Spec threw errors that I could not solve. So through Cwd I basically could achieve creating new folders within 'project', moving files across these folders, and call other scripts that are saved in 'PerlCode' within 'project, it sounds fine and it performs the way I expect it to and ports well ...

use Cwd; my $dir = getcwd; mkdir("$dir/output", 0777); open (my $fh, "<","$dir/data/file.txt") or die ("$!"); open(my $ofh, ">", $dir/output/outfile.txt) or die("$!"); while(my $line = <$fh>){ #do stuff such as process load into a data structure, regex #write to $ofh }


David R. Gergen said "We know that second terms have historically been marred by hubris and by scandal." and I am a two y.o. monk today :D, June,12th, 2011...

In reply to Re^2: Directory independent processing by biohisham
in thread Directory independent processing by biohisham

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 cooling their heels in the Monastery: (4)
As of 2024-04-19 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found