summaryrefslogtreecommitdiff
path: root/t/lib/warnings/perly
blob: afc5dccc72f9e632c3d305bccec4519e8a1be9af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  perly.y	AOK

  dep() => deprecate("\"do\" to call subroutines") 
  Use of "do" to call subroutines is deprecated

	sub fred {} do fred()
	sub fred {} do fred(1)
	sub fred {} $a = "fred" ; do $a()
	sub fred {} $a = "fred" ; do $a(1)


__END__
# perly.y
use warnings 'deprecated' ;
sub fred {} 
do fred() ;
do fred(1) ;
$a = "fred" ; 
do $a() ;
do $a(1) ;
no warnings 'deprecated' ;
do fred() ;
do fred(1) ;
$a = "fred" ; 
do $a() ;
do $a(1) ;
EXPECT
Use of "do" to call subroutines is deprecated at - line 4.
Use of "do" to call subroutines is deprecated at - line 5.
Use of "do" to call subroutines is deprecated at - line 7.
Use of "do" to call subroutines is deprecated at - line 8.