Ahhh sorrry to reply to my own post but I found this:

https://stackoverflow.com/questions/29302181/what-is-in-perl-for

I assume then that if " guess_doc_type" evaluates to false it moves on to
the defined subroutine. My problem is that I can't find where "
guess_doc_type" is defined... which is not a problem for this list to solve!

Thanks,
James

On Thu, Nov 22, 2018 at 1:48 PM James Kerwin <jkerwin2...@gmail.com> wrote:

> Hi All,
>
> I'm looking through some Perl files for software we use and I noticed this
> in one of the config files:
>
> $c->{guess_doc_type} ||= sub {
>
> All other similar config files show a similar structure, but without the
> "||" before the equals sign:
>
> $c->{validate_document} = sub {
>
> My question is, what is the "||" doing in the first example?
>
> It would be useful to know before I go changing anything. My instinct is
> that it's an "or" but that really doesn't make sense in this context.
>
> I've attempted to Google this, but found no solid answer.
>
> Thanks,
> James
>

Reply via email to