Help for this page

Select Code to Download


  1. or download this
    $one = substr($in, 23, 15);
    $two = substr($in, 28, 10);
    
  2. or download this
    $ perl -we'sub foo { print $_[0] } eval { foo(substr "abc", 4, 1); 1} 
    +or die "croak: $@"'
    croak: substr outside of string at -e line 1.
    
  3. or download this
    $in =~ /^  (?=.{23}(.{15}))   # field one
               (?=.{28}(.{10}))   # field two
           /xs
       or warn "bad input: $in ";