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
In reply to I think I'm starting to get it by coolmichael
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |