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...
|
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
|
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...
|
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...
|
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...
|
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
|
| |
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;
|
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
|
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...
|
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...
|
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...
|
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...
|
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...
|
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);
|
| |
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...
|
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?
|
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...
|
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...
|
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...
|
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?
|
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++;
}
|
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?
|
| |
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.
...
|
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...
|
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...
|