X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FUtil.pod;h=a78e50a32c23566a79cb8c8e6fef36c379bf0a6c;hb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;hp=b33627ce7bdee00cdf66554fa59eba697c95c49a;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/perl/Amanda/Util.pod b/perl/Amanda/Util.pod index b33627c..a78e50a 100644 --- a/perl/Amanda/Util.pod +++ b/perl/Amanda/Util.pod @@ -282,14 +282,25 @@ Unquote a string as quoted with C. my($q, $remaider) = skip_quoted_string($str) -Return the first quoted string and the remainder of the string. +Return the first quoted string and the remainder of the string, as separated by +any whitespace. Note that the remainder of the string does not include the +single separating whitespace character, but will include any subsequent +whitespace. The C<$q> is not unquoted. =item C -Split string on unquoted whitespace. Multiple consecutive spaces are not +Split string on unquoted whitespace. Multiple consecutive spaces are I collapsed into a single space: C<"x y"> (with two spaces) parses as C<( "x", "", "y")>. The strings are unquoted before they are returned. An empty string -is split into C<( "" )>. +is split into C<( "" )>. This method is generally used for parsing IPC messages, +where blank space is significant and well-controlled. + +=item C + +Similar to C, but intended for user-friendly uses. In +particular, this function treats any sequence of zero or more whitespace +characters as a separator, rather than the more strict interpretation applied +by C. All of the strings are unquoted. All of these quoting-related functions are available under the export tag C<:quoting>. @@ -320,8 +331,19 @@ For example: "{a,b}-{1,2}" [ "a-1", "a-2", "b-1", "b-2" ] Note that nested braces are not processed. Braces, commas, and -backslashes may be escaped with backslashes. On error, -C returns undef. These two functions are +backslashes may be escaped with backslashes. + +As a special case for numeric ranges, if the braces contain only digits +followed by two dots followed by more digits, and the digits sort in the +correct order, then they will be treated as a sequence. If the first number in +the sequence has leading zeroes, then all generated numbers will have that +length, padded with leading zeroes. + + "tape-{01..10}" [ "tape-01", "tape-02", "tape-03", "tape-04", + "tape-05", "tape-06", "tape-07", "tape-08", + "tape-09", "tape-10" ] + +On error, C returns undef. These two functions are available in the export tag C<:alternates>. =item generate_timestamp()