Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A couple of things' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A couple of things
Authored by: pmccann on Jan 11, '02 05:52:21AM

Hi again,

looks like we've slipped off the front page now! Your revised script still has that problem with $pref_ In fact you should be getting a warning when you ask perl to syntax check it:

[pre]% perl -c rename
Name "main::pref_" used only once: possible typo at rename line 6.
rename syntax OK
[/pre]

That is, as per my first post, you're substituting the value of the variable $pref_ --which will be "" (ie empty)-- instead of substituting the value of $pref followed by an underscore. Just curly bracket the pref, like so: ${pref}_

Cheers,
Paul



[ Reply to This | # ]
A couple of things
Authored by: kevinl on Jan 11, '02 12:22:43PM

ah ha! I think I see the problem -- in the original script, I escaped the underscore after $pref -- so it was substituting $pref and then an underscore, not the variable $pref_ TMTOWTDI!

cheers
-kevin



[ Reply to This | # ]
replying to myself one more time...
Authored by: kevinl on Jan 11, '02 12:35:54PM

my bad -- I guess the escape character didn't come across in the posting of the script! There should be a backslash between pref and the underscore in the substitution, but it just won't display for some reason?

I'll be sure to read more carefully in the future...

cheers
-kevin



[ Reply to This | # ]
replying to myself one more time...
Authored by: pmccann on Jan 13, '02 10:29:49AM

Wow, this thread could serve as a very effective warning for anyone trying to submit scripts! Thanks for the explanation of what was going wrong: it seemed strange to me that you weren't getting the warnings that were slapping my face every time I would cut and paste your script. As is usually the case in such situations, there's some noise in the channel!

Does anyone know whether plain text formatting *supposed* to strip out backslashes (even --yep, I've tried it-- double backslashes)? Any workarounds?

Cheers,
Paul



[ Reply to This | # ]