#perl
10 October 2007
Total 40 pages. You are browsing page 4/40.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
02:22 <****> i bet i have a .pl for you then.
02:22 <****> jettero: FindBin is preferable, though there is an argument that could be made that it's not actually needed
02:22 <****> opendir
02:22 <****> preaction: i copied the exact example (after i tried it myself) and i still got: Can't call method "check" on an undefined value at test.pl line 4.
02:23 <****> (well, technically there are ways in which cwd could change without chdir being called)
02:23 <****> rookpawn: oddly, I have a hard time believing you've discovered a long unknown bug with respect to cwd
02:23 <****> So, im saying, its not just chdir(), but opendir() as well
02:23 <****>new method.
02:23 <****> opendir does not change the cwd
02:23 <****> preaction: /me feels dumb.. thanks
02:24 <****> (for example, execing to a process that changes the directory)
02:24 <****> bpalmer: chdir inheritance is one way
02:24 <****> bpalmer: but that'd just be for the kidpid... it woulodn't change the perl cwd
02:24 <****> jettero: exec doesn't create kids
02:24 <****> rather, cwd inheritance
02:25 <****> Hello all, here's a script that I am trying to get to work by creating a hash from a text files with the key being old file names and the new file names assigned to the value.
02:25 <****> bpalmer: well that's sort of moot, isn't it; you've replaced your existing process, making whatever you do next irrelevant
02:25 <****> I thought exec did a fork and exit... but yes, I missed that it was exec
02:25 <****> Somni: If I wan't to parse some information from a website, what module do you recommend?
02:25 <****> no, it can'tfork...
02:25 <****> Somni: yes, yes, there's a reason I was offering this answer in parens.
02:25 <****> but i cannot think of how to use that hash to run through the files and rename them using hash keys as references.
02:25 <****> sabooky: depends on what layout it's in; HTML::TreeBulider for generic stuff, HTML::TableExtract for tables
02:25 <****> here's what i've got so far: http://rafb.net/p/Xl7ygR45.html
02:25 <****> So, how does one print the working directory without use Cwd or is that necessary
02:26 <****> What the hell is going on in here?
02:26 <****> Somni: crap... Umm it's a mix :/ (guessing TableExtract then?)
02:26 <****> rookpawn: you can do what Cwd does, but it's easier just to use the module
02:26 <****> buu++
02:26 <****> buu: roman orgy.
02:26 * jettero moans
02:26 <****> sabooky: some of the data you want is in tables, and some is outside?
02:26 <****> unfortunately people came dressed in greek togas.
02:26 <****> sabooky, TreeBuilder would probably be your best bet. TableExtract is just for data in tables (or you could combine the two)
02:26 <****> buu, HI BUU
02:27 <****> ok, cool
02:28 <****> Cwd seems to be XS? does it pretty much just call the OSes favorite getpwd()?
02:29 <****> OS's?
02:30 <****> probably, http://search.cpan.org/src/KWILLIAMS/PathTools-3.25/Cwd.xs
02:30 <****> Somni's url is at http://xrl.us/68zh
02:33 <****> bpalmer: This is sort of painful.
02:33 <****> apeiron: WHAT DO YOU WANT.
02:33 <****> buu, YOUR SOUL
02:33 <****> yawnnnnnnnnnnn
02:33 <****> flight16, YOURS TOO
02:34 <****> Why do you want that??
02:34 <****> Be...cause... I.. er.. need them. /me nods.
02:35 <****> I guess if somebody is in need I can't say no :(
02:39 <****> Hey. What's a good way to print out a string as 70-character lines?
02:40 <****> I think I saw a Text::Wrap some years back
02:40 <****> oh ok. was hoping for some built-in. Guess I can just use a little loop
02:41 <****> Text::Wrap is core
02:41 <****> p0wned
02:42 <****> Cwd.xs isn't as simple as I thought it'd be
02:42 <****> Somni: ah, thanks
02:42 <****> it's careful about taint and everything
02:42 * CPAN upload: Test-Reporter-1.38 (++++ ) by FHOXH
02:42 <****> it's magic
02:43 <****> qwho is kwilliams?
02:43 <****> is he one of the leet insiders?
02:50 <****> Can I ask some language comparison questions?
02:50 <****> no
02:50 <****> or perl enthsiasm questions
02:50 <****> ok
02:50 <****> (I was kidding)
02:51 <****> it's probably fine imo, but I'm just some guy ...
02:51 <****> what is a good db connection strategy for perl webapps?
02:51 <****> see that's a good question
02:52 <****>connect; for persistance
02:52 <****> other choices include mod perl and ignoring the mysql connection startup time
02:53 <****> potentially stupid question. .= on undef hash value gives error while 'use strict;'. is there good solution other than checking to see if key exists before .= each time ?
02:55 <****> what would allow me to store a filemask format in a config file and then process that filemask in a regex or equivalent?
02:56 <****> aquaone: it's doing you a favor. what behaviour would you like to happen if the key doesn't exist? don't do anything, or just set the value to the string you're trying to append?
02:56 <****> for instance: i have a file named filename_01.zip
02:56 <****> infi: the latter.
02:56 <****> i want to set something up that says look for filename_%02.zip or something like that
02:56 <****> like sprintf?
02:57 <****> http://www.danga.com/mogilefs/
02:57 <****> aquaone: $hash{ $key} .= 'blah' works without a warning
02:57 <****> (strict has nothing to do with it)
02:58 <****> anno-: gives me a warning in strict. ?
02:58 <****> aquaone: what are you doing?
02:59 <****> this gives me an error: use strict; my %foo = (); $foo{bar} .= 'code';
02:59 <****> i don't get why
03:00 <****> it's something else
03:00 <****> hmm, ok. :-/
03:00 <****> .= ise excepted from the warnin, as is +=
03:00 <****> weird, not sure what it is then, tried that in a foo.pl and it gives me the error
03:01 <****> that's the only line except the shebang line...
03:01 <****> well, ty for the time
03:01 <****> put it up in a pastebot
03:01 <****> see topic
03:02 <****> can you index strings as arrays in Perl?
03:02 <****> substr( $str, $i, 1)
03:02 <****> if you must
03:03 <****> Guys, can u please give me a hint on how to use the hash i created to lookup the the filenames (keys in the hash) and then rename them to the values of the hash?
03:03 <****> here's the link to the script: http://rafb.net/p/9nRMHk89.html
03:03 * jagerman hopes threexk isn't using string indexing as a regex substitute
03:03 <****> anno-: thanks.. I like Python's syntax better in this regard
03:04 <****> when i try to use the hash, in the rename sub, I get nothing- i tried to use a conditional to check the filename using exist.
Total 40 pages. You are browsing page 4/40.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
