Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Problems? Is your data what you think it is?
 
PerlMonks  

webinject rewrite?

by Skeeve (Vicar)
on Dec 08, 2011 at 09:14 UTC ( #942379=perlmeditation: print w/ replies, xml ) Need Help??

I stumbled accross webinject last week because we are monitoring our services with Nagios and a colleague, who want's to check a service needs a login/logout.

When I looked at the source code I was a bit shocked ;) and I get the feeling that I need to rewrite the whole stuff.

I already found a newer version in CPAN Webinject but it still has many of the flaws I want to get rid of.

Unfortunately I can't spent too much time on it (I'm not paid for that) :( and I don't yet know anything about the GUI part. So I thought someone here might be interested in helping?

Here are the main drawbacks I found:

  • Despite the statement in the documentation that the testcase files are XML, they are not. For example one can not use "&" for an ampersand, but has to write "&" which will make any XML tool croak.
  • Same is true for "&lt;" which has to be written as \<
  • This "misuse" of XML::Simple, which is sed for parsing, is achieved by rewriting every "&" and every "\<" in the files by "{AMPERSAND}" and "{LESSTHAN}". As a consequence these 2 Strings, should they appear anywhere in the file, will be replaced.
  • The rewrite is done EVERY run and requires a new file in the filesystem.
  • The older version 1.41 (I didn't check the CPAN version) does a second rewrite if the testcase file contains just one case instead of using XML::Simple properly. (ForceArray => 1)


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Comment on webinject rewrite?
Select or Download Code
Re: webinject rewrite?
by moritz (Cardinal) on Dec 08, 2011 at 10:29 UTC

    It sounds to me that not a full rewrite is in order, just a change to a certain subsystem (though I don't know how deep the implications of such changes go).

      I hope so. But as I said: I don't know the GUI part yet.

      But in any case, it will be a big issue if the configuration files now require real XML. So to the "outside world" it would appear as a major change.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e
Re: webinject rewrite?
by cgoldberg (Initiate) on Dec 08, 2011 at 13:14 UTC

    Hi. I am the original author of WebInject. The website (webinject.org) is currently outdated. The best place to get info is via CPAN and the new maintainer. There is also a discussion group (http://groups.google.com/group/webinject) that the new maintainer responds on. (perhaps you could re-post over there?)

    I apologize for the state of the WebInject 1.4 source code :) I originally wrote it nearly a decade ago as a novice Perl hacker. It's a little mind-boggling. I have since moved on to other languages, but I still have fond memories of the Perl community.

    happy hacking,

    -Corey Goldberg

      I originally wrote it nearly a decade ago as a novice Perl hacker

      ;) Exactly what I thought two days ago when I looked at the code.

      P.S. And you just registered here to reply? Thanks a lot.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://942379]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-04-18 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (473 votes), past polls