edwyr has asked for the wisdom of the Perl Monks concerning the following question:
I want to detect if pod is embedded into a file or not.
Is there an easier way to detect the embedded pod other
than the sample code below?
my $file = '/tmp/file'; + open(IN, "<$file") or die "$0: cannot read file '$file': $!"; + my $pod = 1 if scalar(grep(/^=pod/o, <IN>)) > 0; + close(IN); + pod2html($file) if $pod;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: detecting pod in files?
by xdg (Monsignor) on Aug 17, 2005 at 14:46 UTC | |
Re: detecting pod in files?
by davidrw (Prior) on Aug 17, 2005 at 15:18 UTC | |
by edwyr (Sexton) on Aug 27, 2005 at 15:08 UTC | |
Re: detecting pod in files?
by Ven'Tatsu (Deacon) on Aug 17, 2005 at 14:30 UTC | |
by brian_d_foy (Abbot) on Aug 17, 2005 at 17:17 UTC |
Back to
Seekers of Perl Wisdom