473,550 Members | 2,459 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.
0
17,288
numberwhun
thread by: numberwhun | last post Nov 13 '07 by: numberwhun
Please remember the following when posting a question in the Perl Forum. Doing so will get you better assistance. Provide Sample Code - You will find that this is asked for more often than not. Since this is a coding forum, it is better to provide it than not, saving the Experts of the forum from asking for it. Use [CODE=perl] [/CODE] tags...
1
120,123
thread by: Jeremy Morton | last post Jul 19 '05 by: Big and Blue
Probably been mentioned before but I fail to see why Perl changed the 'break' keyword to 'last', in loops. Bear with me on this - it seems semantically more accurate to say 'break' - you're immediately breaking out of the loop. 'last' makes it sound like the current loop will be the last, but not that the execution should be stopped...
2
101,950
thread by: Natti | last post Feb 17 '07 by: KevinADC
On execution of #!/usr/bin/perl $val = 4; for ($i=0;$i<=$val;$i++) { print "$i\n"; sleep(1); } the output is 0
3
55,658
thread by: asearle | last post May 22 '07 by: shantu
Hallo everyone, I have a perl script which can return error codes. I have done this with, for example, 'exit 11;', which would (I imagine) send the exit code 11 (instead of 0) back to the calling program. I would now like to check that my error codes are being returned correctly and so wanted to write a short script to test this. Here I...
7
55,081
numberwhun
thread by: numberwhun | last post Jan 10 '08 by: numberwhun
**NOTE: This article is written using the 5.8.8 Alpha2 release of Strawberry Perl. I am writing this article with much joy and glee. This is due to the fact that Active State no longer has a monopoly on the issue of Perl on the Windows platform As anyone who code's Perl on the Windows platform knows, the choice that you have (had) for Perl...
1
47,381
KevinADC
thread by: KevinADC | last post Dec 4 '08 by: KevinADC
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
2
47,147
thread by: gfs X | last post Jul 19 '05 by: gfs X
Hi, Im a complete noob to perl. Is there a way to convert array values into a string? For example @myarr=("Sample","test","Array"); My desired output: "SampletestArray" To then work with as a string. I know I could just specify piece by piece but thats just too much and
4
45,988
thread by: Rich | last post Jul 19 '05 by: Rich
I am trying to replace the word "test" in a file with the word "Change" without creating a new file using the following code: #! /usr/bin/perl -w open (IN, "+</path/to/file/test.html"); while (<IN>){ s/test/Change/; print IN;
7
42,645
thread by: deep022in | last post Dec 17 '07 by: numberwhun
guys, I have written a perl script using Win32::OLe module. I was able to read it completly. but I have to specify the number of rows in excel sheet as command line option. I want to know how to retrieve number of rows of the excel sheet and number of columns also. i tried to retrieve the properties using the each methode. see below
11
42,634
thread by: bhanumathy | last post Jul 25 '08 by: KevinADC
hi, I am a beginer in PERL. got stuck in trying to figure out how strings are converted to character arrays. for ex: I want to convert @str1=("apple") to a charcter array like @chr1=('a','p','p','l','e') can some one help me how to implement the above? I basically need to get a string form the user and address each character(letter) of...
3
41,768
thread by: sandycat05 | last post Jan 29 '08 by: poolboi
Hello all, I am a new Perl programmer. Below is the beginnings of a code that I am using to manipulate an Excel spreadsheet via Perl using win32::OLE. However, what I'd like to do is the following: instead of either opening a file or creating a new one, I'd like to do BOTH. I was thinking of creating a loop where I could basically say something...
8
41,762
Chittaranjan
thread by: Chittaranjan | last post Jul 16 '15 by: hulk789
Hi All, I am using perl to get the data from the form fields and I have a text area from where if some one enters data like below: "This is test And this is also test This is also test." So here you can notify the text is entered with hitting of enter key to have the line break. But I am having the problem while saving the data entered...
7
40,948
thread by: chandru1782 | last post Aug 13 '07 by: chandru1782
Dear friends, I am trying to use CPAN for installing some perl modules. i am using a ubuntu system, which has internet connection through lan and authenticated proxy. when trying to install cpan.pm , it gives the following error, can any one help, You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one CPAN: LWP::UserAgent...
4
37,164
thread by: lilly07 | last post Apr 23 '09 by: ghostdog74
I am trying to remove all white spaces, tabs, newline, carriage return etc.. from a text file to make it as a one continous string. But the following code doesnot work. The file size is relatively smaller and hence I didn't use FILE::slurp. Please let me know the problem. Thanks. #!/usr/bin/perl local $/=undef; open(FILE, "test.fa") || die...
4
37,133
thread by: jcor | last post Jul 21 '15 by: tazosmr
Hi, I have a script that convert a file, "$novo" in this case, to a 3gp file: this is part of the script: print "qual é o título da peça? (< 36 caracteres)\n"; my $titul=<STDIN>; chomp($titul);
8
36,462
thread by: rssd | last post Aug 15 '23 by: EggyUen
can somebody help me. I'm trying to read some excel files but i'm always getting this error No type library matching "Microsoft Excel" found at D:\Genes_datasets\exp.pl line 4 Win32::OLE(0.16): GetOleTypeLibObject() Not a Win32::OLE::TypeLib object at C:/Perl/site/lib/Win32/OLE/Const.pm line 45. Died at D:\Genes_datasets\exp.pl line 6. i...
9
35,993
thread by: skyy | last post Jun 1 '07 by: miller
Hi i am trying to use the system() command to run some linux command using perl script... Eg.. Deleting files. system("rm $filename"); However, when my $filename contain " character, the sommand wont work. Any idea how to go around this?
3
35,382
thread by: AngeB | last post Feb 12 '09 by: Icecrack
Hi, I'm looking for a script to copy transaction log backup files from a network drive I have mapped to a local folder. Part of the filenames are common dbname_tlog_datehour.trn (date is formated y/m/d and is 24 hour format ex: 1600, 1700, 1800....) I've searched some perl forums and found a few scripts to try but haven't had any luck...
2
34,474
thread by: sri12 | last post Oct 10 '06 by: miller
Hi , I want to convert a Date in any format into any other format i required. Is there any built in function in PERL to do the date conversion in required format. For exampe: If date is in 28-09-2006 i want to convert it to 09-22-2006 i.e.,(dd-mm-yyyy to mm-dd-yyyy) Mainly i want to convert date in the format 28-sep-2006 to...
21
34,352
KevinADC
thread by: KevinADC | last post Jul 12 '10 by: numberwhun
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready...
9
33,444
thread by: whirly | last post Jul 25 '08 by: Phatfingers
I have a hex value FFFFFFCE that actually represents -50. When I simply use hex function to convert the above value to an integer, I get 4294967246. That means that integer overflow took place. How do I handle such cases, so that conversion will be correct?
7
33,138
thread by: Liang | last post Jul 19 '05 by: nobull
Hi, I need to get the number of keys in an hash. Is there any convenient way to get it? or use the following one? foreach $v (keys %hash){ $count++; }
6
31,240
thread by: TanmayAnand | last post Dec 3 '09 by: numberwhun
Hi, This time I am working on PERL. I want to send SMS alert using my perl script. Can i do this. If yes then how?
3
30,112
thread by: you | last post Oct 5 '07 by: you
Hi I'm installing "po4a" and met the following error. ~ # perl Build.PL Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.8/armv5tejl-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/armv5tejl-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .). at Build.PL line 3. ...
6
29,804
thread by: ajays | last post Oct 31 '13 by: RonB
I want to get the full computer name using the ActiveState Perl on windows . Actually i can get that using the "hostname" command, but i want to have the output of the "hostname" command stored in some variable using perl. And i wan to use that variable in my script. Is it possibel to write a script which will store the return value of the...
3
29,470
thread by: lilly07 | last post Aug 6 '08 by: Ritusriv
I am using following code to find the hostname/dns name of a linux server. (grep {chomp;} system ('hostname -s')); And the name of the server gets printed as XXX. And I am trying assign this value to $host as below. But it is not working and $host name is null. How do I assign XXX to $host. $host =(grep {chomp;} system ('hostname...

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.