Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • b255ef9
  • /
  • external
  • /
  • perl
  • /
  • Text-Template-1.46
  • /
  • t
  • /
  • 06-ofh.t
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:6865ad194531d13c2513ed8685d81a14d0c5b717
directory badge Iframe embedding
swh:1:dir:1d01bfba8f6870b87d99bb3d4729d0941a61b5f3
06-ofh.t
#!perl
#
# test apparatus for Text::Template module
# still incomplete.

use Text::Template;

die "This is the test program for Text::Template version 1.46.
You are using version $Text::Template::VERSION instead.
That does not make sense.\n
Aborting"
  unless $Text::Template::VERSION == 1.46;

print "1..2\n";

$n=1;

$template = new Text::Template TYPE => STRING, SOURCE => q{My process ID is {$$}};
$of = "t$$";
END { unlink $of }
open O, "> $of" or die;

$text = $template->fill_in(OUTPUT => \*O);

# (1) No $text should have been constructed.  Return value should be true.
print +($text eq '1' ? '' : 'not '), "ok $n\n";
$n++;

close O or die;
open I, "< $of" or die;
{ local $/; $t = <I> }
close I;

# (2) The text should have been printed to the file
print +($t eq "My process ID is $$" ? '' : 'not '), "ok $n\n";
$n++;

exit;

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top