Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Literal Token __VALUE__

by aardvark (Pilgrim)
on Mar 16, 2001 at 21:17 UTC ( #64954=perlquestion: print w/ replies, xml ) Need Help??
aardvark has asked for the wisdom of the Perl Monks concerning the following question:

I just got a new job and I've encountered a construct I've never seen. It's not broken, but I'm curious what's going on here;
my $iw_user = __VALUE__('iw_user','html');
It looks like a literal token. Programming Perl v.3 says, "You should consider any identifier that both begins and ends with a double underscore to be reserved for special syntactic use by Perl." (page 68)

When I put that line in a seperate script I get the error:
"Undefined subroutine &main::__VALUE__ called ..."

There is other whackiness in this script, things like __TAG__ and __INSERT__

BTW - This is all going on inside a Perl script written for Interwoven. They seem to be subroutines, but why would anybody use literal tokens for subroutine names?. Is it even possible for people to add custom literal tokens to Perl?

Get Strong Together!!

Comment on Literal Token __VALUE__
Download Code
Re: Literal Token __VALUE__
by jeroenes (Priest) on Mar 16, 2001 at 21:32 UTC
    As I read it, Programming perl and others say:
    "Thou shalt not name thy tokens as beginning and ending with double underscores, as thy script may break in any upcoming relase"

    More or less. Your predecessor clearly chose to ignore such warnings. Rephrased: he just choose funny names for his functions.

    Cheers,

    Jeroen
    "We are not alone"(FZ)
    Update: BrotherAde pointed out the use of 'thy'....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://64954]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-10-01 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (3 votes), past polls