This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SOURCE="npx zenn preview" | |
export DIR="~/Zenn" # 各自のディレクト名にリネームしてください。 | |
if [[ "$(uname)" = "Darwin" ]] && [[ -z "$ON_NEW_TERMINAL" ]] && [[ -z "$NO_NEW_TERMINAL" ]] ; then | |
osascript -e " | |
tell application \"Terminal\" | |
do script \"cd $DIR && $SOURCE\" in window 1 | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature qw(say); | |
say "Firstly, what is returned with defined()?"; | |
say "At line ", __LINE__ + 1, ", if it is defined, ", | |
( local $_ = defined 1 ) ? "true: '$_'" : "false '$_'"; | |
say "At line ", __LINE__ + 1, ", if it is undef, ", | |
( local $_ = defined undef ) ? "true: '$_'" : "false '$_'"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature qw(say); | |
say "## scalars ##"; # スカラは通る | |
say "---- omitted ----", my $empty; # 省略 | |
if ( defined $empty ) { | |
die "it's defined! You are Liar!"; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.008_009; # because Module::CoreList was first released with perl v5.8.9 | |
#use strict; # this line is irrelevant | |
#use warnings; # this line is irrelevant | |
use feature qw(say); | |
#use FastGlob qw(glob); # this line is irrelevant | |
my @modules = qw(Encode FastGlob CGI Dummy); | |
#local @INC = qw(lib); # this line is irrelevant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>form test</title> | |
</head> | |
<body> | |
<form name="test" method="GET" action=""> | |
<input type="email" name="1stEmail"/><br/> | |
<input type="hidden" name="2ndEmail" value="" readonly/><br/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use feature qw(say); | |
package Some; | |
no strict; # to access to ${::,}; | |
use warnings; | |
local $, = ','; # ${Some::,} is ',' now? | |
say ${::,} || 'nothing'; # 'nothing' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use feature qw(say); | |
use strict; | |
use warnings; | |
package Some; | |
our $n = 100; | |
sub say_n { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use feature qw(say); | |
use strict; | |
#use warnings; | |
our $n = 0; | |
for ( local our $n = 0; $n < 10; $n++ ) { | |
say $n; | |
} | |
#0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use feature qw(say); | |
use strict; | |
use warnings; | |
for ( local our $n = 0; $n < 10; $n++ ) { | |
say $n; | |
} | |
#0 | |
#1 |
NewerOlder