G'day
Why am I getting the following two errors from the script fragment below?
The argument "www4.mh.xxxx.co.uk.logstatsto20090610.gz" is not numeric in division (/) on line 56
The argument "/logs/xxxx/200906/mcs0.telhc/borg2" is not numeric in division (/) on line 56
The $ dir and $ log variables are both strings, and the concatenation of two strings along with a slash in the middle is also wrapped in quotation marks.
foreach my $dir (@log_dirs) { foreach my $log (@log_list) { line 56: if ( -s "$dir/$log" ) { push(@logs, $dir/$log); } } }
Edit: Line 56 is definitely an if statement. However, Paul, you are correct, surrounding the division of the line 57 with quotes, fixes the problem. Thanks.
Edit: Line 56 of Perl version reports
stats@fs1 :/var/tmp/robertw> /usr/local/perl/bin/perl -v This is perl, v5.6.1 built for sun4-solaris Copyright 1987-2001, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. stats@fs1 :/var/tmp/robertw>
Edit: Although using the interpolated string method in Perl, given that the variables themselves are strings, and I'm trying to combine them with a slash, is not a concatenation of the result string.
amuses
source share