Forum: Java 16 Days Ago |
| Replies: 2 Views: 177 Every Java program needs a class defined in the file. You can define more than one class in a file and atleast one class as public and its name should be that of the file. In that public class you... |
Forum: Java 16 Days Ago |
| Replies: 4 Views: 209 java.io.FileNotFoundException: File1.txt (The system cannot find the file specified)
the specified path to file is not correct. Java is not able to find the file in the path given which you want to... |
Forum: Python 18 Days Ago |
| Replies: 5 Views: 269 Below are some mistakes you are doing,
1. calling reorder() without any args, in print fuction.
2. you cannot refer a char at a[a+b] which you are doing it in for loop in the reorder fuction,... |
Forum: Perl 19 Days Ago |
| Replies: 2 Views: 277 what line:13, 14 and 15 supposed to have on the initial loop? |
Forum: Perl 19 Days Ago |
| Replies: 2 Views: 410 Hi,
is your cron job created for the same usr as you use to run the script? If yes, in my opinion, the env variables should get assigned with new values. Also note that these env variables you set... |
Forum: Perl Sep 23rd, 2009 |
| Replies: 1 Views: 418 you are returning from the &fname as soon as you enter the function. So your function is not executing till end of the function.
You have two return statements in your function. Learn how to write... |
Forum: Java Sep 10th, 2009 |
| Replies: 3 Views: 246 If your shell does not understand javac command, you might want to add path to your javac in your PATH env variable.
katharnakh. |
Forum: Perl Sep 10th, 2009 |
| Replies: 3 Views: 792 i don't know whether we have any switch to specify mem allocation for the program when running the program in perl. May be some else who know can suggest here.
katharnakh. |
Forum: Perl Sep 10th, 2009 |
| Replies: 3 Views: 792 Hi,
Well as you said your system has enough resource, i dont find any idea why it is failing. As far as my understanding goes the way you read file is line-by-line which is recommended to follow in... |
Forum: Perl May 18th, 2009 |
| Replies: 5 Views: 576 Hi,
1. If you are not able find what is going on when running command from perl, it is better to run the SAME command, used in the code, in your shell by yourself and check. Eg: from above. useradd... |
Forum: Perl May 15th, 2009 |
| Replies: 3 Views: 558 Hi,
Sorry in the first code i posted there was an error, $v in if statement should be $sub_str.
You have to understand the pattern of the string, little try would have got you what you want. Below... |
Forum: Perl May 13th, 2009 |
| Replies: 1 Views: 463 hi,
You might want to assign values if your @row has something. Though, sometimes query executes fine and returns nothing your @row will be an empty array.
#...
@row = $query->fetchrow_array();... |
Forum: Perl May 13th, 2009 |
| Replies: 3 Views: 558 Hi,
Try this..
my $string = 'Lake City 84132, USA. FAU - Carrell, D T AU - Carrell DT FAU - Emery, B R AU - Emery BR
';
foreach my $sub_str(split(/, /, $string)){
print $1,"\n" if($v =~... |
Forum: Perl May 13th, 2009 |
| Replies: 4 Views: 825 Hi,
You can obviously use path to your shell script run. Rather than changing the directory. `/path/to/your/script.sh`
Hope this helps.
katharnakh. |
Forum: Perl Nov 25th, 2008 |
| Replies: 3 Views: 770 print "$1, $2, $3", $/ if ($line =~ /(\w+)=(\".+?\"|\'.+?\'|.+)\s*(#.*|)/);
katharnakh. |
Forum: Perl Nov 25th, 2008 |
| Replies: 3 Views: 2,069 Hi,
I would recommend you to define a method in Parse.pl and use it in your client script which requires parsing. For eg.
#caller.pl
require 'Parse.pl';
#...
# call method parse_me(for eg.) in... |
Forum: Perl Sep 26th, 2008 |
| Replies: 4 Views: 2,063 With Net::SSH::Perl you can execute commands remotely.
katharnakh. |
Forum: Perl Sep 15th, 2008 |
| Replies: 3 Views: 771 Hi,
Two points to consider,
1. In your code, you are opening 'ParsedLog.txt' two times. One before entering for loop in R or read mode and second inside for loop in A or append mode.
Instead... |
Forum: Perl Sep 15th, 2008 |
| Replies: 3 Views: 967 :icon_smile: nice catch Kevin |
Forum: Perl Sep 6th, 2008 |
| Replies: 1 Views: 887 the error clearly says syntax error in sql statement, try running the same query in you query browser and check, correct the syntax there and try to implement the correction after that. It should not... |
Forum: Perl Aug 29th, 2008 |
| Replies: 2 Views: 1,545 |
Forum: Perl Aug 28th, 2008 |
| Replies: 2 Views: 1,545 Hi,
Background:
I have task of calculating dependencies of project(s) of a scenario. Dependency calculation is done using an external command. Since this dependency calculation time depends on how... |
Forum: Perl Jun 26th, 2008 |
| Replies: 4 Views: 4,117 use strict;
use warnings;
use Cwd;
use DirHandle;
my $folder = 'C:\Perl5.8.8\site\lib\File';
my $dh = DirHandle->new($folder);
while(defined(my $val = $dh->read)){
print "\nDirectory:... |
Forum: Perl Jun 26th, 2008 |
| Replies: 12 Views: 2,097 :) i agree.
I think you should try trial version...
katharnakh. |
Forum: Perl Jun 26th, 2008 |
| Replies: 1 Views: 898 First you need to go through this (http://www.daniweb.com/forums/thread70467.html) thread, in my opinion. As Kevin was replying to your earlier post it is nothing to do with Perl as such, only thing... |
Forum: Perl Jun 26th, 2008 |
| Replies: 12 Views: 2,097 Both.
Not necessarily, in komodo you can edit Perl, Python, ruby... but you need to set interpreter(in case of perl) path. I like interactive shell(Perl) the most, where i can test something on... |
Forum: Perl Jun 25th, 2008 |
| Replies: 7 Views: 1,625 I think you would have missed the comment made in the code posted by me. my point was was simple,
%h = {a=>undef};
if (exists $h{a}){
if($h{a}){
print $h{a};
}else{
print 'Key exists,... |
Forum: Perl Jun 24th, 2008 |
| Replies: 7 Views: 1,625 One another thing forgot to mention in the last post, the way you check for existence of a key in hash(phonebook) is not right way. Because if you take this eg: then will come to know
my %h =... |
Forum: Perl Jun 24th, 2008 |
| Replies: 7 Views: 1,625 add chomp($nama); after line 14. Because, you need to remove whitespaces(i.e, new-line character in this case) after you take input from keyboard.
Also you need to lexically scope $nama scalar. my... |
Forum: Perl Jun 9th, 2008 |
| Replies: 3 Views: 1,342 Ok, what's your try?
Go through perldoc perlrequick for getting quick hands on regular expression and perldoc perl for finding help on different help topics.
BTW, Its not a place to get your... |
Forum: Perl Jun 9th, 2008 |
| Replies: 3 Views: 1,342 Hi,
You can use HTML::Parser module to parse html files. You can download the same here (http://search.cpan.org/dist/HTML-Parser/).
Also you can go through this... |
Forum: Perl Jun 4th, 2008 |
| Replies: 6 Views: 1,174 What server you are using to run your .pl file? As far as i know, diff. web servers require to keep files in diff. hierarchy of folders in server installation path. For eg.(in Apache web server) you... |
Forum: Perl May 23rd, 2008 |
| Replies: 9 Views: 3,038 There is a compare_text() method which compares lines of two files. It takes two filehandles and a reference to subroutine. In that sub-routine we can define how we want the comparison, i.e,... |
Forum: Perl May 22nd, 2008 |
| Replies: 9 Views: 3,038 Use File::Compare module to compare two files or contents of two files. Go through the help doc. of this module, first and try.
Without knowing what values you want to compare and how to... |
Forum: Perl May 19th, 2008 |
| Replies: 6 Views: 1,511 I assume READFILE is valid file handle. Because the above code does not show how you are opening file or what is READFILE.
while ($ch = getc(READFILE))
{
++$character_count;
if ($ch eq "?"... |
Forum: Perl May 19th, 2008 |
| Replies: 8 Views: 1,154 Hi,
First go through this (http://www.daniweb.com/forums/announcement112-3.html).
Probably not. Because, from your code it is clear that you are opening your old_data1.txt in 'append'(from your... |
Forum: Perl May 15th, 2008 |
| Replies: 8 Views: 1,154 Hi,
Please go through this (http://www.daniweb.com/forums/announcement112-3.html), before posting your code. Its not an assignment, just a prerequisite if you want to get really quick help.
Only... |
Forum: Perl May 15th, 2008 |
| Replies: 1 Views: 638 Its not true.
If you want to come out of execution for some reason, you can use exit(0) function in the program, which is a premature exit...
It is just a guess... there should be... |
Forum: Perl May 15th, 2008 |
| Replies: 2 Views: 866 for($j=0; $j<=100; $j++){
<do the expression> unless($j%2);
}
If you are doing some mathematical operation with the expression i think you want to re-check whether loop should start from 0.
... |
Forum: Java May 6th, 2008 |
| Replies: 10 Views: 1,388 Thanks a lot Masijade, i will look into it.
katharnakh. |