.11.0-1017 Architecture: amd64 Version: 5.11.0-1017.18~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28808 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1017_5.11.0-1017.18~20.04.1_amd64.deb Size: 6353948 MD5sum: ec8d807eb64ff4d5bf8fe8e3855f0557 SHA1: 19104bc03303978987da4db991ec455572fa72e2 SHA256: 47ba7f56ab16e782d7c681b51521db58cb4e61cef2238f6dcfde9463604ba916 SHA512: cb9b5f4f8a3e4646173db67b01045cc072f6f7acda128c14d06c2cb0eb180d9e81b974b81831e7637c4c995dc3806cab840f838d1b86f1581a67bc919d410e2e Description: Linux kernel version specific tools for version 5.11.0-1017 Description-md5: fb17f58b3a0f278d926a433d3f464e99 Package: linux-azure-5.11-tools-5.11.0-1019 Architecture: amd64 Version: 5.11.0-1019.20~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28808 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1019_5.11.0-1019.20~20.04.1_amd64.deb Size: 6354656 MD5sum: fa46d89236aeb26feab0942b67232199 SHA1: e780a15cc50f69588aca9684a05584bf3fa22196 SHA256: d428529c98c9edab8b5d9122f87103a493db9d3a92e6419d69e539344ba5f678 SHA512: f9861766f069dd7b71a3a320ecc9a3c60ee6af8b74b47f8fb03216d876e40135f929a29f91618d1cf439244e4565091b8e351ca43b9687575f6ac18481cb77dc Description: Linux kernel version specific tools for version 5.11.0-1019 Description-md5: 5e9d8a29a4120aef348dd84189ec8658 Package: linux-azure-5.11-tools-5.11.0-1020 Architecture: amd64 Version: 5.11.0-1020.21~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28815 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1020_5.11.0-1020.21~20.04.1_amd64.deb Size: 6338448 MD5sum: 61a2fd2134a11024a458a83347a77f7e SHA1: a3fd3473c0b55bfb6ce8acba709390f04e8526fb SHA256: 39404f35390ff6bd6c0424d6f92a01d2223adf2597a03d2c653613e82252bd69 SHA512: b68b5481d873ff0ff5ebb02826ee4fadb9606dc6f7ac84e658e671f348548f8181493a8f6de61601997c7401646c7bbe6e8d6d4312e1efe3cd425da6cae65972 Description: Linux kernel version specific tools for version 5.11.0-1020 Description-md5: 5653f02c6b462e29743e40177767fd15 Package: linux-azure-5.11-tools-5.11.0-1021 Architecture: amd64 Version: 5.11.0-1021.22~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28821 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1021_5.11.0-1021.22~20.04.1_amd64.deb Size: 6338484 MD5sum: 9e12b2eb06a25e0971926ba93cd591ca SHA1: 62aa180dcb81bcab212957a54734302568563708 SHA256: a4caa5a4e66e0971e69182b440b093984d3b6d95c4de2b8f5355f600228fd983 SHA512: 8eba0e6303f5da61c5f926751175bb119d0123b62f2c2571034c54cd2de1a0a4b3aa922e4f86760fde8bbc38b0ca9a54c3e6f01e957fb579edc5b84791f3b890 Description: Linux kernel version specific tools for version 5.11.0-1021 Description-md5: 8f5f9d21914adfd1e5257fff9b2def2c Package: linux-azure-5.11-tools-5.11.0-1022 Architecture: amd64 Version: 5.11.0-1022.23~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28851 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1022_5.11.0-1022.23~20.04.1_amd64.deb Size: 6349092 MD5sum: 55db55a77ac987d7cf51892d341377f6 SHA1: b8403608f770db46f7e2572fdf2122707bbb9d23 SHA256: b66083daeda82d274e30ab1a4c29a24a7cf8bf934890b25c4e5f251f929b99b0 SHA512: b9a6dedccf0baedfeb948a54776e54919f641a3785ea404efc92659cb3e9692203d2ea6edb685f0ba493003324f5b2785286b2ef1d22cff1df7946aec91e1777 Description: Linux kernel version specific tools for version 5.11.0-1022 Description-md5: 958b08e566634f6f9caf0475e0182e73 Package: linux-azure-5.11-tools-5.11.0-1023 Architecture: amd64 Version: 5.11.0-1023.24~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28864 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1023_5.11.0-1023.24~20.04.1_amd64.deb Size: 6359496 MD5sum: 1b729aaa4ccc5acf55a0bafc55680074 SHA1: e8bded12fcd8580d34dcae221e31fc84bc4c5699 SHA256: ea58f5b01ba187e4cec5fed3d9b4f7f448cf0b66f122a124575af97df365d7c2 SHA512: b35ce3598ed7b05b61a65360dcf6ca9ff9b05a0851532e7c8a626e5fdce0fa58baf9fe38051c4dc4047009f93a82fcbfa85ffeaa135400ab65e33efed8fa7413 Description: Linux kernel version specific tools for version 5.11.0-1023 Description-md5: 6cc8f3cee45e7cc7782664dbddec7537 Package: linux-azure-5.11-tools-5.11.0-1025 Architecture: amd64 Version: 5.11.0-1025.27~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28864 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1025_5.11.0-1025.27~20.04.1_amd64.deb Size: 6351596 MD5sum: 750fa85042815ea2b459e24241fca8cc SHA1: da18587b8e41fcc5008332928299116cf6256bc9 SHA256: a56e27ff58cbe204efa85324107bcc1c515fd5e3a838768ca3162f776102fdc6 SHA512: 91bd7b06e604be303f2cbf07471179941f990f74c34165aeeb80a32b4fc6671ad9039a12a5c2c9e2b1ff9f7f75234f4c200317a322a530432a460fc9f4db8b79 Description: Linux kernel version specific tools for version 5.11.0-1025 Description-md5: a9ba5948d755c28b7c3bf297cb505a71 Package: linux-azure-5.11-tools-5.11.0-1027 Architecture: amd64 Version: 5.11.0-1027.30~20.04.1 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28865 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1027_5.11.0-1027.30~20.04.1_amd64.deb Size: 6326088 MD5sum: ff20a9175a23e7889672f2cb3d35019b SHA1: 3c168a88c4a893caa91c4712617f1ed05ee18001 SHA256: ebf6f8eedfd41e3220f13ffb446791a01736a44d8e45170fc79e5a84f5ad1914 SHA512: f6998154384ad6799386d1cb7c62b20eec00345894f8c7155ee7e49eff071c206804ea5e1aa73e742861e591e105b0e59b46670536d07674ba6f1745aa578861 Description: Linux kernel version specific tools for version 5.11.0-1027 Description-md5: 8555b3e397cdbe50a971878ec22ab73e Package: linux-azure-5.11-tools-5.11.0-1028 Architecture: amd64 Version: 5.11.0-1028.31~20.04.2 Priority: optional Section: devel Source: linux-azure-5.11 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 28886 Depends: libc6 (>= 2.28), libcap2 (>= 1:2.10), libdw1 (>= 0.157), libelf1 (>= 0.144), liblzma5 (>= 5.1.1alpha+20120614), libnuma1 (>= 2.0.11), libpci3 (>= 1:3.5.1), libslang2 (>= 2.2.4), libudev1 (>= 183), libunwind8, zlib1g (>= 1:1.2.3.3), linux-tools-common Filename: pool/main/l/linux-azure-5.11/linux-azure-5.11-tools-5.11.0-1028_5.11.0-1028.31~20.04.2_amd64.deb Size: 6345872 MD5sum: 018ab7006c28b8cc66c3b6d313b69a48 SHA1: 0fed9d3bf8bdb0247b19a9b9e04a71a1d431aa37 SHA256: 5ecca3a8d2ba5bfe9b0cdb207495f8ab8074080564d22eb6c9efc1595cedb3dd SHA512: b4ef4e1842c65139fd1d8c121cfcaadb181f76418b66c901083a5129277107984ccd401c19f844d8f3b4a5aae480520f09887c7a302d35bd44826318fe1bd373 Description: Linux kernel version specific tools for version 5.11.0-1028 Description-md5: db89aee8ea109bee114c2b5892dee6f2 Package: linux-azure-5.13-cloud-tools-5.13.0-1009 Architecture: amd64 Version: 5.13.0-1009.10~20.04.2 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1161 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1009_5.13.0-1009.10~20.04.2_amd64.deb Size: 84520 MD5sum: 8d4eefe3e313aaf6c955000b6fc5d58d SHA1: 43a5729af1ab2bf6b752b2ae083f72f48f0325fe SHA256: da3a0faac772111e0b11ad4b6d683fb434e5adea4ef05e46044ebfa044a7a7c8 SHA512: f9a0af1f148c837826dd13037a8880e275a5147f728edf4cae242d544fd28a14d6663ac5457610b70adbe73ec9f94debe7888696412412dc3a17c336b6498b36 Description: Linux kernel version specific cloud tools for version 5.13.0-1009 Description-md5: 021ba529db5fffebae5ac200c5f30f0e Package: linux-azure-5.13-cloud-tools-5.13.0-1012 Architecture: amd64 Version: 5.13.0-1012.14~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1161 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1012_5.13.0-1012.14~20.04.1_amd64.deb Size: 84716 MD5sum: 57f8a1be304b0f89f858e240a5979d60 SHA1: e72590f60665f3c4c69c90b272e20472dfa8a3f6 SHA256: e1a9a27740cb9517d5b29f6632d71daa78de136579cf88e20f0c40444c73e3df SHA512: 5d21e8f465392e5dafe1c82ae55468c15e5fb4eb5a7f336510160f6b2806e22b9c67d90600004588e147810bbbd08830f7a4ee9ec3d9d0e3606ff4bb391b462d Description: Linux kernel version specific cloud tools for version 5.13.0-1012 Description-md5: e8bb2080551e624c3cbe286f973b5aba Package: linux-azure-5.13-cloud-tools-5.13.0-1014 Architecture: amd64 Version: 5.13.0-1014.16~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1193 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1014_5.13.0-1014.16~20.04.1_amd64.deb Size: 113200 MD5sum: efbe62d0013609e041022112ff0633f6 SHA1: c48895dabaad2d0a97383448cb3c72fcadea3019 SHA256: be12f539fb5ae2cfe4e99a95daf8a1803c063491f5283c106e21c2aef431afe5 SHA512: 8cb9c33958527a3d2866fbfb81ff9b5c024b92ea1805b45eb95eac06e1ec12c3ece200406d76bcbd9e7f818b3512aa5de1d5704933d29907f5228fc43b29e736 Description: Linux kernel version specific cloud tools for version 5.13.0-1014 Description-md5: 2bdfb321f453477211d6342a36d123e9 Package: linux-azure-5.13-cloud-tools-5.13.0-1017 Architecture: amd64 Version: 5.13.0-1017.19~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1194 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1017_5.13.0-1017.19~20.04.1_amd64.deb Size: 104652 MD5sum: 1b23ef30731bb74162f06b3cae3d7267 SHA1: e6f947498279e04f0564a2218bb7681039486b1e SHA256: 4a754b05efc7821a25d869a45fac8cd978c0ad993df9187212f8f88a96a60c4a SHA512: a38f9fd26af08426dc5f3960ba0f200d69d17d81d7b7f67ee52eb2799bbe5f6bfdf46d923ea0588eaef3b2eb3283d636c7e66aaf4cbcac34221d60fcb33cbc7d Description: Linux kernel version specific cloud tools for version 5.13.0-1017 Description-md5: 78186c76268b16bc05a5c77a863c93b6 Package: linux-azure-5.13-cloud-tools-5.13.0-1021 Architecture: amd64 Version: 5.13.0-1021.24~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1213 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1021_5.13.0-1021.24~20.04.1_amd64.deb Size: 91652 MD5sum: b9c27cd561ff480445107ed385143e9a SHA1: b6031266b3892eb399aa14a58535369ad4ed650a SHA256: 8d9c7902d8b62eab3a9c10e3b01c6318b5ead840bd3a8b44af398aa418c45265 SHA512: e31a36eb779be3949c43cc054b2a35dafe3bc04eaa99d511dc59e4ab84053330215c205062ac6492eef31b6c8633aaaaff3d278d9af96fb94d908adc91067d54 Description: Linux kernel version specific cloud tools for version 5.13.0-1021 Description-md5: a5fc922dd48b65fd9194e61f73040a43 Package: linux-azure-5.13-cloud-tools-5.13.0-1022 Architecture: amd64 Version: 5.13.0-1022.26~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1234 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1022_5.13.0-1022.26~20.04.1_amd64.deb Size: 97168 MD5sum: 573953f42c3f1bdded7560cb8d44b3dc SHA1: 6245d5b7f07659473fca0f2f15645019c9d04c99 SHA256: fa1108c471e828f97a90727c4c9098dea6d4f2c574dfa881eed841f9d1e42d1b SHA512: c246c9ec27daba1c5ab5f6bfd684ccaeb7e5fdc02bc7cc2a6efefcbdbc103224f7d575c19935bba267282f59c61137e54d6a326da918efb4f17209a01f3b0564 Description: Linux kernel version specific cloud tools for version 5.13.0-1022 Description-md5: 71c8f023614b2423b432a4fd8a8f5d27 Package: linux-azure-5.13-cloud-tools-5.13.0-1023 Architecture: amd64 Version: 5.13.0-1023.27~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1246 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1023_5.13.0-1023.27~20.04.1_amd64.deb Size: 110160 MD5sum: d88d51b109ac23aabcedde87205eb0db SHA1: 6695ea37d199840b9970eed99bc7083096b7db04 SHA256: ba09013c4616e5964a5e633c4b8ebee6b604c3877f58bcee037994941b06baff SHA512: abf79ace3fbd65c68e6bf0b96f9749164742910f4d21caa8ce67cab6c2e62047cbf294edf9a7d03489e798007d2ab670017a997c558b05704d49c2f9e4ad6cf1 Description: Linux kernel version specific cloud tools for version 5.13.0-1023 Description-md5: 75b44dfca7eb5bf925ea063b700a7776 Package: linux-azure-5.13-cloud-tools-5.13.0-1025 Architecture: amd64 Version: 5.13.0-1025.29~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1246 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1025_5.13.0-1025.29~20.04.1_amd64.deb Size: 110164 MD5sum: 2d657cb63dbd3080f2d9d6150dd7165e SHA1: 5197cf032b09223edc14c1f059af7a5fca539e59 SHA256: 69476ed2dad22c8b1423571dd14ef7a9d9bb2928e330b6ad04770782e31f0035 SHA512: a21e00c60aa974824053e8eb4c73ec015077ff6cae00d81a2e3a485144c375c67778986a619b267a1c1020136d0a3e556f56b054b01396b6056b80e6612706d1 Description: Linux kernel version specific cloud tools for version 5.13.0-1025 Description-md5: a6ac58fca8c51af8fb9a49e1c79d3e10 Package: linux-azure-5.13-cloud-tools-5.13.0-1028 Architecture: amd64 Version: 5.13.0-1028.33~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1251 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1028_5.13.0-1028.33~20.04.1_amd64.deb Size: 80612 MD5sum: 7bbd7f937f7305e0f6b889e7e8f7d4ed SHA1: f7c0edd4c2fa725095d42656d9d495b6c09346fb SHA256: 8dac5748e5d7cb57528e115c7ebe4edbdb4636905c8122ad9e005591cd1134a6 SHA512: ec153569c4079ef4874378c62b085a2f89a67f0cbe5da3b3b3d9a131ac28807e3aff9f2c366fed496d3628d3f7d8efa2cdd4cc822930f0cb130cd011c6ce1ae1 Description: Linux kernel version specific cloud tools for version 5.13.0-1028 Description-md5: 51f13418f34f4ccacc4c8e107351a9ac Package: linux-azure-5.13-cloud-tools-5.13.0-1029 Architecture: amd64 Version: 5.13.0-1029.34~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1251 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1029_5.13.0-1029.34~20.04.1_amd64.deb Size: 79956 MD5sum: c4ab5f419ed7553d741ebc347317e4af SHA1: 2988f372b11323e979030199e0c0db4c199e617b SHA256: b9ae9f4a2f626488b92af6130c14120ef5bcffbedc411c7ffb4c9340a157ce15 SHA512: 5125e70c4556af40b2dd9e85eb780f3c82a39a74f500f6d0a68088220d86d6dd678251c6121e5a1c62170006655acfba0e0829f6fa4d067791859429045cd606 Description: Linux kernel version specific cloud tools for version 5.13.0-1029 Description-md5: 0c191c8a341b53a8f8c3d7e8bec41ede Package: linux-azure-5.13-cloud-tools-5.13.0-1031 Architecture: amd64 Version: 5.13.0-1031.37~20.04.1 Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1251 Depends: libc6 (>= 2.14), linux-cloud-tools-common Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-cloud-tools-5.13.0-1031_5.13.0-1031.37~20.04.1_amd64.deb Size: 80092 MD5sum: d9980d95e49419453e7d961eaaadb0d1 SHA1: 234e9332f65f5be26a5d9cbaaaa76f56f8626331 SHA256: 14eab51a36e85459b35dbd835a6732449a57f4c280346c6ea8acd075fc8a894e SHA512: d9ca91fd21ea9c068696b11e4dd834c81752ff2dab8b4d379dd48a95d0c5ae970f457da4cd4cb9c5a3a5cd6377f413f9cfccc8e1c3ee263285b2df9fff87556b Description: Linux kernel version specific cloud tools for version 5.13.0-1031 Description-md5: daf48e15373217b3342b86bc1794f356 Package: linux-azure-5.13-headers-5.13.0-1009 Architecture: all Version: 5.13.0-1009.10~20.04.2 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 74989 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1009_5.13.0-1009.10~20.04.2_all.deb Size: 11802128 MD5sum: 69333853ab6bb47543abe9df0e02be0b SHA1: 875d86d2b9fd57c8ce8d4e09ca7a6b10602f4d77 SHA256: c87159a42c1cf1b08809d38ba0e8ef9d3c44eee807cd2ec855857b2f78ad00ea SHA512: 9fa704c333d1f8c10df36744b2cd01064ef89501f04f4e54a2ab33d175a3c2b3dc7c5bba8f8f268b95aa672324112cf01411a2912a950d911a8bae01296bf612 Description: Header files related to Linux kernel version 5.13.0 Description-md5: 9a596b003bc79c1b534e0a5ce8421ef7 Package: linux-azure-5.13-headers-5.13.0-1012 Architecture: all Version: 5.13.0-1012.14~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 74989 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1012_5.13.0-1012.14~20.04.1_all.deb Size: 11802636 MD5sum: 4cf06a4905fb866496321d6b5c9ea558 SHA1: f147ca9af7493c52ed33d2ce97aff27410eb8f18 SHA256: cc1d30914af1e6d38bb41aa04d7549d6b536b9174c3cc530f118a456bb0337ba SHA512: 4bd418031a0150f8e380c6a01ae37153b4cedfb5bafa6229098ebec5ef2c42c8f110bccd3fe0b91eab514a9f63748a5f669335fe858d9bfe30bba581898fee0f Description: Header files related to Linux kernel version 5.13.0 Description-md5: 6ecda0db77c8f9e4fe05c52c70f65976 Package: linux-azure-5.13-headers-5.13.0-1014 Architecture: all Version: 5.13.0-1014.16~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75047 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1014_5.13.0-1014.16~20.04.1_all.deb Size: 11836196 MD5sum: 773a20fe919aef181a13264328b0d6b7 SHA1: 5f9b7fafd60b57234c30b4a8e75c23fddd3e6f07 SHA256: 165a91b060916a6b537d300551ccd7402996d4f5c3a5f019ab97f626287ef113 SHA512: 6682164d3409fa0f6022371e1407578e7cb8bd839fb51d898a01525cad3096fb9e646ead20df657068d300953ca2d09e1d6e521f53383eb73ff6661df1d88f9c Description: Header files related to Linux kernel version 5.13.0 Description-md5: 1dd39a5768366e97bf52a79a9ec7b582 Package: linux-azure-5.13-headers-5.13.0-1017 Architecture: all Version: 5.13.0-1017.19~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75059 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1017_5.13.0-1017.19~20.04.1_all.deb Size: 11828880 MD5sum: ff8e714e122116d40db365b3db74eb62 SHA1: 7177bdc0d1de46d362570f9f48dd0956e8cd1fcc SHA256: 307b372d554202d2331ec2228c02d64248318ac61bf2ec64c8c8a550bf86e143 SHA512: 3972a14b13a8c246e4a6dd5eab2cf3dc63a70f781908bef6b2839dccca65721700d518410295a592b7e883ed8dcfa3d25996a1c1e9364600e3160e4973ab678d Description: Header files related to Linux kernel version 5.13.0 Description-md5: 8a89f46c6256ac753dad3473384ef769 Package: linux-azure-5.13-headers-5.13.0-1021 Architecture: all Version: 5.13.0-1021.24~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75096 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1021_5.13.0-1021.24~20.04.1_all.deb Size: 11819176 MD5sum: bba75ac060a87f1793d6acf76ff05e27 SHA1: 3c52fc11b0061ef1c755c4b35b8631725dd03592 SHA256: 06be653a6e9bc5b3d64d830672c4a9d3c40656fe9423bf09256aba9b4ebf9bce SHA512: a9242316ee8c2029b4fae35f9152797890f4716e570db7080d433ed7623a9b1a87a4e0a2231235eb5391a4d3e4783f7979469e67bf19025c82384930b6ca2f3b Description: Header files related to Linux kernel version 5.13.0 Description-md5: 3f2b9face3b7cee65233f65ee33c5bd2 Package: linux-azure-5.13-headers-5.13.0-1022 Architecture: all Version: 5.13.0-1022.26~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75128 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1022_5.13.0-1022.26~20.04.1_all.deb Size: 11827356 MD5sum: 254ab7573a554b21e1edf720400e553e SHA1: 14b1bb11233abfee36c7bd4e48ab30c94c5403c8 SHA256: 9a4b08f2a556d50cafb98bfc551395126fc2462eb36bfc670cca27da32825cab SHA512: 149c1772823e8c40e75d3c43a7c2015de28381d2b956b845df3d528216e65f0afaea60bd01d3dcb549e14675d49319bc7abfe37b404b3c7c340550ab1a101b2e Description: Header files related to Linux kernel version 5.13.0 Description-md5: dccec1c02298bff498823ecdaf2c9bf3 Package: linux-azure-5.13-headers-5.13.0-1023 Architecture: all Version: 5.13.0-1023.27~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75154 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1023_5.13.0-1023.27~20.04.1_all.deb Size: 11841964 MD5sum: 55a25e5e4c35bf57b830b78b5b792ddc SHA1: 2c50ff14350d483c0134a4485f0516e17a54851a SHA256: 170e6b89da667941a86a4b58f8b43bd1ba80bb7ee048c4c814360cede419edce SHA512: 84f5a57e903038fa3b16d514e7cfe8ed6a57267d7ec4cc0ee4fb2520690537b076e6cfb8bf528ff22d836298e5896860266253974fe8575191c73dcd5e98b3e6 Description: Header files related to Linux kernel version 5.13.0 Description-md5: 67531fc2cafc5c433f8be4ff0d00d62a Package: linux-azure-5.13-headers-5.13.0-1025 Architecture: all Version: 5.13.0-1025.29~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75154 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1025_5.13.0-1025.29~20.04.1_all.deb Size: 11841748 MD5sum: 71a274b2b5aac130591d6f4f8d8dff18 SHA1: a3f315d97165328d8e579aaca5e8bd20d0688e81 SHA256: 3a2717a43cc9e6ef261ccb3a24febaa842b4b00c389c9d4e72d34bbe10808c4b SHA512: ae9c42bdeca02b4c3fd30e67f0e1b403e1bbf3c955a93d724ccbac6aa0e05f8bc4423a9c747913111b1c7de9b0fdd33f1482ab186716d5af80354b4e92f71ab4 Description: Header files related to Linux kernel version 5.13.0 Description-md5: ae93f68ddd86b26c342033768a4b683b Package: linux-azure-5.13-headers-5.13.0-1028 Architecture: all Version: 5.13.0-1028.33~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75160 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1028_5.13.0-1028.33~20.04.1_all.deb Size: 11812892 MD5sum: 292ed13ca0999134fb22dac4450e315b SHA1: 545c43c819b1e3299f915a18e5e64823beee4d67 SHA256: 93939984b718304171c2cb73cd47046999b59577c0450911ef41b168db54b5f2 SHA512: 06869b0e7c614526b149e0ae89e9d25917659df12e0cb65752946dfeb9f47e90e52ea92671e327fe1ae4aaebd5c9eaa1dc1447c4cc2ee889f1cf2feaf857a8f7 Description: Header files related to Linux kernel version 5.13.0 Description-md5: 4e88d9a212245c79d5da03f7dec8d1a1 Package: linux-azure-5.13-headers-5.13.0-1029 Architecture: all Version: 5.13.0-1029.34~20.04.1 Multi-Arch: foreign Priority: optional Section: devel Source: linux-azure-5.13 Origin: Ubuntu Maintainer: Ubuntu Kernel Team Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 75160 Depends: coreutils Filename: pool/main/l/linux-azure-5.13/linux-azure-5.13-headers-5.13.0-1029_5.13.0-1029.34~20.04.1_all.deb Size: 11811736 MD5sum: 4f20d3662e9fb88505aee0c02503cb13 SHA1: 74e94085ca2352d4ca7d6727ef266d45069d934d SHA256: c3f6f364674e958abd3afdd2aec0b89eb6575322ee2799e9716c70a93178e167 SHA512: c5edbb82afaa9e093e471057390bde0e9043287401d0b6c161fdfa1e2d1526c34f89d9ed3eb50d275e918e6bb21adb327be1aaa0092fd0cb8dee438ef75902a0 Description: Header files related to Linux kernel v=head1 NAME CGI - Handle Common Gateway Interface requests and responses =for html Build Status Coverage Status =head1 SYNOPSIS use strict; use warnings; use CGI; # create a CGI object (query) for use my $q = CGI->new; # Process an HTTP request my @values = $q->multi_param('form_field'); my $value = $q->param('param_name'); my $fh = $q->upload('file_field'); my $riddle = $q->cookie('riddle_name'); my %answers = $q->cookie('answers'); # Prepare various HTTP responses print $q->header(); print $q->header('application/json'); my $cookie1 = $q->cookie( -name => 'riddle_name', -value => "The Sphynx's Question" ); my $cookie2 = $q->cookie( -name => 'answers', -value => \%answers ); print $q->header( -type => 'image/gif', -expires => '+3d', -cookie => [ $cookie1,$cookie2 ] ); print $q->redirect('http://somewhere.else/in/movie/land'); =head1 DESCRIPTION CGI.pm is a stable, complete and mature solution for processing and preparing HTTP requests and responses. Major features including processing form submissions, file uploads, reading and writing cookies, query string generation and manipulation, and processing and preparing HTTP headers. CGI.pm performs very well in a vanilla CGI.pm environment and also comes with built-in support for mod_perl and mod_perl2 as well as FastCGI. It has the benefit of having developed and refined over 20 years with input from dozens of contributors and being deployed on thousands of websites. CGI.pm was included in the perl distribution from perl v5.4 to v5.20, however is has now been removed from the perl core... =head1 CGI.pm HAS BEEN REMOVED FROM THE PERL CORE L If you upgrade to a new version of perl or if you rely on a system or vendor perl and get an updated version of perl through a system update, then you will have to install CGI.pm yourself with cpan/cpanm/a vendor package/manually. To make this a little easier the L module has been split into its own distribution, meaning you do not need access to a compiler to install CGI.pm The rationale for this decision is that CGI.pm is no longer considered good practice for developing web applications, B quick prototyping and small web scripts. There are far better, cleaner, quicker, easier, safer, more scalable, more extensible, more modern alternatives available at this point in time. These will be documented with L. For more discussion on the removal of CGI.pm from core please see: L Note that the v4 releases of CGI.pm will retain back compatibility B B, however you may need to make some minor changes to your code if you are using deprecated methods or some of the more obscure features of the module. If you plan to upgrade to v4.00 and beyond you should read the Changes file for more information and B against CGI.pm before deploying it. =head1 HTML Generation functions should no longer be used B HTML generation functions within CGI.pm are no longer being maintained. Any issues, bugs, or patches will be rejected unless they relate to fundamentally broken page rendering. The rationale for this is that the HTML generation functions of CGI.pm are an obfuscation at best and a maintenance nightmare at worst. You should be using a template engine for better separation of concerns. See L for an example of using CGI.pm with the L module. These functions, and perldoc for them, are considered deprecated, they are no longer being maintained and no fixes or features for them will be accepted. They will, however, continue to exist in CGI.pm without any deprecation warnings ("soft" deprecation) so you can continue to use them if you really want to. All documentation for these functions has been moved to L. =head1 Programming style There are two styles of programming with CGI.pm, an object-oriented (OO) style and a function-oriented style. You are recommended to use the OO style as CGI.pm will create an internal default object when the functions are called procedurally and you will not have to worry about method names clashing with perl builtins. In the object-oriented style you create one or more CGI objects and then use object methods to create the various elements of the page. Each CGI object starts out with the list of named parameters that were passed to your CGI script by the server. You can modify the objects, save them to a file or database and recreate them. Because each object corresponds to the "state" of the CGI script, and because each object's parameter list is independent of the others, this allows you to save the state of the script and restore it later. For example, using the object oriented style: #!/usr/bin/env perl use strict; use warnings; use CGI; # load CGI routines my $q = CGI->new; # create new CGI object print $q->header; # create the HTTP header In the function-oriented style, there is one default CGI object that you rarely deal with directly. Instead you just call functions to retrieve CGI parameters, manage cookies, and so on. The following example is identical to above, in terms of output, but uses the function-oriented interface. The main differences are that we now need to import a set of functions into our name space (usually the "standard" functions), and we don't need to create the CGI object. #!/usr/bin/env perl use strict; use warnings; use CGI qw/:standard/; # load standard CGI routines print header(); # create the HTTP header The examples in this document mainly use the object-oriented style. See HOW TO IMPORT FUNCTIONS for important information on function-oriented programming in CGI.pm =head2 Calling CGI.pm routines Most CGI.pm routines accept several arguments, sometimes as many as 20 optional ones! To simplify this interface, all routines use a named argument calling style that looks like this: print $q->header( -type => 'image/gif', -expires => '+3d', ); Each argument name is preceded by a dash. Neither case nor order matters in the argument list: -type, -Type, and -TYPE are all acceptable. In fact, only the first argument needs to begin with a dash. If a dash is present in the first argument CGI.pm assumes dashes for the subsequent ones. Several routines are commonly called with just one argument. In the case of these routines you can provide the single argument without an argument name. header() happens to be one of these routines. In this case, the single argument is the document type. print $q->header('text/html'); Other such routines are documented below. Sometimes named arguments expect a scalar, sometimes a reference to an array, and sometimes a reference to a hash. Often, you can pass any type of argument and the routine will do whatever is most appropriate. For example, the param() routine is used to set a CGI parameter to a single or a multi-valued value. The two cases are shown below: $q->param( -name => 'veggie', -value => 'tomato', ); $q->param( -name => 'veggie', -value => [ qw/tomato tomahto potato potahto/ ], ); Many routines will do something useful with a named argument that it doesn't recognize. For example, you can produce non-standard HTTP header fields by providing them as named arguments: print $q->header( -type => 'text/html', -cost => 'Three smackers', -annoyance_level => 'high', -complaints_to => 'bit bucket', ); This will produce the following nonstandard HTTP header: HTTP/1.0 200 OK Cost: Three smackers Annoyance-level: high Complaints-to: bit bucket Content-type: text/html Notice the way that underscores are translated automatically into hyphens. =head2 Creating a new query object (object-oriented style) my $q = CGI->new; This will parse the input (from POST, GET and DELETE methods) and store it into a perl5 object called $q. Note that because the input parsing happens at object instantiation you have to set any CGI package variables that control parsing B you call CGI->new. Any filehandles from file uploads will have their position reset to the beginning of the file. =head2 Creating a new query object from an input file my $q = CGI->new( $input_filehandle ); If you provide a file handle to the new() method, it will read parameters from the file (or STDIN, or whatever). The file can be in any of the forms describing below under debugging (i.e. a series of newline delimited TAG=VALUE pairs will work). Conveniently, this type of file is created by the save() method (see below). Multiple records can be saved and restored. Perl purists will be pleased to know that this syntax accepts references to file handles, or even references to filehandle globs, which is the "official" way to pass a filehandle. You can also initialize the CGI object with a FileHandle or IO::File object. If you are using the function-oriented interface and want to initialize CGI state from a file handle, the way to do this is with B. This will (re)initialize the default CGI object from the indicated file handle. open( my $in_fh,'<',"test.in") || die "Couldn't open test.in for read: $!"; restore_parameters( $in_fh ); close( $in_fh ); You can also initialize the query object from a hash reference: my $q = CGI->new( { 'dinosaur' => 'barney', 'song' => 'I love you', 'friends' => [ qw/ Jessica George Nancy / ] } ); or from a properly formatted, URL-escaped query string: my $q = CGI->new('dinosaur=barney&color=purple'); or from a previously existing CGI object (currently this clones the parameter list, but none of the other object-specific fields, such as autoescaping): my $old_query = CGI->new; my $new_query = CGI->new($old_query); To create an empty query, initialize it from an empty string or hash: my $empty_query = CGI->new(""); -or- my $empty_query = CGI->new({}); =head2 Fetching a list of keywords from the query my @keywords = $q->keywords If the script was invoked as the result of an ISINDEX search, the parsed keywords can be obtained as an array using the keywords() method. =head2 Fetching the names of all the parameters passed to your script my @names = $q->multi_param my @names = $q->param If the script was invoked with a parameter list (e.g. "name1=value1&name2=value2&name3=value3"), the param() / multi_param() methods will return the parameter names as a list. If the script was invoked as an ISINDEX script and contains a string without ampersands (e.g. "value1+value2+value3"), there will be a single parameter named "keywords" containing the "+"-delimited keywords. The array of parameter names returned will be in the same order as they were submitted by the browser. Usually this order is the same as the order in which the parameters are defined in the form (however, this isn't part of the spec, and so isn't guaranteed). =head2 Fetching the value or values of a single named parameter my @values = $q->multi_param('foo'); -or- my $value = $q->param('foo'); -or- my @values = $q->param('foo'); # list context, discouraged and will raise # a warning (use ->multi_param instead) Pass the param() / multi_param() method a single argument to fetch the value of the named parameter. When calling param() If the parameter is multivalued (e.g. from multiple selections in a scrolling list), you can ask to receive an array. Otherwise the method will return the B value. B - calling param() in list context can lead to vulnerabilities if you do not sanitise user input as it is possible to inject other param keys and values into your code. This is why the multi_param() method exists, to make it clear that a list is being returned, note that param() can still be called in list context and will return a list for back compatibility. The following code is an example of a vulnerability as the call to param will be evaluated in list context and thus possibly inject extra keys and values into the hash: my %user_info = ( id => 1, name => $q->param('name'), ); The fix for the above is to force scalar context on the call to ->param by prefixing it with "scalar" name => scalar $q->param('name'), If you call param() in list context with an argument a warning will be raised by CGI.pm, you can disable this warning by setting $CGI::LIST_CONTEXT_WARN to 0 or by using the multi_param() method instead If a value is not given in the query string, as in the queries "name1=&name2=", it will be returned as an empty string. If the parameter does not exist at all, then param() will return undef in scalar context, and the empty list in a list context. =head2 Setting the value(s) of a named parameter $q->param('foo','an','array','of','values'); This sets the value for the named parameter 'foo' to an array of values. This is one way to change the value of a field AFTER the script has been invoked once before. param() also recognizes a named parameter style of calling described in more detail later: $q->param( -name => 'foo', -values => ['an','array','of','values'], ); -or- $q->param( -name => 'foo', -value => 'the value', ); =head2 Appending additional values to a named parameter $q->append( -name =>'foo', -values =>['yet','more','values'], ); This adds a value or list of values to the named parameter. The values are appended to the end of the parameter if it already exists. Otherwise the parameter is created. Note that this method only recognizes the named argument calling syntax. =head2 Importing all parameters into a namespace $q->import_names('R'); This creates a series of variables in the 'R' namespace. For example, $R::foo, @R:foo. For keyword lists, a variable @R::keywords will appear. If no namespace is given, this method will assume 'Q'. B: don't import anything into 'main'; this is a major security risk! NOTE 1: Variable names are transformed as necessary into legal perl variable names. All non-legal characters are transformed into underscores. If you need to keep the original names, you should use the param() method instead to access CGI variables by name. In fact, you should probably not use this method at all given the above caveats and security risks. =head2 Deleting a parameter completely $q->delete('foo','bar','baz'); This completely clears a list of parameters. It sometimes useful for resetting parameters that you don't want passed down between script invocations. If you are using the function call interface, use "Delete()" instead to avoid conflicts with perl's built-in delete operator. =head2 Deleting all parameters $q->delete_all(); This clears the CGI object completely. It might be useful to ensure that all the defaults are taken when you create a fill-out form. Use Delete_all() instead if you are using the function call interface. =head2 Handling non-urlencoded arguments If POSTed data is not of type application/x-www-form-urlencoded or multipart/form-data, then the POSTed data will not be processed, but instead be returned as-is in a parameter named POSTDATA. To retrieve it, use code like this: my $data = $q->param('POSTDATA'); Likewise if PUTed and PATCHed data can be retrieved with code like this: my $data = $q->param('PUTDATA'); my $data = $q->param('PATCHDATA'); (If you don't know what the preceding means, worry not. It only affects people trying to use CGI for XML processing and other specialized tasks) PUTDATA/POSTDATA/PATCHDATA are also available via L, and as L via L option. =head2 Direct access to the parameter list $q->param_fetch('address')->[1] = '1313 Mockingbird Lane'; unshift @{$q->param_fetch(-name=>'address')},'George Munster'; If you need access to the parameter list in a way that isn't covered by the methods given in the previous sections, you can obtain a direct reference to it by calling the B method with the name of the parameter. This will return an array reference to the named parameter, which you then can manipulate in any way you like. You can also use a named argument style using the B<-name> argument. =head2 Fetching the parameter list as a hash my $params = $q->Vars; print $params->{'address'}; my @foo = split("\0",$params->{'foo'}); my %params = $q->Vars; use CGI ':cgi-lib'; my $params = Vars(); Many people want to fetch the entire parameter list as a hash in which the keys are the names of the CGI parameters, and the values are the parameters' values. The Vars() method does this. Called in a scalar context, it returns the parameter list as a tied hash reference. Changing a key changes the value of the parameter in the underlying CGI parameter list. Called in a list context, it returns the parameter list as an ordinary hash. This allows you to read the contents of the parameter list, but not to change it. When using this, the thing you must watch out for are multivalued CGI parameters. Because a hash cannot distinguish between scalar and list context, multivalued parameters will be returned as a packed string, separated by the "\0" (null) character. You must split this packed string in order to get at the individual values. This is the convention introduced long ago by Steve Brenner in his cgi-lib.pl module for perl version 4, and may be replaced in future versions with array references. If you wish to use Vars() as a function, import the I<:cgi-lib> set of function calls (also see the section on CGI-LIB compatibility). =head2 Saving the state of the script to a file $q->save(\*FILEHANDLE) This will write the current state of the form to the provided filehandle. You can read it back in by providing a filehandle to the new() method. Note that the filehandle can be a file, a pipe, or whatever. The format of the saved file is: NAME1=VALUE1 NAME1=VALUE1' NAME2=VALUE2 NAME3=VALUE3 = Both name and value are URL escaped. Multi-valued CGI parameters are represented as repeated names. A session record is delimited by a single = symbol. You can write out multiple records and read them back in with several calls to B. You can do this across several sessions by opening the file in append mode, allowing you to create primitive guest books, or to keep a history of users' queries. Here's a short example of creating multiple session records: use strict; use warnings; use CGI; open (my $out_fh,'>>','test.out') || die "Can't open test.out: $!"; my $records = 5; for ( 0 .. $records ) { my $q = CGI->new; $q->param( -name => 'counter',-value => $_ ); $q->save( $out_fh ); } close( $out_fh ); # reopen for reading open (my $in_fh,'<','test.out') || die "Can't open test.out: $!"; while (!eof($in_fh)) { my $q = CGI->new($in_fh); print $q->param('counter'),"\n"; } The file format used for save/restore is identical to that used by the Whitehead Genome Center's data exchange format "Boulderio", and can be manipulated and even databased using Boulderio utilities. See L for further details. If you wish to use this method from the function-oriented (non-OO) interface, the exported name for this method is B. =head2 Retrieving cgi errors Errors can occur while processing user input, particularly when processing uploaded files. When these errors occur, CGI will stop processing and return an empty parameter list. You can test for the existence and nature of errors using the I function. The error messages are formatted as HTTP status codes. You can either incorporate the error text into a page, or use it as the value of the HTTP status: if ( my $error = $q->cgi_error ) { print $q->header( -status => $error ); print "Error: $error"; exit 0; } When using the function-oriented interface (see the next section), errors may only occur the first time you call I. Be ready for this! =head2 Using the function-oriented interface To use the function-oriented interface, you must specify which CGI.pm routines or sets of routines to import into your script's namespace. There is a small overhead associated with this importation, but it isn't much. use strict; use warnings; use CGI qw/ list of methods /; The listed methods will be imported into the current package; you can call them directly without creating a CGI object first. This example shows how to import the B and B methods, and then use them directly: use strict; use warnings; use CGI qw/ param header /; print header('text/plain'); my $zipcode = param('zipcode'); More frequently, you'll import common sets of functions by referring to the groups by name. All function sets are preceded with a ":" character as in ":cgi" (for CGI protocol handling methods). Here is a list of the function sets you can import: =over 4 =item B<:cgi> Import all CGI-handling methods, such as B, B and the like. =item B<:all> Import all the available methods. For the full list, see the CGI.pm code, where the variable %EXPORT_TAGS is defined. (N.B. the :cgi-lib imports will B be included in the :all import, you will have to import :cgi-lib to get those) =back Note that in the interests of execution speed CGI.pm does B use the standard L syntax for specifying load symbols. This may change in the future. =head2 Pragmas In addition to the function sets, there are a number of pragmas that you can import. Pragmas, which are always preceded by a hyphen, change the way that CGI.pm functions in various ways. Pragmas, function sets, and individual functions can all be imported in the same use() line. For example, the following use statement imports the cgi set of functions and enables debugging mode (pragma -debug): use strict; use warninigs; use CGI qw/ :cgi -debug /; The current list of pragmas is as follows: =over 4 =item -no_undef_params This keeps CGI.pm from including undef params in the parameter list. =item -utf8 This makes CGI.pm treat all parameters as text strings rather than binary strings (see L for the distinction), assuming UTF-8 for the encoding. CGI.pm does the decoding from the UTF-8 encoded input data, restricting this decoding to input text as distinct from binary upload data which are left untouched. Therefore, a ':utf8' layer must B be used on STDIN. If you do not use this option you can manually select which fields are expected to return utf-8 strings and convert them using code like this: use strict; use warnings; use CGI; use Encode qw/ decode /; my $cgi = CGI->new; my $param = $cgi->param('foo'); $param = decode( 'UTF-8',$param ); =item -putdata_upload / -postdata_upload / -patchdata_upload Makes C<<< $cgi->param('PUTDATA'); >>>, C<<< $cgi->param('PATCHDATA'); >>>, and C<<< $cgi->param('POSTDATA'); >>> act like file uploads named PUTDATA, PATCHDATA, and POSTDATA. See L and L PUTDATA/POSTDATA/PATCHDATA are also available via L. =item -nph This makes CGI.pm produce a header appropriate for an NPH (no parsed header) script. You may need to do other things as well to tell the server that the script is NPH. See the discussion of NPH scripts below. =item -newstyle_urls Separate the name=value pairs in CGI parameter query strings with semicolons rather than ampersands. For example: ?name=fred;age=24;favorite_color=3 Semicolon-delimited query strings are always accepted, and will be emitted by self_url() and query_string(). newstyle_urls became the default in version 2.64. =item -oldstyle_urls Separate the name=value pairs in CGI parameter query strings with ampersands rather than semicolons. This is no longer the default. =item -no_debug This turns off the command-line processing features. If you want to run a CGI.pm script from the command line, and you don't want it to read CGI parameters from the command line or STDIN, then use this pragma: use CGI qw/ -no_debug :standard /; =item -debug This turns on full debugging. In addition to reading CGI arguments from the command-line processing, CGI.pm will pause and try to read arguments from STDIN, producing the message "(offline mode: enter name=value pairs on standard input)" features. See the section on debugging for more details. =back =head1 GENERATING DYNAMIC DOCUMENTS Most of CGI.pm's functions deal with creating documents on the fly. Generally you will produce the HTTP header first, followed by the document itself. CGI.pm provides functions for generating HTTP headers of various types. Each of these functions produces a fragment of HTTP which you can print out directly so that it is processed by the browser, appended to a string, or saved to a file for later use. =head2 Creating a standard http header Normally the first thing you will do in any CGI script is print out an HTTP header. This tells the browser what type of document to expect, and gives other optional information, such as the language, expiration date, and whether to cache the document. The header can also be manipulated for special purposes, such as server push and pay per view pages. use strict; use warnings; use CGI; my $cgi = CGI->new; print $cgi->header; -or- print $cgi->header('image/gif'); -or- print $cgi->header('text/html','204 No response'); -or- print $cgi->header( -type => 'image/gif', -nph => 1, -status => '402 Payment required', -expires => '+3d', -cookie => $cookie, -charset => 'utf-8', -attachment => 'foo.gif', -Cost => '$2.00' ); header() returns the Content-type: header. You can provide your own MIME type if you choose, otherwise it defaults to text/html. An optional second parameter specifies the status code and a human-readable message. For example, you can specify 204, "No response" to create a script that tells the browser to do nothing at all. Note that RFC 2616 expects the human-readable phase to be there as well as the numeric status code. The last example shows the named argument style for passing arguments to the CGI methods using named parameters. Recognized parameters are B<-type>, B<-status>, B<-expires>, and B<-cookie>. Any other named parameters will be stripped of their initial hyphens and turned into header fields, allowing you to specify any HTTP header you desire. Internal underscores will be turned into hyphens: print $cgi->header( -Content_length => 3002 ); Most browsers will not cache the output from CGI scripts. Every time the browser reloads the page, the script is invoked anew. You can change this behavior with the B<-expires> parameter. When you specify an absolute or relative expiration interval with this parameter, some browsers and proxy servers will cache the script's output until the indicated expiration date. The following forms are all valid for the -expires field: +30s 30 seconds from now +10m ten minutes from now +1h one hour from now -1d yesterday (i.e. "ASAP!") now immediately +3M in three months +10y in ten years time Thursday, 25-Apr-2018 00:40:33 GMT at the indicated time & date The B<-cookie> parameter generates a header that tells the browser to provide a "magic cookie" during all subsequent transactions with your script. Some cookies have a special format that includes interesting attributes such as expiration time. Use the cookie() method to create and retrieve session cookies. The B<-nph> parameter, if set to a true value, will issue the correct headers to work with a NPH (no-parse-header) script. This is important to use with certain servers that expect all their scripts to be NPH. The B<-charset> parameter can be used to control the character set sent to the browser. If not provided, defaults to ISO-8859-1. As a side effect, this sets the charset() method as well. B that the default being ISO-8859-1 may not make sense for all content types, e.g.: Content-Type: image/gif; charset=ISO-8859-1 In the above case you need to pass -charset => '' to prevent the default being used. The B<-attachment> parameter can be used to turn the page into an attachment. Instead of displaying the page, some browsers will prompt the user to save it to disk. The value of the argument is the suggested name for the saved file. In order for this to work, you may have to set the B<-type> to "application/octet-stream". The B<-p3p> parameter will add a P3P tag to the outgoing header. The parameter can be an arrayref or a space-delimited string of P3P tags. For example: print $cgi->header( -p3p => [ qw/ CAO DSP LAW CURa / ] ); print $cgi->header( -p3p => 'CAO DSP LAW CURa' ); In either case, the outgoing header will be formatted as: P3P: policyref="/w3c/p3p.xml" cp="CAO DSP LAW CURa" CGI.pm will accept valid multi-line headers when each line is separated with a CRLF value ("\r\n" on most platforms) followed by at least one space. For example: print $cgi->header( -ingredients => "ham\r\n\seggs\r\n\sbacon" ); Invalid multi-line header input will trigger in an exception. When multi-line headers are received, CGI.pm will always output them back as a single line, according to the folding rules of RFC 2616: the newlines will be removed, while the white space remains. =head2 Generating a redirection header print $q->redirect( 'http://somewhere.else/in/movie/land' ); Sometimes you don't want to produce a document yourself, but simply redirect the browser elsewhere, perhaps choosing a URL based on the time of day or the identity of the user. The redirect() method redirects the browser to a different URL. If you use redirection like this, you should B print out a header as well. You are advised to use full URLs (absolute with respect to current URL or even including the http: or ftp: part) in redirection requests as relative URLs are resolved by the user agent of the client so may not do what you want or expect them to do. You can also use named arguments: print $q->redirect( -uri => 'http://somewhere.else/in/movie/land', -nph => 1, -status => '301 Moved Permanently' ); All names arguments recognized by header() are also recognized by redirect(). However, most HTTP headers, including those generated by -cookie and -target, are ignored by the browser. The B<-nph> parameter, if set to a true value, will issue the correct headers to work with a NPH (no-parse-header) script. This is important to use with certain servers, such as Microsoft IIS, which expect all their scripts to be NPH. The B<-status> parameter will set the status of the redirect. HTTP defines several different possible redirection status codes, and the default if not specified is 302, which means "moved temporarily." You may change the status to another status code if you wish. Note that the human-readable phrase is also expected to be present to conform with RFC 2616, section 6.1. =head2 Creating a self-referencing url that preserves state information my $myself = $q->self_url; print qq(I'm talking to myself.); self_url() will return a URL, that, when selected, will re-invoke this script with all its state information intact. This is most useful when you want to jump around within the document using internal anchors but you don't want to disrupt the current contents of the form(s). Something like this will do the trick: my $myself = $q->self_url; print "See table 1"; print "See table 2"; print "See for yourself"; If you want more control over what's returned, using the B method instead. You can also retrieve a query string representation of the current object state with query_string(): my $the_string = $q->query_string(); The behavior of calling query_string is currently undefined when the HTTP method is something other than GET. If you want to retrieved the query string as set in the webserver, namely the environment variable, you can call env_query_string() =head2 Obtaining the script's url my $full_url = url(); my $full_url = url( -full =>1 ); # alternative syntax my $relative_url = url( -relative => 1 ); my $absolute_url = url( -absolute =>1 ); my $url_with_path = url( -path_info => 1 ); my $url_path_qry = url( -path_info => 1, -query =>1 ); my $netloc = url( -base => 1 ); B returns the script's URL in a variety of formats. Called without any arguments, it returns the full form of the URL, including host name and port number http://your.host.com/path/to/script.cgi You can modify this format with the following named arguments: =over 4 =item B<-absolute> If true, produce an absolute URL, e.g. /path/to/script.cgi =item B<-relative> Produce a relative URL. This is useful if you want to re-invoke your script with different parameters. For example: script.cgi =item B<-full> Produce the full URL, exactly as if called without any arguments. This overrides the -relative and -absolute arguments. =item B<-path> (B<-path_info>) Append the additional path information to the URL. This can be combined with B<-full>, B<-absolute> or B<-relative>. B<-path_info> is provided as a synonym. =item B<-query> (B<-query_string>) Append the query string to the URL. This can be combined with B<-full>, B<-absolute> or B<-relative>. B<-query_string> is provided as a synonym. =item B<-base> Generate just the protocol and net location, as in http://www.foo.com:8000 =item B<-rewrite> If Apache's mod_rewrite is turned on, then the script name and path info probably won't match the request that the user sent. Set -rewrite => 1 (default) to return URLs that match what the user sent (the original request URI). Set -rewrite => 0 to return URLs that match the URL after the mod_rewrite rules have run. =back =head2 Mixing post and url parameters my $color = url_param('color'); It is possible for a script to receive CGI parameters in the URL as well as in the fill-out form by creating a form that POSTs to a URL containing a query string (a "?" mark followed by arguments). The B method will always return the contents of the POSTed fill-out form, ignoring the URL's query string. To retrieve URL parameters, call the B method. Use it in the same way as B. The main difference is that it allows you to read the parameters, but not set them. Under no circumstances will the contents of the URL query string interfere with similarly-named CGI parameters in POSTed forms. If you try to mix a URL query string with a form submitted with the GET method, the results will not be what you expect. If running from the command line, C will not pick up any parameters given on the command line. =head2 Processing a file upload field =head3 Basics When the form is processed, you can retrieve an L compatible handle for a file upload field like this: use autodie; # undef may be returned if it's not a valid file handle if ( my $io_handle = $q->upload('field_name') ) { open ( my $out_file,'>>','/usr/local/web/users/feedback' ); while ( my $bytesread = $io_handle->read($buffer,1024) ) { print $out_file $buffer; } } In a list context, upload() will return an array of filehandles. This makes it possible to process forms that use the same name for multiple upload fields. If you want the entered file name for the file, you can just call param(): my $filename = $q->param('field_name'); Different browsers will return slightly different things for the name. Some browsers return the filename only. Others return the full path to the file, using the path conventions of the user's machine. Regardless, the name returned is always the name of the file on the I machine, and is unrelated to the name of the temporary file that CGI.pm creates during upload spooling (see below). When a file is uploaded the browser usually sends along some information along with it in the format of headers. The information usually includes the MIME content type. To retrieve this information, call uploadInfo(). It returns a reference to a hash containing all the document headers. my $filehandle = $q->upload( 'uploaded_file' ); my $type = $q->uploadInfo( $filehandle )->{'Content-Type'}; if ( $type ne 'text/html' ) { die "HTML FILES ONLY!"; } Note that you must use ->upload or ->param to get the file-handle to pass into uploadInfo as internally this is represented as a File::Temp object (which is what will be returned by ->upload or ->param). When using ->Vars you will get the literal filename rather than the File::Temp object, which will not return anything when passed to uploadInfo. So don't use ->Vars. If you are using a machine that recognizes "text" and "binary" data modes, be sure to understand when and how to use them (see the Camel book). Otherwise you may find that binary files are corrupted during file uploads. =head3 Accessing the temp files directly When processing an uploaded file, CGI.pm creates a temporary file on your hard disk and passes you a file handle to that file. After you are finished with the file handle, CGI.pm unlinks (deletes) the temporary file. If you need to you can access the temporary file directly. You can access the temp file for a file upload by passing the file name to the tmpFileName() method: my $filehandle = $q->upload( 'uploaded_file' ); my $tmpfilename = $q->tmpFileName( $filehandle ); As with ->uploadInfo, using the reference returned by ->upload or ->param is preferred, although unlike ->uploadInfo, plain filenames also work if possible for backwards compatibility. The temporary file will be deleted automatically when your program exits unless you manually rename it or set $CGI::UNLINK_TMP_FILES to 0. On some operating systems (such as Windows NT), you will need to close the temporary file's filehandle before your program exits. Otherwise the attempt to delete the temporary file will fail. =head3 Changes in temporary file handling (v4.05+) CGI.pm had its temporary file handling significantly refactored, this logic is now all deferred to File::Temp (which is wrapped in a compatibility object, CGI::File::Temp - B). As a consequence the PRIVATE_TEMPFILES variable has been removed along with deprecation of the private_tempfiles routine and B removal of the CGITempFile package. The $CGITempFile::TMPDIRECTORY is no longer used to set the temp directory, refer to the perldoc for File::Temp if you want to override the default settings in that package (the TMPDIR env variable is still available on some platforms). For Windows platforms the temporary directory order remains as before: TEMP > TMP > WINDIR ( > TMPDIR ) so if you have any of these in use in existing scripts they should still work. The Fh package still exists but does nothing, the CGI::File::Temp class is a subclass of both File::Temp and the empty Fh package, so if you have any code that checks that the filehandle isa Fh this should still work. When you get the internal file handle you will receive a File::Temp object, this should be transparent as File::Temp isa IO::Handle and isa IO::Seekable meaning it behaves as previously. If you are doing anything out of the ordinary with regards to temp files you should test your code before deploying this update and refer to the File::Temp documentation for more information. =head3 Handling interrupted file uploads There are occasionally problems involving parsing the uploaded file. This usually happens when the user presses "Stop" before the upload is finished. In this case, CGI.pm will return undef for the name of the uploaded file and set I to the string "400 Bad request (malformed multipart POST)". This error message is designed so that you can incorporate it into a status code to be sent to the browser. Example: my $file = $q->upload( 'uploaded_file' ); if ( !$file && $q->cgi_error ) { print $q->header( -status => $q->cgi_error ); exit 0; } =head3 Progress bars for file uploads and avoiding temp files CGI.pm gives you low-level access to file upload management through a file upload hook. You can use this feature to completely turn off the temp file storage of file uploads, or potentially write your own file upload progress meter. This is much like the UPLOAD_HOOK facility available in L, with the exception that the first argument to the callback is an L object, here it's the remote filename. my $q = CGI->new( \&hook [,$data [,$use_tempfile]] ); sub hook { my ( $filename, $buffer, $bytes_read, $data ) = @_; print "Read $bytes_read bytes of $filename\n"; } The C<< $data >> field is optional; it lets you pass configuration information (e.g. a database handle) to your hook callback. The C<< $use_tempfile >> field is a flag that lets you turn on and off CGI.pm's use of a temporary disk-based file during file upload. If you set this to a FALSE value (default true) then $q->param('uploaded_file') will no longer work, and the only way to get at the uploaded data is via the hook you provide. If using the function-oriented interface, call the CGI::upload_hook() method before calling param() or any other CGI functions: CGI::upload_hook( \&hook [,$data [,$use_tempfile]] ); This method is not exported by default. You will have to import it explicitly if you wish to use it without the CGI:: prefix. =head3 Troubleshooting file uploads on Windows If you are using CGI.pm on a Windows platform and find that binary files get slightly larger when uploaded but that text files remain the same, then you have forgotten to activate binary mode on the output filehandle. Be sure to call binmode() on any handle that you create to write the uploaded file to disk. =head3 Older ways to process file uploads This section is here for completeness. if you are building a new application with CGI.pm, you can skip it. The original way to process file uploads with CGI.pm was to use param(). The value it returns has a dual nature as both a file name and a lightweight filehandle. This dual nature is problematic if you following the recommended practice of having C in your code. perl will complain when you try to use a string as a filehandle. More seriously, it is possible for the remote user to type garbage into the upload field, in which case what you get from param() is not a filehandle at all, but a string. To solve this problem the upload() method was added, which always returns a lightweight filehandle. This generally works well, but will have trouble interoperating with some other modules because the file handle is not derived from L. So that brings us to current recommendation given above, which is to call the handle() method on the file handle returned by upload(). That upgrades the handle to an IO::File. It's a big win for compatibility for a small penalty of loading IO::File the first time you call it. =head1 HTTP COOKIES CGI.pm has several methods that support cookies. A cookie is a name=value pair much like the named parameters in a CGI query string. CGI scripts create one or more cookies and send them to the browser in the HTTP header. The browser maintains a list of cookies that belong to a particular Web server, and returns them to the CGI script during subsequent interactions. In addition to the required name=value pair, each cookie has several optional attributes: =over 4 =item 1. an expiration time This is a time/date string (in a special GMT format) that indicates when a cookie expires. The cookie will be saved and returned to your script until this expiration date is reached if the user exits the browser and restarts it. If an expiration date isn't specified, the cookie will remain active until the user quits the browser. =item 2. a domain This is a partial or complete domain name for which the cookie is valid. The browser will return the cookie to any host that matches the partial domain name. For example, if you specify a domain name of ".capricorn.com", then the browser will return the cookie to Web servers running on any of the machines "www.capricorn.com", "www2.capricorn.com", "feckless.capricorn.com", etc. Domain names must contain at least two periods to prevent attempts to match on top level domains like ".edu". If no domain is specified, then the browser will only return the cookie to servers on the host the cookie originated from. =item 3. a path If you provide a cookie path attribute, the browser will check it against your script's URL before returning the cookie. For example, if you specify the path "/cgi-bin", then the cookie will be returned to each of the scripts "/cgi-bin/tally.pl", "/cgi-bin/order.pl", and "/cgi-bin/customer_service/complain.pl", but not to the script "/cgi-private/site_admin.pl". By default, path is set to "/", which causes the cookie to be sent to any CGI script on your site. =item 4. a "secure" flag If the "secure" attribute is set, the cookie will only be sent to your script if the CGI request is occurring on a secure channel, such as SSL. =back The interface to HTTP cookies is the B method: my $cookie = $q->cookie( -name => 'sessionID', -value => 'xyzzy', -expires => '+1h', -path => '/cgi-bin/database', -domain => '.capricorn.org', -secure => 1 ); print $q->header( -cookie => $cookie ); B creates a new cookie. Its parameters include: =over 4 =item B<-name> The name of the cookie (required). This can be any string at all. Although browsers limit their cookie names to non-whitespace alphanumeric characters, CGI.pm removes this restriction by escaping and unescaping cookies behind the scenes. =item B<-value> The value of the cookie. This can be any scalar value, array reference, or even hash reference. For example, you can store an entire hash into a cookie this way: my $cookie = $q->cookie( -name => 'family information', -value => \%childrens_ages ); =item B<-path> The optional partial path for which this cookie will be valid, as described above. =item B<-domain> The optional partial domain for which this cookie will be valid, as described above. =item B<-expires> The optional expiration date for this cookie. The format is as described in the section on the B method: "+1h" one hour from now =item B<-secure> If set to true, this cookie will only be used within a secure SSL session. =back The cookie created by cookie() must be incorporated into the HTTP header within the string returned by the header() method: use strict; use warnings; use CGI; my $q = CGI->new; my $cookie = ... print $q->header( -cookie => $cookie ); To create multiple cookies, give header() an array reference: my $cookie1 = $q->cookie( -name => 'riddle_name', -value => "The Sphynx's Question" ); my $cookie2 = $q->cookie( -name => 'answers', -value => \%answers ); print $q->header( -cookie => [ $cookie1,$cookie2 ] ); To retrieve a cookie, request it by name by calling cookie() method without the B<-value> parameter. This example uses the object-oriented form: my $riddle = $q->cookie('riddle_name'); my %answers = $q->cookie('answers'); Cookies created with a single scalar value, such as the "riddle_name" cookie, will be returned in that form. Cookies with array and hash values can also be retrieved. The cookie and CGI namespaces are separate. If you have a parameter named 'answers' and a cookie named 'answers', the values retrieved by param() and cookie() are independent of each other. However, it's simple to turn a CGI parameter into a cookie, and vice-versa: # turn a CGI parameter into a cookie my $c = cookie( -name => 'answers',-value => [$q->param('answers')] ); # vice-versa $q->param( -name => 'answers',-value => [ $q->cookie('answers')] ); If you call cookie() without any parameters, it will return a list of the names of all cookies passed to your script: my @cookies = $q->cookie(); See the B example script for some ideas on how to use cookies effectively. =head1 DEBUGGING If you are running the script from the command line or in the perl debugger, you can pass the script a list of keywords or parameter=value pairs on the command line or from standard input (you don't have to worry about tricking your script into reading from environment variables). You can pass keywords like this: your_script.pl keyword1 keyword2 keyword3 or this: your_script.pl keyword1+keyword2+keyword3 or this: your_script.pl name1=value1 name2=value2 or this: your_script.pl name1=value1&name2=value2 To turn off this feature, use the -no_debug pragma. To test the POST method, you may enable full debugging with the -debug pragma. This will allow you to feed newline-delimited name=value pairs to the script on standard input. When debugging, you can use quotes and backslashes to escape characters in the familiar shell manner, letting you place spaces and other funny characters in your parameter=value pairs: your_script.pl "name1='I am a long value'" "name2=two\ words" Finally, you can set the path info for the script by prefixing the first name/value parameter with the path followed by a question mark (?): your_script.pl /your/path/here?name1=value1&name2=value2 =head1 FETCHING ENVIRONMENT VARIABLES Some of the more useful environment variables can be fetched through this interface. The methods are as follows: =over 4 =item B Return a list of MIME types that the remote browser accepts. If you give this method a single argument corresponding to a MIME type, as in Accept('text/html'), it will return a floating point value corresponding to the browser's preference for this type from 0.0 (don't want) to 1.0. Glob types (e.g. text/*) in the browser's accept list are handled correctly. Note that the capitalization changed between version 2.43 and 2.44 in order to avoid conflict with perl's accept() function. =item B Returns the HTTP_COOKIE variable. Cookies have a special format, and this method call just returns the raw form (?cookie dough). See cookie() for ways of setting and retrieving cooked cookies. Called with no parameters, raw_cookie() returns the packed cookie structure. You can separate it into individual cookies by splitting on the character sequence "; ". Called with the name of a cookie, retrieves the B form of the cookie. You can use the regular cookie() method to get the names, or use the raw_fetch() method from the CGI::Cookie module. =item B Returns the QUERY_STRING variable, note that this is the original value as set in the environment by the webserver and (possibly) not the same value as returned by query_string(), which represents the object state =item B Returns the HTTP_USER_AGENT variable. If you give this method a single argument, it will attempt to pattern match on it, allowing you to do something like user_agent(Mozilla); =item B Returns additional path information from the script URL. E.G. fetching /cgi-bin/your_script/additional/stuff will result in path_info() returning "/additional/stuff". NOTE: The Microsoft Internet Information Server is broken with respect to additional path information. If you use the perl DLL library, the IIS server will attempt to execute the additional path information as a perl script. If you use the ordinary file associations mapping, the path information will be present in the environment, but incorrect. The best thing to do is to avoid using additional path information in CGI scripts destined for use with IIS. A best attempt has been made to make CGI.pm do the right thing. =item B As per path_info() but returns the additional path information translated into a physical path, e.g. "/usr/local/etc/httpd/htdocs/additional/stuff". The Microsoft IIS is broken with respect to the translated path as well. =item B Returns either the remote host name or IP address if the former is unavailable. =item B Returns the name of the remote user (as returned by identd) or undef if not set =item B Returns the remote host IP address, or 127.0.0.1 if the address is unavailable. =item B Returns the interpreted pathname of the requested document or CGI (relative to the document root). Or undef if not set. =item B Return the script name as a partial URL, for self-referring scripts. =item B Return the URL of the page the browser was viewing prior to fetching your script. =item B Return the authorization/verification method in use for this script, if any. =item B Returns the name of the server, usually the machine's host name. =item B When using virtual hosts, returns the name of the host that the browser attempted to contact =item B Return the port that the server is listening on. =item B Returns the protocol and revision of the incoming request, or defaults to HTTP/1.0 if this is not set =item B Like server_port() except that it takes virtual hosts into account. Use this when running with virtual hosts. =item B Returns the server software and version number. =item B Return the authorization/verification name used for user verification, if this script is protected. =item B Attempt to obtain the remote user's name, using a variety of different techniques. May not work in all browsers. =item B Returns the method used to access your script, usually one of 'POST', 'GET' or 'HEAD'. If running from the command line it will be undef. =item B Returns the content_type of data submitted in a POST, generally multipart/form-data or application/x-www-form-urlencoded =item B Called with no arguments returns the list of HTTP environment variables, including such things as HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, and HTTP_ACCEPT_CHARSET, corresponding to the like-named HTTP header fields in the request. Called with the name of an HTTP header field, returns its value. Capitalization and the use of hyphens versus underscores are not significant. For example, all three of these examples are equivalent: my $requested_language = $q->http('Accept-language'); my $requested_language = $q->http('Accept_language'); my $requested_language = $q->http('HTTP_ACCEPT_LANGUAGE'); =item B The same as I, but operates on the HTTPS environment variables present when the SSL protocol is in effect. Can be used to determine whether SSL is turned on. =back =head1 USING NPH SCRIPTS NPH, or "no-parsed-header", scripts bypass the server completely by sending the complete HTTP header directly to the browser. This has slight performance benefits, but is of most use for taking advantage of HTTP extensions that are not directly supported by your server, such as server push and PICS headers. Servers use a variety of conventions for designating CGI scripts as NPH. Many Unix servers look at the beginning of the script's name for the prefix "nph-". The Macintosh WebSTAR server and Microsoft's Internet Information Server, in contrast, try to decide whether a program is an NPH script by examining the first line of script output. CGI.pm supports NPH scripts with a special NPH mode. When in this mode, CGI.pm will output the necessary extra header information when the header() and redirect() methods are called. The Microsoft Internet Information Server requires NPH mode. As of version 2.30, CGI.pm will automatically detect when the script is running under IIS and put itself into this mode. You do not need to do this manually, although it won't hurt anything if you do. =over 4 =item In the B statement Simply add the "-nph" pragma to the list of symbols to be imported into your script: use CGI qw(:standard -nph) =item By calling the B method: Call B with a non-zero parameter at any point after using CGI.pm in your program. CGI->nph(1) =item By using B<-nph> parameters in the B and B statements: print header(-nph=>1); =back =head1 SERVER PUSH CGI.pm provides four simple functions for producing multipart documents of the type needed to implement server push. These functions were graciously provided by Ed Jordan . To import these into your namespace, you must import the ":push" set. You are also advised to put the script into NPH mode and to set $| to 1 to avoid buffering problems. Here is a simple script that demonstrates server push: #!/usr/bin/env perl use strict; use warnings; use CGI qw/:push -nph/; $| = 1; print multipart_init( -boundary=>'----here we go!' ); for (0 .. 4) { print multipart_start( -type=>'text/plain' ), "The current time is ",scalar( localtime ),"\n"; if ($_ < 4) { print multipart_end(); } else { print multipart_final(); } sleep 1; } This script initializes server push by calling B. It then enters a loop in which it begins a new multipart section by calling B, prints the current local time, and ends a multipart section with B. It then sleeps a second, and begins again. On the final iteration, it ends the multipart section with B rather than with B. =over 4 =item multipart_init() multipart_init( -boundary => $boundary, -charset => $charset ); Initialize the multipart system. The -boundary argument specifies what MIME boundary string to use to separate parts of the document. If not provided, CGI.pm chooses a reasonable boundary for you. The -charset provides the character set, if not provided this will default to ISO-8859-1 =item multipart_start() multipart_start( -type => $type, -charset => $charset ); Start a new part of the multipart document using the specified MIME type and charset. If not specified, text/html ISO-8859-1 is assumed. =item multipart_end() multipart_end() End a part. You must remember to call multipart_end() once for each multipart_start(), except at the end of the last part of the multipart document when multipart_final() should be called instead of multipart_end(). =item multipart_final() multipart_final() End all parts. You should call multipart_final() rather than multipart_end() at the end of the last part of the multipart document. =back Users interested in server push applications should also have a look at the CGI::Push module. =head1 AVOIDING DENIAL OF SERVICE ATTACKS A potential problem with CGI.pm is that, by default, it attempts to process form POSTings no matter how large they are. A wily hacker could attack your site by sending a CGI script a huge POST of many gigabytes. CGI.pm will attempt to read the entire POST into a variable, growing hugely in size until it runs out of memory. While the script attempts to allocate the memory the system may slow down dramatically. This is a form of denial of service attack. Another possible attack is for the remote user to force CGI.pm to accept a huge file upload. CGI.pm will accept the upload and store it in a temporary directory even if your script doesn't expect to receive an uploaded file. CGI.pm will delete the file automatically when it terminates, but in the meantime the remote user may have filled up the server's disk space, causing problems for other programs. The best way to avoid denial of service attacks is to limit the amount of memory, CPU time and disk space that CGI scripts can use. Some Web servers come with built-in facilities to accomplish this. In other cases, you can use the shell I or I commands to put ceilings on CGI resource usage. CGI.pm also has some simple built-in protections against denial of service attacks, but you must activate them before you can use them. These take the form of two global variables in the CGI name space: =over 4 =item B<$CGI::POST_MAX> If set to a non-negative integer, this variable puts a ceiling on the size of POSTings, in bytes. If CGI.pm detects a POST that is greater than the ceiling, it will immediately exit with an error message. This value will affect both ordinary POSTs and multipart POSTs, meaning that it limits the maximum size of file uploads as well. You should set this to a reasonably high value, such as 10 megabytes. =item B<$CGI::DISABLE_UPLOADS> If set to a non-zero value, this will disable file uploads completely. Other fill-out form values will work as usual. =back To use these variables, set the variable at the top of the script, right after the "use" statement: #!/usr/bin/env perl use strict; use warnings; use CGI; $CGI::POST_MAX = 1024 * 1024 * 10; # max 10MB posts $CGI::DISABLE_UPLOADS = 1; # no uploads An attempt to send a POST larger than $POST_MAX bytes will cause I to return an empty CGI parameter list. You can test for this event by checking I, either after you create the CGI object or, if you are using the function-oriented interface, call for the first time. If the POST was intercepted, then cgi_error() will return the message "413 POST too large". This error message is actually defined by the HTTP protocol, and is designed to be returned to the browser as the CGI script's status code. For example: my $uploaded_file = $q->param('upload'); if ( !$uploaded_file && $q->cgi_error() ) { print $q->header( -status => $q->cgi_error() ); exit 0; } However it isn't clear that any browser currently knows what to do with this status code. It might be better just to create a page that warns the user of the problem. =head1 COMPATIBILITY WITH CGI-LIB.PL To make it easier to port existing programs that use cgi-lib.pl the compatibility routine "ReadParse" is provided. Porting is simple: OLD VERSION require "cgi-lib.pl"; &ReadParse; print "The value of the antique is $in{antique}.\n"; NEW VERSION use CGI; CGI::ReadParse(); print "The value of the antique is $in{antique}.\n"; CGI.pm's ReadParse() routine creates a tied variable named %in, which can be accessed to obtain the query variables. Like ReadParse, you can also provide your own variable. Infrequently used features of ReadParse, such as the creation of @in and $in variables, are not supported. Once you use ReadParse, you can retrieve the query object itself this way: my $q = $in{CGI}; This allows you to start using the more interesting features of CGI.pm without rewriting your old scripts from scratch. An even simpler way to mix cgi-lib calls with CGI.pm calls is to import both the C<:cgi-lib> and C<:standard> method: use CGI qw(:cgi-lib :standard); &ReadParse; print "The price of your purchase is $in{price}.\n"; print textfield(-name=>'price', -default=>'$1.99'); =head2 Cgi-lib functions that are available in CGI.pm In compatibility mode, the following cgi-lib.pl functions are available for your use: ReadParse() PrintHeader() SplitParam() MethGet() MethPost() =head1 LICENSE The CGI.pm distribution is copyright 1995-2007, Lincoln D. Stein. It is distributed under the Artistic License 2.0. It is currently maintained by Lee Johnson (LEEJO) with help from many contributors. =head1 CREDITS Thanks very much to: =over 4 =item Mark Stosberg (mark@stosberg.com) =item Matt Heffron (heffron@falstaff.css.beckman.com) =item James Taylor (james.taylor@srs.gov) =item Scott Anguish (sanguish@digifix.com) =item Mike Jewell (mlj3u@virginia.edu) =item Timothy Shimmin (tes@kbs.citri.edu.au) =item Joergen Haegg (jh@axis.se) =item Laurent Delfosse (delfosse@delfosse.com) =item Richard Resnick (applepi1@aol.com) =item Craig Bishop (csb@barwonwater.vic.gov.au) =item Tony Curtis (tc@vcpc.univie.ac.at) =item Tim Bunce (Tim.Bunce@ig.co.uk) =item Tom Christiansen (tchrist@convex.com) =item Andreas Koenig (k@franz.ww.TU-Berlin.DE) =item Tim MacKenzie (Tim.MacKenzie@fulcrum.com.au) =item Kevin B. Hendricks (kbhend@dogwood.tyler.wm.edu) =item Stephen Dahmen (joyfire@inxpress.net) =item Ed Jordan (ed@fidalgo.net) =item David Alan Pisoni (david@cnation.com) =item Doug MacEachern (dougm@opengroup.org) =item Robin Houston (robin@oneworld.org) =item ...and many many more... for suggestions and bug fixes. =back =head1 BUGS Address bug reports and comments to: L See the L file for information on raising issues and contributing The original bug tracker can be found at: L =head1 SEE ALSO L - provides L implementation tailored to the CGI environment. L - supports running CGI applications under FastCGI =cut