what is a soft reference? what is a bareword? why is strict disallowing a compile here.... When I comment out strict the syntax checks outs as ok!??? how do I display each element # with its corresponding data line, b/c I only want certain elements printed out?
I'll leave these to some Guru who knows what he is talking about, but I think I can say why strict is disallowing a compile...
thank you!
# Set pragma
use strict;
use warnings; #It just makes things easier... #Use always, or nearly. use diagnostics; #It answers questions... #Use until comfortable that you know #what it will tell you.
&tsm_critical_servers;
# Declare sub
sub tsm_critical_servers {
my $crout="/tmp/critical_servers.out";
# Make system call for data gathering
system ("dsmadmc -id=menu -password=xxxxxx 'q event * * begind=-1 begint=15:30 endd=today endtime=now' > $crout");
# Create array and read in each line as a seperate element
open (CRITICALSERVERS, "$crout") || die "can't open file \n: $!"; while ( defined($line = <CRITICALSERVERS>) ) {
Right here. You've never told the compiler what $line is before. 'strict' doesn't like that, though it is technically legal Perl.
Make that: my $line; while ( defined($line = <CRITICALSERVERS>) ) {
chomp ($line); my @tsm = <CRITICALSERVERS>; foreach $_ (@tsm) { print $_; } } close (CRITICALSERVERS); }
I think that will get you going.
Daniel T. Staal
--------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>