print operand file name 
Author Message
 print operand file name

I've recently developed a script to validate simple macro commands.  This
script may be run on as many as 200 files at once (macro_valid.pl *).
Currently it prints only the errors detected (no way to tell which errors go
with which filename).  I need a way to print the filename when an error is
detected.  Possibly some way to read the filename into input, and print it
if an error is detected.  Any suggestions?


Tue, 29 Nov 2005 04:17:59 GMT  
 print operand file name

Quote:

> I've recently developed a script to validate simple macro commands.  This
> script may be run on as many as 200 files at once (macro_valid.pl *).
> Currently it prints only the errors detected (no way to tell which errors go
> with which filename).  I need a way to print the filename when an error is
> detected.  Possibly some way to read the filename into input, and print it
> if an error is detected.  Any suggestions?

 From perlvar:

$ARGV

contains the name of the current file when reading from <>.

--
   Simon Oliver



Tue, 29 Nov 2005 08:26:11 GMT  
 print operand file name

Quote:

> I've recently developed a script to validate simple macro commands.  This
> script may be run on as many as 200 files at once (macro_valid.pl *).
> Currently it prints only the errors detected (no way to tell which errors go
> with which filename).  I need a way to print the filename when an error is
> detected.  Possibly some way to read the filename into input, and print it
> if an error is detected.  Any suggestions?

There is an error on line 17.

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Tue, 29 Nov 2005 13:13:22 GMT  
 print operand file name

Quote:
> I've recently developed a script to validate simple macro commands.  This
> script may be run on as many as 200 files at once (macro_valid.pl *).
> Currently it prints only the errors detected (no way to tell which errors go
> with which filename).  I need a way to print the filename when an error is
> detected.  Possibly some way to read the filename into input, and print it
> if an error is detected.  Any suggestions?

See "perldoc perlvar" for $ARGV.  It may or may not be what you want.

Vague question, vague answer...

Anno



Fri, 02 Dec 2005 12:33:31 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. want better way to extract file name from full path file name

2. array names same as file names

3. Three Operand Conditional Operator

4. Null right hand comma operand in hash assignment

5. Is evaluation of printf operands left-to-right?

6. Regex: operand could be empty

7. ?? How to print to 2 files with one print command

8. Atomic named pipe print?

9. printing variable name

10. Can I print names of associations?

11. print name of var

12. Get the name from the passwd and then print it :)

 

 
Powered by phpBB® Forum Software