Hi,
For anything more complex than a simple script you should
consider using switches and parameters.
You know, something like this [highly dangerous] dd
command:
dd if=/dev/zero of=/dev/hda7 count=1 bs=512
Or:
tar -zxvf archive.tar.gz
Processing these can be quite hard, but guess what... th
>
>
>But how could I take two arguments from the command line:
>
>i.e. my guess:
>
>%Test.pl "Foo" "Bar"
>
>#/!/usr/bin/perl
> $A = $ARGV[0];
> $B = $ARGV[1];
> print "Thing A: $A Thing B: $B";
>
I think you already answered your own question! Though your shebang
line should be "
Hello all.
I want to be able to take the file name in as an argument of the function,
for example:
%Extract.pl MyFile.txt
I know that I could use:
#!/usr/bin/perl
while (<>) {
}
But how could I take two arguments from the command line:
i.e. my guess:
%Test.pl "Foo" "B