Can't find string terminator "EOHTML" anywhere before EOF


Hi I just copied this script from CGI::Ajax manual at cpan.org page use strict; use CGI; # or any other CGI:: form handler/decoder use CGI::Ajax; my $cgi = new CGI; my $pjx = new CGI::Ajax( 'exported_func' => \&perl_func ); print ...
Posted On: Saturday 10th of November 2012 03:36:39 AM Total Views:  94
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




I cant install Perl Module.

Hi folks. I very new to perl. I would like some one to help me. I need to install perl modules on my PC but cant get a head start.The Module converts Shpefiles to SVG format. I found it here.http://wiki.github.com/kbh3rd/shptosvg/I downloaded all the needed modules onto my Windows XP PC.Now in his writeup, he mentions that i need to install [Proj4 library] first before even using CPAN. I downloaded this too from http://trac.osgeo.org/proj/wiki/WikiStart#Download. Using my commandline, i navigated to the folder where i unzipped it. I perused through its read me, but i've failed to install it. I also downloaded a small software called Strawberry perl from http://strawberryperl.com/. But with it too. I cant get to install any thing. someone please help me. I need this shapefile to "svg converter".regards
VIEWS ON THIS POST

255

Posted on:

Sunday 4th November 2012
View Replies!

find if the date is the today date, in Perl

Hi all, i am new to perl. i have a text file that contains the date in only one row. I want to check if the date inside this file is the today date or not. The file contains the date in this form: file_save = 20120628150005 the first 8 numbers( 20120628 ) indicates the date, the other numbers the hour (150005) Thank you very much! PS: i have to do this in a Perl script , Thank you very much!! that was great! Can you please help me in another step I want to add this: If the date is the TODAY day, copy this file into another server. Thank you very very much!!!
VIEWS ON THIS POST

85

Posted on:

Wednesday 7th November 2012
View Replies!

qx not find file with full path name

When i execute the script I get the following error:./run.plsh: ls -l /tmp/var/a.log: No such file or directorysh: ls -l /tmp/var/b.log: No such file or directorysh: ls -l /tmp/var/c.log: No such file or directorySeems its bombing on the qx but why wouldn't it find the filenames they are there\tAny thought.\tThnx Gents!$aLog = "/tmp/var/a.log";$bLog = "/tmp/var/b.log";$cLog = "/tmp/var/c.log";my @files = ( $aLog, $bLog, $cLog );foreach $f (@files) {\tchomp($f);\t$LogSize = qx("ls -l $f");\t( $LS_FSIZE ) = (split)[4];\tif ( $LS_FSIZE > 5000000 ) {\t\t\tsystem("/bin/gzip -9 $f");\t\t\tsystem("/bin/mv $f.gz /logs/$f.gz");\t\t\t\t\t\tprint "log moved..\n";\t}} # End foreach Loopexit 0;
VIEWS ON THIS POST

82

Posted on:

Wednesday 7th November 2012
View Replies!

search.bat: find, write to a file, highlight the found text

. I'm using this script below to grab single pages from a site. I then parse the file, stripping the HTML, leaving plain text, which writes to that file. use strict; use HTML::Stripper; use LWP::Simple qw( get ); my $stripper = HTML::Stripper->new( skip_cdata => 1, strip_ws => 0 ); my $page_html = get(' http://www.google.com/ '); open (FILE, "> http___www.google.com_.txt print FILE $stripper- >strip_html($page_html); Close(FILE); What I want to do is use a search function in Perl to find a regular expression, one word, write it to a file with surrounding text, nine or ten to the right or left, and then highlight the regular expression. Is there a perl mod. to do this. I couldn't find anything on CPAN.
VIEWS ON THIS POST

129

Posted on:

Wednesday 7th November 2012
View Replies!

find and multiline delete

I need a starting point to learn to accomplish the following action: I need to take a plain text ascii file such as: Foo a line of variable text another line of variable text morelines and morelines Foo a line of variable text another line of variable text morelines and morelines Foo a line of variable text another line of variable text morelines and morelines and I need to end up with: Foo morelines and morelines Foo morelines and morelines Foo morelines and morelines In short, I want to see "Foo" in the file and delete the next two lines following. This pattern can repeat hundreds of times within the file and spread across multiple files. I'd rather learn to write something in preference to using a canned module.
VIEWS ON THIS POST

93

