Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What kind of Perl code is this? "<[" Tags - Tomahawk?

Status
Not open for further replies.

MatthewP

Programmer
Jan 16, 2001
176
GB
I've just received a perl application to look at, but I don't recognise the format of the code at all, and it quite obviously won't run on a normal system without some module or external parser.

As it's embedded into HTML files, I guessed it might be EmbPerl or Mason in some format, but a quick look on the net told me it wasn't either of these.

The name "tomahawk" was bounced around a bit previously, which I've heard of, I don't know if this means anything to anyone?

The more I look it looks like its embedded for a particular CMS or a specific parser, given that it doesnt use $ for varible names for the most part (but does on $dbh-> connection code for example). I've attached a couple of snippets below. Does anyone recognize what this might be?

Thanks,
Matt.

Example 1: (from a .html file)
<[banner->select_banner(location=>'login_script')
i=1
while banner.file {]>
<div class="ads">
<a href="<[=banner.link]>"><img src="/banner/<[=banner.file]>" /></a>
</div>
<[i+=1}]>

Exammple 2: (from a .lib file)
my $dbh = DBI->connect('dbi:Oracle:SITE.WEBSITE.NET',
'USER',
'PASS',
);
$tomahawk->globalvars->{'local'}->{'oreturn'} = -1 unless($dbh);

$tomahawk->globalvars->{'oracle'}->{'dbh'} = $dbh;

endinline
unless (oreturn == -1) {
oracle.connected = 1
return 1;
}..........................
 
Tomahawk is a (Java) subproject of MyFaces. I don't think this looks like it - see
Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Thanks Steve,

Was just wondering what all the

$tomahawk->globalvars->{'local'}->{'oreturn'} = -1 unless($dbh);

is about. Strangest looking Perl I ever saw!

Matt

 
these looks like references:

$tomahawk->globalvars->{'oracle'}->{'dbh'} = $dbh;

$tomahawk looks like a reference to a hash, the arrow operator -> is used to get the data out of a reference.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Yes, Im wondering about this tomahawk business.

I found this:
which appears to reference a fairly out dated (not touched in well over 7 years) web server based on apache called tomahawk. This is possible a likely candidate.

I've posted on perlmonks too, not even a reply there as yet.

Matt
 
I realize you have some perl code, but Tomahawk is not a perl topic. $tomahawk could really mean anything, are there no other clues in the application you have? Is that html file you posted run directly in the browser and is parsed by the http server (like an SSI document for example) or does it get parsed by the perl program?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Hi Kevin,

Thanks for the replys. There are no other clues whatsoever. I was rather hoping that somebody might recognise something from it and say that there was a perl or apache module that did stuff with code like this 10 years ago for example. Theres hundreds of lines of this stuff spread over many files.

I do understand the multi level hashes and referencing, and have heard of software called Tomahawk. It obviously ran in something or with something else, and I thought it may spark something in someone enabling me not to have to rewrite the whole thing!

Thanks,
Matt.
 
ahh.... I see. Hopefully someone will know.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top