Perl Script Word Questions and Answers



Open Question: SQL / PERL advice on running multiple queries?

Okay, so I'm trying to come up w/ the correct statement for this, but unfortunately I am new to writing perl and could use some help. So from a table, I am getting 4 columns (for the sake of not giving away company info, let's just call it Column A, Column B, Column C, and Column D). What I want to do is group by column A, and then make an alert if WordB appears in Column B for corresponding term in Column A over 2% of the time, if WordC appears less than 30% for Column A term, and if LIKE '%wordD1%' OR '%wordD2%' appears over 5% of the time for corresponding A. An example could be this: If the word "football" is one of the terms in column A, then if kick appears 3 times in column B, flag, or if punt appears under 30% in Column C, flag, or if pass or throw appear over 5% of the time in Column D, flag. Could I do this all in one ensted if statement? Would I need multiple scripts for this? Any help is appreciated.  more

Resolved Question: Best book for a beginner to learn how to create and use perl scripts?

Hi, I am using Dreamweaver and want to be able to allow users of my website to send me word documents by uploading them on my website. I have got Dreamweaver for Dummies and understand that I need a 'Perl script' to make this possible. Can you recommend a good book for learning how to do this and that will definitely include this type of script? Many thanks.  more

Voting Question: Perl script suggestions for practice?