Posted on:

Wednesday 7th November 2012
View Replies!

FAQ 8.37 How do I find out if I'm running interactively or not?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.37: How do I find out if I'm running interactively or not Good question. Sometimes "-t STDIN" and "-t STDOUT" can give clues, sometimes not. if (-t STDIN && -t STDOUT) { print "Now what "; } On POSIX systems, you can test whether your own process group matches the current process group of your controlling terminal as follows: use POSIX qw/getpgrp tcgetpgrp/; # Some POSIX systems, such as Linux, can be # without a /dev/tty at boot time. if (!open(TTY, "/dev/tty")) { print "no tty\n"; } else { $tpgrp = tcgetpgrp(fileno(*TTY)); $pgrp = getpgrp(); if ($tpgrp == $pgrp) { print "foreground\n"; } else { print "background\n"; } } -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

88

Posted on:

Wednesday 7th November 2012
View Replies!

How to find version of a module

How do I find out the version of DBD:Oracle module that is installed with my perl If I install another version, will it overwrite everything that is related to the older module
VIEWS ON THIS POST

77

Posted on:

Wednesday 7th November 2012
View Replies!

How to find memory leak in perl server

Hi , I have written an event driven network server in perl. However, when running tests I see that the server process increases in memory and slows down. How would you recommend to approach the problem What to look for in order to identify the cause of the memory leaks -- Y
VIEWS ON THIS POST

92

Posted on:

Wednesday 7th November 2012
View Replies!

find an entry in hash array

Is there a way to find out if an entry exists in a hash array e.g. I have a hash array and another normal array. I would like loop though regular array and see if the entries defined in this array exist in hash array.
VIEWS ON THIS POST

112

Posted on:

Wednesday 7th November 2012
View Replies!

Please let me know where can I find practice exercises

I am currently learning perl programming. Please help me by giving some practice exercises or direct me to the site where i can find them.
VIEWS ON THIS POST

100

Posted on:

Wednesday 7th November 2012
View Replies!

cant find locally installed module

I have installed permute module locally and added the path to my script. However, perl fails to find the module. The script: #!/usr/bin/perl use lib "/u/basappas/local/perl/Algorithm-Permute-0.06"; use Algorithm::Permute; my @array = (1..9); Algorithm::Permute:ermute { print "@array\n" } @array; The files under /u/basappas/local/perl/Algorithm-Permute-0.06: bench Changes Makefile.PL META.yml Permute.c Permute.pm pm_to_blib typemap blib Makefile MANIFEST Permute.bs Permute.o Permute.xs test.pl The error: Can't locate Algorithm/Permute.pm in @INC (@INC contains: /u/basappas/local/perl/Algorithm-Permute-0.06 /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at Perm.pl line 3. BEGIN failed--compilation aborted at Perm.pl line 3. Please let me know if I am missing something...
VIEWS ON THIS POST

156

Posted on:

Wednesday 7th November 2012
View Replies!

Fastest way to find a match?

I'm trying to find the fastest way in perl to see if a name contains another. I've a list of 2704 names (aka "A") I've another name (aka "B") I need to know if any of A is contained in B. A = foo foo1 foo2 foo3 foo45 .... B = INCASE_foo2_YOUWANT is a match B = INCASE_YOURDONOTWANT is not a match. what would be the fastest way to check the 2704 possible values of "A"
VIEWS ON THIS POST

81

Posted on:

Wednesday 7th November 2012
View Replies!

FAQ 4.35 How do I find the soundex value of a string?

This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 4.35: How do I find the soundex value of a string (contributed by brian d foy) You can use the Text::Soundex module. If you want to do fuzzy or close matching, you might also try the "String::Approx", and "Text::Metaphone", and "Text:oubleMetaphone" modules. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

72

Posted on:

Wednesday 7th November 2012
View Replies!

FAQ 4.12 How do I find the day or week of the year?

This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 4.12: How do I find the day or week of the year The localtime function returns the day of the year. Without an argument localtime uses the current time. $day_of_year = (localtime)[7]; The "POSIX" module can also format a date as the day of the year or week of the year. use POSIX qw/strftime/; my $day_of_year = strftime "%j", localtime; my $week_of_year = strftime "%W", localtime; To get the day of year for any date, use "POSIX"'s "mktime" to get a time in epoch seconds for the argument to localtime. use POSIX qw/mktime strftime/; my $week_of_year = strftime "%W", localtime( mktime( 0, 0, 0, 18, 11, 87 ) ); The "Date::Calc" module provides two functions to calculate these. use Date::Calc; my $day_of_year = Day_of_Year( 1987, 12, 18 ); my $week_of_year = Week_of_Year( 1987, 12, 18 ); -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

