Minimal Perl For UNIX and Linux People 2 doc
... routinely in Minimal Perl and removed only in the rare cases where it spoils the results. It’s shown here for both the sed and perl commands for uniformity. WRITING SIMPLE SCRIPTS 37 The second form ... "msg" format validate_file2: Sorry, no switches allowed at validate_file2 line 6 Table 2. 6 Shell and Perl techniques for writing messages to STDOUT and STDE...
Ngày tải lên: 06/08/2014, 03:20
... 19 20 $DEBUG and # show new size 21 print "Size of $fname: ", -s $fname, ' bytes'; 22 23 $qual=$qual - 5; # reduce for next iteration 24 } 25 } NOTE The Shell’s for ... Shell’s for loop is similar to Perl s foreach loop, not Perl s for loop. 10.5 LOOPING WITH for Although the Shell’s for is like Perl s foreach, Perl does have a for loop o...
Ngày tải lên: 06/08/2014, 03:20
... process lists 22 3 Comparing Unix pipelines and Perl functions 22 3 Using sort 22 4 ✦ Using grep 22 7 ✦ Using join 22 9 Using map 23 2 7.4 Globbing for filenames 23 4 Tips on globbing 23 7 7.5 Managing ... 20 1 Part 2 Minimal Perl: for UNIX and Linux Shell Programmers 20 3 7 Built-in functions 20 5 7.1 Understanding and managing evaluation context 20 6 Det...
Ngày tải lên: 25/03/2014, 10:27
Minimal Perl For UNIX and Linux People 1 ppsx
... collect and process input 6 Further details on creating Perl commands and scripts are provided in sections 2. 1 and 2. 4. xii 5 Perl as a (better) awk command 121 5.1 A brief history of AWK 122 5 .2 Comparing ... modules 422 12. 4 Summary 424 Directions for further study 425 epilogue 426 appendix A: Perl special variables cheatsheet 427 appendix B: Guidelines for pa...
Ngày tải lên: 06/08/2014, 03:20
Minimal Perl For UNIX and Linux People 3 pot
... two-letter country codes other than .us are “foreign” (to Americans, at least); for instance, the .pl domain stands for Poland, and .au stands for Australia. 22 Although this example works at the time ... case differences Matches perl , PERL , Perl , and so on in $data. $data =~ / perl /xi Same, except x requests extended syntax Matches perl , PERL , Perl , and so on in...
Ngày tải lên: 06/08/2014, 03:20
Minimal Perl For UNIX and Linux People 4 ppt
... generate: • perldoc -f length # documentation for function called length • perldoc Text::Tabs # documentation for "expand" function • man ascii # info on character sets 18 The following command ... command brings up the documentation for s2p, which, unlike the scary Perl Version 4 code that s2p generates, can be viewed with impunity: • man s2p # documentation on sed to Per...
Ngày tải lên: 06/08/2014, 03:20
Minimal Perl For UNIX and Linux People 5 pot
... installing Perl (and therefore find 2perl) , such people can use find commands like those shown previously. The procedure is as follows. The find 2perl command is run with options appropriate for the ... command clause, followed by a “\;” sequence to mark the end of command’s argument list. The usual command format is therefore find dir(s) attribute(s) -exec command {} \; 1 82 CHA...
Ngày tải lên: 06/08/2014, 03:20
Minimal Perl For UNIX and Linux People 6 pptx
... integers 111 10 19 88 43 55 81 23 04 40 12 2 1 2 1 10 91 88 43 55 18 23 40 17 21 000 $ intra_line_sort integers 1 2 04 10 12 19 23 40 43 55 81 88 111 000 1 2 10 17 18 21 23 40 43 55 88 91 The effect ... 10 19 88 43 55 81 23 04 40 12 2 1 <- Original 1 2 04 10 12 19 23 40 43 55 81 88 111 <- Sorted 2 1 10 91 88 43 55 18 23 40 17 21 000 <- Original 000 1 2 10 17...
Ngày tải lên: 06/08/2014, 03:20
Minimal Perl For UNIX and Linux People 7 potx
... sort a script’s arguments: 28 8 CHAPTER 8 SCRIPTING TECHNIQUES 20 }; 21 22 $p and $/=""; # paragraph mode 23 $c and $/=$c; # custom record separator mode 24 $i and $X.='i'; # ... of $/ separated records. a. cmd and cmd2 represent OS commands, var/$var and array/@array Shell /Perl variable names, and function a Perl function name. 26 2 CHAPTER 8 SCR...
Ngày tải lên: 06/08/2014, 03:20
Minimal Perl For UNIX and Linux People 9 potx
... { 19 # Contents 20 } 21 22 sub stantial { 23 # Contents 24 } 25 # And so forth 26 27 1; # Indicate module's end, with True value You’ll learn how to use this template next. 2 For a more detailed ... "undefined" value 20 } 21 else { 22 defined $cl_width and $cl_width > 2 or $cl_width=80; 23 24 $string=shift; # get sub’s argument 25 $string=expand $...
Ngày tải lên: 06/08/2014, 03:20