I got the first bit, that perl was interpolating the slashes when my first feeble attempt didn't work. So, &DBI::connect() really sees it as C:\\WINDOWS\\Desktop and then the function interpolates it again somewhere to get C:\WINDOWS\Desktop
That part is fairly simple, but I was happy to have figured that out on my own.
What was difficult for me to grasp was why perl interpolates the string a second time. I was still thinking in C. "Shouldn't perl just know that it's been interpolated once and not do it again? Wouldn't that be simpler?" I couldn't for the life of me figure it out. I knew there had to be a reason St. Larry did what he did. Like a flash, it just came to me last night while I was trying to sleep (avoid insomnia like the plague). If perl only interpolated strings once, you couldn't do stuff like
which is infinitly useful. And it's probably in the camel I've been reading. Perhaps it's time to RTFM again.$foo="can I get you a \$bar?\n"; $bar="cow"; print $foo; $bar="chicken"; print $foo;
Update: No, I'm not. In fact, I'm rather wrong. No wonder it took so long to figure it out. And it's probably not in the camel either. Damn, I hate when that happens.
michael
the blue haired monk
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: I think I'm starting to get it
by nashdj (Friar) on Apr 04, 2001 at 14:16 UTC | |
(tye)Re: I think I'm starting to get it
by tye (Sage) on Apr 04, 2001 at 21:40 UTC | |
by cLive ;-) (Prior) on Apr 04, 2001 at 23:49 UTC | |
by tye (Sage) on Apr 04, 2001 at 23:55 UTC | |
by extremely (Priest) on Apr 05, 2001 at 02:33 UTC | |
by coolmichael (Deacon) on Apr 10, 2001 at 10:53 UTC | |
by tye (Sage) on Apr 10, 2001 at 18:37 UTC | |
Re: I think I'm starting to get it
by ton (Friar) on Apr 05, 2001 at 01:21 UTC |