In this paper, we introduce the notion of affordance proposed by Gibson, and provide a computational formalism based on Petri Nets (PNs) for conducting perception-based task analysis. Gibson used affordance to refer to what an environment offers an animal for either ill or good. Since then, affordance has been widely adopted and used in several areas such as human computer interaction, mobile robotics, etc. We argue that Petri Net provides the appropriate framework for performing a perception-based task analysis (PTA) as it helps investigate the task from an ecological perspective based on concepts such as affordance, effectivity and actualizations. Additionally, Petri Net can be used to study behavioral properties such as reachability, boundedness and liveness, which relate to the perception-based task. We illustrate how the ecological concepts can be modeled using the proposed PN formalism with reference to a driving task. We conclude that Petri Net is a very useful tool for conducting perception-based task analysis.