I have a file in perl that has a constructor
#!/usr/bin/perl
package ConfigFileReader;
sub new {
my ($mode, $configFileName) = @ARGV;
print $mode;
print $configFileName;
}
I know that passing a parameter to a perl script is like
helloworld.pl arg1 arg2 argN
Now, how can I call the constructor new{} from the command line? BTW I am calling the perl file in a shell script.
#!/bin/bash
x=`helloworld.pl arg1 arg2 argN`;
echo $x;
1 Answer