460 Posted Topics

Member Avatar for satimis

This thread is three years old surinder oberoi and this forum is for asking perl questions.

Member Avatar for KevinADC
0
197
Member Avatar for kahaj

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 …

Member Avatar for kahaj
0
129
Member Avatar for kahaj

You need to clarify your question and post any code you have written so far.

Member Avatar for kahaj
0
107
Member Avatar for ratul
Member Avatar for BobUillean
0
125
Member Avatar for dr_substance

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,

Member Avatar for eggi
0
156
Member Avatar for kahaj

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]

Member Avatar for masijade
0
103
Member Avatar for susuoi

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

Member Avatar for susuoi
0
119
Member Avatar for kahaj

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?

Member Avatar for KevinADC
0
99
Member Avatar for SergioQ

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.

Member Avatar for KevinADC
0
117
Member Avatar for MojoS

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 …

Member Avatar for MojoS
0
119
Member Avatar for leathan

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.

Member Avatar for xmassey
0
337
Member Avatar for Rao veerla

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.

Member Avatar for kfacets
0
118
Member Avatar for hippomg

search on script archive sites like [url]www.hotscripts.com[/url] for "file manager" scripts.

Member Avatar for KevinADC
0
79
Member Avatar for andrewkl
Member Avatar for KevinADC
0
182
Member Avatar for ranadheer

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 …

Member Avatar for masijade
0
122
Member Avatar for kahaj

this line: [B]if $celToFah eq "true" {[/B] needs parenthesis: [B]if ($celToFah eq "true") {[/B]

Member Avatar for KevinADC
0
130
Member Avatar for ranadheer
Member Avatar for KevinADC
0
136
Member Avatar for sunil_kumar

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.

Member Avatar for KevinADC
0
98
Member Avatar for pkraop

[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.

Member Avatar for KevinADC
0
2K
Member Avatar for padmaja_3

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.

Member Avatar for KevinADC
0
80
Member Avatar for stupidenator
Member Avatar for trudge
0
162
Member Avatar for brendaky

it's probably those smilies in the code..... I don't think perl handles smilies too well...... ;)

Member Avatar for KevinADC
0
134
Member Avatar for sickly_man

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 …

Member Avatar for KevinADC
0
129
Member Avatar for toptier

It will depend on how your current perl script is coded. Does it use the CGI module?

Member Avatar for toptier
0
117
Member Avatar for kahaj

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 …

Member Avatar for KevinADC
0
108
Member Avatar for kahaj
Member Avatar for prashant.jnu
Member Avatar for DaveHammer

You don't want to do this: $md-1 I explained why in your other thread. Where is $x getting defined?

Member Avatar for KevinADC
0
112
Member Avatar for DaveHammer

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: …

Member Avatar for KevinADC
0
94
Member Avatar for DaveHammer

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 …

Member Avatar for DaveHammer
0
142
Member Avatar for osirus0830

ask this question on [url]www.perlmonks.com[/url] where you will get some replies

Member Avatar for osirus0830
0
78
Member Avatar for cancer10

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.

Member Avatar for KevinADC
0
45
Member Avatar for EnderX

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 …

Member Avatar for KevinADC
0
98
Member Avatar for zswong
Member Avatar for Syakoban
Member Avatar for akash_msrit
Member Avatar for chandrag
Member Avatar for jvisprime

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 …

Member Avatar for chandrag
0
128
Member Avatar for nmm32

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? …

Member Avatar for nmm32
0
207
Member Avatar for christina>you

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?

Member Avatar for jbennet
0
116
Member Avatar for richip

I was going to suggest a BEGIN{} block too. Perl will compile a BEGIN{} block as soon a possible so it should work.

Member Avatar for masijade
0
484
Member Avatar for KevinADC

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. "

Member Avatar for KevinADC
0
70
Member Avatar for kxh29

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?

Member Avatar for KevinADC
0
88
Member Avatar for jammalg

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 …

Member Avatar for KevinADC
0
117
Member Avatar for belhifet
Member Avatar for masijade
0
81
Member Avatar for EnderX

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.

Member Avatar for EnderX
0
122
Member Avatar for ithelp

LWP::UserAgent is good for this type of stuff: [url]http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP/UserAgent.pm[/url]

Member Avatar for devesh9392
0
119
Member Avatar for devesh9392
Member Avatar for devesh9392
0
147
Member Avatar for roswell1329
Member Avatar for devesh9392

thats because google does not allow you to do what you are trying to do. If you want to hit google use their API.

Member Avatar for devesh9392
0
697

The End.