Skip to content

Instantly share code, notes, and snippets.

@bg1bgst333
Created March 10, 2025 06:03
Show Gist options
  • Save bg1bgst333/87c047637eef0fb6682da2e5ca7be642 to your computer and use it in GitHub Desktop.
Save bg1bgst333/87c047637eef0fb6682da2e5ca7be642 to your computer and use it in GitHub Desktop.
CGI::checkbox(-checked)
#!/usr/bin/perl
use strict; # 厳密な文法チェック.
use CGI; # CGI
# CGIオブジェクトの作成.
my $q = CGI->new; # CGI::newでCGIオブジェクトを生成し, $qに格納.
# HTTPヘッダの出力.
print $q->header;
# HTMLヘッダの出力.
print $q->start_html("CGI::checkbox(-checked)"); # <html>タグなどの出力.
# チェックボックスの出力.
print $q->checkbox(-checked => 'checked'); # <input>タグのtype=checkboxであらかじめチェックを付ける.
# HTMLフッタの出力.
print $q->end_html; # </html>タグなどの出力.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment