460 Posted Topics
Re: This thread is three years old surinder oberoi and this forum is for asking perl questions. | |
Re: You have to generate your output while the file is opened and you are processing the data line by line. You generate the output after the file is closed, so naturally you will only ever get the last line of the file. A generic example of one way to do … | |
Re: You need to clarify your question and post any code you have written so far. | |
Re: first check if the module you are using has a method to find the process by name. | |
Re: If you are running the script as a CGI from a browser of course you will not see the html tags. You will see them in the source code, | |
Re: more efficient suggestion: [CODE]my $string = ' Mary had a little lamb. '; $string =~ s/^\s+//; #remove leading spaces $string =~ s/\s+$//; #remove trailing spaces print $string;[/CODE] use the Email::Valid module to check email addresses [url]http://search.cpan.org/~rjbs/Email-Valid-0.176/lib/Email/Valid.pm[/url] | |
![]() | Re: Your output looks like a hash of array of hashes. Try this print $xml_ref->{Photos}->[0]->{photo}->{ownner}; print $xml_ref->{Photos}->[0]->{photo}->{isfriend}; print $xml_ref->{Photos}->[0]->{photo}->{ispublic}; etc etc etc ![]() |
Re: read the file however you want, get the data you want into variables and use the appropriate operators to do the data munging. Where are you stuck? | |
Re: Impossible to say. May have nothing to do with the browser. Third party software, proxies. firewalls, etc, anyone of them might have something to do with any particular problem. | |
Re: aside from any other problems, this line is wrong: push my @alpha_carbon, my $alpha_carbon; You can't declare your variables with "my" during the push() function. You have to predeclare them. Also, $alpha_carbon is not defind, not even initialized, in the code you posted. I don't understand what you are trying … | |
Re: Hi Chris, try this on your 1and1 server: #!/usr/bin/perl print "Content-type: text/html\n\n"; print "Works"; it should work. The CGI module does not have to be loaded to run a CGI script. | |
Re: I have no experience with REST but there are a lot of REST modules listed on CPAN: [url]http://search.cpan.org/search?query=REST&mode=all[/url] maybe you can check through them and see if one or more will be helpful for you. | |
Re: search on script archive sites like [url]www.hotscripts.com[/url] for "file manager" scripts. | |
Re: $clob looks like a reference to a scalar, so try this: print ${$clob},", $str, $num\n"; | |
Re: Post code and sample data. On a side note do not use parenthesis in your print statements: print("$HeaderHash{'Deal Name'}\n"); better written as: print "$HeaderHash{'Deal Name'}\n"; while this is not the source of your problem, using parenthesis with the print command is in general a bad habit to get into. Se … | |
Re: this line: [B]if $celToFah eq "true" {[/B] needs parenthesis: [B]if ($celToFah eq "true") {[/B] | |
Re: It's a poorly written perl script. You would be better off starting from scratch. | |
Re: anyways, why should anyone just correct your code for you even if there is a problem? This is not a code debugging/ script writing service, it's a help forum. | |
Re: [QUOTE=cerf_machine;452758]i thought that the filename is different every iteration of the loop.[/QUOTE] Actually, that was the impression I had too. So you might be correct. Maybe the OP will clarify. | |
Re: plus this question is cross-posted on another perl forum where it has many replies. The OP obviously has no clue, there is no way the code posted would perform division. The forward slashes are strings not operators. | |
Re: search CPAN for RSS modules. I have no specific recommendations. | |
Re: it's probably those smilies in the code..... I don't think perl handles smilies too well...... ;) | |
Re: why are you mixing that terrible form parsing code in with CGI anyway? Use the CGI module to get all the form data, don't mix it with that insecure code you are using. Also, when the script reads the data from STDIN: read(STDIN, $text, $ENV{'CONTENT_LENGTH'}); it empties the buffer, so … | |
Re: It will depend on how your current perl script is coded. Does it use the CGI module? | |
Re: You did not say what output it is giving, but judging by your other thread it just displays the perl code. That means your http server is not setup correctly to run scripts. You need to find a tutorial for the specific http server you are using and find out … | |
Re: You don't want to do this: $md-1 I explained why in your other thread. Where is $x getting defined? | |
Re: Your question is very confusing. I can not understand what date you are trying to convert into another date. But this makes no sense to me: ($md-8) Why are you subtracting 8 from the day of the month? Then later you add 7 days worth of seconds to the date: … | |
Re: You can certainly use the open() command to read a file, any file, as long as your script has permission to open the file. We will assume it does. There are perl modules for reading CSV files too: [url]http://search.cpan.org/~hmbrand/Text-CSV_XS-0.31/CSV_XS.pm[/url] This gets into the "you need to install the module" discussion … | |
Re: ask this question on [url]www.perlmonks.com[/url] where you will get some replies | |
Re: No configuration is necessary. But you will need the DBI module and the mysql drivers. Read the activestate help files for informati0n about using PPM to install modules. The install the DBI module and the mysql drivers. | |
Re: There are a number of currecny formatting modules on CPAN. The are also conversion modules to convert between currencies. If you are simply wanting to format an existing USA monetary value into a fixed format you can role your own function. [CODE]$foo = 1999999.99; print USA_Format($foo); sub USA_Format { (my … | |
Re: I knew I should have copyrighted that script. | |
Re: That is too much code to try and explain what it all does. | |
Re: answer postd on other form to this question | |
Re: You will want to look into WWW::Mechanize if you intend to use perl. [url]http://search.cpan.org/author/PETDANCE/WWW-Mechanize-1.30/lib/WWW/Mechanize.pm[/url] [url]http://search.cpan.org/author/PETDANCE/WWW-Mechanize-1.30/lib/WWW/Mechanize/Examples.pod[/url] [url]http://search.cpan.org/author/PETDANCE/WWW-Mechanize-1.30/lib/WWW/Mechanize/FAQ.pod[/url] There are also some modules written for gathering stock data. [url]http://search.cpan.org/~hampton/Finance-Quote-1.13/lib/Finance/Quote.pm[/url] I have never used any of the above modules so I can't really help much more than I already have. this will most … | |
Re: I understand that you say you have setup Tomcat to run CGI scripts, but it appears you did not set it up correctly. Since this is really a Tomcat configuration issues maybe asking on a Tomcat forum will get you the info you need. Does Tomcat use the ubiquitous cgi-bin? … | |
Re: Why do you even care? But it seems obvious: [QUOTE]B*tch? Thanks for the good laugh![/QUOTE] Does the above rep from you look familiar? | |
Re: I was going to suggest a BEGIN{} block too. Perl will compile a BEGIN{} block as soon a possible so it should work. | |
When I click the link to go to the second page of code snippets in the perl category, I get an error message instead of seeing more code snippets: "No code snippets available with the criteria specified. " | |
Re: I'm pretty sure system() waits until the process ends to return to the perl script. So I doubt your loop is running multiple instances of the process, but it could still be bogging down the computer since you run it over and over. How many loops does it run through? | |
Re: File::Path and the rmtree function sounds like the way to go if you stick with perl. There isn't much o understand, load the module into your scrip: [CODE]use File::Path;[/CODE] and feed the rmtree() function the name of a directory you wat to wipe out. [CODE]rmtree('some_directory');[/CODE] You can probably feed it … | |
Re: You have this question posted on another forum where it has replies. | |
Re: it will be in the http server error logs but most likely will not help much. But look in the apache folder, find the logs folder and find the error file. | |
Re: LWP::UserAgent is good for this type of stuff: [url]http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP/UserAgent.pm[/url] | |
Re: Can we see the script or is this going to be a guessing game? | |
Re: my $unc = '\\\\somebox.somehost.com\someshare'; | |
Re: thats because google does not allow you to do what you are trying to do. If you want to hit google use their API. |
The End.