[Webchange-list] Changing perl scripts

Vince M Hudd vince at softrock.co.uk
Tue Mar 15 16:08:38 GMT 2011

Tim Hill <tim at timil.com> wrote:
> In article <da9966b451.ricp at user.minijem.plus.com>,
>    Richard Porter <ricp at minijem.plus.com> wrote:
> > I tried to use webchange to modify a set of perl scripts but it appeared
> > to ignore them. I guess it's only looking for html files.
In the older versions, it literally only looked at files that were typed as
either plain text or HTML (and its behaviour varied according to which of
those types is looked at, depending on what you are asking it to do). The
obvious flaw with that was how the user deals with other filetypes they
might want to use WebChange with - I could make assumptions about filetypes,
but better would be to allow the user full control.

Thefore, in the new version, I devised a simple method to allow that - the
software sees files as falling into a number of categories, the two most
important being plain text and mark up. Basically, within WebChange's
Choices folder there is a file called PlainText and another called MarkUp,
and these contain a list of filetypes. When WebChange is doing whatever task
you ask of it, it checks the filetype against the lists in those files to
determine what, if anything, to do.

> Unless you change
> !WebChange.Choices.Markup to include the filetype you want to edit.

Or ...PlainText, which *might* be better, depending on the nature of what's
in the files.

However, I thought I'd long since updated WebChange to use a Choices folder
within !Boot - why is yours still contain in the application? =:o
> > I suppose one way around this would be to set all the files to type
> > html, update them and then change them back to perl (&102)?
> > What does it do with other file types that might have html within their
> > content?
> Webchange doesn't 'know' or 'understand' the different between PHP, HTML
> or plain text. A match is a match!

I'd be a bit worried about what process that (in a limited way) understand
HTML make of PHP and Perl /containing/ HTML. Their very nature might mean a
simple HTML tag isn't a simple HTML tag (being split between writes and
variables), so (for example) the tag case changer could make a mess.

If you're only really intending the search and replace to operate on them,
it's probably better to put them in the Plain Text file.

Soft Rock Software:                   http://www.softrock.co.uk
Vince M Hudd:                         http://misc.vinceh.com/about-vinceh/

Bristol RISC OS Users second meeting: http://www.riscository.com/?p=147
South West Show report:               http://www.riscository.com/?p=169

More information about the Webchange-list mailing list