I'm an amateur Perl programmer (I recently finished "Perl 5 for dummies") and I've been searching for ideas on what to script. I already have written (at my father's suggestion) a program for extracting the unique words from a text file but that isn't enough for practice. Does anyone have any ideas on what kind of program I should create next (novice level please)? I really can't think of anything at all and I really need the practice. Thanks to anyone who can contribute some ideas! :-)  more

Resolved Question: Help— perl neighbor pair search?

0 I have a file called 1.txt with the format for each line is like route+node i.e 190.227.163.142to190.227.163.142asn7303 7303 the 1st column is the route and the 2nd column will be a specific node number which is unique for one route. I wanner use perl script to generate another file called “2.txt”. It should count the neighbor for each node i.e the one after the node and the one before the node and print them out. In other words, a consisting of 1 2 3 I need to produce the output like: 1 2 2 1 2 3 3 2  more

Resolved Question: Regex help to return $1 only and not $2, $3, $4?

I have a regular expression that I'm using to pull pre-determined links from a string (URLs surrounded by brackets), and putting them into an array so that I can work with them in a foreach loop. However, when I put the URLs into the array, the output is giving me $1 (the entire URL) plus $2, $3, and $4 which are part of the URL (http, domain, .com). Here's how the code is setup: $mystring = qq{This is my string http://www.example.com and these are words [http://example.com] with more words here and a link with a query string [http://example.com/?this=good&other=bad1234] and a link using co.uk like this one [http://www.google.co.uk] }; @array = $mystring =~ m/((\[http:\/\/)?(\.?\w+-*\w+)+\.([a-z]{2,4}|[a-z]{2}\.[a-z]{2,3})\/*[^\s]*\])/gi; foreach (@array) { $_ =~ s/\[//g; $_ =~ s/\]//g; print "$_\n"; } This returns something like this: http://www.example.com http:// .example com http://example.com/?this=good&other=bad1234 http:// example com http://www.google.co.uk http:// .co uk However, I want it to return this only: http://www.example.com http://example.com/?this=good&other=bad1234 http://www.google.co.uk and not the other parts. This is a CGI-script (Perl), but as these things are fairly similar in many languages, maybe somebody can help me out here? techieguy - Yea, I noticed that, but I didn't think it was super important because it was working. I didn't text your much-shorter regex yet, but it looks like it's missing the left bracket before the http... though it looks like it should work as good as or better than what I have (how I wish I would have thought of something that simple hours ago... I'll try your code out to see if there's a difference in the data that is added to the array, but otherwise, or unless I hear about something more efficient, I added a regex to the foreach loop to only use the links with brackets on both sides: @array = $mystring =~ m/((\[http:\/\/)?(\.?\w+-*\w+)+\.([a-z]{2,4}|[a-z]{2}\.[a-z]{2,3})\/*[^\s]*\])/gi; foreach (@array) { if ($_ =~ m/^\[.*\]$/) { $_ =~ s/\[//g; $_ =~ s/\]//g; print "$_\n"; } } Which, again, I wish I would have thought of something this simple this morning... Thanks for your help. Ok - I see what you were doing with that. I only want to grab certain links from a string, not all of them. My goal is to have the selected links replaced with a tracking link created on the fly. This string is the email body of messages that I'm sending out to subscribers.  more

Resolved Question: Problem with my variable in Perl?

I have a problem with my perl script. I have variables $L for all letters and $AV02 for some suffixes. my $L = "[aeiuoyâäáàêëéèîïíìôöóòûüúùbcdfghjklmnpqrstvwxz]"; my $AV02 = "ik|i\*ke|ig|i\*ge|loos|lo\*se"; My input is afrikaans words that is hyphenated by an asterisk ( * ). : eg. nut*te*lo*se The regular expression I use for this word: if ($token3 =~ /^($L+)(\*)($L+)(\*)($AV02)$/) { $token3 = $1.$2.';'.$3.$4.$5; last; } where the following is supposed to happen: $1 = nut $2 = * $3 = te $4 = * $5 = lo*se but it does not want to work that way. It does not see "lo\*se" as a unit. It keeps using another rule where it breaks up "lo\*se" Is there something wrong with my variable $AV02? Hope you can help me!  more

Resolved Question: URGENT!! Perl Scripting help?

I m stuck at this part, i need to write a scrip tht will open and read a file that is supplied as a command line argument. the script must: 1- output the words in reverse order 2- replace al instances of "his" with her" Thanks, i really need this quick BTW the file will be called text4.txt  more

Resolved Question: $string =~ /(\w+)\s+(\w+)/; $second_word = ; help?

I want to complete the code to capture second word this is perl script  more

Resolved Question: how would I create simple scripts or programs to save time on my computer?

For example here are some programs I would like to create. Something that can install all the programs I want on my computer when I do a clean re-install of windows. For example, instead of having to spend an entire day installing and clicking and installing ect. is there a script or answer file I could create? What language? Also something that can convert a group of files into another file type (ex: word to pdf, or chm to pdf, avi to mpeg, ect.) Instead of having to convert each individual file at a time manually using a program that could take an hour or more. I'm an intermediate in C++ and getting there with Java and C# also, just started learning PHP, html, Javascript ect this year and I eventually plan to pick up perl and python once I master these other ones. That should give me plenty of options to program or script what I want. Anyone know where to start or have advice? 10 points to anyone who can help or just answer. the first scenario, the OS would have already been installed and I'd just run an exe or script to install all the programs I want which I have the exe's to in a folder. I heard the best way to pick up languages is to program stuff on your own, those are some things I'd like to try, where should I start? Any source code examples anywhere to study?  more

Resolved Question: How do I add a submit button to my form perl script?

I assume it's somewhere in here: } else { print start_form(); print p(textfield("word")); print end_form(); } I have the full code here: http://8rays.com/translate/code.txt and the form at http://8rays.com/translate/  more

Resolved Question: How can I clean up my logfile directory using Perl or shell scripting?

I've got an Ubuntu Linux server that's got logrotate running on it nightly. That's great, but my /var/log directory is looking a bit messy...I've got the log files, and then logfile1.1.gz, logfile1.2.gz, etc, for all my different files. I want to make archive directories that will hold the .gz files (i.e., all mail archived logfiles (mail.1.gz, mail.2.gz, etc) go in in the mail directory; same for all different log files that rotate) What I want to do is get a perl script in place (a shell script would work too, but I like perl better) that will do the following: 1.) ls -l /var/log 2.) check for lines in that output that have .gz all the way at the end 3.) of the lines that have .gz at the end, strip everything but the beginning of the file name, up to the first "." 4.) Take that word, and check to see if a directory by that name already exists. 4a.) if it does, then take all the log files in /var/log that begin with that name, and end in .gz, and move them into that dir. 4b.) if the dir doesn't exist, then make the dir, and follow 4a.  more

