I'm attending (and presenting at) GULEV Congreso Internacional de Software Libre 2004 , which is apparently primarily in spanish. My spanish is mostly "which way to the airport" and "no more beer", but I figured I'd sit in on an intro to Perl course. Wow.
One thing I learned was that $! is internationalized, so the error messages might not match, even on linux, if you're looking for
$! =~ /permission denied/and such. Hmm... I have to rethink some of my programs.
Another reason to watch this Salvador Ortiz Garcia give his Perl class even though I don't understand anything but the keywords is that I want to know what he has covered before I give my "intro to objects" talk tomorrow, and backfill appropriately.
Although, if you're sitting in a brand new intro class, it's unlikely you'd want to spend hours 11 through 14 of your Perl exposure learning about objects, so I think I can presume that nobody's gonna try to drink from the firehose here.
Another thing that is shocking is that it seems about 2:1 for male-female, unlike similar conferences in the US which are about 10:1 in my experience. Perhaps the mexican schools don't create the "girls can't do math" stigma that the US schools do. Hmm. Need to look into that further.
Hmmm, slash doesn't like a subject consisting solely of $!...
I thought that's why the %! hash was there, so you can say die $! if $! && $!{EPERM}.
-Dom
Re:Dollar-Bang
BooK on 2004-11-25T12:54:16
Wow, I didn't even know that %! existed! It's a recent addition to the language, isn't it? It looks very useful.
Re:Dollar-Bang
merlyn on 2004-11-25T12:55:46
Oh yeah, speaking of dollar... from what I can make out, they pronounce $ as "pesos". I wonder if their strings are 1/10th as long, then. {grin}Re:Dollar-Bang
Dom2 on 2004-11-25T13:43:06
I've never understood why they all talk about "potatoes" the whole time.;-) -Dom
Re:Dollar-Bang
Juerd on 2004-11-26T09:03:18
Still, I prefer the somewhat easier to read and type$! && $!{EPERM}
Even though that requires$! == EPERMuse Errno qw(EPERM);
.Re:Dollar-Bang
merlyn on 2004-11-26T12:00:40
You shouldn't have to test if $! is true. It'll always be true, left over from some failed system call from the beginning of the Perl program generally. You should die only if the thing you just tried to do "failed" at a Perl level, and only then check $! to see what kind of failure you have.It's a common mistake, and it looks like you were making it. {grin}
Don't count on specific values of $!, neither numeric nor especially the strings values-- users may switch their locales causing error messages to be translated into their languages. If you can trust a POSIX-ish environment, you can portably use the symbols defined by the Errno module, like ENOENT. And don't trust on the values of $! at all except immediately after a failed system call.