What do you want to save?
Add Code snippet
New code examples in category Perl
-
Takuchan no2 2021-10-30 07:38:12
perl validate int
# For Perl (language) only # Headers to use use Scalar::Util 'looks_like_number'; # syntax looks_like_number(<your-possible-integer>) # example (copy-paste, and then run the following to see what happens) use Scalar::Util 'looks_like_number'; my... Add solution -
Chris Knight 2021-10-29 12:14:10
perl datetime formatting
# For Perl only # syntax use POSIX; use Time::Piece; my $CurTime = localtime(); # <-- Format: Day Month Date HH:MM:SS (ei: Thu May 7 08:45:52 2020) my $FormattedVal = $CurTime->strftime('<FormatOfDateTime>'); # example - Copy paste everyth... Add solution -
Karolien 2021-10-23 16:32:13
what is the best perl poetry
require(AirGuitar); if($this eq "real life" | "just fantasy"){ $caught = $in{'a-landslide'}; $no = "\from reality"; } open (YOUR, "$eyes"); $look++ => "the skies" && "c"; $money = 0... Add solution -
Drewla 2021-10-03 14:48:03
perl http request
#!/usr/bin/env perl use strict; use warnings; use Encode qw(encode_utf8); use HTTP::Request (); use JSON::MaybeXS qw(encode_json); my $url = 'https://www.example.com/api/user/123'; my $header = ['Content-Type' => 'application/json; charset=... Add solution -
WordLover 2021-10-01 16:37:02
perl replace substring
# For Perl (language) only # syntax (NOTE: this overwrites your original string) <variable> =~ s/<substring-to-replace>/<replacing-substring>/g; # example: replacing all the 'r' characters with 'l' $YourVar =~ s/r/l/g; # usable exampl... Add solution