I
Ishmael
I'd like to store a variable across separate function calls from the
command line.
For example, I now have this code:
--- myfunction.pl ----
#!/usr/bin/perl
my $num = 0;
print "$num\n";
$num++;
-------------------------
I would like the value of $num to be stored 'statically', so it is
initialized only the first time the function is called and incremented
every time thereafter. Is there some keyword that will allow me to do
this?
Thanks for your help!
command line.
For example, I now have this code:
--- myfunction.pl ----
#!/usr/bin/perl
my $num = 0;
print "$num\n";
$num++;
-------------------------
From the command line, I type:
perl myfunction.pl
I would like the value of $num to be stored 'statically', so it is
initialized only the first time the function is called and incremented
every time thereafter. Is there some keyword that will allow me to do
this?
Thanks for your help!