ptkFAQ
view release on metacpan or search on metacpan
#!/usr/bin/perl
$/ = ''; # set paragraph mode
$SHlinesep = "\n";
while ($SHcmd = <>) {
$/ = $SHlinesep;
eval $SHcmd; print $@ || "\n";
$SHlinesep = $/; $/ = '';
}
etc/tomc_pod2html.shar view on Meta::CPAN
X
X %pages = (); # associative array used to find the location
X # of pages referenced by L<> links.
X %sections = (); # sections within this page
X %items = (); # associative array used to find the location
X # of =item directives referenced by C<> links
X
X
X # read the pod a paragraph at a time
X warn "Scanning for sections in input file(s)\n" if $verbose;
X $/ = "";
X open(POD, "<$podfile")
X || die "$0: cannot open $podfile file for input: $!\n";
X @poddata = <POD>;
X close(POD);
X
X
X # scan the pod for =head[1-6] directives and build an index
X $index = scan_headings(\%sections, @poddata);
X
X
etc/tomc_pod2html.shar view on Meta::CPAN
X die "$0: error opening directory $dir for reading: $!\n";
X @files = grep(/\.html$/, readdir(DIR));
X closedir(DIR);
X
X open(HTML, ">$html") ||
X die "$0: error opening $html for output: $!\n";
X
X # for each .html file in the directory, extract the index
X # embedded in the file and throw it into the big index.
X foreach $file (@files) {
X $/ = "";
X
X open(IN, "<$dir/$file") ||
X die "$0: error opening $dir/$file for input: $!\n";
X @filedata = <IN>;
X close(IN);
X
X @index = grep(/<!-- INDEX BEGIN -->.*<!-- INDEX END -->/s,
X @filedata);
X for (@index) {
X s/<!-- INDEX BEGIN -->(\s*<!--)(.*)(-->\s*)<!-- INDEX END -->/$2/s;
etc/tomc_pod2html.shar view on Meta::CPAN
# is encountered in the input file.
#
sub splitpod {
X my($pod, $poddir, $htmldir, $splitdirs) = @_;
X my(@poddata, @filedata, @heads);
X my($file, $i, $j, $prevsec, $section, $nextsec);
X
X warn "splitting $pod\n" if $debug;
X
X # read the file in paragraphs
X $/ = "";
X open(SPLITIN, "<$pod") ||
X die "$0: error opening $pod for input: $!\n";
X @filedata = <SPLITIN>;
X close(SPLITIN) ||
X die "$0: error closing $pod: $!\n";
X
X # restore the file internally by =head[1-6] sections
X @poddata = ();
X for ($i = 0, $j = -1; $i <= $#filedata; $i++) {
X $j++ if ($filedata[$i] =~ /^\s*=head[1-6]/);
history/perl425.html-pl view on Meta::CPAN
exercise for the reader.
I had to change a little bit of the formatting to make it more regular.
--tom
=cut
if (open(STDIN, "-|")) {
$/ = '';
while (<STDIN>) {
s,</XMP>(\s*)<XMP>,$1,gis;
s,\s+</XMP>,</XMP>,gi;
print;
}
exit;
}
while (<DATA>) {
if (s/# (?=\$Id.*)//) {
ptkFAQ.A4.ps view on Meta::CPAN
0 -512 M
0 -12 R
(quite simply as: )S
0 -529 M
0 -544 M
FF 12 SF
0 -9 R
( #!/usr/bin/perl)S
0 -558 M
0 -9 R
( $/ = ''; # set paragraph mode)S
0 -572 M
0 -9 R
( $SHlinesep = "\\n";)S
0 -586 M
0 -9 R
( while \($SHcmd = <>\) {)S
0 -600 M
0 -9 R
( $/ = $SHlinesep;)S
0 -614 M
0 -9 R
( eval $SHcmd; print $@ || "\\n";)S
0 -628 M
0 -9 R
( $SHlinesep = $/; $/ = ''; )S
0 -642 M
0 -9 R
( })S
0 -656 M
0 -671 M
RF 14 SF
0 -12 R
(You can use this during code development to test out little snippets of code. It helps to be an accurate typist and)S
0 -688 M
0 -12 R
ptkFAQ.US.ps view on Meta::CPAN
0 -512 M
0 -12 R
(quite simply as: )S
0 -529 M
0 -544 M
FF 12 SF
0 -9 R
( #!/usr/bin/perl)S
0 -558 M
0 -9 R
( $/ = ''; # set paragraph mode)S
0 -572 M
0 -9 R
( $SHlinesep = "\\n";)S
0 -586 M
0 -9 R
( while \($SHcmd = <>\) {)S
0 -600 M
0 -9 R
( $/ = $SHlinesep;)S
0 -614 M
0 -9 R
( eval $SHcmd; print $@ || "\\n";)S
0 -628 M
0 -9 R
( $SHlinesep = $/; $/ = ''; )S
0 -642 M
0 -9 R
( })S
0 -656 M
0 -671 M
RF 14 SF
0 -12 R
(You can use this during code development to test out little snippets of code. It helps to be an accurate typist and)S
0 -688 M
0 -12 R
ptkFAQ.html view on Meta::CPAN
is derived from Ousterhout's Tcl/Tk version of <b>rmt</b> [see section 27.2 of
his book]. <b>rmt</b> is capable of "inserting Tk code" into
simultaneously running Tk applications.)
<p>
A cruder way to get <CODE>wish</CODE>-like behaviour with perl/Tk is to run a
"perl shell" and type in your usual commands, including
<KBD>use Tk;</KBD> <i>etc.</i> There is a script distributed with perl called
<CODE>perlsh</CODE> which is written quite simply as:
<pre>
#!/usr/bin/perl
$/ = ''; # set paragraph mode
$SHlinesep = "\n";
while ($SHcmd = <>) {
$/ = $SHlinesep;
eval $SHcmd; print $@ || "\n";
$SHlinesep = $/; $/ = '';
}
</pre>
You can use this during code development to test out little snippets of code.
It helps to be an accurate typist and the <KBD>use strict;</KBD> is optional
here :-)
<p>
Hiroaki Kobayasi has a more sophisticated <kbd>wish</kbd> like perl/Tk
"shell" that is called EVA. It is available from:
<pre>
<a href="ftp://ftp.sowa.is.uec.ac.jp/pub/Lang/perl5/Tk/">ftp://ftp.sowa.is.uec.ac.jp/pub/Lang/perl5/Tk/eva-*.tar.gz</a>
things like $mmm = new MainWindow; etc. at the rmt: prompt. (This use belies
the power of rmt which is derived from Ousterhout's Tcl/Tk version of rmt [see
section 27.2 of his book]. rmt is capable of "inserting Tk code" into simultaneously
running Tk applications.)
A cruder way to get wish-like behaviour with perl/Tk is to run a "perl shell" and
type in your usual commands, including use Tk; etc. There is a script distributed
with perl called perlsh which is written quite simply as:
#!/usr/bin/perl
$/ = ''; # set paragraph mode
$SHlinesep = "\n";
while ($SHcmd = <>) {
$/ = $SHlinesep;
eval $SHcmd; print $@ || "\n";
$SHlinesep = $/; $/ = '';
}
You can use this during code development to test out little snippets of code. It helps to
be an accurate typist and the use strict; is optional here :-)
Hiroaki Kobayasi has a more sophisticated wish like perl/Tk "shell" that is called
EVA. It is available from:
ftp://ftp.sowa.is.uec.ac.jp/pub/Lang/perl5/Tk/eva-*.tar.gz
ptkFAQ4.txt view on Meta::CPAN
things like $mmm = new MainWindow; etc. at the rmt: prompt. (This use belies
the power of rmt which is derived from Ousterhout's Tcl/Tk version of rmt [see
section 27.2 of his book]. rmt is capable of "inserting Tk code" into simultaneously
running Tk applications.)
A cruder way to get wish-like behaviour with perl/Tk is to run a "perl shell" and
type in your usual commands, including use Tk; etc. There is a script distributed
with perl called perlsh which is written quite simply as:
#!/usr/bin/perl
$/ = ''; # set paragraph mode
$SHlinesep = "\n";
while ($SHcmd = <>) {
$/ = $SHlinesep;
eval $SHcmd; print $@ || "\n";
$SHlinesep = $/; $/ = '';
}
You can use this during code development to test out little snippets of code. It helps to
be an accurate typist and the use strict; is optional here :-)
Hiroaki Kobayasi has a more sophisticated wish like perl/Tk "shell" that is called
EVA. It is available from:
ftp://ftp.sowa.is.uec.ac.jp/pub/Lang/perl5/Tk/eva-*.tar.gz
qna16.2.html view on Meta::CPAN
is derived from Ousterhout's Tcl/Tk version of <b>rmt</b> [see section 27.2 of
his book]. <b>rmt</b> is capable of "inserting Tk code" into
simultaneously running Tk applications.)
<p>
A cruder way to get <CODE>wish</CODE>-like behaviour with perl/Tk is to run a
"perl shell" and type in your usual commands, including
<KBD>use Tk;</KBD> <i>etc.</i> There is a script distributed with perl called
<CODE>perlsh</CODE> which is written quite simply as:
<pre>
#!/usr/bin/perl
$/ = ''; # set paragraph mode
$SHlinesep = "\n";
while ($SHcmd = <>) {
$/ = $SHlinesep;
eval $SHcmd; print $@ || "\n";
$SHlinesep = $/; $/ = '';
}
</pre>
You can use this during code development to test out little snippets of code.
It helps to be an accurate typist and the <KBD>use strict;</KBD> is optional
here :-)
<p>
Hiroaki Kobayasi has a more sophisticated <kbd>wish</kbd> like perl/Tk
"shell" that is called EVA. It is available from:
<pre>
<a href="ftp://ftp.sowa.is.uec.ac.jp/pub/Lang/perl5/Tk/">ftp://ftp.sowa.is.uec.ac.jp/pub/Lang/perl5/Tk/eva-*.tar.gz</a>
( run in 0.446 second using v1.01-cache-2.11-cpan-49f99fa48dc )