in reply to mix arguments with normal input

The diamond operator reads from STDIN only when there are no parameters to the script, otherwise it reads line by line the files specified as parameters one by one. That's the behaviour of the default magic ARGV filehandle.

You have to options:

  1. Remove the two filenames from the array
    my ($input1, $input2) = splice @ARGV, 0, 2; # Make sure no arguments +are left.
  2. Specify that you don't want to read from the magic ARGV handle but standard input:
    $inputinside = <STDIN>;

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: mix arguments with normal input
by Lotus1 (Vicar) on Sep 28, 2018 at 14:56 UTC

    Another way to remove from @ARGV is

    my ($input1, $input2) = (shift,shift);

    I realize you know this but since this is a new to Perl type question I'll throw in this option.

      What?! No splice!? :P

      my ( $one, $two ) = splice @ARGV, 0, 2;
Re^2: mix arguments with normal input
by bofinken (Initiate) on Sep 28, 2018 at 17:42 UTC
    Cheers! Pat yourself on your head. Wonderful. So easy, yet so very helpful. Enjoy life and thanks again!