Home > Archive > PERL Beginners > August 2004 > Error: Can't modify subroutine entry in scalar assignment at script.pl line 165, near
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Error: Can't modify subroutine entry in scalar assignment at script.pl line 165, near
|
|
|
| I have this code and receive the message "Can't modify subroutine
entry in scalar assignment at script.pl line 165, near "$_;" " when
running on perl, version 5.005_03 but not when running on perl version
v5.6.1, I know the easiest answer would be to upgrade the older verson
of perl but I have NO control over that.
Is there a change I can make for this to work on 5.005.03 as well.
I appreciate your help:
$conmsg=("Agent is now connected");
$disconmsg=("Agent is now disconnected");
foreach (@logarray)
{
our $msg = $_; #this is line 165.
if ($msg=~ "$conmsg")
{
$flag="TRUE"
}
if ($msg=~ "$disconmsg")
{
$flag="FALSE"
}
}
if ($flag eq "FALSE")
{ system("echo Please check $filein. The following message
was found: $disconmsg. |mail -s \"$0 - $sysName\"
username\@host.com");
print"An error was found, an email has been sent. \n";
exit(1);
}
seane@us.ibm.com (seane) wrote in message news:<6634fdf1.0408020641.5b9f9b4e@posting.google.com>...[color=darkred]
> OK you ever spell check a document and you are so far off that spell
> check has no idea what you are trying to spell????
>
> That's what I feel like here.. Am I that far off base?
> What I have here works it's just not exactly what I want...
>
> At the end of the script running; I basically want to know if the
> agent is still connected or has it disconnected, sometimes it will
> drop connection but then reconnect on it's own and each event will
> write to the log.
>
> Any pointers/suggestions would be appreciated.
>
>
>
>
> seane@us.ibm.com (seane) wrote in message news:<6634fdf1.0407281010.2f825f8b@posting.google.com>...
>
>
|
|
|
|
|