$ alias perle
alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E'
####
chomp(my $ok = <>),
####
$ perle 'print "Query (Y/N): "; chomp(my $in = <>), say $in;'
Global symbol "$in" requires explicit package name (did you forget to declare "my $in"?) at -e line 1.
Execution of -e aborted due to compilation errors.
at -e line 1.
####
$ perl -MO=Deparse -e 'chomp(my $in = <>), say $in;'
chomp(my $in = readline ARGV), $in->say;
-e syntax OK
####
print "do you want to remove tags Y/N \n";
####
my $ok = <>
####
# This dies:
$ perle 'print "Query (Y/N): "; chomp(my $in = <>); say $in;' some_arg
Can't open some_arg: No such file or directory at -e line 1.
Use of uninitialized value $in in chomp at -e line 1.
Use of uninitialized value $in in say at -e line 1.
Query (Y/N):
# This allows input:
$ perle 'print "Query (Y/N): "; chomp(my $in = ); say $in;' some_arg
Query (Y/N): y
y
####
print "do you want to remove tags Y/N \n";
chomp(my $ok = <>),
my $yes = 'y';
my $no = 'n';
####
$inp =
####
lc($ok)
####
if ($inp eq $yes) {...} elsif ($inp eq $no) {...}
####
if (fc($ok) eq fc($yes)) {
print "Removing ...\n";
RemoveAltTag($some_doc_variable);
}
else {
print "No removal.\n";
}
####
sub RemoveAltTag($)
####
my $doc = shift;
####
for(my $i = 0;$i < $nodes->getLength(); $i++)
####
for my $i (0 .. $end) { ... }