# tasks.ref(...)

`tasks.ref(`*`module: str`*`)`

* **Parameters**
  * `module`: the module whose task's output you wish to retrieve. This string should be the path of the module relative to the `modules` directory.

**Example:**

{% tabs %}
{% tab title="Class-based tasks" %}

```python
import prism.task
import prism.target
import prism.decorators

class ExampleTask(prism.task.PrismTask):
    
    @prism.decorators.target(
        type=prism.target.Txt, 
        loc="/Users/hello_world.txt",
        **kwargs
    )
    def run(self, tasks, hooks):
        test_str = "Hello, world!"
        previous_task_output = tasks.ref("first_task.py")
        return test_str + previous_task_output
```

{% endtab %}

{% tab title="Function-based tasks" %}

```python
from prism.decorators import task

@task()
def example_function(tasks, hooks):
    test_str = "Hello, world!"
    previous_task_output = tasks.ref("first_task.py")
    return test_str + previous_task_output
```

{% endtab %}
{% endtabs %}
