460 Posted Topics
Re: 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] | |
Re: [QUOTE]Both of my files are huge[/QUOTE] How big are they? | |
Re: 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] | |
Re: [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 … | |
Re: 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 … | |
Re: add this line anywhere in the script and see if it returns more specifc information about the error: use CGI::Carp qw/fatalsToBrowser/; | |
Re: 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 … | |
| |
Re: 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. | |
Re: did you give up on the other perl forum? [url]http://bytes.com/forum/thread819194.html[/url] | |
Re: the code you posted is not perl, I am not sure after reading your post if you know that or not. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: [CODE]foreach my $name (@required) $name = trim($name); next; }[/CODE] the "next" keyword in the above loop is unecessary. | |
Re: 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". | |
Re: 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'); … | |
Re: 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 … | |
Re: I think he wants to use File::Find to browse all files in all sub folders. | |
Re: 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 … | |
Re: [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 … | |
Re: 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 … | |
Re: Look into [URL="http://search.cpan.org/~phoenix/List-Permutor-0.022/Permutor.pm"]List::Permutor[/URL] | |
Re: 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 … | |
| |
Re: 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). | |
Re: 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. | |
Re: shows us your current code that tries to insert the image. | |
Re: See if anything here helps you: [url]http://search.cpan.org/search?query=Win32%3A%3ATieRegistry&mode=all[/url] | |
Re: print qq{ all your popup code here }; | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: This is not tech support, we don't do peoples work for them unless they show some effort. | |
Re: Like anyone here is supposed to understand your vague requirements? How come you have no idea where to start? | |
Re: 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. | |
Re: post your perl code and post any error messages you get when you run the perl code. | |
Re: WWW:::Mechanize does not support javascript (which is clearly documented in the modules manpage on CPAN). Look into Win32::IE::Mechanize | |
Re: If you want to process the even number indices of an array: for (my $i = 0; $i <= $#array; $i+=2) { | |
Re: Did you have a question? If not, what is the purpose of posting that code? | |
Re: 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. | |
Re: [QUOTE=katharnakh;591892]Post your code.[/QUOTE] Ditto. Post your code. | |
Re: 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 … | |
| |
Re: [CODE]OUTTER: while(<DATA>){ if(m#^/\*#){ while (<DATA>) { next OUTTER if (m#^\*/# ); } } print; } __DATA__ foo bar /* if () { .... ... } */ bash baz[/CODE] | |
Re: 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. | |
Re: 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). | |
Re: [url]http://search.cpan.org/~miyagawa/Email-Find-0.10/lib/Email/Find.pm[/url] You should remove that personal information from your post. |
The End.