460 Posted Topics

Member Avatar for cardician

I would read the file line by line instead of trying to make a single regexp that tries to do too much. [code] while(<>){ if (/^([a-zA-Z]{0,2}\d+)/) { my $id = $1; # now get the title/source/text in this block # and write to a new file } } [/code]

Member Avatar for KevinADC
0
97
Member Avatar for SNN
Member Avatar for SNN
0
95
Member Avatar for lil_panda

You install the module or use the lib pragma to run the module from @INC without actually installing it. I don't know how you install modules on a MAC, maybe you use the CPAN shell. You can read the "lib" pragmas documentation online: [url]http://perldoc.perl.org/lib.html[/url]

Member Avatar for KevinADC
0
94
Member Avatar for barteled

[QUOTE=Lamer980;663921]Yep, there is a limit to the amount of GET data. If my memeory servers my well, it's 255 bytes (characters). I'm not sure if this is before or after url encoding. With that amount of data, I suggest going either to a form with POST data, or writing some …

Member Avatar for KevinADC
0
108
Member Avatar for kahaj

Well, if you mean the action attribute of the form tag, thats not the way to go about it. One way is to include a hidden form field with the name of the subroutine you want to run: <input type=hidden name=action value=new> after parsing the form data check the value …

Member Avatar for KevinADC
0
87
Member Avatar for hhheng

add this line anywhere in the script and see if it returns more specifc information about the error: use CGI::Carp qw/fatalsToBrowser/;

Member Avatar for KevinADC
0
199
Member Avatar for kahaj

You should use one script to handle the entire process. But, writing CGI scripts is not a good idea for a person that seems to not have any experience and probably does not understand even the basics of writing secure CGI scripts. I suggest you hire a programmer, one that …

Member Avatar for kahaj
0
144
Member Avatar for bgbiplab
Member Avatar for w0h0m

I nominate you for forum cross-poster of the month award. Thats three perl forums so far I have seen this same question posted on.

Member Avatar for Major Major
0
152
Member Avatar for ramesh54

did you give up on the other perl forum? [url]http://bytes.com/forum/thread819194.html[/url]

Member Avatar for dwks
0
97
Member Avatar for PoovenM

the code you posted is not perl, I am not sure after reading your post if you know that or not.

Member Avatar for PoovenM
0
232
Member Avatar for kahaj

replace these lines: [CODE]#create page print <<endHtml;[/CODE] replace with: [CODE]#create page print header; print <<endHtml;[/CODE] "header" is a function of the CGI modules ":standard" functions and will print the http header which is required before printing anything else to the browser. I could have sworn I already told you that …

Member Avatar for kahaj
0
109
Member Avatar for Didiera

looks like you are on Windows, so I assume you are using activeperl. For that you use the PPM application to install modules. Read the activeperl documentation for instructions on using PPM. There is no compling involved.

Member Avatar for Didiera
0
757
Member Avatar for raul15791

You should not use numbered scalar variables in your perl programs, $1 and $2 and etc are used internally by perl for pattern memory and are read only. If you have meta characters in your array elements just use the \Q option to escape them: $foo =~ /\Q$bar/; stuff like …

Member Avatar for raul15791
0
141
Member Avatar for muppetjones

It appears you are just running out of memory. Where the error occurs is here: symmetryfinder.pl line 183 Your regexp does not appear to be valid. I don't think you can run code inside a regexp like that. Maybe it is something new with perl 6 I am not aware …

Member Avatar for KevinADC
0
139
Member Avatar for Scruffstone

[CODE]foreach my $name (@required) $name = trim($name); next; }[/CODE] the "next" keyword in the above loop is unecessary.

Member Avatar for KevinADC
0
118
Member Avatar for raul15791

I think the problem is your use of 'wanted2' as the name for the callback function. I think it has to be 'wanted'. Just use "wanted" and ignore the warning about "sub wanted redefined".

Member Avatar for raul15791
0
154
Member Avatar for Scruffstone

CGI scripts must return something to the browser, at minimum that would be an HTTP header. The header must also be printed before anything else gets printed back to the browser. [CODE]#!/usr/bin/perl use CGI qw(:standard); print header; #<-- prints the http header using the CGI module my $button_value = param('name'); …

Member Avatar for Scruffstone
0
53
Member Avatar for kahaj

Do you have an http server installed on your XP machine and perl? You can install and configure the apache http server on your XP box and run your perl based CGI scripts. If you want to get your two boxes communicating you will have to network them and setup …

Member Avatar for KevinADC
0
329
Member Avatar for raul15791
Member Avatar for raul15791
0
154
Member Avatar for raul15791

What you want is an IDE, a good free one is Perl Express [url]http://www.perl-express.com/[/url] I think its only for Windows operating systems. Install activeperl from [url]www.activestate.com[/url] then use the IDE to run write and run your perl scripts. I believe you can also use it as just an editor if …

Member Avatar for KevinADC
0
204
Member Avatar for raul15791

[QUOTE=katharnakh;633467]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 [code=Perl] my %h = (a=>undef); if ($h{a}){print $h{a};} # this way you check, but …

Member Avatar for KevinADC
0
192
Member Avatar for katharnakh

At best the url is just wrong, you left out the cgi folder in the path: [url]http://localhost/cgi/hello.cgi[/url] At worst your server is not setup correctly, but I know nothing of Tomcat, which is not a perl topic anyway, but an http server question. The fact you can't run the perl …

Member Avatar for KevinADC
0
1K
Member Avatar for sugaprem
Member Avatar for KevinADC
0
45
Member Avatar for Scruffstone

javascript and perl are two entirely different things. Perl has no concept of javascript and the same is true in reverse. What you need to do is a send some data to your perl script via a CGI form and use that data to tell your perl script what to …

Member Avatar for Scruffstone
0
234
Member Avatar for asda71
Member Avatar for prashant.jnu
Member Avatar for Scruffstone

If the directory and file are correct, I have no idea why perl can't open the file. There is no CHMOD on Windows servers (that I am aware of).

Member Avatar for Scruffstone
0
149
Member Avatar for massfo

the exec() function in perl never returns to the perl script. Once you use it your perl script is exited. Ask on [url]www.perlmonks.com[/url] if you do not get the answer on this forum.

Member Avatar for KevinADC
0
75
Member Avatar for suresh82
Member Avatar for function

See if anything here helps you: [url]http://search.cpan.org/search?query=Win32%3A%3ATieRegistry&mode=all[/url]

Member Avatar for KevinADC
0
79
Member Avatar for Syakoban
Member Avatar for scuba183

start with a simple script. Use a form with one text field: 'test'. [CODE]#!/usr/bin/perl use warnings; use strict; use CGI qw(:standard); print header; print start_html; print param('test'); print end_html;[/CODE] if that still crashes then your install of perl is bad or is maybe a non standard distribution.

Member Avatar for KevinADC
0
120
Member Avatar for Anilbrp

the problem with this is that your perl script will continue running in the background. Maybe that's not a problem for your application though. You can use system() or exec() or qx// or backtiks ``. Anyone of thses will open a notepad window. Since windows is almost always (or maybe …

Member Avatar for samarudge
0
2K
Member Avatar for ejazcyberia

Nobody here is going to debug your script. If it does not work describe what is not working and any error messages you get. Then [I]maybe[/I] someone can try and help.

Member Avatar for ejazcyberia
0
156
Member Avatar for ibroxy

This is not tech support, we don't do peoples work for them unless they show some effort.

Member Avatar for KevinADC
0
94
Member Avatar for prakasnisha

Like anyone here is supposed to understand your vague requirements? How come you have no idea where to start?

Member Avatar for Major Major
0
223
Member Avatar for jephthah

Emotional attachment? Perl is a good language, that is why people continue to use it. People will stop using it when it no longer serves a purpose. That will not be for a long time I suspect.

Member Avatar for Major Major
0
262
Member Avatar for prakasnisha

post your perl code and post any error messages you get when you run the perl code.

Member Avatar for prakasnisha
0
102
Member Avatar for ze-m!nd

WWW:::Mechanize does not support javascript (which is clearly documented in the modules manpage on CPAN). Look into Win32::IE::Mechanize

Member Avatar for KevinADC
0
126
Member Avatar for SNN

If you want to process the even number indices of an array: for (my $i = 0; $i <= $#array; $i+=2) {

Member Avatar for KevinADC
0
57
Member Avatar for rampicos

Did you have a question? If not, what is the purpose of posting that code?

Member Avatar for KevinADC
0
132
Member Avatar for wizard_bro

There is no urgent help here. All questions have the same priority: none. If you want help you need to post your code, describe in detail the problems you are having and post any error messages you are getting. Then if someone wants to help you they will.

Member Avatar for KevinADC
0
137
Member Avatar for rysin

[QUOTE=katharnakh;591892]Post your code.[/QUOTE] Ditto. Post your code.

Member Avatar for rysin
0
115
Member Avatar for godevars

There are a lot of array handling modules that do this kind of work already. But you could use a hash of arrays and give the keys any value you wanted that would associate it with the respective array. You could also use the grep() function because arrays can be …

Member Avatar for katharnakh
0
2K
Member Avatar for mank
Member Avatar for rayscosmic

[CODE]OUTTER: while(<DATA>){ if(m#^/\*#){ while (<DATA>) { next OUTTER if (m#^\*/# ); } } print; } __DATA__ foo bar /* if () { .... ... } */ bash baz[/CODE]

Member Avatar for KevinADC
0
159
Member Avatar for mimsc

Look in the HTTP::Request modules documentation and see if has some authentication method. Or look in the documentation of other modules your script might use, like LWP or LWP::Simple or whatever.

Member Avatar for KevinADC
0
93
Member Avatar for godevars

this creates an array, not a hash: ($temp1, $temp2) = split (/,/, $_); $words[$temp1]= $temp2 actually unless $temp1 is a number it should not create anything. This would create a hash: ($temp1, $temp2) = split (/,/, $_); $words{$temp1}= $temp2 Your code used [] (array indices) instead of {} (hash keys).

Member Avatar for trudge
0
135
Member Avatar for devesh9392

[url]http://search.cpan.org/~miyagawa/Email-Find-0.10/lib/Email/Find.pm[/url] You should remove that personal information from your post.

Member Avatar for KevinADC
0
162

The End.