2,452 Topics
| |
Ever wanted to evaluate a user-provided expression, maybe from a form input or otherwise, and return the result? eval($expr) is dangerous because eval(open $out, "> file.what"); will open the file, infact, eval(everything) will pretty much do everything. checking though everything is tedious, and manually parsing everything seems like a waste … | |
Regex to match the dd/mm/yyyy date format. | |
Given the date in mm-dd-yyyy (or M-D-YYYY) format (or any combination of that format) you can find out what day of the week that was on or is on or will be on, within the limitations of the system the script resides on. This snippet uses only core functions and … | |
This is my first working perl script that does anything useful; that being to count the hits made on a web page and display the count graphically. To make the counter work on your web page (should you wish to), you will need to create images for the number tiles … | |
Convert 1000000 into 1,000,000 using a perl regexp. | |
Use the List::Util module. I believe List::Util is a core module starting with perl 5.8. For older versions of perl you may need to install the module. See the module documentation for more details: [URL="http://perldoc.perl.org/List/Util.html"]List::Util[/URL] | |
I've seen this question (or similar) asked many times on forums: I have a variable in a file (text) and want to expand it. For example, I have this line in a text file: Mary had a little $lamb and I want to be able to expand $lamb but text … | |
"How can I find all the permutations of a list (or a word)"? I have seen this question asked a number of times on forums. There is a module that makes this task very easy: List::Permutor. It is not a core module so you may need to install it. See … | |
You will need to install the Email::Valid module if it's not already installed. See the module documentation for further details. [URL="http://search.cpan.org/~rjbs/Email-Valid-0.176/lib/Email/Valid.pm"]Email::Valid[/URL] | |
The [URL="http://perldoc.perl.org/File/Basename.html"]File::Basename[/URL] module is used to parse file paths into directory, filename and suffix (or file extension). My simple example shows how to get just the file extensions. | |
Hi, I have written a small script that takes an infile, slurps it into an array, and makes a change to the file. Well that is my intention.... I can get the changes to be made using Regular Expressions because I can print and see my H1 tags are changed … | |
how to compare two directories that contain xml files in perl.. and prints the content that is modified, added and deleted | |
[code] #!/usr/local/bin/perl use IO::Socket; my $url = 'localhost'; my $port = 6464; my $error = 1; my $sock ; while ($error) { my $sock = new IO::Socket::INET ( LocalHost => $url, LocalPort => $port, Proto => 'tcp', Listen => 1, Reuse => 1 ); $error = 0 ; $error =1 … | |
| I'm trying to cut off the text leading up to the whitespace past the >. For example the string is 'Web & Programming > Testing & QA Contractor' and my regex is [icode]$job->{'title'} =~ s/^.+>\s+//;[/icode] I need to end up with just 'Testing & QA Contractor'. Can someone point me … |
I am trying to copy a list of email addresses in Excel and paste them into SQL. I am using Navicat. I am able to paste the text, but I lose the hyperlink format. What can I do? Obviously, I new at this. Any help would be appreciated. Thanks...Gadfly_1943 | |
hello everyone... i wrote a basic program for my C++ class that includes SUMs and while loops. its fairly self explanatory, but i am not getting the correct SUMs for my outputs. apparently, i am missing something extremely important somewhere here. can someone take a look and give me a … | |
I'm trying to find or create a Perl script that: Checks for and creates these files: notes notes.1 notes.2 notes.3 notes.4 The first represents the current log file and the others are older versions. Each time the script runs it would check for the existence of notes.3 and, if it … | |
kindly help me to get out the error of " Use of uninitialized Value $_ in substitution. my code is..... #!/usr/bin/perl use warnings; use strict; open (TEXT_FILE1,'C:\Documents and Settings\rnjenga\Muguga.embl'); # open file for reading my ($line1, $nextline1 ,$line2,$newline ); my ($find1, $find2); #Get required line from file while ($line1 = … | |
Hi, I'm running a Perl script as a service which moves files from a particular source directory to the target directory in Windows server 2003 . It polls the source directory and runs in an infinite loop. The service hangs and perl script does not move files from source to … | |
Hey Guys, Have u any Idea how to call a perl script within my main script in a loop. I used system and exec both, but it seems to be not working. I want the second calling of the script shouldn't depend on the first calling.... all should run independently............ | |
hello - i am trying to take a text file with multiple sets of numbered lines and sort each set, leaving the non-numbered text in place. i can't seem to figure out how to loop over the regular text, save then sort the numbered text, then move on. i want … | |
This book is excellent: [b]Sams Teach Yourself Shell Programming in 24 Hours (2nd Edition)[/b] [url]http://www.amazon.com/exec/obidos/ASIN/0672323583/qid=1034404576/sr=2-3/ref=sr_2_3/102-8089820-6681729[/url] It received good reviews. Here's my personal review from Amazon.com: This is probably one of the best books by Sams that I've read. If you want to start shell programming, you've picked up the perfect … | |
I want to make it so that in the terminal (where the post-execution occurs), the input is at the bottom of it, rather than at the top. Does anyone know how to do this? | |
Can anyone help with this... Google is being very strange, won't let me log into iGoogle, all links opened redirect me to yahoo.de unless i 'open in new tab', overall just not working very well. My log: Logfile of Trend Micro HijackThis v2.0.2 Scan saved at 15:19:36, on 15/08/2009 Platform: … | |
I don't get this.. I was able to use it the other day without issue, but now when I use it, the "message" that I put into the paramater doesn't get printed out to the console, and I get an error box saying "Program has stopped working. Windows is checking … | |
I am new to perl and want to migrate VSS to SVN. I have searched for tools and codes but they are bit difficult can anyone please suggest some easy way or perl script or any link that will help me?? Its urgent please reply as soon as possible. thanks … | |
Ajax control is not wroking fine.It is displaying partically and its behaviour is also totally different and not upto its usualy standard.Cud anyone plz give me some solution to solve this problem.urgenttttttttttttttt regards saleem | |
So guys... everything is working properly except for when the radio button is clicked to either "yes" or "no" on the form the email that is send does not display it at all. [code] $message = " $todayis [PST] \n Attention: Interactive Media Requesting a Bid \n Phone Number: $areacode2, … | |
I have a Player class, a Weapon class and a Projectile class in my applet game. The weapon class uses Projectile objects when fired. For example, everytime I click I want this code to execute: [CODE]projectileList.add( player.weapon.fire() );[/CODE] player.weapon.fire() returns one or more projectiles that the projectileList handles every frame. … | |
Hi, I've been reading through some tutorials on creating a basic web upload script with perl and cgi. The problem is that my server keeps throwing an Internal Server Error 500 without giving any feedback. I am hoping that someone has run into a similar problem or there is an … |
The End.