103

Posted on:

Wednesday 7th November 2012
View Replies!

FAQ 4.16 How can I find the Julian Day?

This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 4.16: How can I find the Julian Day (contributed by brian d foy and Dave Cross) You can use the "Time::JulianDay" module available on CPAN. Ensure that you really want to find a Julian day, though, as many people have different ideas about Julian days. See http://www.hermetic.ch/cal_stud/jdn.htm for instance. You can also try the "DateTime" module, which can convert a date/time to a Julian Day. $ perl -MDateTime -le'print DateTime->today->jd' 2453401.5 Or the modified Julian Day $ perl -MDateTime -le'print DateTime->today->mjd' 53401 Or even the day of the year (which is what some people think of as a Julian day) $ perl -MDateTime -le'print DateTime->today->doy' 31 -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

96

Posted on:

Wednesday 7th November 2012
View Replies!

FAQ 8.1 How do I find out which operating system I'm running under?

This is an excerpt from the latest version perlfaq8.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 8.1: How do I find out which operating system I'm running under The $^O variable ($OSNAME if you use English) contains an indication of the name of the operating system (not its release number) that your perl binary was built for. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

124

Posted on:

Wednesday 7th November 2012
View Replies!

Re: find2perl

oryann9> No, but good point. My intent was to determine when -prune was set on oryann9> the CLI what the De-parsed code told me, 1==true, 0==false because oryann9> when I run this code below prune = 0 is not working, its descending oryann9> down "/". You're misusing it. Set it within the wanted() routine when you're looking at a directory that you don't want to descend. It'll be cleared to 0 before calling wanted(), so setting it before calling find() is completely useless. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. - __OUTPUT__ main:find_hog:47): if ( $fs eq "/" ) { # only if the root directory DB print $fs / DB n main:find_hog:48): find_me ( $fs, 0 ); DB n print caller find_me main:find_hog:61): my ( @sorted_large_files, @large_files ) ; DB main:find_hog:80): if (@sorted_large_files) { DB print caller find_me invalid top directory at /opt/perl/lib/5.8.2/File/Find.pm line 568, line 1. DB print $fs / DB n main:find_hog:81): my %meta ; DB n main:find_hog:82): for my $file (@sorted_large_files) { DB n main:find_hog:83): $meta{$file} = { main:find_hog:84): 'uid' => (stat($file))[4], main:find_hog:85): 'gid' => (stat($file))[5], main:find_hog:86): 'sz' => (stat($file))[7], main:find_hog:87): 'mod' => (stat($file))[9], DB print $file /data/data01/recovery/archives/dubhdv04/2007-11-15,11:21 DB /data/... should not be appearing if prune set to false, or 0. __CODE__ Is this what you mean on line 9 I tried and it does not seem to work, meaning it still descending. 1 sub find_me { 2 use Data:umper; 3 my $fs = shift; 4 #local $File::Find:rune = shift; ##-- localize prune to just this block --## 5 #my @directory = ($fs) ; 6 use constant MAX_SIZE => (25*1024*1024) ; 7 use constant DIVISOR => (1024) ; 8 my ( $wanted, $list ) = find_by_min_size ( MAX_SIZE ) ; 9 File::Find::find ( { wanted => $wanted, prune => $File::Find:rune = shift}, $fs ) ; 10 @large_files = $list->() ; 11 12 @sorted_large_files = 13 sort { -s $b -s $a } 14 @large_files ; 15 16 } ##-- End sub --## ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
VIEWS ON THIS POST

63

Posted on:

Wednesday 7th November 2012
View Replies!

[RESOLVED]Re: How to find version of a module

nm. I was able to get the version by running perl -MDBD::Oracle -e 'print "$DBD::Oracle::VERSION\n"'
VIEWS ON THIS POST

77

Posted on:

Saturday 10th November 2012
View Replies!

FAQ 4.23 How do I find matching/nesting anything?

This is an excerpt from the latest version perlfaq4.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

84

Posted on:

Saturday 10th November 2012
View Replies!