460 Posted Topics
| |
Re: Thats not really enough information but try making the match non-greedy by adding '?': (\w:\\.*?\.\w{3}) | |
Re: That is far from a beginners perl project. Makes no sense you would get a project like that and apparently have no idea how to even start. Step one: Read the CGI modules documentation. | |
Re: Do you understand what the error means? "Can't call method "SaveAs" on an undefined value at Y:/In/FileReport.pl line 183." You have created an object in the perl script at some point that did not return a true value, something like: my $object = FOO->new; then you are trying to use … | |
Re: [url]http://search.cpan.org/search?query=facebook&mode=all[/url] | |
Re: There is no way to know why the download was slow, that has nothing to do with PPM. Either the downlaod site was busy or your DSL providor was busy or your computer might have been overloaded doing other things. PPM does have its negative side but also a positive … | |
Re: Some input data would also be nice. | |
Re: THere is no one size fits all answer. Depends on your overall requirements not just the part you posted. Can perl do what you asked about? I am sure it can. Would it be easy? Not if you don't know any perl. | |
Re: There are other ways, but here is one: [CODE]my $string = 'address=no+3%2C+oxford+street'; (my $key,$value) = split(/=/,$string); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; print $value;[/CODE] | |
Re: The standard way is to use the CGI modeule that comes with perl. [url]http://perldoc.perl.org/CGI.html[/url] | |
Daniweb.... please remove all the stupid comments posted by sultan6928 in this code snippet: [url]http://www.daniweb.com/code/snippet631.html[/url] Thanks | |
Re: Yes, with perl this should not be a problem although it does help to properly declare variables within the intended scope of their use using "my", "our", or "local" when and where appropriate. As ithelp has said, in perl they are called references. They are mostly used to create complex … | |
Re: My vote for: Most confusing question of the year award. | |
Re: When you use print, you should quote strings. print reverse <>, "history.txt > history_rev.txt\n"; On the other hand, if you are expecting perl to know those are input and output files you must not have been awake in perl class. ;) | |
Re: You need to install DBI and DBD::mysql. Open the activestate/activeperl folder that was created on the hard drive when you install activeperl and open the documentation. Read the PPM directions which is what you use to install and manage modules with activeperl. Then see this thread on another forum: [url]http://bytes.com/forum/thread840298-install+dbd%3A%3Amysql.html[/url] | |
Re: [QUOTE=ealion;729768]1. I can't get a stable and full version of Perl. 2. Need help in developping an FTP application and INVOICING application under PERL. Tx.[/QUOTE] You can get perl from many sources, there is no reason to not be able to get a working distribution of perl. If you need … | |
Re: Kelicula, the thread is over a year old..... PS: i added a comment to both of your recent code snippets if you are interested. | |
Re: "it doesn't work" is too vague. Any error messages? What does it do? Is Mail::Sendmail installed? Use code tags to post code. | |
Re: with a CGI script it often means you tried to print something to the screen or perl tried to print something to the screen, like an error message, before the http header was printed. See your other thread, that is probably where the error is occuring. You had the shebang … | |
Re: Activeperl is perl, it is the compiler. The biggest difference, I guess, is that Windows does not use the shebang line to find perl. You open a text editor and write some perl code and save it to your hard drive. To run it open a DOS windows and at … | |
Re: Don't bother, they have been given the answer on another forum: [url]http://www.perlguru.com/gforum.cgi?post=32920[/url] | |
Re: If you're using Windows you would use activestate activeperl (see Salems post above), its the easiest way to get perl on your windows computer. If you want to do CGI script you may also want to install an HTTP server. Apache is free ([url]www.apache.org[/url]) or you can try using your … | |
Re: This is wrong: <FORM ACTION="http://cgi-bin/xxxx.cgi" method=POST> probably should be: <FORM ACTION="cgi-bin/xxxx.cgi" method=POST> You also need a </select> tag: <SELECT NAME="Type"> <OPTION VALUE="c_fah">Convert from Celsius to Fahrenheit<BR/> <OPTION VALUE="f_cel">Convert from Fahrenheit to Celsius<BR/> </SELECT> besides that it looks like the script should work. | |
Re: What data do you pass into the function? Which module are you using that imports the timegm() function? | |
Re: This is the perl forum mate. Post in the shell scripting forum. | |
Re: The short answer is no. Perl has no builtin function that checks if a character is an alpha character. | |
Re: You have this same incomprehensible question on several perl forums. I assume English is not your native language, but you still have to ask a question that we can understand. Besides telling you to read the CGI.pm documentation like you have been told on two forums, there is no way … | |
Re: You have this posted on too many forums for me to want to help you. You should also try and do your own school work. | |
Re: [CODE]opendir (DIR, "path/name of directory") or die "$!"; while(my $file = readdir(DIR)) { next if ($file eq '.' || $file eq '..'); open (my $FH, "path/name of directory/$file") or print "$!\n"; while (my $line = <$FH>) { do something with $line } close $FH; } } closedir DIR;[/CODE] | |
Re: [QUOTE=PPP1;704112]Hello, Please tell me the form of Perl.[/QUOTE] high on the ends, low in the middle. | |
Re: Yes, it sounds possible if I understand your question. A programing language would be useless if it were unable to read/write to files. | |
Re: @branch is an array of arrays in the perl code. It is a global variable in the above code, but global only to that perl script. Its a lexical variable that is scoped to the entire script so in essence it is global, but still only global to that script. … | |
Re: [CODE]open (IN, "filename.pdb") or die "$!"; while (my $line = <IN>) { chomp($line); my @array = (split(/\s+/,$line))[6,7,8]; print "@array\n"; } close (IN);[/CODE] Look into perls math operators for the distance calculations. The above just shows an example of how to get the last three columns from a line with 9 … | |
Re: Have you looked at Net::SFTP or Net::SFTP::Util ? | |
Re: opendir() [url]http://perldoc.perl.org/functions/opendir.html[/url] | |
Re: You could try using a reference to a function. [CODE]sub some_function { print "foo"; } my $some_function = \&some_function;[/CODE] You can pass $some_function like any other scalar, but you need to use the arrow operator to run the function. [CODE]$some_function->()[/CODE] Assuming you pass references to functions to your sub rotuine: … | |
Re: grep is OK in this situation because you have to search the entire file. grep uses "$_ =~ m/pattern/" internally to search for the pattern. When you say search for multiple things in the file, how does the user input those multiple things? You have to tell the user something … | |
Re: this is the perl forum, not the php forum. | |
Re: Is there more than one line with "free disk space" in the file? | |
Re: This guy posted on a number of forums and already has a solution, he will not be coming back here to read your response. | |
Re: Do you have some perl code you need help with? | |
Re: post some sample input data and desired output data. If you want to continue with awk you should take this discussion to an awk forum. Perl has very similar command line syntax to awk and could be done as a command line/one-liner if you really wanted to do that. one-liners … | |
Re: You seem to have skipped the basics of perl. The biggest problem is using single-quotes around your scalar variables, which will not interpolate them but treat them as literal strings. You almost never quote a lone scalar variable anyway. Assuming $data[0] and $data[1] are properly defined: [CODE]my %stuff = (); … | |
Re: "pack" and "unpack" have lots of templates used for this type of conversion of one thing into another thing. I don't know if they can do what you want, but that is a starting place anyway. | |
Re: Sorry, I have no experience using threads. If you get no further replies here ask on [url]www.perlmonks.com[/url] | |
Re: Some people on this forum are like that, but I am not a student nor am I from a second-world country, although it is debateable since the USA is going down the tubes pretty fast. | |
Re: Open an editor and start writing code and testing the results is how you start. School work? | |
![]() | Re: [url]http://www.perlmonks.com/index.pl?node=Tutorials[/url] |
Re: [CODE]if (/RNA[ -]?binding protein/) { do somethihng }[/CODE] ? is a quantifier which means zero or one, its the same as: [CODE]if (/RNA[ -]{0,1}binding protein/) { do somethihng }[/CODE] Look up "quantifiers" in a regular expression tutorial. |
The End.