#perl - Mon 9 Apr 2007 between 04:02 and 04:16



cowbudI am looking to run a function that returns a recursive listing of a directory, I have looked at File::Find but it won't give me a list I can only process the files in order, any suggestions what I should look at? Preferably a built in module..
revdiablocowbud: Use File::Find to create a list?
tabris|awaywrite your own.
it's not that hard.
buucowbud: There's a.. File::Find::Rule or some such
That will do that.
tabris|awaythe only trick to worry about is recursive symlinks
bpalmerfind2perl . -print <-- now change the print in the output script to be a push into your collecting variable
cowbudbuu: ill take a look thanks
bpalmer: I don't want to use global shit
buuYou don't have to use globals.
cowbuderr stuff
really?
buuCreate a closure that pushes onto a lexical.
sub foo { my @x; find(sub { push @x, $_ } });
zamolxeswell, you probably need to use $File::Find::name isntead of $_
cowbudbuu: ahh I had something similar but Ihad an error so I thought it wasn't possible thanks man :)
NeophyteHello, I have a question. I just downloaded ActivePerl for Windows XP, saved it in \usr\ . I wanted to see if Perl would work so I made a simple Hello World program. I went to C: made a folder called perl scripts, wrote out the Hello World Code with #!/usr/bin/perl, went in run cmd and typed cd c:\perlscripts, then hello.pl -- and I get an error.
Can someone help me?
decYou didn't even say what the error is.
NeophyteI'll type the error out.
Jmax-#!C/usr/perl ## or something, i'm sure there are active state FAQs on the matter
Khisanththat sounds like the wrong procedure for windows
NeophyteBackslash found where operator expected at C:\perlscripts\hello.pl line 1, near "rtf1\" "ansi\" "ansicpg1252\"
and it goes on... for about 5 lines
Khisanththe shebang doesn't matter except for the switches IIRC
maukedid you write your script in word?
NeophyteYES
word
maukeexcellent (NOT)
NeophyteSo notepad? :P
rob...
NeophyteI am a newbie, sorry.
So write it from notepad?
revdiabloYes
maukeany text editor will work
NeophyteWord didnt work
why?
silinotepad won't work
\r\n = break

Page: 5 12 19 26 33 40 47 54 61 

IrcArchive