in reply to ARGV Usage
I'd have to agree with andyford. You code is doing the correct thing from a perl perspective:
when called, does:#!/usr/bin/perl use strict; use warnings; my $infile_name = shift( @ARGV ); print $infile_name, "\n";
So are you expecting test.pl to be in the @ARGV array? This is one place where perl differs from other programming languages. @ARGV is not populated with the name of the invoked program (ala C) - that's in the magic variable $0.> ./test.pl foo.txt foo.txt
|
|---|