Server IP : 23.254.227.96 / Your IP : 216.73.216.7 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/usr/share/doc/perltidy/examples/ |
Upload File : |
#!/usr/bin/perl -w # Example use a perltidy postfilter to outdent certain leading keywords # Usage: # perltidy_okw.pl -sil=1 file.pl # This version outdents hardwired keywords 'step', 'command', and 'expected' # The following is an example of the desired effect. The flag -sil=1 is # needed to get a starting indentation level so that the outdenting # is visible. =pod step 4; command 'Share project: project1'; expected 'A project megjelenik a serveren'; shareProject ('project1', 'login', '123', Login => 1, PortalServer => $openJoinAddress); valueCheck ('project1_share', listBIMCloudData ('projects')); step 5; command 'quitAC'; quitAC (); =cut # Run it exactly like perltidy, and the postfilter removes the # leading whitespace of lines which begin with your keywords. The # postfilter works on the file as a single string, so the 'm' quote # modifier is needed to make the ^ and $ string positioners work # See http://perltidy.sourceforge.net/Tidy.html for further details # on how to call Perl::Tidy use Perl::Tidy; my $arg_string = undef; my $err=Perl::Tidy::perltidy( argv => $arg_string, postfilter => sub { $_ = $_[0]; s/^\s*(step|command|expected)(.*)$/$1$2/gm; return $_ } ); if ($err) { die "Error calling perltidy\n"; }