Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: using change directory within perl script

by tangent (Vicar)
on Mar 27, 2012 at 04:22 UTC ( #961827=note: print w/replies, xml ) Need Help??


in reply to using change directory within perl script

The variable $dir is not interpolated when you use single quotes, try changing them to doubles: "$dir/Hsapiens_fasta_folder"

The idea of File::chdir is to not use chdir() and use $CWD instead:
#!/usr/bin/perl use strict; use File::chdir; my $dir = '/data1/sgb'; $CWD = "$dir/Hsapiens_fasta_folder"; my @files=<*.fa>; $CWD = "$dir/targetp-1.1"; foreach my $file( @files) { print "$file\n"; print "$CWD\n"; }

Replies are listed 'Best First'.
Re^2: using change directory within perl script
by Anonymous Monk on Nov 27, 2012 at 10:25 UTC
    ThANKS A LOT ...VERY HELPFUL

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961827]
help
Chatterbox?
[Corion]: But who am I to worry about necrocpan - I'm revisiting my online banking module, and also I'll somewhat revive WWW::Mechanize:: Firefox, at least if the test suite passes under the Waterfox browser ...
[Corion]: Maybe I should look through my CPAN releases and revisit them in order of last release and think about what to do with the modules :)
[marto]: this cpan day there should be a call to remove old crud :P
[marto]: as well as encourage active development

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-07-17 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (359 votes). Check out past polls.

    Notices?