On Nov 7, 2013, at 3:22 PM, Angela Barone wrote:
Hello,
I've set up a new cloud account to get familiar with nginx and I'd like
to know if it's possible to run an older cgi perl script, and if so, how
would I go about doing that? I think I read somewhere that it could be done
On Nov 18, 2013, at 2:02 PM, SSC_perl wrote:
Hi John,
Thanks for getting back to me with your findings. I really appreciate
it. I've gone through everything, made the changes that I could, and I have
some questions to some of your remarks.
You should be responding to the list,
On Nov 18, 2013, at 2:02 PM, SSC_perl p...@surfshopcart.com wrote:
Surf.pm:65: $cookie =~ Encode($cookie);
Surf.pm:66: $value =~ Encode($value);
Did you really mean to use the return value from Encode() as a regular
expression?
Unfortunately, I can't
On Nov 25, 2013, at 10:55 AM, Mike Blezien wrote:
Hello,
Regular expression have never been my strong suite so hoping to get a litte
help with a line in file I need to extract a portion of it.
The text I need to extract from this line is November 21, 2013 from this
line in the file,
On Nov 25, 2013, at 12:08 PM, Rajeev Prasad wrote:
i need to go to a website and input some data in a specific input field, and
run the query which opens a new page, i need to download and save it as an
html page on my unix box. there are several blockages i am not able to figure
out.
On Dec 11, 2013, at 7:34 AM, punit jain contactpunitj...@gmail.com wrote:
Hi,
I have a requirement where I need to capture phone number from different
strings.
The strings could be :-
1. COMP TEL NO 919369721113 for computer science
2. For Best Discount reach 092108493, from
On Jan 27, 2014, at 11:32 PM, Luca Ferrari fluca1...@infinito.it wrote:
Hi all,
often I find myself writing something like the following to get the
human date:
my ($day, $month, $year) = (localtime())[3..5];
$month++, $year += 1900;
print \nToday is $month / $day / $year \n;
I was
On Feb 3, 2014, at 12:30 PM, Paul Fontenot wrote:
Hi, I am attempting to write a regex but it is giving me a headache.
I have two log entries
1. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR
[org.apache.commons.logging.impl.Log4JLogger]
2. Feb 3 12:54:28 cdrtva01a1005 [12:
On Feb 13, 2014, at 12:27 PM, Uri Guttman wrote:
On 02/13/2014 12:39 PM, Janek Schleicher wrote:
Am 05.02.2014 23:30, schrieb kavita kulkarni:
Can somebody suggest me good book to learn/practice object oriented Perl
programming.
The usual answer is to study computer science.
OO
On Feb 21, 2014, at 6:21 AM, Wernher Eksteen crypt...@gmail.com wrote:
Hi all,
From the below file names I only need the version number 1.2.4 without
explicitly specifying it.
check_mk-1.2.4.tar.gz
check_mk-agent-1.2.4-1.noarch.rpm
check_mk-agent-logwatch-1.2.4-1.noarch.rpm
On Feb 23, 2014, at 5:10 AM, Wernher Eksteen crypt...@gmail.com wrote:
Hi,
Thanks, but how do I assign the value found by the regex to a variable so
that the 1.2.4 from 6 file names in the array @fileList are print only
once, and if there are other versions found say 1.2.5 and 1.2.6 to
On Feb 23, 2014, at 7:09 PM, Shaji Kalidasan shajiin...@yahoo.com wrote:
Dear Perlers,
I made some improvements in my code (now I am checking the file size of
remote file) but still can't figure out how to calculate the MD5 hash of a
remote file.
You cannot calculate the MD5 digest of a
On Feb 25, 2014, at 2:30 PM, Bill McCormick wrote:
What would be the perl'ish way using map or some other sugar to check if a
list of values meet some criteria? Instead of doing something like
my @issues = qq(123,456,a45);
my $max = 999;
for (@issues) {
die if $_ 0 or $_ $max;
}
On Feb 26, 2014, at 7:59 AM, jet speed speedj...@googlemail.com wrote:
Chaps,
Any quick one liner code in perl were i can get rid off the before and after
wwn each line for file as below
file
---
device name lz_09_red_e10 vsan 200
* fcid 0xef0013 [pwwn
On Feb 28, 2014, at 9:13 PM, Bill McCormick wpmccorm...@gmail.com wrote:
Can somebody help me understand this? Given this loop, and the logged output
following ...
my $found;
for( @$products ) {;
$found = $$_ =~ m|$project|;
$dump = Data::Dumper-Dump([$_, $project, $$_, $found]);
On Mar 3, 2014, at 8:47 AM, Wernher Eksteen wrote:
Hi Shlomi,
Thank you for the pointers. I do want to learn Python as well when I get a
chance. This framework I'm writing now will automate things to a great
extend eventually freeing up loads of my daily operations time so I can focus
On Mar 7, 2014, at 1:58 PM, s...@missionstclare.com wrote:
I have some text files from which I would like to remove the first line, but
only if it's blank. Any hints? I tried a few things, but the results haven't
quite been satisfactory.
You should be able to do that in just a few lines
On Mar 7, 2014, at 10:05 PM, Bill McCormick wpmccorm...@gmail.com wrote:
I have the following string I want to extract from:
my $str = foo (3 bar): baz;
and I want to to extract to end up with
$p1 = foo;
$p2 = 3;
$p3 = baz;
the complication is that the \s(\d\s.+) is optional, so
On Mar 8, 2014, at 4:50 AM, rakesh sharma rakeshsharm...@hotmail.com wrote:
Hi all,
how do you get all words starting with letter 'r' in a string.
Try
my @rwords = $string =~ /\br\w*?\b/g;
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail:
On Mar 14, 2014, at 5:28 AM, Anant kumar anant.singh1...@gmail.com wrote:
Hi everyone,
I am trying to write a script to search on the
internet for different keywords (like Organism name, metabolic reactions and
Genes involved). Can anyone suggest me how to proceed.
On Mar 25, 2014, at 6:55 AM, shawn wilson ag4ve...@gmail.com wrote:
i want to sort an array for certain key words first and then alphabetically.
my @foo = qw/foo bar baz first second third/;
foreach my $i (sort {$a cmp $b} @foo) {
print $i\n;
}
How do I make 'first', 'second', and
On Mar 25, 2014, at 7:56 AM, shawn wilson ag4ve...@gmail.com wrote:
Thanks (y'all). Though, I like this one best I think.
BTW, Jim's isn't exactly correct:
my @keys = qw( foo bar second baz first third );
my %primary = ( second = 1, first = 1, third = 1);
And then the output becomes:
On Mar 26, 2014, at 6:30 PM, Benjamin Fernandis benjo11...@gmail.com wrote:
Hi,
I am new with perl and we have virtual machines in our infra. i want to use
perl sys::virt module to manage them, means to shutdown / start vm by script
and for that i wrote below small code.
On May 20, 2014, at 4:19 PM, Benjamin Fernandis wrote:
Hi,
I want to fetch rawuuid from below file for each partition name.
I tried to use while loop and all but no luck.
example : partition name : ada0p2
rawuuid: 5899824d-e019-11e3-9cbc-08002731cc9a
file :
Geom
On May 20, 2014, at 6:41 PM, Yonghua Peng sys...@mail2000.us wrote:
I probably meant search.cpan.org doesn't work.
Try picking a different mirror. These are the ones I am using:
http://httpupdate35.cpanel.net/CPAN/
http://mirrors.gossamer-threads.com/CPAN/
http://cpan.cs.utah.edu/
--
To
Benjamin:
Please post messages to the list, not individual members.
On May 20, 2014, at 6:51 PM, Benjamin Fernandis benjo11...@gmail.com wrote:
Hey Jim,
I tried to use while loop to read file line by line, but facing problem to
get exact phrase or a way to start reading from predefined
On May 22, 2014, at 2:04 AM, siegfr...@heintze.com siegfr...@heintze.com
wrote:
I need to extract some information from source code.
How can I write a perl regular expression that will match a literal string in
languages like C#, javascript, java and lisp?
Here is my naive approach:
On May 23, 2014, at 2:45 PM, Sherman Willden wrote:
Disclaimer: I am 67 and not in school. I am doing this for my own
satisfaction.
How do I get a new line at the end of a non-quoted text. I am doing the
following:
Use Math::Trig;
print pi * 2;
print \n;
How do I get the new line
Please post messages to the list, not to me personally. That way, you will get
better answers sooner.
On May 23, 2014, at 3:13 PM, Sherman Willden wrote:
Thank you, Jim;
How do I get rid of the warning message without getting rid of the -w switch?
Use the 'use warnings;' pragma in your
On May 24, 2014, at 9:40 AM, siegfr...@heintze.com wrote:
I have multiple processes running cygwin/bash that are accessing the same
files in a certain directory.
I want to create a lock or semaphore or gate to serialize access to this
directory so that no two (or more processes) can
On May 29, 2014, at 1:20 PM, James Kerwin wrote:
Hello all, long time lurker, first time requester...
I have a Perl exam tomorrow and came across a question that I just cannot
find an answer to (past paper, this isn't cheating or homework etc.).
Explain the difference between:
On May 29, 2014, at 3:34 PM, Sherman Willden wrote:
Maybe I'm missing the point but isn't the following code the problem's
answer? Please let me know if I am off base.
Just a bit off (see below).
#!/usr/bin/perl
my @test = a b c;
That is a scalar on the right-hand side. You end up with
On Jun 10, 2014, at 2:59 PM, Kenneth Wolcott wrote:
Hi All;
how to create a text progress status line that updates on the same line in
Perl?
I know that this questions is probably not well-posed, but I hope you
get what I'm after.
I'd like to do what application installers do,
On Jun 17, 2014, at 1:10 AM, Philippe Rousselot rousse...@rousselot.org wrote:
Hi,
I know nothing about perl and I have a problem with a cgi script for a
website called geneweb (genealogy stuff).
I moved from one web site to another and now the site does not work and give
me a 500
On Jun 17, 2014, at 1:02 PM, SSC_perl wrote:
What's the best way to stop undefined warnings for code like this:
$data-{'image'} = CopyTempFile('image') if ($main::global-{'admin'}
$main::global-{'form'}-{'image_upload'} ne '');
CGI::Carp gives the following:
[Tue Jun 17
On Jun 25, 2014, at 12:11 AM, Uday Vernekar vernekaru...@gmail.com wrote:
Dear Ron,
You are better off addressing your questions to the entire mailing list, rather
than asking information from one person. Ron is not obligated to help you and
may not be available, but others may be willing to
On Jun 26, 2014, at 2:05 AM, Uday Vernekar wrote:
Please suggest if any Corrections Needed.
There are several improvements you could make.
[code]
#!/usr/bin/perl
use 5.10.0;
use strict;
use warnings;
#Pattern
On Jun 30, 2014, at 2:44 AM, Uday Vernekar vernekaru...@gmail.com wrote:
please Explain
next if $line =~ /^-/;
“Skip this input line if it starts with a dash ‘-‘ character.”
my @f = split('\s*\|\s*',$line);
Break the input line into files separated by the vertical pipe character ‘|’
On Jun 30, 2014, at 11:57 AM, Sunita Pradhan wrote:
Hi
I want to count number of occurrences of one word in a line within one single
line of perl script .
My code :
$c++ if ($line =~ /\s+$w\s+/g);
print count $c\n;
Try this:
$c = () = $line =~ /\b$w\b/g;
--
To unsubscribe,
On Jun 30, 2014, at 12:17 PM, Sunita Pradhan wrote:
Thanks Jim. It is working but why a array is required here?
Please respond to the list and not to me personally. That way, everybody will
see your question, and somebody else can answer.
Try this:
$c = () = $line =~ /\b$w\b/g;
, 2014 at 9:06 PM, Jim Gibson jimsgib...@gmail.com wrote:
On Jun 30, 2014, at 2:44 AM, Uday Vernekar vernekaru...@gmail.com wrote:
please Explain
next if $line =~ /^-/;
“Skip this input line if it starts with a dash ‘-‘ character.”
my @f = split('\s*\|\s*',$line);
Break
On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
hi,
i have an array of arrays which contains equal elements. I would like to
isolate the unique values.
Do you mean that the subarrays contain equal NUMBERS of elements?
I have tried using the uniq method of List::MoreUtils but it
On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote:
On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson jimsgib...@gmail.com wrote:
On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote:
hi,
i have an array of arrays which contains equal elements. I would like to
isolate the unique values
On Jul 10, 2014, at 11:50 AM, Natxo Asenjo wrote:
On Thu, Jul 10, 2014 at 1:00 AM, Jim Gibson jimsgib...@gmail.com wrote:
On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote:
On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson jimsgib...@gmail.com wrote:
On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote
On Jul 25, 2014, at 9:54 AM, Chris Knipe wrote:
Hi All,
I have the odd (very rare) case where I am given a date in an incorrect
format. I already use Date::Parse to convert the dates to a unix timestamp,
and it’s working incredibly well. However, on the rare case that I get
On Jul 28, 2014, at 3:59 PM, ESChamp esch...@gmail.com wrote:
Suddenly, without warning or error messages, the script below is
producing null for values of $hfile and $bfile!
What are $hfile and $bfile? You don’t show them in your script. You show two
arrays: @hfile and @bfile, but those are
On Jul 29, 2014, at 5:12 PM, ESChamp esch...@gmail.com wrote:
ESChamp wrote on 7/28/2014 6:59 PM:
Suddenly, without warning or error messages, the script below is
producing null for values of $hfile and $bfile!
The script begins:
Let me backtrack and provide some background
On Jul 29, 2014, at 11:00 PM, ESChamp wrote:
Jim Gibson wrote on 7/29/2014 10:08 PM:
This is all speculation because you have not provided us with your exact
program and data files.
I was warned not to post a 3000 line data file and a 150 line program,
but if you'd like me to send
On Jul 30, 2014, at 1:23 PM, Martin G. McCormick wrote:
I thought that one could test for an empty or undefined array
against the @arrayname but it looks like doing that always
succeeds if it is set with my or our @arrayname.
You can test for an empty or an undefined array. Any array in
On Jul 31, 2014, at 12:02 PM, ESChamp wrote:
John W. Krahn wrote on 7/31/2014 3:11 AM:
Peter Holsberg wrote:
I think I've isolated the section that is not doing what I want.
open (FHIN, $recapfile) or die $!;
That would be better as:
open my $FHIN, '', $recapfile or die Cannot open
On Aug 6, 2014, at 10:55 AM, ESChamp wrote:
The program begins
#!/usr/bin/perl
You really should add these two lines:
use strict;
use warnings;
here and correct the mistakes they reveal.
use Tie::File;
use File::Copy 'copy';
use File::Spec;
my $copy=00-copy.htm;
my
On Aug 19, 2014, at 9:12 AM, Manuel Reimer wrote:
Hello,
there are many very good examples on how to execute perl code from C. For
example the following tutorial is very helpful:
http://perldoc.perl.org/perlembed.html
But it only shows calling from C to perl.
What I want to do is
On Sep 8, 2014, at 3:13 PM, lee wrote:
Shawn H Corey shawnhco...@gmail.com writes:
On Mon, 18 Aug 2014 16:17:53 +0800
Ken Peng o...@dnsbed.com wrote:
sub myfunc {
my @x=(1,2,3);
return \@x;
}
# or,
sub myfunc {
my @x=(1,2,3);
return [@x];
}
# or
sub myfunc {
On Sep 9, 2014, at 2:09 PM, lee wrote:
Jim Gibson jimsgib...@gmail.com writes:
On Sep 8, 2014, at 3:13 PM, lee wrote:
Shawn H Corey shawnhco...@gmail.com writes:
On Mon, 18 Aug 2014 16:17:53 +0800
# or
sub myfunc {
return [ 1, 2, 3 ];
}
Is there a difference to
sub myfunc
On Sep 9, 2014, at 2:57 PM, Shawn H Corey wrote:
On Tue, 09 Sep 2014 23:09:52 +0200
lee l...@yun.yagibdah.de wrote:
my $i = 1;
my $f = 2.5;
my $s = 'string';
my $list = (1, 2, 3);
No, the count of items in the list gets stored in $list: $list == 3
Unless the thing on the
The ‘our’ statement associates a simple name with a package global variable in
the current package. Therefore, if you want to make $var in file b.pl mean the
package global variable $var in package a ($a:var), just put ‘our $var;’ after
the ‘package a;’ statement in file b.pl (see below).
On
On Feb 5, 2015, at 6:53 PM, Wang, Zeng-Sheng (TS-GSD-China-ZZ)
zengsheng.w...@hp.com wrote:
Dear Uri,
First thanks for your kindly help and a read-friendly instruction, I will not
use $a and $b for variables. According to your explanation, I finish the code
as below:
On Jan 18, 2015, at 9:03 AM, Mike ekimduna...@gmail.com wrote:
I was able to find match extraction in the perldoc.
Here is a snippet of what I have.
my $insult = ( $mech-text =~ m/Insulter\ (.*)\ Taken/ );
print $insult\n;
But $insult is being populated with: 1
It should be
On Mar 13, 2015, at 2:07 PM, Sherman Willden sherman.will...@gmail.com
wrote:
I downloaded Eclipse and I was looking at the screens and in general just
messing with Eclipse. Now I can't find the first splash screen with the
tutorials, samples, and such. Also is there a help button on
On Mar 24, 2015, at 3:42 AM, Anirban Adhikary anirban.adhik...@gmail.com
wrote:
Hi List
I have a file like this.
RXMOI:MO=RXOTRX-473-0,SC=0,DCP1=178,SIG=SCCONC,DCP2=179186,TEI=0;
RXMOI:MO=RXOTRX-473-5,SC=0,DCP1=223,SIG=SCCONC,DCP2=224231,TEI=5;
On Mar 24, 2015, at 7:27 AM, Anirban Adhikary anirban.adhik...@gmail.com
wrote:
Hi Jim
In your code there is some hard coded value [ /RXMOI:MO=RXOTRX
But I can't put any hard coded value since I use this code as a function and
pass the filename as an argument.
As you can see in my
On Mar 25, 2015, at 10:07 AM, Anirban Adhikary anirban.adhik...@gmail.com
wrote:
Hi List
I have a configuration file and I would like to split the main file into
multiple small files and push the small temp. files into an array. My config
file looks like this
The best book on Perl (in my opinion) is “Programming Perl, 4th ed.”,
Christiansen, foy, Wall, Orwant.
See “perldoc perlbook” for other recommendations, as well as
http://books.perl.org
On Mar 30, 2015, at 9:42 AM, rakesh sharma rakeshsharm...@hotmail.com wrote:
Hi all
Please suggest
On Mar 26, 2015, at 3:54 PM, Benjamin Fernandis benjo11...@gmail.com wrote:
Hi,
We are using otrs help desk system which is in fully perl. We require to
append automatic comment when our specific customer raise ticket to us. We
have iteam no for each customer.So when customer send mail
It seems that you are working with a two-dimensional array of numbers, so it is
not clear why you are using a hash to store this data instead of an array of
arrays.
What you seem to be asking for is to generate the transpose of the
two-dimensional array. So the simplest approach would be to
On Jul 6, 2015, at 9:43 AM, Unknown User knowsuperunkn...@gmail.com wrote:
What is a good way to fire and forget a sub from a module in perl, in a non
blocking mode, preferably without forking or using threads.
I may have to run the sub a few times to determine the approx delay for it to
On Aug 11, 2015, at 3:16 PM, Chris Knipe sav...@savage.za.org wrote:
Lastly, you're reading from a socket so there's no guarantee that
the buffer string is going to necessarily end at the termination
boundary. Perhaps the protocol guarantees that, but the socket
surely doesn't. You may
On Jul 31, 2015, at 4:39 AM, David Emanuel da Costa Santiago
deman...@gmail.com wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hello.
Thanks for your reply.
I remember that i did some performance tests and
$string = $string .something
had better performance
On Aug 1, 2015, at 1:49 AM, bikram behera jobforbik...@gmail.com wrote:
Hi Team,
can you tell me about perl multi threading, uses of multi threading with
examples.
See ‘perldoc perlipc’ for all kinds of information about multi-threading with
lots of example code.
--
To unsubscribe,
On Jul 21, 2015, at 12:40 PM, Simon Reinhardt si...@keinstein.org wrote:
Hi Team,
is there a ready solution to convert an linear array of hashrefs
like this
[ {level = 0, value = string1},
{level = 1, value = string2},
{level = 2, value = string3},
{level = 2, value = string4}
]
> On Nov 3, 2015, at 2:03 PM, David Emanuel da Costa Santiago
> wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
>
> Hello all.
>
> I'm trying to interpolate a hash value in a string but i got stuck.
> I already tried with eval, without any success…
Show
On Jul 9, 2015, at 8:27 AM, Nagy Tamas (TVI-GmbH) tamas.n...@tvi-gmbh.de
wrote:
Hi,
So I have a better version. But if it goes down in the recursion tree, at the
end it goes into infinite loop,
because there is no other dir inside the last dir in the tree. At this point
it has to
> On Nov 26, 2015, at 7:06 AM, Parysatis Sachs wrote:
>
> Hey,
>
> can you please remove me from the mailing list?
>
> Thanks!
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
--
To unsubscribe,
If you want to sort your data numerically, then the data must look like a
number. Your data is mixed numerical and alpha data, hence the error message.
You first need to extract the numerical parts of your data records and compare
just those parts.
The first step would be to write a sort
a hash with the strings as keys and the number of strings
encountered in the array so far as the hash value. You can then add the number
to each string as you iterate over the array and increment the hash value count.
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
> On Feb 9, 2016, at 6:46 AM, James Kerwin wrote:
>
> Thank you both very much for your help. I'll investigate this way when I get
> home later (I'm a bit wary of hashes because they're weird).
Here is a solution using a hash:
#!/usr/bin/perl
use strict;
use warnings;
close($out) or die(“Error writing to output file $newfile: $!”);
# rename the old file
my $savefile = $filename . ‘.sav’;
rename $filename, $savefile;
# rename the new file
rename $newfile, $filename;
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
> On May 15, 2016, at 5:05 AM, Unknown User wrote:
>
> The port is not in use before i run the script. It is in use when i
> run it. However the problem is that only one iteration runs. I
> expected all to run.
Your ‘listen’ statement is in a loop. Therefore, the
onks.org/?node_id=638391>
<http://search.cpan.org/~kwilliams/Algorithm-SVMLight/lib/Algorithm/SVMLight.pm>
<https://www.youtube.com/watch?v=Cdcx4lbUbes>
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
through the
documentation and figure that out.
For example, you can print out individual sections like this:
print "\n;; HEADER SECTION\n";
$reply->header->print();
but I don’t see anything that supports an optional TSIG file equivalent to the
-k option (I don’t know what that is, so can’t help with that).
Good luck!
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Feb 15, 2017, at 7:10 PM, Eko Budiharto wrote:
>
> Jim,
> if I want to extract all incoming emails from my qmail emails, how can
> specify the folder location and specify the file name since the file name
> always different?
>
> Thx.
Use File::Find or opendir and
> On Feb 15, 2017, at 8:10 PM, Eko Budiharto wrote:
>
> dear Jim,
> I tried to add lines to read file like this:
>
> use Email::MIME;
>
> my $file = '/var/qmail/mailnames/
> On Feb 9, 2017, at 7:39 AM, Simon Bauer wrote:
>
> Hi,
>
> when I turn on -W in one of my perl scripts then I get a lot of warnings
> concerning Math::Complex
>
> Prototype mismatch: sub Math::Complex::abs (_) vs none at
> /usr/share/perl/5.22/Math/Complex.pm line 667.
> On Feb 15, 2017, at 9:56 PM, Eko Budiharto wrote:
>
> Jim,
> I have one a couple more questions.
> -. For the header, what if, I just need the subject, the from, and the
> recipient, what is the command? I read the manual in the
>
he email file into
the variable $text I do this:
my $mime = Email::MIME->($text);
my @parts = $mime->parts();
for my $npart ( 0..$#parts ) {
my $part = $parts[$npart];
my $header = $part->header_obj();
my $htext = $header->as_string();
my $body = $part->body();
…
}
Jim Gi
> On Sep 9, 2016, at 8:54 AM, Nathalie Conte wrote:
>
> Hello,
> I have a question about making a calculation within a loop
>
> I have a hash of hashes
> ##
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> use Data::Dumper qw(Dumper);
>
> my %grades;
>
> On Sep 12, 2016, at 6:24 AM, Nathalie Conte wrote:
>
> Dear all,
>
> Thanks a lot for the codes various people which all work perfectly!! I have
> also discover some useful functions (eval and state) which can also be very
> helpful for this kind of data.
>
> In the
> On Nov 10, 2016, at 3:34 AM, jaceke wrote:
>
> I would like as argument of function use path with special characters then ''
> are needed.
> That's why function adding apostrophe but after adding apostrofe file cannot
> be found.
If the string value of the scalar variable
On Nov 10, 2016, at 2:30 AM, jaceke wrote:
>
> Hi,
> how can I check if file exist or not ?
>
> Here's a short test/example:
>
> if (-e '/etc/passwd')
> {
> printf "File exist !\n";
> } else {
> printf "File not exist !\n";
> }
>
> That works great !
>
> but next a short
See inline comments below.
On Nov 10, 2016, at 3:15 AM, jaceke wrote:
>
> This example will be better :
>
> #!/usr/bin/perl
> use strict;
> use File::Basename;
> use utf8;
>
You should indent all blocks (subroutines, if statements, loops, etc.) to make
it easier to read and
> On Mar 25, 2017, at 8:51 AM, SSC_perl wrote:
>
> I’ll sometimes use the following code at the beginning of a script to
> log errors while testing:
>
> BEGIN {
> use CGI::Carp qw(carpout);
> open(_STDERR,'>'); close STDERR;
> open (my $log,
gt; Use of uninitialized value in uc at
>
> Any ideas how to get rid of the warning
Make sure that all $options{$key}->{type} values are defined:
foreach my $key ( keys %options ) {
$options{$key}->{type} = ‘’ unless defined $options{$key}->{type};
}
Substitute something else for ‘’ depe
doc Text::Wrap how @text is supposed
> to be populated.
@text is a list of scalar strings passed to the wrap subroutine. You can pass a
single string also. Try this loop instead:
while (<>) {
if (/$rgx/) {
print "\n";
print wrap(",", $_);
}
}
It is usually better t
H, $file) or die "could not open file\n";
>
> while( my $line = <$FH> ){
> #[process the lines & hash construction.]
> }
> close $FH;
> }
>
> Regards,
> Kamal.
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
ate.
If I had to do this, I would create a hash that had the directory name as a key
and the number of files in that directory that have a numerical file name. I
would use File::Find to traverse the directory tree, check the name of each
non-directory file, and increment the count for the enclosing directory for
each such file I found.
A line something like this:
$filecount{$File::Find::dir}++;
would be central to my program.
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
;
$total_dir++;
$total_files += $nfiles;
}
print "\n<$total_files> files in <$total_dir> directories\n”;
Note that I recommend keeping the raw numerical data (file counts) and not
saving the output lines. Generate the output lines when you print them.
Jim Gibson
> On May 5, 2017, at 6:06 PM, lee <l...@yagibdah.de> wrote:
>
>
> Hi,
>
> how can a sleeping program react to a key that was pressed without
> return being pressed?
>
See ‘perldoc -q "How can I read a single character from a file? From the
keyboard?”
note that the smallest factor of any number cannot be larger than the
square root of that number, so the function isprime need not consider potential
factors larger than the square root of its argument.
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
> On Aug 18, 2017, at 6:05 AM, Harry Putnam <rea...@newsguy.com> wrote:
>
> jimsgib...@gmail.com (Jim Gibson) writes:
>>>
>
> A second attempt trying to use your last example as inspiration
> follows:
>
> ---8< snip -8< snip -
tps://metacpan.org/pod/CGI>
<https://metacpan.org/pod/Task::Kensho#Task::Kensho::WebDev:-Web-Development>
>
>
>
> --
> Ahmad Bilal
>
Jim Gibson
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
601 - 700 of 723 matches
Mail list logo