1Perl::Tidy(3) User Contributed Perl Documentation Perl::Tidy(3)
2
3
4
5 my (
6 $perltidyrc_stream, $is_Windows, $Windows_type,
7 $rpending_complaint, $dump_options_type
8 ) = @_;
9
10 my $use_cache = !defined($perltidyrc_stream) && !$dump_options_type;
11 if ($use_cache) {
12 my $cache_key = join( chr(28), @ARGV );
13 if ( my $result = $process_command_line_cache{$cache_key} ) {
14 my ( $argv, @retvals ) = @{$result};
15 @ARGV = @{$argv};
16 return @retvals;
17 }
18 else {
19 my @retvals = _process_command_line(@_);
20 $process_command_line_cache{$cache_key} = [ \@ARGV, @retvals ]
21 if $retvals[0]->{'memoize'};
22 return @retvals;
23 }
24 }
25 else {
26 return _process_command_line(@_);
27 }
28}
29
30 ############################################################
31 # This code is not reachable because syntax check is deactivated,
32 # but it is retained for reference.
33 ############################################################
34
35 # We need a named input file for executing perl
36 my ( $stream_filename, $is_tmpfile ) = get_stream_as_named_file($stream);
37
38 # TODO: Need to add name of file to log somewhere
39 # otherwise Perl output is hard to read
40 if ( !$stream_filename ) { return $stream_filename, "" }
41
42 # We have to quote the filename in case it has unusual characters
43 # or spaces. Example: this filename #CM11.pm# gives trouble.
44 my $quoted_stream_filename = '"' . $stream_filename . '"';
45
46 # Under VMS something like -T will become -t (and an error) so we
47 # will put quotes around the flags. Double quotes seem to work on
48 # Unix/Windows/VMS, but this may not work on all systems. (Single
49 # quotes do not work under Windows). It could become necessary to
50 # put double quotes around each flag, such as: -"c" -"T"
51 # We may eventually need some system-dependent coding here.
52 $flags = '"' . $flags . '"';
53
54 # now wish for luck...
55 my $msg = qx/perl $flags $quoted_stream_filename $error_redirection/;
56
57 if ($is_tmpfile) {
58 unlink $stream_filename
59 or Perl::Tidy::Die("couldn't unlink stream $stream_filename: $!\n");
60 }
61 return $stream_filename, $msg;
62 }
63
65 Hey! The above document had some coding errors, which are explained
66 below:
67
68 Around line 2261:
69 =pod directives shouldn't be over one line long! Ignoring all 2
70 lines of content
71
72 Around line 3863:
73 =pod directives shouldn't be over one line long! Ignoring all 3
74 lines of content
75
76
77
78perl v5.28.1 2018-11-19 Perl::Tidy(3)