Hello all! First time poster, and essentially first time visitor to the site
I've been using perl for development for around 8 years now, and was doing a fair amount of VB / ASP programming before that. I took a few (2, and one was really a SQL class, not a java class) classes in Java during my undergraduate degree, but never really got into it. Now I'm heading back to school for my Masters (since my employer will pay for the school, and pay me more if I get the masters) but I must say, I'm finding the obligated intro to java classes very frustrating as it seems most things I want to do that would be one line in perl are awkword in Java.
So, lets start with the questions, shall we?
First -- is there a Java resource like perl's cpan.org out there? When I'm looking to do something new, all I'm generally interested in is a short code snippet to do what I want to do, and the oracle docs are extremely verbose and not a ""3 second solution".
Second -- array declaration and management. Is there a java equavilent to something like this:
@temp = split("\s+",$line);
I'm running into issues dynamically creating and assigning values to arrays in java.
Third -- Hashes. There are times where I want a dynamically named variable to contain a value, in this case, I would use a hash in perl, like this:
foreach $line(<FILE>) {
@temp = split("\s",$line);
foreach $word (@temp) {
$wordCount{"$word"}++;
}
}
The above example even covers some file handling that seems oddly difficult in Java as compared to perl, but I think I'm doing it right.
Any discussion is appreciated, and I'm sure I'll have more as I keep working on java. Thanks for reading this far!
I've been using perl for development for around 8 years now, and was doing a fair amount of VB / ASP programming before that. I took a few (2, and one was really a SQL class, not a java class) classes in Java during my undergraduate degree, but never really got into it. Now I'm heading back to school for my Masters (since my employer will pay for the school, and pay me more if I get the masters) but I must say, I'm finding the obligated intro to java classes very frustrating as it seems most things I want to do that would be one line in perl are awkword in Java.
So, lets start with the questions, shall we?
First -- is there a Java resource like perl's cpan.org out there? When I'm looking to do something new, all I'm generally interested in is a short code snippet to do what I want to do, and the oracle docs are extremely verbose and not a ""3 second solution".
Second -- array declaration and management. Is there a java equavilent to something like this:
@temp = split("\s+",$line);
I'm running into issues dynamically creating and assigning values to arrays in java.
Third -- Hashes. There are times where I want a dynamically named variable to contain a value, in this case, I would use a hash in perl, like this:
foreach $line(<FILE>) {
@temp = split("\s",$line);
foreach $word (@temp) {
$wordCount{"$word"}++;
}
}
The above example even covers some file handling that seems oddly difficult in Java as compared to perl, but I think I'm doing it right.
Any discussion is appreciated, and I'm sure I'll have more as I keep working on java. Thanks for reading this far!