The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

File::Namaste - routines for NAMe-AS-TExt tags (V0.1)

SYNOPSIS

 use File::Namaste;         # to import routines into a Perl script

 $stat = set_namaste( $number, $fvalue, $max, $ellipsis )
                            # Return empty string on success, else an
                            # error message.  The first two arguments are
                            # required; remaining args passed to elide().
                            # Uses the current directory.

 # Example: set the directory type and title tag files.
 ($msg = set_namaste(0, "dflat_0.4")
          || set_namaste(2, "Crime and Punishment"))
     and die("set_namaste: $msg\n");

 @num_nam_val_triples = get_namaste( $filenameglob, ...)
                            # Return an array of number/filename/value
                            # triples (eg, every 3rd elem is number).
                            # Args give numbers (as file globs) to fetch
                            # (eg, "0" or "[1-4]") and no args is same
                            # as "[0-9]".  Uses the current directory.

 # Example: fetch all namaste tags and print.
 my @nnv = get_namaste();
 while (defined($num = shift(@nnv))) {  # first of triple is tag number;
     $fname = shift(@nnv);              # second is filename derived...
     $fvalue = shift(@nnv);             # from third (the full value)
     print "Tag $num (from $fname): $fvalue\n";
 }

DESCRIPTION

This is very brief documentation for the Namaste Perl module, which implements the Namaste (Name as Text) convention for containing a data element completely within the content of a file, using as filename an approximation of the value preceded by a numeric tag.

The functions file_value() and elide() are general purpose and do not rely on Namaste; however, they are used by set_namaste() and get_namaste().

SEE ALSO

Directory Description with Namaste Tags http://www.cdlib.org/inside/diglib/namaste/namastespec.html

HISTORY

This is an alpha version of Namaste tools. It is written in Perl.

AUTHOR

John A. Kunze jak at ucop dot edu

COPYRIGHT AND LICENSE

Copyright 2009 UC Regents. Open source Apache License, Version 2.

PREREQUISITES

Perl Modules: File::Glob

Script Categories:

UNIX : System_administration