Hi all,

I am using a script which takes various command line options, does some zipping activities and publish a log file of what is has zipped.

arguments:

zip_contents.pl -u content_name -s c:\contetn_path -u content_flag -m content.sender@mail

When the log file is created I want that the given command line inputs are also written there for reference, to see later on what were the commands applied.

How can it be done?

Recommended Answers

All 2 Replies

$0 -> Gives the perl file name.
@ARGV -> Holds the arguments values.

use the above variable in your code and write the log file

print "\nCommand Line Option used : $0 @ARGV";

Thanks Muthu.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.