1748024 Members
3969 Online
108757 Solutions
New Discussion юеВ

Re: Perl issues

 
Paul Coviello
Frequent Advisor

Perl issues

I tried to run this today and got the following error. last week it ran fine. any thoughts?

thanks Paul

perl -"I" emon.pl -c DSA0:[EPIC.BIN4.PERFTOOLS.conf.test]base.conf
Semicolon seems to be missing at dsa0:[epic.bin4.perftools.conf.test]base.conf l
ine 26.
Semicolon seems to be missing at dsa0:[epic.bin4.perftools.conf.test]base.conf l
ine 30.
Semicolon seems to be missing at dsa0:[epic.bin4.perftools.conf.test]base.conf l
ine 34.
Semicolon seems to be missing at dsa0:[epic.bin4.perftools.conf.test]base.conf l
ine 38.
Can't modify concatenation (.) or string in scalar assignment at dsa0:[epic.bin4
.perftools.conf.test]base.conf line 18, near "DSA0:"
syntax error at dsa0:[epic.bin4.perftools.conf.test]base.conf line 18, near "DSA
0:"
dsa0:[epic.bin4.perftools.conf.test]base.conf had compilation errors.
%SYSTEM-F-ABORT, abort
10 REPLIES 10
Craig A Berry
Honored Contributor

Re: Perl issues

Let's review the parameters you are passing and see what it is you really want to do. First of all, the -I (capital i) switch is used for explicitly adding a directory to the library search path. Typical usage would look something like:

$ perl -"Idka0:[stuff.perllib]" myscript.pl

What you have done is add the file "emon.pl" to the beginning of the search list, which makes no sense since emon.pl is not a directory. You can see that this happens by printing out the zeroth element of the @INC array, the built-in array that holds the search list:

$ perl -"I" emon.pl -e "print $INC[0];"
emon.pl

The -c switch instructs perl to do a syntax check but stop short of executing the script. In your case, base.conf is most likely not a Perl script, so of course it has syntax errors when run through the Perl parser.

Without knowing more about emon.pl and base.conf, it's impossible to say for sure what the correct incantation is of the command you are trying to guess at, but I would start by eliminating the command-line switches that clearly don't do what you're expecting. My next two guesses would be:

$ perl emon.pl disk:[dir]base.conf

$ perl emon.pl < disk:[dir]base.conf

If you post emon.pl, better guesses are likely possible (no promises).
Martin P.J. Zinser
Honored Contributor

Re: Perl issues

Hi,

actually another guess

perl -"I" emon.pl -c DSA0:[EPIC.BIN4.PERFTOOLS.conf.test]base.conf

In that case -c would be a commandline switch processed by the script, not by Perl.

Greetings, Martin
Paul Coviello
Frequent Advisor

Re: Perl issues

Craig that isn't an I it is an l, I also tried the commands without the switches, still failed... I'll try to attach both files.

Martin, with or without the dir it gives me the same error...

thanks
Paul
Hein van den Heuvel
Honored Contributor

Re: Perl issues

>> Craig that isn't an I it is an l

Cut & Paste, or a reply shows the difference.
But in the default forum font it is impossible to tell an upper-case-i from a one.

It sure seems like that .conf file is executed as pure perl source. It is not.
If it was perl you'd have to quote those directories and add the missing semicolons on the very lines it complains about.

I'd be tempted to make it happy by changing the .conf file to perl syntax but that would just be trying to hide the real problem. Still, just to see wat happens next.. :-).

So what changed?
A new perl install?
Perl became a verb from a image?
New perl modules installed?
What else did 'not' change?

Hein.
Paul Coviello
Frequent Advisor

Re: Perl issues

Hein, nothing has changed. as I said this worked last week.

can you give an example of what it needs to look like?

thanks
Paul
Craig A Berry
Honored Contributor

Re: Perl issues

Paul,

Knowing that, as Hein says, the l and the I look identical on the forum pages, I copied and pasted from your post, and it definitely has an I, uppercase i, pronounced eye, which doesn't make sense for the reasons I stated before.

If lowercase L, pronounced ell, is what you intended, that's not what's there in the example you provided. I'm not sure why you'd want that, unless it's an attempt to try to handle an improperly transferred script by stripping the line end characters. I would open the script in a text editor and make sure it doesn't have any weird line endings; that could explain why Perl basically ignores the script and processes the data file as if it were a script.

Reading the usage directions in the script, Martin is right and the -c switch is for the script and not for Perl; it just tells the script that the parameter to follow is the name of the conf file to process. I would first try to figure out what's wrong with the script. You may get insight from:

$ perl -wc emon.pl

which will just do a syntax check and print warnings. Once you get past that you should just need:

$ perl emon.pl -c foo.conf

where foo.conf would be replaced by the full name of the file you want to process.
Paul Coviello
Frequent Advisor

Re: Perl issues

ok it is an I, just double/tripled checked. I also was able to run the command and it worked and as far as I know nothing changed.

this is very wierd...

I'm so confused...

I'll keep you posted.

thanks
Paul
Paul Coviello
Frequent Advisor

Re: Perl issues

this doesn't make sense but here goes...
any one want to explain?


set def DSA0:[EPIC.BIN4.PERFTOOLS.BIN]

Directory DSA0:[EPIC.BIN4.PERFTOOLS.BIN]

EAPPSTAT.PL;1 ECOLLECT.PL;1 ECSTAT.PL;1 ECTOP.PL;1
EINTERFSTAT.PL;1 EMON.PL;1 EMWA.PL;1 ESAR.PL;1
EVMSTAT.PL;1

Total of 9 files.
perl -"I" DSA0:[EPIC.BIN4.PERFTOOLS.LIB] ecstat.pl -c DSA0:[EPIC.BIN4.PERFTOOLS.conf.test]base.conf
%DELETE-W-SEARCHFAIL, error searching for DSA0:[EPIC.BIN4.PERFTOOLS.LOG]*.*;
-RMS-E-FNF, file not found
V70REL>

Date Time LocRefs RemRefs GloRefs PhyRead PhyWri Ratio %lS+Ky
07/28/2004 12:58:39 433 0 433 0 0 4440 1.850
07/28/2004 12:58:49 443 0 443 0 1 4578 2.300
07/28/2004 12:58:59 437 0 437 0 1 4448 1.300
07/28/2004 12:59:09 442 0 442 0 1 4550 1.670

V70REL>

-->ecstat.pl|2004-07-28 13:00:10|Mail Sent
Craig A Berry
Honored Contributor

Re: Perl issues

Paul,

It's not clear to me what needs explaining. It looks like the script is running without error and is printing statistics. You are now passing a directory name to the -"I" switch, and that makes sense; it was the absence of a directory there in your original post that was odd. You are also now running a different script (ecstat.pl instead of emon.pl) which may or may not make any difference.