1,633 Topics

Member Avatar for
Member Avatar for KevinADC

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 …

1
1K
Member Avatar for Mushy-pea

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 …

Member Avatar for Mushy-pea
0
184
Member Avatar for KevinADC
Member Avatar for KevinADC

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]

0
162
Member Avatar for KevinADC

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 …

0
271
Member Avatar for KevinADC

"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 …

0
170
Member Avatar for KevinADC

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]

0
291
Member Avatar for KevinADC

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.

0
874
Member Avatar for MikeDexter

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 …

Member Avatar for MikeDexter
-1
159
Member Avatar for prajnapj

how to compare two directories that contain xml files in perl.. and prints the content that is modified, added and deleted

Member Avatar for gginnj
-1
92
Member Avatar for gginnj

[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 …

Member Avatar for gginnj
-1
199
Member Avatar for perlguy

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 …

Member Avatar for Amps
-1
74
Member Avatar for DemonixXV2

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 …

Member Avatar for DemonixXV2
-1
154
Member Avatar for rayken1

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 = …

Member Avatar for wickedxter
-1
134
Member Avatar for sanushks

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 …

Member Avatar for KevinADC
-1
241
Member Avatar for Prakash_8111

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............

Member Avatar for onaclov2000
-1
138
Member Avatar for LSU_223

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 …

Member Avatar for KevinADC
-1
124
Member Avatar for samaru

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 …

Member Avatar for jenn11
-1
459
Member Avatar for FrankQC

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?

-1
39
Member Avatar for dipsn

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 …

-1
53
Member Avatar for JayT

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 …

Member Avatar for bildja
0
214
Member Avatar for magix

Hello, I'm trying to simply do a SELECT from an ODBC source. It works perfectly in PHP but not in perl ! Therefore there is no problem at source or at ODBC level, it seems to reside at perl/DBI level... What I do : [CODE] use DBI; $dbh = DBI->connect('dbi:ODBC:' …

Member Avatar for magix
0
306
Member Avatar for morfanaion

At the moment I'm busy updating a number of modules for perl on one of our servers, but I'm experiencing some problems with the Mail::SPF::Query module. Most of the subtests fail right now, but I can't find out why. Anyone has a clue? Below is the output of "make test" …

0
78
Member Avatar for shaife

Hi I have a short script :(see below) My problem is on the system lines syntax it doesnt do what I expect. Instead of running the bb command send as status dbr-cmrm06.us.ensrv.mgmt.bmc and then cat to the history_test file and send the content to the hobbit server it prints the …

0
77
Member Avatar for rayken1

use warnings; use strict; open (TEXT_FILE,'C:\Documents and Settings\rnjenga\sawa3.txt'); my ($line, $nextline); while ($line = <TEXT_FILE>) { if ($line =~ /FT\s*\Wnote.+\w+:/){ $nextline = <TEXT_FILE> ; print ("$line $nextline \n"); } if ($line =~ /FT\s*\Wnote.+none/){ $nextline = <TEXT_FILE> ; print ("$line $nextline \n"); } } close (TEXT_FILE); I have written the above …

Member Avatar for mitchems
0
120
Member Avatar for maudits

hi everybody, i need some help, I am stuck on a problem for too long. I have a decimal number (big Int), very big, (246 cypher). I need to convert this number to a 96byte char. I cannot understand how. I have already read and tried pack/unpack, but i can't …

0
57
Member Avatar for derekn

I am trying to accurately calculate percentages with perl. The problem is of course that percentages don't end up as nice, even whole numbers...and I want to truncate those number (92.38495%) to the whole number accurately reflecting the percentage (92%). Using "($value/$total)*100" gives the percentages, then I used "$value=int($value+0.5)" to …

Member Avatar for KevinADC
0
223
Member Avatar for perlfan

The following code: Exits immediately and produces the message below when search pattern "[COLOR="Green"]\b\w+{3}\b[/COLOR]" is entered: [code=perl] #!/usr/bin/perl -w #matchtest1.pl use strict; my($pattern); my($true); $_ = '1: A silly sentence (495,a) *BUT* one which will be useful. (3)'; do { print "Enter a regular expression: "; chomp($pattern = <STDIN>); if …

Member Avatar for perlfan
0
134
Member Avatar for jen140

Hello all. I have a small problem. I have a crewler, that gets into one website and extract some info from it, and writes the exctracted content to file. The only prob, that in 3~4hours of work, thise script uses 1 gig of ram. [code]for(my $increment = 1; $increment <= …

Member Avatar for lordspace
0
92
Member Avatar for perlfan

I am reading the book "Beginning Perl" by James Lee and have been pretty happy with the content so far. That said I am stuck on chpt 7 which deals with regular expressions - I can't get the backreferences to work even when I copy the source verbatim. source: [COLOR="Green"] …

Member Avatar for perlfan
0
121

The End.