good chemistry is complicated,
and a little bit messy -LW
Solved! I would have expected a syntax error hereby roboticus (Chancellor)
|on Oct 19, 2018 at 16:05 UTC||Need Help??|
roboticus has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, guys! That was a quick resolution. Indirect Object syntax was what tripped me up. As haukex suggests, I'll have to start using the Yadda, Yadda operator ... to ensure that I don't miss that in the future.
Using that operator and a comment, I can either let the program run and execute and die only if I reach unfinished code:
Or if I'd rather have the program just fail without running, I can prefix my original comment with the operator (so long as I don't use a semicolon as the first character in my comment:
Really, though, not one Monty Python reference? 8^)
Original post follows:
When I write experimental bits of code and don't get a chance to finish, I'll frequently mark my position with a few words and no comment marker with the intent that if I run the program, perl will tell me that bit(s) of my code are unfinished, and let me know where the unfinished bits are. This morning I decided to adapt a working program I've been using all week to add some new functionality, and when I looked at the code, I saw this bit:
What the heck? The code is working, but that subroutine just can't be right. So I looked over the program--It doesn't look like the code is commented out anywhere (I normally use "=h1 foo" and "=cut" to comment out blocks of code I don't want to use). I ran:
OK, then, *something* has to be masking this syntax error, right? So I copied the code to xyzzy.pl and started removing chunk after chunk, eventually coming up with:
So consider me baffled, I don't know what's going on here. Can anyone tell me what I'm not seeing?
For the record:
Interesting ... one more bit of information before I hit the preview button. I changed the contents of the subroutine to:
and now I get what I expected to see:
Does anyone know what's happening here? My only (ill-informed) guess would be something to do with parsing the GOTO statement.
When your only tool is a hammer, all problems look like your thumb.