Resolved Question: Perl/CGI displaying images

How do I display images with Perl CGI? I'm using the script below, but it's not working. When it is just the word "TEST" it is OK, but once I add the "<IMG SRC= . . . " it breaks. Also, using the path below (substituting the actual site name) will display the image in a browser. Help! What am I doing wrong??! ========== #!/usr/local/bin/perl -wT use strict; use integer; use DBI; print "Content-type: text/html\n\n"; print " TEST<p> <IMG SRC=" http://www.sitename.com/images/1.gif "> ";  more

Resolved Question: Perl - Regular expressions?

I am asking about is that: I want to save Regex rules in a file and from the script(perl script) I want to match URL content with the rules in the file:S Note:the file doesn't content normal words, it content Regex rules and i want to match the URL with each regex rule saved in the file it's like htaccess idea? is that possible?  more

Resolved Question: Ruby/Perl Data Manipulation - Excel, array/concatenate?

Here's what I'd like to do have a list of any number of words in excel in a column. have another list of any number of words in another column I want to take each word from List A and concatenate it with each word in list B. So if list A had: pumpkin birds hawks seafood and if list B had: fast scream wow the script would produce pumpkin fast pumpkin scream pumpkin wow birds fast birds scream birds wow hawks fast hawks scream hawks wow seafood fast seafood scream seafood wow I don't need a GUI, just something I can execute from the command prompt. I know a little bid about ruby so I know this is just some basic array manipulation and concatenation...any takers? Even Perl would be fine if you know that...or any language.  more

Resolved Question: differentiate these coded languages?

in your own words and knowledge how can u differentiate theses programing languages : ASP CSS Cold fusion DHTML Java *Java script Perl PHP SSI and XML* high points for high givers  more

Resolved Question: How can we replace a word from a file using PERL,using script only?Not from the Konsole?

If we have a file and we want a particular word in it to be replaced by some other word using perl script only.I am not able to replace that word in a file by some other word.This can be done from the Konsole in Linux but i want that from the script only  more

Resolved Question: trying to upload this guest book to my web page cgi perl script?

Bareword found where operator expected at guestbook.cgi line 1, near "/nf/lib" (Missing operator before lib?) Unquoted string "lib" may clash with future reserved word at guestbook.cgi line 1. syntax error at guestbook.cgi line 1, near "/usr/local" BEGIN not safe after errors--compilation aborted at guestbook.cgi line 8. could not fire up guestbook.cgi The error message I am getting ? what am I doing wrong thanks changed somethings now it is saying no path info? after I get the page which says it is uploaded and to click on control panel #!/usr/bin/perl ### All code is copyright active-scripts.net 2006. # Bookmarks: 0,325 0,2173 0,4155 ### Unauthorised use, editing or copying for ANY reason is ### an infringement. Anti-spam code can not be edited ### and/or used in any way outside of the code in this script. $var = time; use CGI qw(:all); use CGI::Carp qw/fatalsToBrowser/; # working on refer for (param()) { $NEWFORM{$_} = param($_); } for (param()) { $FORM{$_} = param($_); $FORM{$_} =~ s/\|/-/gi unless param(action) eq "delete_ips"; } $query = new CGI; @todel = $query->param('todel'); $cookiedata = $ENV{'HTTP_COOKIE'}; @cookies = split(/;/,$cookiedata ); foreach $i (@cookies){ ($name,$cid) = split(/=/,$i); $name =~ s/\s+//gi; $COOK{$name} = $cid; } @var1 = split(//,$var); $lastnotvar = $var1[-1]; $lastnotvar++; $lastnotvar = 2 if $lastnotvar ==1; $lastnotvar2 = $lastnotvar -1; $use_absolute_reference = "no"; $urladdress = "http://www.domainhereifallelsefails.net/cgi-bin/gb/guestbook.cgi"; $font = "<font face=Arial si I have to use this its for a school assignment  more

