| 167 | | {% p.write_methods %} |
| | 167 | =item new |
| | 168 | |
| | 169 | my $obj = String::BlackWhiteList->new; |
| | 170 | my $obj = String::BlackWhiteList->new(%args); |
| | 171 | |
| | 172 | Creates and returns a new object. The constructor will accept as arguments a |
| | 173 | list of pairs, from component name to initial value. For each pair, the named |
| | 174 | component is initialized by calling the method of the same name with the given |
| | 175 | value. If called with a single hash reference, it is dereferenced and its |
| | 176 | key/value pairs are set as described before. |
| | 177 | |
| | 178 | =item black_re |
| | 179 | |
| | 180 | my $value = $obj->black_re; |
| | 181 | $obj->black_re($value); |
| | 182 | |
| | 183 | A basic getter/setter method. If called without an argument, it returns the |
| | 184 | value. If called with a single argument, it sets the value. |
| | 185 | |
| | 186 | =item black_re_clear |
| | 187 | |
| | 188 | $obj->black_re_clear; |
| | 189 | |
| | 190 | Clears the value. |
| | 191 | |
| | 192 | =item blacklist |
| | 193 | |
| | 194 | my @values = $obj->blacklist; |
| | 195 | my $array_ref = $obj->blacklist; |
| | 196 | $obj->blacklist(@values); |
| | 197 | $obj->blacklist($array_ref); |
| | 198 | |
| | 199 | Get or set the array values. If called without an arguments, it returns the |
| | 200 | array in list context, or a reference to the array in scalar context. If |
| | 201 | called with arguments, it expands array references found therein and sets the |
| | 202 | values. |
| | 203 | |
| | 204 | =item blacklist_clear |
| | 205 | |
| | 206 | $obj->blacklist_clear; |
| | 207 | |
| | 208 | Deletes all elements from the array. |
| | 209 | |
| | 210 | =item blacklist_count |
| | 211 | |
| | 212 | my $count = $obj->blacklist_count; |
| | 213 | |
| | 214 | Returns the number of elements in the array. |
| | 215 | |
| | 216 | =item blacklist_index |
| | 217 | |
| | 218 | my $element = $obj->blacklist_index(3); |
| | 219 | my @elements = $obj->blacklist_index(@indices); |
| | 220 | my $array_ref = $obj->blacklist_index(@indices); |
| | 221 | |
| | 222 | Takes a list of indices and returns the elements indicated by those indices. |
| | 223 | If only one index is given, the corresponding array element is returned. If |
| | 224 | several indices are given, the result is returned as an array in list context |
| | 225 | or as an array reference in scalar context. |
| | 226 | |
| | 227 | =item blacklist_pop |
| | 228 | |
| | 229 | my $value = $obj->blacklist_pop; |
| | 230 | |
| | 231 | Pops the last element off the array, returning it. |
| | 232 | |
| | 233 | =item blacklist_push |
| | 234 | |
| | 235 | $obj->blacklist_push(@values); |
| | 236 | |
| | 237 | Pushes elements onto the end of the array. |
| | 238 | |
| | 239 | =item blacklist_set |
| | 240 | |
| | 241 | $obj->blacklist_set(1 => $x, 5 => $y); |
| | 242 | |
| | 243 | Takes a list of index/value pairs and for each pair it sets the array element |
| | 244 | at the indicated index to the indicated value. Returns the number of elements |
| | 245 | that have been set. |
| | 246 | |
| | 247 | =item blacklist_shift |
| | 248 | |
| | 249 | my $value = $obj->blacklist_shift; |
| | 250 | |
| | 251 | Shifts the first element off the array, returning it. |
| | 252 | |
| | 253 | =item blacklist_splice |
| | 254 | |
| | 255 | $obj->blacklist_splice(2, 1, $x, $y); |
| | 256 | $obj->blacklist_splice(-1); |
| | 257 | $obj->blacklist_splice(0, -1); |
| | 258 | |
| | 259 | Takes three arguments: An offset, a length and a list. |
| | 260 | |
| | 261 | Removes the elements designated by the offset and the length from the array, |
| | 262 | and replaces them with the elements of the list, if any. In list context, |
| | 263 | returns the elements removed from the array. In scalar context, returns the |
| | 264 | last element removed, or C<undef> if no elements are removed. The array grows |
| | 265 | or shrinks as necessary. If the offset is negative then it starts that far |
| | 266 | from the end of the array. If the length is omitted, removes everything from |
| | 267 | the offset onward. If the length is negative, removes the elements from the |
| | 268 | offset onward except for -length elements at the end of the array. If both the |
| | 269 | offset and the length are omitted, removes everything. If the offset is past |
| | 270 | the end of the array, it issues a warning, and splices at the end of the |
| | 271 | array. |
| | 272 | |
| | 273 | =item blacklist_unshift |
| | 274 | |
| | 275 | $obj->blacklist_unshift(@values); |
| | 276 | |
| | 277 | Unshifts elements onto the beginning of the array. |
| | 278 | |
| | 279 | =item clear_black_re |
| | 280 | |
| | 281 | $obj->clear_black_re; |
| | 282 | |
| | 283 | Clears the value. |
| | 284 | |
| | 285 | =item clear_blacklist |
| | 286 | |
| | 287 | $obj->clear_blacklist; |
| | 288 | |
| | 289 | Deletes all elements from the array. |
| | 290 | |
| | 291 | =item clear_is_literal_text |
| | 292 | |
| | 293 | $obj->clear_is_literal_text; |
| | 294 | |
| | 295 | Clears the boolean value by setting it to 0. |
| | 296 | |
| | 297 | =item clear_white_re |
| | 298 | |
| | 299 | $obj->clear_white_re; |
| | 300 | |
| | 301 | Clears the value. |
| | 302 | |
| | 303 | =item clear_whitelist |
| | 304 | |
| | 305 | $obj->clear_whitelist; |
| | 306 | |
| | 307 | Deletes all elements from the array. |
| | 308 | |
| | 309 | =item count_blacklist |
| | 310 | |
| | 311 | my $count = $obj->count_blacklist; |
| | 312 | |
| | 313 | Returns the number of elements in the array. |
| | 314 | |
| | 315 | =item count_whitelist |
| | 316 | |
| | 317 | my $count = $obj->count_whitelist; |
| | 318 | |
| | 319 | Returns the number of elements in the array. |
| | 320 | |
| | 321 | =item index_blacklist |
| | 322 | |
| | 323 | my $element = $obj->index_blacklist(3); |
| | 324 | my @elements = $obj->index_blacklist(@indices); |
| | 325 | my $array_ref = $obj->index_blacklist(@indices); |
| | 326 | |
| | 327 | Takes a list of indices and returns the elements indicated by those indices. |
| | 328 | If only one index is given, the corresponding array element is returned. If |
| | 329 | several indices are given, the result is returned as an array in list context |
| | 330 | or as an array reference in scalar context. |
| | 331 | |
| | 332 | =item index_whitelist |
| | 333 | |
| | 334 | my $element = $obj->index_whitelist(3); |
| | 335 | my @elements = $obj->index_whitelist(@indices); |
| | 336 | my $array_ref = $obj->index_whitelist(@indices); |
| | 337 | |
| | 338 | Takes a list of indices and returns the elements indicated by those indices. |
| | 339 | If only one index is given, the corresponding array element is returned. If |
| | 340 | several indices are given, the result is returned as an array in list context |
| | 341 | or as an array reference in scalar context. |
| | 342 | |
| | 343 | =item is_literal_text |
| | 344 | |
| | 345 | $obj->is_literal_text($value); |
| | 346 | my $value = $obj->is_literal_text; |
| | 347 | |
| | 348 | If called without an argument, returns the boolean value (0 or 1). If called |
| | 349 | with an argument, it normalizes it to the boolean value. That is, the values |
| | 350 | 0, undef and the empty string become 0; everything else becomes 1. |
| | 351 | |
| | 352 | =item is_literal_text_clear |
| | 353 | |
| | 354 | $obj->is_literal_text_clear; |
| | 355 | |
| | 356 | Clears the boolean value by setting it to 0. |
| | 357 | |
| | 358 | =item is_literal_text_set |
| | 359 | |
| | 360 | $obj->is_literal_text_set; |
| | 361 | |
| | 362 | Sets the boolean value to 1. |
| | 363 | |
| | 364 | =item pop_blacklist |
| | 365 | |
| | 366 | my $value = $obj->pop_blacklist; |
| | 367 | |
| | 368 | Pops the last element off the array, returning it. |
| | 369 | |
| | 370 | =item pop_whitelist |
| | 371 | |
| | 372 | my $value = $obj->pop_whitelist; |
| | 373 | |
| | 374 | Pops the last element off the array, returning it. |
| | 375 | |
| | 376 | =item push_blacklist |
| | 377 | |
| | 378 | $obj->push_blacklist(@values); |
| | 379 | |
| | 380 | Pushes elements onto the end of the array. |
| | 381 | |
| | 382 | =item push_whitelist |
| | 383 | |
| | 384 | $obj->push_whitelist(@values); |
| | 385 | |
| | 386 | Pushes elements onto the end of the array. |
| | 387 | |
| | 388 | =item set_blacklist |
| | 389 | |
| | 390 | $obj->set_blacklist(1 => $x, 5 => $y); |
| | 391 | |
| | 392 | Takes a list of index/value pairs and for each pair it sets the array element |
| | 393 | at the indicated index to the indicated value. Returns the number of elements |
| | 394 | that have been set. |
| | 395 | |
| | 396 | =item set_is_literal_text |
| | 397 | |
| | 398 | $obj->set_is_literal_text; |
| | 399 | |
| | 400 | Sets the boolean value to 1. |
| | 401 | |
| | 402 | =item set_whitelist |
| | 403 | |
| | 404 | $obj->set_whitelist(1 => $x, 5 => $y); |
| | 405 | |
| | 406 | Takes a list of index/value pairs and for each pair it sets the array element |
| | 407 | at the indicated index to the indicated value. Returns the number of elements |
| | 408 | that have been set. |
| | 409 | |
| | 410 | =item shift_blacklist |
| | 411 | |
| | 412 | my $value = $obj->shift_blacklist; |
| | 413 | |
| | 414 | Shifts the first element off the array, returning it. |
| | 415 | |
| | 416 | =item shift_whitelist |
| | 417 | |
| | 418 | my $value = $obj->shift_whitelist; |
| | 419 | |
| | 420 | Shifts the first element off the array, returning it. |
| | 421 | |
| | 422 | =item splice_blacklist |
| | 423 | |
| | 424 | $obj->splice_blacklist(2, 1, $x, $y); |
| | 425 | $obj->splice_blacklist(-1); |
| | 426 | $obj->splice_blacklist(0, -1); |
| | 427 | |
| | 428 | Takes three arguments: An offset, a length and a list. |
| | 429 | |
| | 430 | Removes the elements designated by the offset and the length from the array, |
| | 431 | and replaces them with the elements of the list, if any. In list context, |
| | 432 | returns the elements removed from the array. In scalar context, returns the |
| | 433 | last element removed, or C<undef> if no elements are removed. The array grows |
| | 434 | or shrinks as necessary. If the offset is negative then it starts that far |
| | 435 | from the end of the array. If the length is omitted, removes everything from |
| | 436 | the offset onward. If the length is negative, removes the elements from the |
| | 437 | offset onward except for -length elements at the end of the array. If both the |
| | 438 | offset and the length are omitted, removes everything. If the offset is past |
| | 439 | the end of the array, it issues a warning, and splices at the end of the |
| | 440 | array. |
| | 441 | |
| | 442 | =item splice_whitelist |
| | 443 | |
| | 444 | $obj->splice_whitelist(2, 1, $x, $y); |
| | 445 | $obj->splice_whitelist(-1); |
| | 446 | $obj->splice_whitelist(0, -1); |
| | 447 | |
| | 448 | Takes three arguments: An offset, a length and a list. |
| | 449 | |
| | 450 | Removes the elements designated by the offset and the length from the array, |
| | 451 | and replaces them with the elements of the list, if any. In list context, |
| | 452 | returns the elements removed from the array. In scalar context, returns the |
| | 453 | last element removed, or C<undef> if no elements are removed. The array grows |
| | 454 | or shrinks as necessary. If the offset is negative then it starts that far |
| | 455 | from the end of the array. If the length is omitted, removes everything from |
| | 456 | the offset onward. If the length is negative, removes the elements from the |
| | 457 | offset onward except for -length elements at the end of the array. If both the |
| | 458 | offset and the length are omitted, removes everything. If the offset is past |
| | 459 | the end of the array, it issues a warning, and splices at the end of the |
| | 460 | array. |
| | 461 | |
| | 462 | =item unshift_blacklist |
| | 463 | |
| | 464 | $obj->unshift_blacklist(@values); |
| | 465 | |
| | 466 | Unshifts elements onto the beginning of the array. |
| | 467 | |
| | 468 | =item unshift_whitelist |
| | 469 | |
| | 470 | $obj->unshift_whitelist(@values); |
| | 471 | |
| | 472 | Unshifts elements onto the beginning of the array. |
| | 473 | |
| | 474 | =item white_re |
| | 475 | |
| | 476 | my $value = $obj->white_re; |
| | 477 | $obj->white_re($value); |
| | 478 | |
| | 479 | A basic getter/setter method. If called without an argument, it returns the |
| | 480 | value. If called with a single argument, it sets the value. |
| | 481 | |
| | 482 | =item white_re_clear |
| | 483 | |
| | 484 | $obj->white_re_clear; |
| | 485 | |
| | 486 | Clears the value. |
| | 487 | |
| | 488 | =item whitelist |
| | 489 | |
| | 490 | my @values = $obj->whitelist; |
| | 491 | my $array_ref = $obj->whitelist; |
| | 492 | $obj->whitelist(@values); |
| | 493 | $obj->whitelist($array_ref); |
| | 494 | |
| | 495 | Get or set the array values. If called without an arguments, it returns the |
| | 496 | array in list context, or a reference to the array in scalar context. If |
| | 497 | called with arguments, it expands array references found therein and sets the |
| | 498 | values. |
| | 499 | |
| | 500 | =item whitelist_clear |
| | 501 | |
| | 502 | $obj->whitelist_clear; |
| | 503 | |
| | 504 | Deletes all elements from the array. |
| | 505 | |
| | 506 | =item whitelist_count |
| | 507 | |
| | 508 | my $count = $obj->whitelist_count; |
| | 509 | |
| | 510 | Returns the number of elements in the array. |
| | 511 | |
| | 512 | =item whitelist_index |
| | 513 | |
| | 514 | my $element = $obj->whitelist_index(3); |
| | 515 | my @elements = $obj->whitelist_index(@indices); |
| | 516 | my $array_ref = $obj->whitelist_index(@indices); |
| | 517 | |
| | 518 | Takes a list of indices and returns the elements indicated by those indices. |
| | 519 | If only one index is given, the corresponding array element is returned. If |
| | 520 | several indices are given, the result is returned as an array in list context |
| | 521 | or as an array reference in scalar context. |
| | 522 | |
| | 523 | =item whitelist_pop |
| | 524 | |
| | 525 | my $value = $obj->whitelist_pop; |
| | 526 | |
| | 527 | Pops the last element off the array, returning it. |
| | 528 | |
| | 529 | =item whitelist_push |
| | 530 | |
| | 531 | $obj->whitelist_push(@values); |
| | 532 | |
| | 533 | Pushes elements onto the end of the array. |
| | 534 | |
| | 535 | =item whitelist_set |
| | 536 | |
| | 537 | $obj->whitelist_set(1 => $x, 5 => $y); |
| | 538 | |
| | 539 | Takes a list of index/value pairs and for each pair it sets the array element |
| | 540 | at the indicated index to the indicated value. Returns the number of elements |
| | 541 | that have been set. |
| | 542 | |
| | 543 | =item whitelist_shift |
| | 544 | |
| | 545 | my $value = $obj->whitelist_shift; |
| | 546 | |
| | 547 | Shifts the first element off the array, returning it. |
| | 548 | |
| | 549 | =item whitelist_splice |
| | 550 | |
| | 551 | $obj->whitelist_splice(2, 1, $x, $y); |
| | 552 | $obj->whitelist_splice(-1); |
| | 553 | $obj->whitelist_splice(0, -1); |
| | 554 | |
| | 555 | Takes three arguments: An offset, a length and a list. |
| | 556 | |
| | 557 | Removes the elements designated by the offset and the length from the array, |
| | 558 | and replaces them with the elements of the list, if any. In list context, |
| | 559 | returns the elements removed from the array. In scalar context, returns the |
| | 560 | last element removed, or C<undef> if no elements are removed. The array grows |
| | 561 | or shrinks as necessary. If the offset is negative then it starts that far |
| | 562 | from the end of the array. If the length is omitted, removes everything from |
| | 563 | the offset onward. If the length is negative, removes the elements from the |
| | 564 | offset onward except for -length elements at the end of the array. If both the |
| | 565 | offset and the length are omitted, removes everything. If the offset is past |
| | 566 | the end of the array, it issues a warning, and splices at the end of the |
| | 567 | array. |
| | 568 | |
| | 569 | =item whitelist_unshift |
| | 570 | |
| | 571 | $obj->whitelist_unshift(@values); |
| | 572 | |
| | 573 | Unshifts elements onto the beginning of the array. |