When running perltidy on windows i get the following error. I
uninstalled/reinstalled from PPM and looked at the perltidy site but no
luck.
Any ideas ?
D:\Perl\bin>perl perltidy -b foo.pl
Subroutine Cwd::cwd redefined at D:/Perl/lib/Cwd.pm line 518.
Subroutine Cwd::getcwd redefined at D:/Perl/lib
I have a program that generates a random number between 1 and 6. based on
the outcome I want to run a subroutine that corresponds to the result.
i.e if the result is 1 then the program should run sub F1. my question is
how can I dynamically call the subroutine.
i tried this but obviously it didn't
greets to Peter Scott for pointing to Randal Schwartz's answer on C.L.P.M.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=86hds1fa6n.fsf%40blue.stonehenge.com
[SOLUTION]
use List::Util from CPAN
http://search.cpan.org/~gbarr/Scalar-List-Utils-1.14/lib/List/Util.pm
basically you use the
Hi,
(reposting this since i did not see the original in my newsreader or google)
I want to generate 10 numbers from 1..15 and put them in an array.
easy ?
while ($fill < 10){
$foo = int(rand(15));
unshift(@array, $foo);
$fill++;
}
print "the [EMAIL PROTECTED] is --> @array\n";
my problem is
Hi,
I want to generate 10 numbers from 1..15 and put them in an array.
easy ?
while ($fill < 10){
$foo = int(rand(15));
unshift(@array, $foo);
$fill++;
}
print "the [EMAIL PROTECTED] is --> @array\n";
my problem is that many times the numbers repeat themselves in the array.
how can i generat
Hi,
Newbie here. I am writing a program that takes a file that has two columns
of words, extracts the second column, then saves the original file with only
the data in the first column.
Question #1 - would it be better to do this w/ the split or s/// functions ?
Question #1 - how do I write back