473,541 Members | 13,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Perl Forum

Perl programming language - ask questions about perl programming, syntax, variables, scoping, constructs, operators and functions, files, I/O, regular expressions, regex, subroutines, OO (object oriented), perl modules, CGI and more.
1
3,157
thread by: Shridhar Sharma | last post Jul 7 '11 by: miller
I have a list of paths in a file => small.txt i wish to open that file, copy the path and change my directory to the path collected from small.txt. open(LIST,"small.txt") or die "Cant open small.txt"; @arr= <LIST>; for($i = 0; $i < @arr; $i++) { chomp($arr); print "path read from file = $arr\n";
7
2,665
thread by: yjulien | last post Jul 1 '11 by: yjulien
Hello, I would like to fix the maximum size of a picture in a list so none of the picture exceed 200 pixels in width or height. I'm using pictures with various height and width so I can't simply fix it in the HTML code such as : <img src="$photo_dir/$section.$number.$i.gif" border=2 width="200" height=200></a> How do we read the...
2
5,284
thread by: Pawan Kumar | last post Jul 1 '11 by: Pawan Kumar
Hi All, I have been using the Perl in window environment, but now i started using perl scripts in Linux flavor. I am new to Linux + perl combination. I am trying to get the value of any system command executed in a variable, something like 1. my $DIR = system(pwd); 2. print "Current Dir: $DIR \n"; Here i don't get any output in line...
1
2,115
thread by: Clive Bostock | last post Jun 23 '11 by: miller
Hello. I have a hash which I need sorting. Each record in the hash consists of a string with numbers separated by commas. For example ('2.1, 4.3, 2.5,...3.1'). I wish to sort my hash by the sum of the values. I wrote a function, sum_fields, to receive the string and return the total the values. However I was hoping to reference the subroutine /...
1
3,670
thread by: Kamalendu | last post Jun 18 '11 by: numberwhun
1. I am using Padre perl IDE 2. I have DBD-Oracle-1.19 installed in my machine. 3. Oracle 10g Express Edition is Installed. Source code #!/usr/bin/perl -w use 5.006; use strict;
15
2,694
thread by: Elizabeth H | last post Jun 15 '11 by: rovf
I need to search for a particular function in a shell script and replace it with the modified function for which I can use sed inplace editor. But I am not able to correctly parse for the function. Can I have a regular expression to search for the function which is of the form function() { no other braces in between }
2
3,826
thread by: chintan85 | last post Jun 10 '11 by: chintan85
Hi Guys, Any suggestion would be very helpful on this. My codes goes likes this while(@row = $sql_query->fetchrow_array()) { print $row; )
8
9,470
thread by: Mangala Amargol | last post Jun 10 '11 by: RonB
For example,runnig "ipconfig" command through perl script and printing it on web browser. my $cmd = "ipconfig"; my $output = `$cmd`; print $output; Above code works fine in Windows Server 2003,but $output is null in Windows Server 2008 R2. Done necessary settings in IIS for perl,is there additional settings in windows server 2008 R2...
1
1,579
thread by: yjulien | last post Jun 10 '11 by: numberwhun
Hi everyone, Does anyone know if there is an already made code in Perl to do slide show using images located in a specific directory. I'm looking for something like on facebook. If not in Perl, it could also be in Java. Thanks,
1
5,931
karthik baskar
thread by: karthik baskar | last post Jun 9 '11 by: miller
Hi, I wanna pass a hash as a command line argument in perl. and I wanna call that perl program from another perl program using system() function. Please Leave a reply if you know. Thanks in advance.
4
2,570
thread by: James Shealey | last post Jun 8 '11 by: James Shealey
I am working on a paid membership website for a non-profit association. All memberships are good for a year and expire on the last day of the month. I would like to send a customized auto email (members name and membership expiration date) to members one month and one week before their membership expires. Emails would go out twice a month...
6
1,343
thread by: yjulien | last post Jun 6 '11 by: miller
Hi, I'm trying to use the sort function without success up to now. I'm opening a file and wish to reverse sort on the first field "$users_fields" and then print the output found in the IF statement. Can you help? Thanks, Here is the code, which print the entire file not sorted:
1
5,014
karthik baskar
thread by: karthik baskar | last post May 26 '11 by: miller
I'm using perl. In that i wanna install Spreadsheet:WriteExcel in windows. to install that , i wanna use the nmake.exe.
5
1,943
thread by: techtween | last post May 26 '11 by: techtween
I have an XML file of the form, <?xml version="1.0" encoding="UTF-8"?> <testResults version="1.2"> <httpSample t="704" lt="704" ts="1306146504248" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 2-1" dt="text" by="411"/> <httpSample t="525" lt="525" ts="1306146505234" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group...
1
2,387
thread by: techtween | last post May 23 '11 by: miller
for example, if this is the tag, <httpSample t="527" lt="527" ts="1306146411999" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="411" /> i need the value of lt alone to be displayed. i couldnt get it right through regular expression. Hope you can provide me the code. Also, if possible, could you please...
2
4,412
karthik baskar
thread by: karthik baskar | last post May 21 '11 by: numberwhun
I need to execute 'cd' (change directory) command in windows. I tried that using 1)system('cd..') 2)`cd` But both are not working. Please provide me with a solution. Thanks in advance ..
2
1,786
thread by: santhanalakshmi | last post May 17 '11 by: santhanalakshmi
Hi, I installed Xampp on my server(windows 2003).I am having perl script(i.e cgi program).Inside cgi program, i wants to use HTML HYPERLINK-that should points to my PHP program and plus i wants to pass one parameter to this hyperlink. Is it possible to call PHP script?If is it possible means, please see my line coding print...
4
4,968
thread by: chez | last post May 13 '11 by: miller
Hi, I want to save the text from a text box to a text file, but i have problems implementing it. can someone guide me? Thanks!
2
1,426
thread by: Hardik Bhagat | last post May 12 '11 by: miller
Hello Perl Experts, I have a file which looks something like this... ******** "OUT_BUS" + "Q0" + "Q1" + "Q2" + "Q3" + "Q4" + "SO" + "SO" + "SO" + "SO" + "SO" + "SO" + "SO" + "SO"'; } ScanStructures { ScanChain "1" {
4
3,338
thread by: Aparna Shree | last post Apr 26 '11 by: chorny
hi, i am trying to make perl/tk script into executable using pp i have it installed and can open the tkpp gui from the cmd but after filling in the file names it shows building and again shows the same window again and again.i dnt knw where to look for the error coz it's not showing any.can anyone help?
3
6,297
thread by: Wiinie | last post Apr 22 '11 by: miller
Hi, I have this error when i try to insert some values into the database via perl script. there is my code sub addWords { my $self = shift; my $wordsRef = shift; my @words = \$wordsRef; my $language = Language->new();
1
5,139
thread by: Wiinie | last post Apr 21 '11 by: miller
Hi guys, I have an error "Can't use string ("Test") as an ARRAY ref while "strict refs" in use ~~~" I am trying to add word into the database, and then it gives me this error. please help ,, sub addWords { my $self = shift; my $wordsRef = shift;
7
3,168
Srijith B
thread by: Srijith B | last post Apr 19 '11 by: Srijith B
I am trying to print file information using ffmpeg tool in perl Here is my code use strict; use warnings; use IPC::Open3; # example
1
4,064
Srijith B
thread by: Srijith B | last post Apr 18 '11 by: miller
Hi I have this code to print the current directory using Perl use Cwd qw(abs_path); my $path = abs_path($0); print "$path\n"; But it is displaying my perl source code file along with the directory.
5
2,731
thread by: priyankapendkar | last post Apr 15 '11 by: miller
Hi! I need to check everyday log file if anything “error” message on it? If answer yes I like to receive auto email. Please let me know how to write shell script for this auto alert email.plz help me as early as possible. Thanks and regards Priyanka

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.