are set to undef.
=item I<$year, $month, $day, $hour, $min, $sec>
If more than one argument is given (and less than 7), it is assumed
that the date and time are being given as a series of integers i
----------------------------
~~ Same as SQL "LIKE" operator 'scrappy,marc' ~~ '%scrappy%'
!~~ Same as SQL "NOT LIKE" operator 'bruce' !~~ '%al%'
~ Match (regex),
########
=item $logger->set_file_handle( HANDLE );
Associates the error logger object with the given (opened) IO::Handle, and
closes the old file handle that used to be associated with the object (i
<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# $option, $help
# ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# $help
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# $help
# ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# $help
. ("<" x $maxoption) . " ^" . ("<" x ($textlength-1)) . "\n".
"\$option, \$help\n" .
"~~ " . (" " x $maxoption) . " ^" . ("<" x ($textlength-1)) . "\n" .
"\$help\n.";
$alt_forma
if ($in ~~ Array && $in.elems > 0) {
$type ~= $in.list[0].WHAT.gist;
$type ~~ s{")("} = " of ";
}
my Str $s-in = sprintf "%-16s %s", $type, $in.gist;
$s-in ~~ s:g{\n}
> $csv), "Sub/Obj { s-in ($in) }");
}
# Test supported "out" formats
my $datn = $data; $datn ~~ s:g{ "\r\n" } = "\n";
for in () -> $in {
is (csv (in => $in, out => Str, :!quote-space), $data
my $fh = open "test.csv", :r, chomp => False;
while (my @row = $csv.getline($fh)) {
@row[2] ~~ m/pattern/ or next; # 3rd field should match
@rows.push: @row;
}
$fh.close;
# and wri
cept and C<False>
for records to reject.
csv (in => "file.csv", filter => {
$^row[2] ~~ /a/ && # third field should contain an "a"
$^row[4].chars > 4 # length of the 5th fi
at have no visible data
This filter is a shortcut for
filter => { $^row.first: { .defined && $_ ~~ /\S/ }}
This filter rejects all lines that I<not> have at least one field that does
not evaluate
sep, ",", "Sep = ,");
for < , ; > -> $sep {
my Str $data = "bAr,foo\n1,2\n3,4,5\n";
$data ~~ s:g{ "," } = $sep;
$csv.column-names (False);
{ my $fh = IO::String.new: $data;
ok (my
,", ";" ];
for ",", ";", "|", "\t" -> $sep {
my Str $data = "bAr,foo\n1,2\n3,4,5\n";
$data ~~ s:g{ "," } = $sep;
$csv.column-names (False);
{ my $fh = IO::String.new: $data;
ok (my
>], "Headers");
}
for < , ; > -> $sep {
my Str $data = "bAr,foo\n1,2\n3,4,5\n";
$data ~~ s:g{ "," } = $sep;
$csv.column-names (False);
{ my $fh = IO::String.new: $data;
ok (my
ticle C<read()> method.
=item apply (MODULES)
This method hands the message off to each module given (if no modules are
given, the message is given to each module registered by C<modules()> in
the o
);
my $n = +$f;
ok ($n ~~ Num, "Undefined in Numeric context type");
is ($n.defined, False, "Undefined in Numeric context defined");
my $s = ~$f;
ok ($s ~~ Str, "U
if ($expect.defined && $expect ~~ m/ "\r\n" /) {
my $r = $expect;
my $n = $expect;
$n ~~ s:g{ "\r\n" } = "\n";
"0\n\0",
"\0\n\0",
);
my %exp;
for @pat -> $pat {
my $x = $pat;
$x ~~ s:g/\0/\\0/;
$x ~~ s:g/\n/\\n/;
%exp{$pat} = $x;
}
my Str @line = ("", Str, "0\n", "", "\0\0\n0")
n level should be incremented (decremented) by the given
number. If only a plus or minus sign is given (without a number) then
the current indentation level is incremented or decremented by some
defau
n_and_get_sc_rate_pairs(\%input, \$window_size)};
# Function : scans input sequences(arg1) in a given(arg2) window size and gets
# each composition and sequence identity rate(sc_rate) of
s$k"}[$i]}=~ s/\,//g; }
}
}
}
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
# Following is to make ends of sequences ne
$offset,$larg)="$gap_char"x$diff;
}
}
} print "\n";
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Following is the core code for making block printing
----------------------------
~~ Same as SQL "LIKE" operator 'scrappy,marc' ~~ '%scrappy%'
!~~ Same as SQL "NOT LIKE" operator 'bruce' !~~ '%al%'
~ Match (regex),
----------------------------------------------------------------------------------
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# All the defaults
#______________________________
$sub_dir_size=2;
$make_msp_in_sub
}
close FILE_1;
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`~~~~~~~~~~~~~~~~~~~~~`
# (3) When ranges information is given(via \@range), seq in those ranges a
}
return(\%Sizes);
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
# (5) when hash which has range info is given(@range should not be defined)
#__
and @arg = (",", "", "");
loop (my $a = 0; $a < @arg.elems; $a++) {
my $exp = @arg[$a];
$exp ~~ s{^ '"' (.*) '"' $} = $0;
is (@row[$a].text, $exp, "$tst - field $a");
}
ok ($csv.parse ("")
7,g";
$fh.close;
$fh = open $tfn, :r;
sub Filter (CSV::Row $r) returns Bool { +$r[0] % 2 && $r[1] ~~ /^ <[abcd]> / ?? True !! False };
$csv = Text::CSV.new;
ok ($csv.callbacks ("filter", &Filter), "A
ext::CSV.new, "new");
ok (my $version = $csv.version, "version");
ok ($version ~~ m{^ <[0..9.-]>+ $}, "CSV-$version");
is ($csv.quote_char, '"', "quote_char");
i
ce, it is useful
# to combine both the form and the script in one place. If no parameters
# are given (i.e., ReadParse returns FALSE), then a form could be output.
# If a reference to a hash is give
ce, it is useful
# to combine both the form and the script in one place. If no parameters
# are given (i.e., ReadParse returns FALSE), then a form could be output.
# If a reference to a hash is give