File: synopsis.pl

package info (click to toggle)
libdata-util-perl 0.67-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 556 kB
  • sloc: perl: 2,958; ansic: 416; makefile: 8
file content (24 lines) | stat: -rw-r--r-- 310 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!perl -w
# synopsis.pl
use strict;
use Data::Util qw(:all);

# print the file for example
open my $this, '<', __FILE__;
print while <$this>;

sub f{
	printf "f(%s) called.\n", neat($_[0]);

	my $ary_ref = array_ref shift;
}

sub g{
	f([undef, 42]);      # pass
	f({foo => "bar\n"}); # FATAL
}

g();

__END__