You can use @ARGV to pass information into the script ....
Code:#!/usr/bin/perl my $filenumber = scalar(@ARGV); print "You asked me to open $filenumber files";
Hi,
I have this perl script that will parse info from a couple of files.
I could use $filenames = <STDIN>
to ask for the files when it runs but Id like to be able to possibly follow the script by the name fo the files like in bash scripts for example
$> perl parsingscript.pl filename1 filename2 another_value
Is this possible or is it easier to do it w/ a bash script?
thanx,
You can use @ARGV to pass information into the script ....
Code:#!/usr/bin/perl my $filenumber = scalar(@ARGV); print "You asked me to open $filenumber files";
[quote author=Ashcrow link=board=9;threadid=4529;start=0#45316 date=1029005482]
[/quote]Code:#!/usr/bin/perl my $filenumber = scalar(@ARGV); print "You asked me to open $filenumber files";
Code:#!/usr/bin/perl print "And those files are named: "; foreach(@ARGV) { print "$_ "; } print "\n";
Bookmarks