- or download this
$ alias perle
alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
+'
- or download this
chomp(my $ok = <>),
- or download this
$ 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.
- or download this
$ perl -MO=Deparse -e 'chomp(my $in = <>), say $in;'
chomp(my $in = readline ARGV), $in->say;
-e syntax OK
- or download this
print "do you want to remove <alt> tags Y/N \n";
- or download this
my $ok = <>
- or download this
# This dies:
$ perle 'print "Query (Y/N): "; chomp(my $in = <>); say $in;' some_arg
...
$ perle 'print "Query (Y/N): "; chomp(my $in = <STDIN>); say $in;' som
+e_arg
Query (Y/N): y
y
- or download this
print "do you want to remove <alt> tags Y/N \n";
chomp(my $ok = <>),
my $yes = 'y';
my $no = 'n';
- or download this
$inp =
- or download this
lc($ok)
- or download this
if ($inp eq $yes) {...} elsif ($inp eq $no) {...}
- or download this
if (fc($ok) eq fc($yes)) {
print "Removing ...\n";
...
else {
print "No removal.\n";
}
- or download this
sub RemoveAltTag($)
- or download this
my $doc = shift;
- or download this
for(my $i = 0;$i < $nodes->getLength(); $i++)
- or download this
for my $i (0 .. $end) { ... }