內容

名稱

Pod::Simple::PullParserStartToken -- Pod::Simple::PullParser 中的開始標記

語法

(請參閱 Pod::Simple::PullParser)

說明

當您對 Pod::Simple::PullParser 物件執行 $parser->get_token 時,可能會取得此類別的物件。

這是 Pod::Simple::PullParserToken 的子類別,並繼承其所有方法,並新增下列方法

$token->tagname

這會傳回此開始標記物件的標記名稱。例如,剖析 "=head1 ..." 行會提供標記名稱為 "head1" 的開始標記、其內容的標記,然後是標記名稱為 "head1" 的結束標記。

$token->tagname(somestring)

這會變更此起始代碼物件的標籤名稱。你可能不需要這麼做。

$token->tag(...)

$token->tagname(...) 的捷徑

$token->is_tag(somestring) 或 $token->is_tagname(somestring)

這些是 $token->tag() eq somestring 的捷徑

$token->attr(attrname)

這會傳回此起始代碼物件的 attrname 屬性的值,或 undef。

例如,剖析 L<Foo/"Bar"> 連結會產生一個起始代碼,其「to」屬性的值為「Foo」,「type」屬性的值為「pod」,而「section」屬性的值為「Bar」。

$token->attr(attrname, newvalue)

這會將此起始代碼物件的 attrname 屬性設定為 newvalue。你可能不需要這麼做。

$token->attr_hash

這會傳回此起始代碼的屬性設定的 hashref。這很有用,例如,如果你想詢問所有屬性為何,你可以直接執行 keys %{$token->attr_hash}

你不太可能需要自己建構此類別的物件,但如果你想這麼做,請呼叫 Pod::Simple::PullParserStartToken->new( tagname, attrhash )

另請參閱

Pod::Simple::PullParserTokenPod::SimplePod::Simple::Subclassing

另請參閱

Pod::Simple::PullParserTokenPod::SimplePod::Simple::Subclassing

支援

有關 POD 和 Pod::Simple 的問題或討論應寄送至 pod-people@perl.org 郵件清單。寄送一封空白電子郵件至 pod-people-subscribe@perl.org 以訂閱。

此模組在一個開放的 GitHub 儲存庫中管理,https://github.com/perl-pod/pod-simple/。歡迎分岔和貢獻,或複製 git://github.com/perl-pod/pod-simple.git 並傳送修補程式!

歡迎針對 Pod::Simple 的修補程式。請將錯誤報告寄送至 <bug-pod-simple@rt.cpan.org>。

著作權和免責聲明

著作權所有 (c) 2002 Sean M. Burke。

此函式庫為免費軟體;你可以在與 Perl 相同的條款下重新散布和/或修改它。

散布此程式時,希望它對你有用,但沒有任何擔保;甚至沒有適銷性或特定目的適用性的默示擔保。

作者

Pod::Simple 由 Sean M. Burke <sburke@cpan.org> 建立。但他已退休,請勿打擾他。

Pod::Simple 由下列人員維護