Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: writing the finding result into a file.txt

by clueless newbie (Chaplain)
on Mar 28, 2012 at 11:29 UTC ( #962156=note: print w/replies, xml ) Need Help??

in reply to writing the finding result into a file.txt

use File::Find; use strict; use warnings; my $dir = "c:/temp"; sub edit { print FILE "$File::Find::name"."\n"; } open(FILE, ">file.txt"); find(\&edit,$dir); close(FILE);
added my to $dir = "c:/temp";

Replies are listed 'Best First'.
Re^2: writing the finding result into a file.txt
by The Mass (Initiate) on Mar 28, 2012 at 17:16 UTC
    I tried to use strict but it failed , and I tried to use the code above for(clueless newbie)
    but it didn't work :(
    what is the wrong , please help me :)
      I'm assuming you're on Windows. Perhaps you don't have a "C:\temp"? (Be careful to either use "C:/temp" note the use of double quotes and the forward slash or to use 'C:\temp' single quote and backslash. If you double quote and backslash you'll have to escape the backslash i.e. "c:\\temp". Also: add a my to the $dir as in
      my $dir='c:\temp';
        thanks bro , it is work done
        but I have a small question :
        why when we add a my to $dir , it is work done ??
        and without it , it doesn't work?
        please answer my small question .
        thanks again for your helping :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://962156]
[james28909]: what i am trying to do is track state of a chat based application. i need to be able to store the channels and such for a user, and when they join a new server/channel i need to be able to update that feild.
[james28909]: do you think OO would best suite that?
[karlgoethebier]: james28909: The last two are not mainstream. You have been warned ;-)
[karlgoethebier]: james28909: I don't know. Try it.
[james28909]: foreach server this bot is on, the gateway sends me a json response, which i parse out all the info with JSON, and this response has user information, i need to be able to add a user, and then update the user info when they join/leave rooms ect

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-05-25 16:35 GMT
Find Nodes?
    Voting Booth?