# Respond to an unknown method call

```perl
class Farragut {
    method FALLBACK ($name, *@rest) {
        say "{self.WHAT.raku}: $name.tc() the @rest[], full speed ahead!";
    }
}

class Sparrow is Farragut { }

Farragut.damn: 'torpedoes';
Sparrow.hoist: <Jolly Roger mateys>;
```

#### Output:

```
Farragut: Damn the torpedoes, full speed ahead!
Sparrow: Hoist the Jolly Roger mateys, full speed ahead!
```

`<a rel="nofollow" class="external text" href="https://docs.raku.org/language/typesystem#index-entry-FALLBACK_(method)">FALLBACK</a>` will be called for any method that is not defined. Since any class inherits from `Any`, there will be plenty of already defined methods. Those which are not defined can also be used as L-Values by the magic of `<a rel="nofollow" class="external text" href="https://docs.raku.org/type/Attribute#index-entry-trait_is_rw_(Attribute)-trait_is_rw">is rw</a>`.

```perl
class L-Value { 
    our $.value = 10;
    method FALLBACK($name, |c) is rw { $.value }
}

my $l = L-Value.new;
say $l.any-odd-name; # 10
$l.some-other-name = 42;
say $l.i-dont-know; # 42
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/r/respond_to_an_unknown_method_call.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
