Inline::SLang::AssocInline::SLang::Assoc module contains support for associative arrays. | |
Download |
Inline::SLang::Assoc Ranking & Summary
Advertisement
- License:
- GPL
- Price:
- FREE
- Publisher Name:
- Smithsonian Astrophysical Observatory
- Publisher web site:
- http://search.cpan.org/~djburke/Inline-SLang-1.00/SLang/Assoc.pod
Inline::SLang::Assoc Tags
Inline::SLang::Assoc Description
Inline::SLang::Assoc module contains support for associative arrays. Inline::SLang::Assoc module contains support for associative arrays.SYNOPSIS use Inline 'SLang'; # you can send hash references to S-Lang print_in_slang( { a => 23, "b b" => "foo" } ); # and get them back from S-Lang $href = get_from_slang(); print "The assoc array contains:n" . join( "", map { "t$_ => $$href{$_}n"; } keys %$href ); __END__ __SLang__ define print_in_slang (assoc) { message( "SLang thinks you sent it an assoc. array with:" ); foreach ( assoc ) using ( "keys", "values" ) { variable k, v; ( k, v ) = (); vmessage( " key %s = %S", k, v ); } } define get_from_slang() { variable x = Assoc_Type ; x = "a value"; x = "another value"; return x; }The output of this code - which can be found in the source-code distribution as examples/assoc.pl - is: SLang thinks you sent it an assoc. array with: key a = 23 key b b = foo The assoc array contains: another key => another value a key => a value Requirements: · Perl v5.6.0 or higher. · Test::More module (comes with perl 5.8.0) · Inline module version 0.42 or higher. · PDL v2.4.0 or higher will be used if installed
Inline::SLang::Assoc Related Software