On Dec 17, 2007 10:19 AM, ciwei2103 <[EMAIL PROTECTED]> wrote:
> Can somebody enlighten me what I'm doing wrong?
>
> I have a list in a file , "test.dat"
>
> sh> cat test1.dat
> 0039
> 0038
>
> sh> cat test1.pl
> #!/usr/bin/perl -w
> use strict;
> my $input = $ARGV[0];
>
> my @devices = <$input>
Maybe tell us what you are trying to do?
Try this:
> #!/usr/bin/perl -w
> use strict;
> my $input = $ARGV[0];
# File handle
my $FH;
# Check the file is a normal file and exists
die "File does not exist\n" if not -f $input;
# Open the file handle for read only, file named by $input
# Or die and
On 12/17/07, ciwei2103 <[EMAIL PROTECTED]> wrote:
> Can somebody enlighten me what I'm doing wrong?
> my $input = $ARGV[0];
>
> my @devices = <$input> ;
$input is a string, since it comes from @ARGV; but you're using it as
if it's a filehandle. Do you need open()? Hope this helps!
--Tom Phoen