Can't use subscript in angle brackets

2005-05-25 Thread Tielman Koekemoer \(TNE\)
Hi all, Why can't I use a subscript in the angle brackets? e.g. @files=`ls /app2/koekemtn/scripts/dbstats/test`; chomp $files[0]; open ( $files[0] , $files[0]) || die Cannot open $files[0]\n; while ($files[0]) { print $_; } TIA

Re: Can't use subscript in angle brackets

2005-05-25 Thread John W. Krahn
Tielman Koekemoer (TNE) wrote: Hi all, Hello, Why can't I use a subscript in the angle brackets? e.g. @files=`ls /app2/koekemtn/scripts/dbstats/test`; chomp $files[0]; open ( $files[0] , $files[0]) || die Cannot open $files[0]\n; while ($files[0]) { print $_; } perldoc perlop

RE: Can't use subscript in angle brackets

2005-05-25 Thread Tielman Koekemoer \(TNE\)
Thanks for the help. So I cannot use an array or hash in angle brackets as file handle. I have a variable amount of files which I'd like opened and the contents shuffled. What would be the best way to do this as my next idea also did not work? _BEGIN_ @files=`ls

Re: Can't use subscript in angle brackets

2005-05-25 Thread Ing. Branislav Gerzo
Tielman Koekemoer (TNE) [TK], on Wednesday, May 25, 2005 at 10:32 (+0200) typed the following: TK $file$num = $line; # Problem assignment! use hash instead scalar variables; $file{$num} is OK. First you have to ofcourse declare it: my %file = (); -- How do you protect mail on web? I

Re: Can't use subscript in angle brackets

2005-05-25 Thread Xavier Noria
On May 25, 2005, at 10:32, Tielman Koekemoer ((TNE)) wrote: Thanks for the help. So I cannot use an array or hash in angle brackets as file handle. I have a variable amount of files which I'd like opened and the contents shuffled. What would be the best way to do this as my next idea also did

RE: Can't use subscript in angle brackets

2005-05-25 Thread Thomas Bätzler
Hi, Tielman Koekemoer (TNE) [EMAIL PROTECTED] asked: Thanks for the help. So I cannot use an array or hash in angle brackets as file handle. I have a variable amount of files which I'd like opened and the contents shuffled. What would be the best way to do this as my next idea also did

RE: Can't use subscript in angle brackets

2005-05-25 Thread Jeff 'japhy' Pinyan
On May 25, Tielman Koekemoer (TNE) said: Thanks for the help. So I cannot use an array or hash in angle brackets as file handle. I have a variable amount of files which I'd like opened and the contents shuffled. What would be the best way to do this as my next idea also did not work?

Re: Can't use subscript in angle brackets

2005-05-25 Thread Dave Gray
foreach my $file ( @ARGV ){ if( my $fh = new IO::File $file ){ # Be explicit[1] if (my $fh = IO::File-new($file)) { push @infh, $fh; } else { die Failed to open input file '$file': $!; } } [1] http://www.perl.com/doc/manual/html/pod/perlobj.html#WARNING -- To unsubscribe,