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

Re: Unable to write to log-file

by fetusbear (Initiate)
on Jul 27, 2009 at 19:26 UTC ( [id://783650]=note: print w/replies, xml ) Need Help??


in reply to Unable to write to log-file

try using print (STRM_ALLDevices "$file\n"); instead of print STRM_ALLDevices ("$file\n");

Replies are listed 'Best First'.
Re^2: Unable to write to log-file
by sselva (Novice) on Jul 29, 2009 at 16:06 UTC
    Hi , As you said you need the list of directories in to a log file, for this you can use the flie commands. here is the code which is working fine for me , as it will read all directories inside in the given path .
    ( path have to be given in command line for exampel perl <file name> <folder name> .
    use File::Path;
    use File::Find;
    use vars /@files $file $path/;
    $path = $ARGV[0];
    find sub{ push @files, "$File::Find::name" if(-d
    $File::Find::name); },$path;
    print @files;
    open FILE,">>direcotry.txt" or die $!;
    print FILE @files;

    (-d $File::Find::name) : this will give you the directories inside the path which you gave at command line . ( you can use -f to find the files)

Log In?
Username:
Password:

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

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

    No recent polls found