File: test62-tie-a.p

package info (click to toggle)
libdevel-nytprof-perl 6.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,552 kB
  • sloc: perl: 5,616; javascript: 4,033; ansic: 107; makefile: 23
file content (14 lines) | stat: -rw-r--r-- 342 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# test determination of subroutine caller in tie calls

{
    # calls to TIESCALAR aren't seen by perl < 5.8.9 and 5.10.1
    sub MyTie::TIESCALAR { bless {}, shift; }
    sub MyTie::FETCH { }
    sub MyTie::STORE { }
}

tie my $tied, 'MyTie', 42;  # TIESCALAR
$tied = 1;                  # STORE
if ($tied) { 1 }            # FETCH

exit 0;