Help for this page

Select Code to Download


  1. or download this
    $ alias perle
    alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E
    +'
    
  2. or download this
    chomp(my $ok = <>),
    
  3. 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.
    
  4. or download this
    $ perl -MO=Deparse -e 'chomp(my $in = <>), say $in;'
    chomp(my $in = readline ARGV), $in->say;
    -e syntax OK
    
  5. or download this
    print "do you want to remove <alt> tags Y/N \n";
    
  6. or download this
    my $ok = <>
    
  7. 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
    
  8. or download this
    print "do you want to remove <alt> tags Y/N \n";
    chomp(my $ok = <>),
    my $yes = 'y';
    my $no = 'n';
    
  9. or download this
    $inp =
    
  10. or download this
    lc($ok)
    
  11. or download this
    if ($inp eq $yes) {...} elsif ($inp eq $no) {...}
    
  12. or download this
    if (fc($ok) eq fc($yes)) {
        print "Removing ...\n";
    ...
    else {
        print "No removal.\n";
    }
    
  13. or download this
    sub RemoveAltTag($)
    
  14. or download this
    my $doc = shift;
    
  15. or download this
    for(my $i = 0;$i < $nodes->getLength(); $i++)
    
  16. or download this
    for my $i (0 .. $end) { ... }