Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Perl
String 264 codes
Home
Perl
String
1 $statement = qprint Hello
2 $statement = qqprint Hello
3 % 2f specifies a floating-point number with two decimal digits
4 %3d specifies that the integer number should be displayed with three digits
5 %x
6 `` returns the result of an shell command
7 A here-document starts on the line after the two arrows
8 A simple word-count program
9 A single q creates a single-quoted string
10 A string is a sequence of bytes (characters) enclosed in quotes
11 A stringful of 16-bit characters
12 A very simple password checker
13 Add new line character to string
14 Adding float-point number to the result returning from sprintf function
15 All Perl math operations are performed on double-precision floating-point values
16 Alternative Delimiters
17 Alternative delimiters can be used for all four of the q constructs
18 Alternative Quotes
19 An example of the DATA file variable
20 Append two string value
21 ASCII Character Codes
22 Assign returning value from qw to an array
23 Assigning a double quote by
24 Assigns a single quote
25 Backquotes and command substitution
26 Backslash Escapes in Perl
27 Binmode STDOUT
28 Brackets and Repetition operator
29 Calculating the length of $string
30 Calculation on string
31 Calling a here document in print statement
32 Capitalize with ucfirst
33 Check password
34 Chomp
35 Chomp in a while statement
36 Chomp matches the input line separator defined by the $ system variable
37 Chomp the pre-set character
38 Chop
39 Chop function deletes the character at the right end of the line of text
40 Chop function in action
41 Cleaning Up Typed Input
42 Combine string concatenation operator and string multiplication operator
43 Compare two words with cmp
44 Comparing Strings
45 Concatenate string
46 Concatenate strings
47 Concatenate the separate strings
48 Concatenate two string value in print statement
49 Concatenate two strings
50 Convert all letters of $string to lowercase
51 Convert all letters of $string1 to uppercase
52 Convert input to lowercase and uppercase
53 Convert mixed-case input
54 Convert value to character based on its ASCII code
55 Converting a string from lowercase to uppercase with the uc function
56 Converting a string to all lowercase with the lc function
57 Converting digit to string with sprintf
58 Crypt a string
59 Define variable for Here document
60 Demonstrating the qw operator
61 Demonstration of the index function
62 Difference between chomp and chop
63 Display double quotation marks in a printed string
64 Double quote string
65 Double quote with windows file path
66 Escape character
67 Escape double quote
68 Escape double quote in double quote
69 Escape sequences and singledouble quotes
70 Escape sequences in strings
71 Escaping the double quote
72 Field specifiers for printf
73 Find a word after splitting a string
74 Find the characters value by using the ord() function
75 Find the substring with $_ =~ Aa
76 Format 1234 56789
77 Format and sprintf
78 Format by here string
79 Format Codes for the sprintf and printf Functions
80 Format Options for sprintf and printf
81 Get the length of a string
82 Get the rindex
83 Get the sub string
84 Here document in a loop
85 Here document with Interpolation
86 How to create multiline output using the n newline character
87 If a string is enclosed in single quotes, it is printed literally (what you see is what you get)
88 If the offset is negative, substr counts from the end of the string
89 If you want to draw a horizontal line made up of hyphens
90 Index function returns the location of the first occurrence of a substring within a string
91 Insert multiple values to printf
92 Interpolate and double quote
93 Interpolation with with double quote
94 Interpolcation inside scalar variable
95 Join strings
96 Join the mapped value
97 Join the result of the split function
98 Join variables
99 Join with
100 Join with map chr
101 Join with map lc
102 Joining string with empty string
103 Keeping the separators by having them in parentheses
104 Locate a substring with space inside
105 Lower and upper case
106 Mix string multiplication operator and number multiplication
107 Multiline string
108 N with double quotation
109 Nested alternative quotes
110 Only change first letter to lowercase
111 Only change first letter to uppercase
112 Output month name and week name by using the return value from gmtime
113 Output string as UCS2
114 Output string as utf8
115 Output tab sign
116 Output the initial in lowercase and uppercase
117 Passing variable to length() function
118 Perl 5 Quotation Marks
119 Perl 5 String Functions
120 Perls Alternative Quotes
121 Print chr 65
122 Print chr(ord A)
123 Print Escape Sequences
124 Print ord A
125 Print ord ABC
126 Print out Here document
127 Print qqI said, Hello
128 Print sprintf % 2f, 3 1415926
129 Print sprintf %+ 4en, $value
130 Print sprintf %6 6fn, $value
131 Print with double vs single quotes
132 Printf % 5fn, $value
133 Printf %+ 4en, $value
134 Printf %c is ASCII value 65 and %c is value 66n, 65, 66
135 Printf %dn, +455 34
136 Printf %dn, -455
137 Printf %dn, 455 954
138 Printf %on, 455
139 Printf %un, 455
140 Printf %xn, -455
141 Printf Data Formats
142 Printf Left-justified the number is %-10dn, 100
143 Printf The character is %cn, 65
144 Printf The floating point number is %8fn, 15
145 Printf The formatted floating point number is %8 2fn,14 3456
146 Printf The formatted number is %10dn, 100
147 Printf The number in decimal is %dn, 45
148 Printf The number in hexadecimal is %xn, 15
149 Printf The number in octal is %on,15
150 Printf The number printed with leading zeros is %010dn, 5
151 Printf This string is %sn, literal
152 Printf(%-15s%-20sn, Jack, Sprat)
153 Printing a percent sign after a digit
154 Printing a space before signed values not preceded by + or -
155 Printing integers right-justified
156 Printing numbers with the + flag
157 Printing numbers without the + flag
158 Printing out an array of string one by one
159 Printing out message and adding new line character
160 Printing with the 0 (zero) flag fills in leading zeros
161 Printing without Quotes
162 Properties of printing with single quotes
163 Put double quote into single quote
164 Put qotation marks in q function
165 Put single quote into double quote
166 Qq function with variable interpolation
167 Quote Operators
168 Quote with qq (bar)
169 Quote with qq (less than)
170 Quote with qq# (number sign)
171 Quote with qq( (parenthesis)
172 Qw across more than one lines
173 Qx command
174 Read input lines and concatenate them
175 Repetition operator, marked with an x
176 Repetition; print 10 stars
177 Replace first 5 characters of $string with bye and assign substring that was replced to $substring
178 Replace function based on substr function
179 Replace function based on the length
180 Reverse a string
181 Reverses the word order of the input file
182 Single quote string
183 Single quote with windows file path
184 Single quotes do not interpret
185 Single quotes interpret
186 Split string into separate words, and then test to see if each word is the one were looking for
187 Split string with
188 Split up
189 Split words
190 Sprintf function assigns the formatted string to a variable
191 Sprintf function with array variable
192 String comperison operator
193 String concatenate operator
194 String interpolation
195 String Literals
196 String multiply operator
197 String Operations
198 String Operators
199 String plus
200 String value reference
201 String variable
202 Strings are normally delimited by a matched pair of either double or single quotes
203 Substr and index function
204 Substring from 10 to 14
205 T = tab, n = newline, = backslash
206 Takes its input and joins it into a single string
207 Text Formatting
208 The chomp function is a safer version of chop
209 The chop function removes the last character in a scalar variable
210 The correct use of three of the operators
211 The crypt function encrypts a string using the NBS Data Encryption Standard (DES) algorithm
212 The DATA Filehandle
213 The difference between single and double quotes
214 The Heredoc Operator without Variable Interpolation
215 The length of string with whitespace
216 The printf formats a string and prints it to the given file handle
217 The qq operator does the same for double-quoted strings
218 The sprintf command returns a formatted string
219 To print a single text string using %s
220 Turn off the special effect a backslash has, and so we escape it
221 Type four characters with chomp
222 Type four characters without chomp
223 Use print to output string
224 Use Repetition operator in conjunction with concatenation
225 Use tabs in print function
226 Use the crypt() operator to store passwords in an unbreakable format
227 Using {} to separate variable in variable interpolation
228 Using ~ operator to check if a scalar is a string type variable
229 Using alternative quotes
230 Using backslash for double quote
231 Using backticks to capture program output
232 Using index function
233 Using index function to check out if a string contains a sub string
234 Using index to search a line repeatedly
235 Using length function to check the length of a string
236 Using pos to display pattern match positions
237 Using precision while printing floating-point numbers
238 Using precision while printing integers
239 Using precision while printing strings
240 Using qq for quote
241 Using quotemeta
242 Using qw to assign value to scalar
243 Using qw to create string array without quotation marks
244 Using split function to split a string
245 Using sprintf
246 Using sprintf to format a float-point number and assign the result to a variable
247 Using string interpolation to reference two dimensional array element
248 Using strstr in POSIX
249 Using substr
250 Using substr with offset (-6), and length (2)
251 Using substr with the string and the offset (2)
252 Using substr with the string, offset (2) and length (3)
253 Using the # flag with conversion specifier g
254 Using the # flag with conversion specifier o
255 Using the # flag with conversion specifier X
256 Using the ord function to the get the ASCII code value
257 Using ucfirst function
258 Utf8 Composite Character Classes
259 Utf8 encode
260 Utf8 encoding
261 Variable Interpolation
262 When a string is enclosed in double quotes, scalar variables and arrays are interpolated
263 X times pattern
264 You can change the delimiters with the q operator