Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -Mwarnings -e '(a,b,c,d,e,f) = [line.split()[i] for i 
    +in (0,1,3,5,7,9)]'
    Bareword "line" not allowed while "strict subs" in use at -e line 1.
    syntax error at -e line 1, near ")["
    Execution of -e aborted due to compilation errors.
    
  2. or download this
    $ perl -E '$_ = " a0 a1 a2 \n"; my ($x, @y) = split; say "|$x|@y|";'
    |a0|a1 a2|
    ...
    
    $ perl -E '$_ = " a0 a1 a2 \n"; my ($x, @y) = split /\s+/; say "|$x|@y
    +|";'
    ||a0 a1 a2|
    
  3. or download this
    my @wanted = (extraction_function($string))[0, 1, 3];
    my ($f1, $f2, undef, $f3) = extraction_function($string);