in reply to Re: Why doesn't this work?
in thread Why doesn't this work?

*Bingo*. That was it! *doh!* <palmslaps self>

Replies are listed 'Best First'.
Re^3: Why doesn't this work?
by LanX (Saint) on Apr 12, 2013 at 22:35 UTC
    maybe shorter?

    DB<178> open $fh,"<",\"1\0 2\0 3" DB<179> print scalar do {local $/="\0"; () = <$fh> } 3

    update
    as one liner
    perl -e '$/="\0"; print $a=()=<>'

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      Even shorter:
      {local $/="\0"; () = <$fh>; print $.}
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