Resolved Question: how do i write a prel script prgm to find or filter a file that contains d word i am looking for frm a folder?

how do i write a prel script program to find or filter a file that contains the word i am looking for from a folder which contains several files. for example i want fo filter all the files that contain the word "windriver" from different files present in that folder, what sould be the perl script coding for this.  more

Resolved Question: Does Anybody know how to search a particular word and extract it from Word document using PERL script ?

Detail : I would like to extract particular words from Word document using PERL script.  more

Resolved Question: How can I create and manipulate an application object using Java in UNIX?

Yes, big question, but I really am looking for the UNIX equivalent of a Windows JScript that does the following (for example only, I realized I can't call a Microsoft application on UNIX).... var objwd=new ActiveXObject("word.application"); objwd.visible=false; objwd.Documents.open("blah"); ... Again, obviously the example above is a Windows-application specific example only. What I'm looking to do is merely emulate a similar concept except using Java (or Perl would be fine too, but I have so little knowledge of either). I want to create an object reference to a particular UNIX-installed application and then manipulate the object with the permissible methods associated with that object. I'm fairly familiar with the way to do this in Windows Scripting, but am quite new to UNIX and am trying to learn the various analygous scripting methods there. Any help (especially code samples) would be much appreciated. My UNIX box is Sun Solaris.  more

Resolved Question: PHP Modules?

I'm new to PHP and just starting to learn it. I found a site where they say that they host PHP scripts. But it's worded like this: -Full Development Environment + PHP (as a module), Perl (with many modules), Python, C, C++, Tcl, and more + Level 1 & 2 System CGI (free scripts) + Use of Cron Jobs permitted (up to once per hour) Does that mean I can use PHP on that server or just certain modules?  more

Resolved Question: Perl programming q is below?

Write a script that prompts you for a sentence, and tells you the number of characters in the sentence, the number of words, and prints the sentence in reverse order.  more

Resolved Question: could you use windows voice recognition for electrionic dictation?

i was quite impressed with CMU's open source, continuous voice recognition program called sphynx, however using it requires both Perl and a C compiler. i only have a concept of programming i have learned through a macro scripting software called autohotkey (which is an excellent program for windows users). i have no knowledge or experience of perl (although i know what it is). my goal is to be able to speak into a microphone on my computer and see the words appear on the screen without paying 100 bucks for it. (i know dragon has a really good dictation program but its nearly 1000 bucks) any suggestions?  more

Resolved Question: Stop junk email in a cgi perl form script?

hi i have a simple form script, how would i stop a cgi form from allowing a spammer from writing junk information through my form mail script to a text file if their input contains certain words like viagra or levitra? for instance, if $input does not contain "viagra,levitra" then do this: open and write the contents to this file, however, if $input does contain "viagra,levitra" then don't write to the text file but don't just die, just skip the part about writing to the text file and continue down the script and email the user so that the spammer doesn't realize it's not writing their junk mail on the text file for these flagged words. thanks, jr  more

Resolved Question: Perl script to remove html tags?

Looking for a perl script that can remove anything between font tags such that: <font color="red">Hello World!</font> will result in an empty string. Note that this script should remove the words "Hello World!" since they are in between the font tags. Also note that the tags can span multiple lines. Thanks!  more

Resolved Question: well , how could I master web designing and web development !?

Hi , I like the Internet and it's applications. I just wanted to know , how to master it . in other words , how to be a brilliant ( professioanl ) at web designing and web development. I want to study at home with a good capeablity to buy courses and ebooks as well . first , what should I learn ? PHP ...ASP ..JSP ....HTML\XML\CSS...PERL...and others that i don't even know yet .??? My question purely is : what is the logical sequence or what to study firstly ,secondly , thridly ....etc ..I want to learn as much as I can , I want to improve my career to even be an instructor or scripts programmer.. I really LOVE the internet and want to be a WEB MASTER with it's truly meaning ..and also please recommend me some ebooks and even video courses , or ordinary online courses.. Thank all of you in advance and hope I could find the perfect answer in my perfect site. DonKelio.  more

Resolved Question: how to count the number of words in a paragraph by Perl?

I want to count the numbers of words in the paragraph by Perl script  more

Resolved Question: pay per click script needed?

hi yahoo here is my question im building a website using Yahoo! sitebuilder on my website ill have many ads from advertisers these will be in the form of words and photos eg: there will be a word or photo, once a user clicks on it they will be sent to the advertisers website i need a script to count the number of times each ad is clicked. also the script needs to be have a payement system for me to take payements eg: at a weekly basis or once a certain number of hits have been reached. there are many scripts that do this but many are not very good and some take a percentage of my money which i dont want. also yahoo sitebuilder only uses some scripts, html, perl i think, but they dont guarantee php..... can you find me a very good script to integrate with my website? many thanks  more

Perl Script Word News

Read more


Perl Script Word Links

Another File Integrity Checker 2.15-1

It works by first creating a database that represents a snapshot of the most essential parts of your computer system. more

Playing with jQuery UI's Autocomplete Control

This weekend I finally took a look at it, specifically the new autocomplete widget, and I thought I'd whip up a few quick examples showing the control being used with ColdFusion. more

Subversion to GIT Migration: A Tale of Two Gotchas

I've been wanting to migrate the GPSD codebase off Subversion to a distributed version control system for many months now. more

HTC Desire is 'Best Yet' Android Phone: Droid Overload?

February 17, 2010, 04:56 PM - PC World - The Google Nexus One is no longer the king of the Android hill anymore. more

synspam 0.3.6

Synspam uses Netfilter NFQUEUE to catch the source IP address of any machine connecting to your mail server, running multiple tests against it before forwarding the connection to the MTA. more

RE[3]: BASIC

Fiwix 0.3.3 has been released . "Fiwix is an operating system kernel based on the UNIX architecture and fully focused on being Linux compatible. more

Batch replace text in PDF files

Simple text replacements in simple PDF documents can be made with changepagestring.pl , part of CAM-PDF-1.52 , which, by the way, includes many other cool tools like: $ perl -MCPAN -e shell If this is the first time you've run CPAN, it will ask you a series of questions - the default answers worked fine for me. more

Rootkit Hunter 1.3.6

Rootkit Hunter scans files and systems for known and unknown rootkits, backdoors, sniffers, and malware. more

Yokadi 0.11.2

Yokadi is a command-line oriented, SQLite powered, TODO list tool. It helps you organize all the things you have to do and you must not forget. more

$errorCode = 7
xml_error_string() = mismatched tag
xml_get_current_line_number() = 11
xml_get_current_column_number() = 2
xml_get_current_byte_index() = 780

perl.com: Manipulating Word Documents with Perl
In Word Hacks, Sean M. Burke and I demonstrated how to use the Windows clipboard as a primitive but simple means of exchanging data between Word and a Perl script.

Where can I find a code sample for a Perl word count script?
This is a pretty straightforward problem in Perl. Check the Perl Cookbook for a discussion. A very brief sample script is as follows (adapted from the code in the Cookbook):

Perl - Wikipedia, the free encyclopedia
Perl is a high-level, general-purpose, interpreted, dynamic ... considered (and rejected) every three- and four-letter word ... been used since the early days of the Web to write CGI scripts.

Word Count Script+
Category: Miscellaneous: Author/Contact Info: xgunnerx: Description: A word count script that "attempts" to be more accurate. It will take into account works at the end of a line that end ...

Word maniplulator (perl script) - Remote Exploit Forums
I put this script together while learning Perl (still a newbie), and also want to contribute back to the community for the knowledge I am getting. The

Chris Pound's Name Generation Page
Scripts I have written several scripts in perl to help you generate cool names or vocabulary for your setting or ... Yet another word generator Werd is a tiny word generator that takes a ...

Word import perl script - Confluence Extensions - Atlassian ...
The Atlassian Extension Spaces have been migrated to http://plugins.atlassian.com. These pages are now deprecated and will soon be deleted.

Deals of the Day