Data-Table-Text
view release on metacpan or search on metacpan
is_deeply [readFile $f], ["aaabbb"];
my $F = writeTempFile(qw(aaa bbb));
is_deeply [readFile $F], ["aaa
", "bbb
"];
eval {writeFile($f, q(ccc))};
ok $@ =~ m(File already exists:)i;
overWriteFile($F, q(ccc));
ok readFile($F) eq q(ccc);
unlink $f, $F;
### createEmptyFile ($file)
Create an empty file unless the file already exists and return the name of the file else confess if the file cannot be created.
Parameter Description
1 $file File to create or B<undef> for a temporary file
**Example:**
my $D = temporaryFolder;
ok -d $D;
my $d = fpd($D, q(ddd));
ok !-d $d;
my @f = map {createEmptyFile(fpe($d, $_, qw(txt)))} qw(a b c); # ðð
ð®ðºð½ð¹ð²
is_deeply [sort map {fne $_} findFiles($d, qr(txt\Z))], [qw(a.txt b.txt c.txt)];
my @D = findDirs($D);
my @e = ($D, $d);
my @E = sort @e;
is_deeply [@D], [@E];
is_deeply [sort map {fne $_} searchDirectoryTreesForMatchingFiles($d)],
["a.txt", "b.txt", "c.txt"];
is_deeply [sort map {fne $_} fileList(prefferedFileName "$d/*.txt")],
["a.txt", "b.txt", "c.txt"];
ok -e $_ for @f;
is_deeply scalar(searchDirectoryTreeForSubFolders $D), 2;
my @g = fileList(qq($D/*/*.txt));
ok @g == 3;
clearFolder($D, 5);
ok onWindows ? 1 : !-e $_ for @f;
ok onWindows ? 1 : !-d $D;
### setPermissionsForFile   ($file, $permissions)
Apply [chmod](https://linux.die.net/man/1/chmod) to a **$file** to set its **$permissions**.
Parameter Description
1 $file File
2 $permissions Permissions settings per chmod
**Example:**
if (1)
{my $f = temporaryFile();
setPermissionsForFile($f, q(ugo=r)); # ðð
ð®ðºð½ð¹ð²
my $a = qx(ls -la $f);
ok $a =~ m(-r--r--r--)s;
setPermissionsForFile($f, q(u=rwx)); # ðð
ð®ðºð½ð¹ð²
my $b = qx(ls -la $f);
ok $b =~ m(-rwxr--r--)s;
}
### numberOfLinesInFile ($file)
Return the number of lines in a file.
Parameter Description
1 $file File
**Example:**
my $f = writeFile(undef, "a
b
");
ok numberOfLinesInFile($f) == 2; # ðð
ð®ðºð½ð¹ð²
### overWriteHtmlFile   ($file, $data)
Write an [HTML](https://en.wikipedia.org/wiki/HTML) file to /var/www/html and make it readable.
Parameter Description
1 $file Target file relative to /var/www/html
2 $data Data to write
**Example:**
overWriteHtmlFile (q(index.html), q(<html><h1>Hello</h1></html>)); # ðð
ð®ðºð½ð¹ð²
overWritePerlCgiFile(q(gen.pl), q(...));
### overWritePerlCgiFile($file, $data)
Write a [Perl](http://www.perl.org/) file to /usr/lib/cgi-bin and make it executable after checking it for syntax errors.
Parameter Description
1 $file Target file relative to /var/www/html
2 $data Data to write
**Example:**
overWriteHtmlFile (q(index.html), q(<html><h1>Hello</h1></html>));
overWritePerlCgiFile(q(gen.pl), q(...)); # ðð
ð®ðºð½ð¹ð²
337 [runInParallel](#runinparallel) - Process the elements of an array in parallel using a maximum of **$maximumNumberOfProcesses** processes.
338 [runInSquareRootParallel](#runinsquarerootparallel) - Process the elements of an array in square root parallel using a maximum of **$maximumNumberOfProcesses** processes.
339 [s3Delete](#s3delete) - Return an S3 --delete keyword from an S3 option set.
340 [s3DownloadFolder](#s3downloadfolder) - Download a specified **$folder** on S3 to a **$local** folder using the specified **%options** if any.
341 [s3FileExists](#s3fileexists) - Return (name, size, date, time) for a **$file** that exists on S3 else () using the specified **%options** if any.
342 [s3ListFilesAndSizes](#s3listfilesandsizes) - Return {file=>size} for all the files in a specified **$folderOrFile** on S3 using the specified **%options** if any.
343 [s3Profile](#s3profile) - Return an S3 profile keyword from an S3 option set.
344 [s3ReadFile](#s3readfile) - Read from a **$file** on S3 and write the contents to a local file **$local** using the specified **%options** if any.
345 [s3ReadString](#s3readstring) - Read from a **$file** on S3 and return the contents as a string using specified **%options** if any.
346 [s3WriteFile](#s3writefile) - Write to a file **$fileS3** on S3 the contents of a local file **$fileLocal** using the specified **%options** if any.
347 [s3WriteString](#s3writestring) - Write to a **$file** on S3 the contents of **$string** using the specified **%options** if any.
348 [s3ZipFolder](#s3zipfolder) - Zip the specified **$source** folder and write it to the named **$target** file on S3.
349 [s3ZipFolders](#s3zipfolders) - Zip local folders and upload them to S3 in parallel.
350 [saveAwsDomain](#saveawsdomain) - Make the server at [Amazon Web Services](http://aws.amazon.com) with the given domain name the default primary server as used by all the methods whose names end in **r** or **Remote**.
351 [saveAwsIp](#saveawsip) - Make the server at [Amazon Web Services](http://aws.amazon.com) with the given IP address the default primary server as used by all the methods whose names end in **r** or **Remote**.
352 [saveCodeToS3](#savecodetos3) - Save source code every **$saveCodeEvery** seconds by zipping folder **$folder** to zip file **$zipFileName** then saving this zip file in the specified [S3](https://aws.amazon.com/s3/) **$bucket** using any additio...
353 [saveSourceToS3](#savesourcetos3) - Save source code.
354 [searchDirectoryTreeForSubFolders](#searchdirectorytreeforsubfolders) - Search the specified directory under the specified folder for sub folders.
355 [searchDirectoryTreesForMatchingFiles](#searchdirectorytreesformatchingfiles) - Search the specified directory trees for the files (not folders) that match the specified extensions.
356 [setCombination](#setcombination) - Count the elements in sets **@s** represented as arrays of strings and/or the keys of hashes.
357 [setDifference](#setdifference) - Subtract the keys in the second set represented as a hash from the first set represented as a hash to create a new hash showing the set difference between the two.
358 [setFileExtension](#setfileextension) - Given a **$file**, change its extension to **$extension**.
359 [setIntersection](#setintersection) - Intersection of sets **@s** represented as arrays of strings and/or the keys of hashes.
360 [setIntersectionOverUnion](#setintersectionoverunion) - Returns the size of the intersection over the size of the union of one or more sets **@s** represented as arrays and/or hashes.
361 [setPackageSearchOrder](#setpackagesearchorder) - Set a package search order for methods requested in the current package via AUTOLOAD.
362 [setPartitionOnIntersectionOverUnion](#setpartitiononintersectionoverunion) - Partition, at a level of **$confidence** between 0 and 1, a set of sets **@sets** so that within each partition the [setIntersectionOverUnion](#setintersectionoverunion...
363 [setPartitionOnIntersectionOverUnionOfHashStringSets](#setpartitiononintersectionoverunionofhashstringsets) - Partition, at a level of **$confidence** between 0 and 1, a set of sets **$hashSet** represented by a hash, each hash value being a stri...
364 [setPartitionOnIntersectionOverUnionOfHashStringSetsInParallel](#setpartitiononintersectionoverunionofhashstringsetsinparallel) - Partition, at a level of **$confidence** between 0 and 1, a set of sets **$hashSet** represented by a hash, each has...
365 [setPartitionOnIntersectionOverUnionOfSetsOfWords](#setpartitiononintersectionoverunionofsetsofwords) - Partition, at a level of **$confidence** between 0 and 1, a set of sets **@sets** of words so that within each partition the [setIntersectionO...
366 [setPartitionOnIntersectionOverUnionOfStringSets](#setpartitiononintersectionoverunionofstringsets) - Partition, at a level of **$confidence** between 0 and 1, a set of sets **@strings**, each set represented by a string containing words and punc...
367 [setPermissionsForFile](#setpermissionsforfile) - Apply [chmod](https://linux.die.net/man/1/chmod) to a **$file** to set its **$permissions**.
368 [setUnion](#setunion) - Union of sets **@s** represented as arrays of strings and/or the keys of hashes.
369 [showGotVersusWanted](#showgotversuswanted) - Show the difference between the wanted string and the wanted string.
370 [showHashes](#showhashes) - Create a map of all the keys within all the hashes within a tower of data structures.
371 [showHashes2](#showhashes2) - Create a map of all the keys within all the hashes within a tower of data structures.
372 [spellCheck](#spellcheck) - Spell checker
373 [squareArray](#squarearray) - Create a two dimensional square array from a one dimensional linear array.
374 [startProcess](#startprocess) - Start new processes while the number of child processes recorded in **%$pids** is less than the specified **$maximum**.
375 [storeFile](#storefile) - Store into a **$file**, after creating a path to the file with [makePath](https://metacpan.org/pod/makePath) if necessary, a data **$structure** via [Storable](https://metacpan.org/pod/Storable).
376 [stringMd5Sum](#stringmd5sum) - Get the Md5 sum of a **$string** that might contain [utf8](https://en.wikipedia.org/wiki/UTF-8) code points.
377 [stringsAreNotEqual](#stringsarenotequal) - Return the common start followed by the two non equal tails of two non equal strings or an empty list if the strings are equal.
378 [subNameTraceBack](#subnametraceback) - Find the names of the calling subroutines and return them as a blank separated string of names.
379 [subScriptString](#subscriptstring) - Convert alphanumerics in a string to sub scripts.
380 [subScriptStringUndo](#subscriptstringundo) - Undo alphanumerics in a string to sub scripts.
381 [sumAbsAndRel](#sumabsandrel) - Combine zero or more absolute and relative names of **@files** starting at the current working folder to get an absolute file name.
382 [summarizeColumn](#summarizecolumn) - Count the number of unique instances of each value a column in a table assumes.
383 [superScriptString](#superscriptstring) - Convert alphanumerics in a string to super scripts.
384 [superScriptStringUndo](#superscriptstringundo) - Undo alphanumerics in a string to super scripts.
385 [swapFilePrefix](#swapfileprefix) - Swaps the start of a **$file** name from a **$known** name to a **$new** one if the file does in fact start with the $known name otherwise returns the original file name as it is.
386 [swapFolderPrefix](#swapfolderprefix) - Given a **$file**, swap the folder name of the $file from **$known** to **$new** if the file $file starts with the $known folder name else return the $file as it is.
387 [syncFromS3InParallel](#syncfroms3inparallel) - Download from [S3](https://aws.amazon.com/s3/) by using "aws s3 sync --exclude '\*' --include '.
388 [syncToS3InParallel](#synctos3inparallel) - Upload to [S3](https://aws.amazon.com/s3/) by using "aws s3 sync --exclude '\*' --include '.
389 [temporaryFile](#temporaryfile) - Create a new, empty, temporary file.
390 [temporaryFolder](#temporaryfolder) - Create a new, empty, temporary folder.
391 [timeStamp](#timestamp) - Hours:minute:seconds.
392 [transitiveClosure](#transitiveclosure) - Transitive closure of a hash of hashes.
393 [trim](#trim) - Remove any white space from the front and end of a string.
394 [Udsr::kill](#udsr-kill) - Kill a communications server.
395 [Udsr::read](#udsr-read) - Read a message from the [newUdsrServer](#newudsrserver) or the [newUdsrClient](#newudsrclient).
396 [Udsr::webUser](#udsr-webuser) - Create a systemd installed server that processes http requests using a specified userid.
397 [Udsr::write](#udsr-write) - Write a communications message to the [newUdsrServer](#newudsrserver) or the [newUdsrClient](#newudsrclient).
( run in 1.105 second using v1.01-cache-2.11-cpan-d7f47b0818f )