Re: No decode delegate for this image format `PNG'

2022-01-26 Thread Dermot
-looney-tunes-cartoon-bugs-and-lola-bunny.png','png-transparent-bugs-bunny-in-double-trouble-looney-tunes-others.png'); >> warn "$x" if "$x"; >> >> $x = $image->Crop(geometry=>'100x100+100+100'); >> warn "$x" if &q

Re: No decode delegate for this image format `PNG'

2022-01-25 Thread Andy Bach
d wrong or just that the one can't find the other. You might try tests with other formats to see if any format is usable, which might help debug the problem. You might try re-installing Image::Magick, esp. if you installed it before you installed libpng On Tue, Jan 25, 2022 at 10:35 AM William

No decode delegate for this image format `PNG'

2022-01-25 Thread William Torrez Corea
metry=>'100x100+100+100'); > warn "$x" if "$x"; > > $x = $image->Write('x.png'); > warn "$x" if "$x"; > The following error was: Exception 420: no decode delegate for this image format `PNG' @ > error/co

Re: Regex for date format

2018-06-29 Thread Mike Martin
Worked perfectly thanks, uri, and same technique works perfectly in postgresql regexp_replace for info On 29 June 2018 at 16:18, Mike Martin wrote: > Thanks > > > On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > >> On 06/29/2018 10:41 AM, Mike Martin wrote: >> >> sorry >> -mm-dd hh:mm:ss.dd

Re: Regex for date format

2018-06-29 Thread Mike Martin
Thanks On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > On 06/29/2018 10:41 AM, Mike Martin wrote: > > sorry > -mm-dd hh:mm:ss.dd > eg: > 2018-01-01 12-45-10-456789 to > 2018-01-01 12:45:10.456789 > > > > please reply to the list and not to me! > > then why did you want lookbehind? this

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 10:41 AM, Mike Martin wrote: sorry -mm-dd hh:mm:ss.dd eg: 2018-01-01 12-45-10-456789 to 2018-01-01 12:45:10.456789 please reply to the list and not to me! then why did you want lookbehind? this is very easy if you just grab the time parts and reassemble them as you wan

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 09:32 AM, Mike Martin wrote: Hi I am trying to convert a string of the format 2018-01-01 16-45-21-654278 to a proper timestamp string so basically I want to replace all -  after the date part i am not sure what you are trying to do. show the after text that you want. a proper

Regex for date format

2018-06-29 Thread Mike Martin
Hi I am trying to convert a string of the format 2018-01-01 16-45-21-654278 to a proper timestamp string so basically I want to replace all - after the date part I am getting a bit stuck, lookbehind doesnt seem to work as it includes the lookbehind on every occurence last attempt is s

Re: Changing date format using carpout

2017-03-26 Thread X Dungeness
The rest of it: use Time::Piece; use CGI::Carp (carpout); { local *CGI::Carp::stamp = sub {... }; open( my $log, ">>", "/path/to/error.log") or die $!; carpout($log); carp("foo happened"); # close($log) } carp("foo again but with module's timestamp"); On Sun, Mar 26, 2017 at 3:04 PM,

Re: Changing date format using carpout

2017-03-26 Thread X Dungeness
Shawn may have a different take but I think the "local" is misplaced and goes out of scope when the call's made. Here's a potential workaround: out of scope On Sun, Mar 26, 2017 at 2:02 PM, SSC_perl wrote: >> On Mar 26, 2017, at 1:15 PM, Shawn H Corey wrote: >> >> it would mean replacing the s

Re: Changing date format using carpout

2017-03-26 Thread SSC_perl
> On Mar 26, 2017, at 1:15 PM, Shawn H Corey wrote: > > it would mean replacing the subroutine after the module was loaded. Thanks, Shawn, but I can’t get that to work. Reading perldoc Core gives me the impression that I’d need to call the new sub, not the module. If that’s true, I d

Re: Changing date format using carpout

2017-03-26 Thread Shawn H Corey
On Sun, 26 Mar 2017 11:28:44 -0700 SSC_perl wrote: > > On Mar 25, 2017, at 8:58 PM, Jim Gibson > > wrote: > > > > You could also try overriding the supplied function of the imported > > module with your own version (not sure exactly how that is done). > > Hmm… me neither, but it’s a go

Re: Changing date format using carpout

2017-03-26 Thread SSC_perl
my ($timestamp, $message) = ($1, $2); ## [Wed Mar 22 12:43:20 2017] -- Original timestamp format. my $dt = Time::Piece->strptime($timestamp, '%a %b %d %H:%M:%S %Y'); my $datetime = $dt->strftime('%Y-%m-%d %H:%M'); say

Re: Changing date format using carpout

2017-03-26 Thread SSC_perl
> On Mar 25, 2017, at 8:58 PM, Jim Gibson wrote: > > You could also try overriding the supplied function of the imported module > with your own version (not sure exactly how that is done). Hmm… me neither, but it’s a good idea. I’ll contact the maintainer of CGI::Carp to see if that c

Re: Changing date format using carpout

2017-03-26 Thread X Dungeness
open(_STDERR,'>&STDERR'); close STDERR; > open (my $log, '>>', 'logs/error.log') or warn("Couldn't open > error.log: $! \n"); > carpout($log); > close ($log); > } > > However, I would

Re: Changing date format using carpout

2017-03-25 Thread Jim Gibson
TDERR; > open (my $log, '>>', 'logs/error.log') or warn("Couldn't open > error.log: $! \n"); > carpout($log); > close ($log); > } > > However, I would like to change the date format. I’m not wild about > seeing th

Changing date format using carpout

2017-03-25 Thread SSC_perl
;) or warn("Couldn't open error.log: $! \n"); carpout($log); close ($log); } However, I would like to change the date format. I’m not wild about seeing the the full timestamp on every line: [Sat Mar 25 08:05:58 2017] Is there a way I can format that to my liki

Re: suggestion for print format string based on configuration

2017-01-03 Thread Luca Ferrari
On Wed, Jan 4, 2017 at 12:22 AM, Chris Fedde wrote: > my ($condition, @fields) = parse_data($source_item); > print sprintf $formats[ $condition ], @fields; > > Or something. Well, I've simplified the example and effectively, in my code, the formats is an hash instrumented by the condition

Re: suggestion for print format string based on configuration

2017-01-03 Thread Luca Ferrari
On Tue, Jan 3, 2017 at 5:58 PM, Shlomi Fish wrote: > Perhaps try looking at this page about generating text in Perl - > http://perl-begin.org/uses/text-generation/ (note that Perl-Begin is a site > which I maintain). This page on my personal website, which is not > Perl-specific, but which may hav

Re: suggestion for print format string based on configuration

2017-01-03 Thread Chris Fedde
: my ($condition, @fields) = parse_data($source_item); print sprintf $formats[ $condition ], @fields; Or something. if this works then $condition could be some string from the $source_item. Then @formats could be %formats and $condition is the key and the printf format is the value. Here

Re: suggestion for print format string based on configuration

2017-01-03 Thread Shlomi Fish
more elegant. > What I do is something like the following: > > print sprintf $formats[ $condition ], @fields; > > where $condition is the condition used to select a sprintf format > string out of an array (@formats) that contains something like: > > my @formats = ( >

suggestion for print format string based on configuration

2017-01-03 Thread Luca Ferrari
], @fields; where $condition is the condition used to select a sprintf format string out of an array (@formats) that contains something like: my @formats = ( qw( %09d %-1s %03d ... ) , qw(%-4s %1s %09d %1s %-150s %-4s %011d) , ... ); Now, while this approach is working really fine, it is a litt

Re: converting Genbank format in gff format

2015-08-20 Thread Mike Flannigan
On 8/20/2015 4:01 AM, beginners-digest-h...@perl.org wrote: Subject: Re: converting Genbank format in gff format From: John SJ Anderson Date: 8/17/2015 10:03 PM To: Perl Beginners On Mon, Aug 17, 2015 at 3:58 PM, Uri Guttman <mailto:u...@stemsystems.com>> wrote: On 08/17/2

Re: converting Genbank format in gff format

2015-08-18 Thread Uri Guttman
a possibilty to convert Genbank format in gff format using perl? I installed perl5 in my linux. Atteyet-Alla -- there's a 'genbank2gff' script in the Bioperl dist, perhaps that at least gives you some hints on where to start? Code is here: https://metacpan.org/source/CJFIEL

Re: converting Genbank format in gff format

2015-08-18 Thread John SJ Anderson
On Mon, Aug 17, 2015 at 3:58 PM, Uri Guttman wrote: > On 08/17/2015 03:57 AM, atteyet-alla.yas...@ukb.uni-bonn.de wrote: > > hi all, > > is there a possibilty to convert Genbank format in gff format using perl? > I installed perl5 in my linux. > > Atteyet-Alla -- there&

Re: converting Genbank format in gff format

2015-08-17 Thread Uri Guttman
On 08/17/2015 03:57 AM, atteyet-alla.yas...@ukb.uni-bonn.de wrote: hi all, is there a possibilty to convert Genbank format in gff format using perl? I installed perl5 in my linux. the answer is yes, perl can convert anything into anything. that is true for most if not all languages. do

converting Genbank format in gff format

2015-08-17 Thread Atteyet-Alla . Yassin
hi all, is there a possibilty to convert Genbank format in gff format using perl? I installed perl5 in my linux. Thank you in advance for help. Yassin

Re: use perl format data

2015-02-09 Thread Shlomi Fish
Shlomi Fish > > Begin forwarded message: > > Date: Tue, 10 Feb 2015 11:01:56 +0530 > From: prasanth > To: Shlomi Fish > Subject: Re: use perl format data > > > Hi, > > Lets see if the below code helps: > First of all your code is missing strict an

Fw: use perl format data

2015-02-09 Thread Shlomi Fish
Dear Prasanth, next time please reply to the list. I'm going to comment on your code after this forwarded message arrives at the list. Regards, Shlomi Fish Begin forwarded message: Date: Tue, 10 Feb 2015 11:01:56 +0530 From: prasanth To: Shlomi Fish Subject: Re: use perl format

Re: use perl format data

2015-02-08 Thread Shlomi Fish
On Sun, 8 Feb 2015 15:51:59 + "Wang, Zeng-Sheng (TS-GSD-China-ZZ)" wrote: > Thanks for your kindly suggestion, you help me learn more of perl knowledge. > You're welcome! My pleasure. Regards, Shlomi Fish -- - Shlom

RE: use perl format data

2015-02-08 Thread Wang, Zeng-Sheng (TS-GSD-China-ZZ)
Thanks for your kindly suggestion, you help me learn more of perl knowledge. -Original Message- From: Shlomi Fish [mailto:shlo...@shlomifish.org] Sent: Friday, February 06, 2015 4:45 PM To: beginners@perl.org Subject: Re: use perl format data Hi Mr./Ms. Wang, a few notes on your code

Re: use perl format data

2015-02-06 Thread Uri Guttman
On 02/06/2015 03:44 AM, Shlomi Fish wrote: @first_file, @second_file, and @third_file really should be an array of arrays. See: http://perl-begin.org/topics/references/ did you see my comment on not doing that right away? he obviously is so new that simpler perl things are what he needs to lea

Re: use perl format data

2015-02-06 Thread Shlomi Fish
Hi Mr./Ms. Wang, a few notes on your code. On Fri, 6 Feb 2015 02:53:52 + "Wang, Zeng-Sheng (TS-GSD-China-ZZ)" 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

RE: use perl format data

2015-02-05 Thread Wang, Zeng-Sheng (TS-GSD-China-ZZ)
: Wang, Zeng-Sheng (TS-GSD-China-ZZ); beginners@perl.org Subject: Re: use perl format data > On Feb 5, 2015, at 6:53 PM, Wang, Zeng-Sheng (TS-GSD-China-ZZ) > wrote: > > Dear Uri, > > First thanks for your kindly help and a read-friendly instruction, I will not > use $a

Re: use perl format data

2015-02-05 Thread Jim Gibson
> On Feb 5, 2015, at 6:53 PM, Wang, Zeng-Sheng (TS-GSD-China-ZZ) > 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: > #!/usr/bin/perl -w > 2 us

RE: use perl format data

2015-02-05 Thread Wang, Zeng-Sheng (TS-GSD-China-ZZ)
alue within @third_file in concatenation (.) or string at format.pl line 25. a b c x y z 1 2 3 d e f q w e n 3 4 5 j p ka s d 8 9 2 1 Thank you very much again. From: Uri Guttman [mailto:u...@stemsystems.com] Sent: Friday, February 06, 2015 9:25 AM To: beginners

Re: use perl format data

2015-02-05 Thread Uri Guttman
On 02/05/2015 08:07 PM, Wang, Zeng-Sheng (TS-GSD-China-ZZ) wrote: Dear Shawn, Please forgive me for my poor English explanations of my question, there are three files, file 1, file 2 and file3. File 1: a b c d e f j p k file 2: x y z q w e n a s d file 3: 1 2 3 3 4 5 8 9 2 1 I

RE: use perl format data

2015-02-05 Thread Wang, Zeng-Sheng (TS-GSD-China-ZZ)
For the question, I don’t want use the system command “paste”. Only want to resolve it in perl way. From: Wang, Zeng-Sheng (TS-GSD-China-ZZ) Sent: Friday, February 06, 2015 9:08 AM To: 'shawn wilson' Cc: beginners@perl.org; Wang, Zeng-Sheng (TS-GSD-China-ZZ) Subject: RE: use perl f

RE: use perl format data

2015-02-05 Thread Wang, Zeng-Sheng (TS-GSD-China-ZZ)
: Thursday, February 05, 2015 7:17 PM To: Wang, Zeng-Sheng (TS-GSD-China-ZZ) Cc: beginners@perl.org Subject: Re: use perl format data On Feb 5, 2015 4:06 AM, "Wang, Zeng-Sheng (TS-GSD-China-ZZ)" mailto:zengsheng.w...@hp.com>> wrote: > > > a b c x y z

Re: use perl format data

2015-02-05 Thread shawn wilson
gt; how to use $a, $b and $c product $x? > Along with what was already mentioned about variable names, if you're asking about math, look at pdl. If you're asking about output format, you can either use printf, look at one of the grid modules, or use perltex (or there's probably a docbook or mathml module or two but I haven't looked).

Re: use perl format data

2015-02-05 Thread Shlomi Fish
Hi Mr./Ms. Wang, On Thu, 5 Feb 2015 09:03:19 + "Wang, Zeng-Sheng (TS-GSD-China-ZZ)" wrote: > Dear all, > I meet a problem and I can't resolve it. Would you like to help me for it? > I simple my problem to below text. > > $a content: > a b c > d e f > j p k > > $b content > > x y z > q w e

use perl format data

2015-02-05 Thread Wang, Zeng-Sheng (TS-GSD-China-ZZ)
Dear all, I meet a problem and I can't resolve it. Would you like to help me for it? I simple my problem to below text. $a content: a b c d e f j p k $b content x y z q w e n a s d $c content 1 2 3 3 4 5 8 9 2 1 $x content a b c x y z 1 2 3 d e f q w e n

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-04 Thread Brandon McCaig
Harry: (New to thread, reading bottom-up..) On Tue, Nov 4, 2014 at 1:12 PM, Harry Putnam wrote: > Shlomi Fish writes: >> 1. No need to wrap «$cmd» in double quotes here: >> >> http://perl-begin.org/tutorials/bad-elements/#vars_in_quotes >> >> 2. You should use the list form: >> >> my @cmd = qw(

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-04 Thread Harry Putnam
Shlomi Fish writes: Accidentally left out of my previous resonse. > In addition to what Ken said: > >> cat tst: >> >> #!/usr/local/bin/perl >> >> use strict; >> use warnings; >> >> my $cmd = 'ls /'; >> >> open my $ch, '-|', "$cmd" or die "Can't open $cmd: $!"; >> > > 1. No need to wrap «$cm

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-04 Thread Harry Putnam
Ken Slater writes: (Note: somehow a post about like below didn't make it to the list when my other response did... this is paraphrasing) >> cat tst: >> >> #!/usr/local/bin/perl >> >> use strict; >> use warnings; >> >> my $cmd = 'ls /'; >> >> open my $ch, '-|', "$cmd" or die "Can't open $cmd: $!"

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-03 Thread John SJ Anderson
On Mon, Nov 3, 2014 at 9:57 AM, Harry Putnam wrote: > Ken Slater writes: that attribution is wrong. Ken didn't say this, Shlomi did. >> It is a good idea to avoid using $_ in production code: This is an opinion. I think it's ... I hesitate to use the word "controversial", but it's not uni

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-03 Thread Harry Putnam
Ken Slater writes: > > It is a good idea to avoid using $_ in production code: > > http://perl-begin.org/tutorials/bad-elements/#overuse_dollar_underscore > > So write it as: > > while (my $l = <$ch>) { > print $l; > } Again, easy enough to do. and no doubt it would be good. But why is

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-03 Thread Shlomi Fish
Hi Harry, On Sun, 02 Nov 2014 17:22:10 -0500 Harry Putnam wrote: > Intermittent programming can lead to brain bleed off. > > In the real script the command is something only found on solaris or > any other zfs filesystem so I just used the first simple command I > could think of. But the aim i

Re: (Possibly a terrible lamer) is `open' format wrong

2014-11-02 Thread Ken Slater
> cat tst: > > #!/usr/local/bin/perl > > use strict; > use warnings; > > my $cmd = 'ls /'; > > open my $ch, '-|', "$cmd" or die "Can't open $cmd: $!"; > > while ($ch) { > print; > } I believe you meant: while (<$ch>) HTH, Ken On Sun, Nov 2, 2014 at 5:22 PM, Harry Putnam wrote: > Intermitten

(Possibly a terrible lamer) is `open' format wrong

2014-11-02 Thread Harry Putnam
Intermittent programming can lead to brain bleed off. In the real script the command is something only found on solaris or any other zfs filesystem so I just used the first simple command I could think of. But the aim is to use the output of a command to perform a string match. I left that out t

CPAN Not installing dependencies ( was: Re: want to write to file in different format )

2014-07-08 Thread Kent Fredric
On 8 July 2014 19:00, Uday Vernekar wrote: > when i try to install Path::Tiny it gives me following error > > # The following REQUIRED prerequisites were not satisfied: > # > # File::Spec version '3.33' is not in required range '3.40' > # > t/00-report-prereqs.t . ok > t/basename.t ..

Re: want to write to file in different format

2014-07-08 Thread Uday Vernekar
when i try to install Path::Tiny it gives me following error # The following REQUIRED prerequisites were not satisfied: # # File::Spec version '3.33' is not in required range '3.40' # t/00-report-prereqs.t . ok t/basename.t .. File::Spec version 3.4 required--this i

Re: want to write to file in different format

2014-07-07 Thread Kent Fredric
I'm not about to write my own version here, just offer some pointers I find makes life easier for myself, and they may help others too if you're not bound to "I don't want to use CPAN". These days, I find it easier and safer to just use > use Path::Tiny qw(path); > > my $infile = path('numbers.tx

Re: want to write to file in different format

2014-07-07 Thread Nathan Hilterbrand
On 07/07/2014 10:26 AM, Розанда ЧУП wrote: Without comments is more clear :) == #!/usr/bin/perl -w use strict; use 5.010; open FILE, '<', "numbers.txt" or die "can not open file . $!\n"; open FILE1, '>>', "sumfile.txt" or die "can not open file . $!\n"; selec

Re: want to write to file in different format

2014-07-07 Thread Розанда ЧУП
thanks ! :) 07.07.2014, 17:38, "Shawn H Corey" : > On Mon, 07 Jul 2014 17:26:05 +0300 > Розанда ЧУП wrote: >>  #!/usr/bin/perl -w > > This turns the warnings on for everything, including modules that have > to violate best practices in order to achieve their function. It is > better to `use warni

Re: want to write to file in different format

2014-07-07 Thread Shawn H Corey
On Mon, 07 Jul 2014 17:26:05 +0300 Розанда ЧУП wrote: > #!/usr/bin/perl -w This turns the warnings on for everything, including modules that have to violate best practices in order to achieve their function. It is better to `use warnings;` so hey can turn it off where needed and you don't get wa

Re: want to write to file in different format

2014-07-07 Thread Розанда ЧУП
Without comments is more clear :) == #!/usr/bin/perl -w use strict; use 5.010; open FILE, '<', "numbers.txt" or die "can not open file . $!\n"; open FILE1, '>>', "sumfile.txt" or die "can not open file . $!\n"; select FILE1; # set the defualt output stream chom

Re: want to write to file in different format

2014-07-07 Thread Розанда ЧУП
#!/usr/bin/perl -w use strict; use 5.010; open FILE, '<', "numbers.txt" or die "can not open file . $!\n"; # recommended to use open with three argument open FILE1, '>>', "sumfile.txt" or die "can not open file . $!\n"; select FILE1; # set the defualt output stream chomp (my @lines = ); my (@ln,

RE: want to write to file in different format

2014-07-07 Thread Sunita Pradhan
Program is working . Thank you all. Date: Mon, 7 Jul 2014 15:48:48 +0530 Subject: Re: want to write to file in different format From: mukeshbarn...@gmail.com To: johndelac...@gmail.com CC: beginners@perl.org Very nice John!!!I couldn't think it.Mukesh Kumar Member of Technical Staff Ca

Re: want to write to file in different format

2014-07-07 Thread Mukesh Baranwal
Very nice John!!! I couldn't think it. *Mukesh Kumar* *Member of Technical Staff* *Cadence Design Systems (I) Pvt. Ltd.* *Mob:- +91-8527749333* On 7 July 2014 15:26, John Delacour wrote: > > On 7 Jul 2014, at 09:18, Sunita Pradhan > wrote: > > > I have a file of contents: > > --- >

Re: want to write to file in different format

2014-07-07 Thread John Delacour
On 7 Jul 2014, at 09:18, Sunita Pradhan wrote: > I have a file of contents: > --- > 1 6 > 2 7 > 3 8 > 4 9 > 5 10 > -- > I want a file with content: > > 1 2 3 4 5 > 6 7 8 9 10 Try this: #!/usr/local/bin/perl use strict; my (@col1, @col2); while () { chomp; my @words = spli

Re: want to write to file in different format

2014-07-07 Thread Mukesh Baranwal
#! /usr/bin/perl use strict; use warnings; my $str1 = ""; my $str2 = ""; my $res; open(FILE, "numbers.txt") or die "Can't open the file 1 $!\n"; open(FILE1, ">test1.txt") or die "Can't open the file 2 $!\n"; open(FILE2, ">test2.txt") or die "Can't open the file 3 $!\n"; while () { chomp; if(

Re: want to write to file in different format

2014-07-07 Thread Shaji Kalidasan
Hi Sunita, Here's one way to do it [code] use strict; use warnings; open my $fin, '<', 'data.txt' or die "Cannot open file ($!)"; open my $fout1, '>', 'output1.txt' or die "Cannot open file ($!)"; open my $fout2, '>', 'output2.txt' or die "Cannot open file ($!)"; while (<$fin>) { #Approach 1 us

want to write to file in different format

2014-07-07 Thread Sunita Pradhan
I have a file of contents: --- 1 6 2 7 3 8 4 9 5 10 -- I want a file with content: 1 2 3 4 5 6 7 8 9 10 I have written a few lines of following code but it does not work as expected : --- #!/usr/bin/perl use v5.10; use strict; use

Re: Reading a config file and exporting it updated with the new/changes values in the same format.

2014-03-03 Thread Wernher Eksteen
ame entries and their values intact. Regards, Wernher On Tue, Mar 4, 2014 at 5:18 AM, Wernher Eksteen wrote: > Hi Jim, > > The format of the config file is like this: > > *Config file example1:* For one host in this case named hostname1 > belonging to 4 contactgroups (group1

Re: Reading a config file and exporting it updated with the new/changes values in the same format.

2014-03-03 Thread Wernher Eksteen
Hi Jim, The format of the config file is like this: *Config file example1:* For one host in this case named hostname1 belonging to 4 contactgroups (group1 to group4), < begin config file example 1 > host_contactgroups += [ ( 'group1', ['hostnam

Re: Reading a config file and exporting it updated with the new/changes values in the same format.

2014-03-03 Thread Jim Gibson
t some examples of how to parse your config files, then you should show us some examples of those config files. How to best parse the files depends wholly upon the format of the files. Some formats are easy to parse; other formats are more difficult. Nobody can advise you without seeing some exam

Re: Reading a config file and exporting it updated with the new/changes values in the same format.

2014-03-03 Thread Wernher Eksteen
config > > file with the > > latest hostname that was added or removed to a new config file in the > same > > format so that the Python based web tool can read it. > > > > This exceeds my knowledge of Perl at the moment and hope I can learn the > > ways from the Perl

Re: Reading a config file and exporting it updated with the new/changes values in the same format.

2014-03-03 Thread Shlomi Fish
file using > Perl. > > The idea I have is for Perl to read this config file, and instead of > adding/replcing values to the original config file, to re-write the config > file with the > latest hostname that was added or removed to a new config file in the same > format so tha

Reading a config file and exporting it updated with the new/changes values in the same format.

2014-03-02 Thread Wernher Eksteen
values to the original config file, to re-write the config file with the latest hostname that was added or removed to a new config file in the same format so that the Python based web tool can read it. This exceeds my knowledge of Perl at the moment and hope I can learn the ways from the Perl Masters

Re: Problem setting $= (Format Lines Per Page Special Variable)

2013-11-07 Thread Shaji Kalidasan
hough I set it to 10 it takes the default value which is 60. In line > number 31, I set the variable to a value of 10. It is not printing the > page number for every 10 lines > > Please guide me where I am going wrong. The problem is that you need to have your format selected when you

Re: Problem setting $= (Format Lines Per Page Special Variable)

2013-11-07 Thread Paul Johnson
ot printing the > page number for every 10 lines > > Please guide me where I am going wrong. The problem is that you need to have your format selected when you assign to $= so perl knows to which format you are referring: my $fh = select REPORT; $= = 10; select $fh; Alterna

Problem setting $= (Format Lines Per Page Special Variable)

2013-11-06 Thread Shaji Kalidasan
while (<$fin>) { ( $name, $empno, $department, $location ) = split ':'; my $len = length $name; if ( $len > $name_length ) { $name_length = $len; } } format REPORT_TOP= Page Number : -@|- $% -

Re: DateTime::Format::MySQL not working as expected, throwing error

2013-09-04 Thread Dr.Ruud
On 05/09/2013 02:28, J M wrote: However, I'm running into a problem: the FIRST instance of DateTime::Format::MySQL works perfectly... but when I get to the second one, it throws me this error: Use of uninitialized value $input in concatenation (.) or string at /usr/local/share/perl/5

DateTime::Format::MySQL not working as expected, throwing error

2013-09-04 Thread J M
Hi! I'm writing a simple script to output data from a MySQL database... Eventually I'd like to pipe it all into a .tex file and make a custom pdf out of it. However, I'm running into a problem: the FIRST instance of DateTime::Format::MySQL works perfectly... but when I get to the

Re: Convert any date format to ISO

2013-07-27 Thread Michael Brader
On 07/26/2013 06:10 AM, Charles DeRykus wrote: On Wed, Jul 24, 2013 at 10:56 PM, Michael Brader mailto:mbra...@internode.com.au>> wrote: [...] There are at least 2 modules that can definitely do the job for you, Date::Manip::Date and DateTime (with DateTime::Format::Natur

Re: Convert any date format to ISO

2013-07-27 Thread Charles DeRykus
; Most of the date modules on CPAN cannot do the job for me. I >>> >> >> Date::Manip and friends are wonderfully versatile but with even in this >> simple case, it does start to get a bit twisty with special parse and >> output methods: >> >> IMO,

Re: Convert any date format to ISO

2013-07-25 Thread Charles DeRykus
stands, I have to do this myself. > > > There are at least 2 modules that can definitely do the job for you, > Date::Manip::Date and DateTime (with DateTime::Format::Natural). I usually > use the latter, but since you want the former: > > Have a look at the documentation for Dat

Re: Convert any date format to ISO

2013-07-24 Thread Michael Brader
On 07/25/2013 03:26 PM, Jim Gibson wrote: You don't need a module to recognize a date in the form DD-MM- and change it into the form -MM-DD (untested): if( $date =~ /^(\d\d)-(\d\d)-(\d\d\d\d)$/ ) { $date = "$3-$2-$1"; }else{ # try other conversions } Jim's right, but be aware

Re: Convert any date format to ISO

2013-07-24 Thread Jim Gibson
On Jul 24, 2013, at 5:44 PM, mimic...@gmail.com wrote: > I was trying to use Date::Simple to convert date from DD-MM- to ISO > standard -MM-DD, but it produced error below because it returned undef > when the date passed is not ISO standard. You don't need a module to recognize a date

Re: Convert any date format to ISO

2013-07-24 Thread Michael Brader
:Date and DateTime (with DateTime::Format::Natural). I usually use the latter, but since you want the former: Have a look at the documentation for Date::Manip::Date and look for parse_format and printf If you are still stuck, don't hesitate to show your attempt and ask for more help

Re: Convert any date format to ISO

2013-07-24 Thread mimic...@gmail.com
print "$x\n" or "invalid\n";' 1972-01-29 Most of the date modules on CPAN cannot do the job for me. I spent time reading documentations but as it now stands, I have to do this myself. Mimi On 24 July 2013 15:24, mimic...@gmail.com wrote: > I'm trying to convert dates (input from user in any format) to ISO and > check it's valid. > > Can someone provide an example of this using Date::Simple or Date::Manip? > > Mimi >

Re: How to format the data ??

2012-08-23 Thread jet speed
'10:00:00:00:c9:c9:89:8b', > '10:00:00:00:c9:c9:89:8a', > '10:00:00:00:c9:c9:89:8i' > ] > } > }; > > So, yo

Re: How to format the data ??

2012-08-22 Thread timothy adigun
imple with less work. Hope this helps On 8/22/12, jet speed wrote: > Hi Rob, > Thanks for the detailed explanation. Appreciate it. > > Yes, perfect. All the details are captured. i should be able to modify the > output from your code. > > Thanks > Sj > > &

Re: How to format the data ??

2012-08-22 Thread jet speed
t; >> Hi All, >> >> Please advice me on now to capture the data below in the format as below. >> >> i thought of using hash, but then the problem is each DisplayDevNum has >> multiple WWN. some has 4 elements, some has 2. Any other method ? >> Apprecaite your co

Re: How to format the data ??

2012-08-22 Thread Rob Coops
On Wed, Aug 22, 2012 at 4:39 PM, jet speed wrote: > Hi All, > > Please advice me on now to capture the data below in the format as below. > > i thought of using hash, but then the problem is each DisplayDevNum has > multiple WWN. some has 4 elements, some has 2. Any other met

Re: How to format the data ??

2012-08-22 Thread Ken Slater
On Wed, Aug 22, 2012 at 10:39 AM, jet speed wrote: > Hi All, > > Please advice me on now to capture the data below in the format as below. > > i thought of using hash, but then the problem is each DisplayDevNum has > multiple WWN. some has 4 elements, some has 2. Any other met

How to format the data ??

2012-08-22 Thread jet speed
Hi All, Please advice me on now to capture the data below in the format as below. i thought of using hash, but then the problem is each DisplayDevNum has multiple WWN. some has 4 elements, some has 2. Any other method ? Apprecaite your comments. i want to caputre in the below format

Re: setting format explicitly

2011-10-12 Thread Shlomi Fish
e = strftime("%y%m%d%H%",localtime); > > open my $fh, '<', $filepath or die "ERROR opening $filepath: $!"; > open my $out, '>', $runTime or die "ERROR opening $runTime: $!"; > > while(<$fh>) { > print if /,HEH/; > }

Re: setting format explicitly

2011-10-11 Thread Rob Dixon
"ERROR opening $filepath: $!"; open my $out, '>', $runTime or die "ERROR opening $runTime: $!"; while(<$fh>) { print if /,HEH/; } # my $timeStamp = localtime;#&getDateTime(my $time,0); format RAW_HEADER = ^>>>>>

Re: setting format explicitly

2011-10-11 Thread John W. Krahn
s you forgot to load "RAW"?) at ./heh.pl line 39,<$fh> line 4288257. Have you read the format man page: perldoc perlform #!/usr/bin/perl use warnings; use strict; use POSIX; # require "heh_lib.pl"; # my $filepath = sprintf("/omp/omp-data/logs/OMPROP1/%s.APX

setting format explicitly

2011-10-11 Thread Chris Stinemetz
t;; open my $out, '>', $runTime or die "ERROR opening $runTime: $!"; while(<$fh>) { print if /,HEH/; } # my $timeStamp = localtime;#&getDateTime(my $time,0); format RAW_HEADER = ^>>>>>> HR 17-21 HEH Report @<<<<<<

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-29 Thread Octavian Rasnita
From: "Agnello George" > > >> This interpolation of string variables into an SQL statement is an SQL >> injection attack waiting to happen: >> >> * http://en.wikipedia.org/wiki/SQL_injection >> >> * http://community.livejournal.com/shlomif_tech/35301.html >> >> * http://bobby-tables.com/ >> >> Pl

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-29 Thread Agnello George
> > This interpolation of string variables into an SQL statement is an SQL > injection attack waiting to happen: > > * http://en.wikipedia.org/wiki/SQL_injection > > * http://community.livejournal.com/shlomif_tech/35301.html > > * http://bobby-tables.com/ > > Please avoid it by using placeholders.

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-28 Thread Octavian Rasnita
From: "Agnello George" > great !! i used tinymce in my insert form that solved all my html alignment > problem :) It would be much great if you wouldn't quote more than 140 lines of previous messages just to answer a single line... :-) Octavian -- To unsubscribe, e-mail: beginners-unsubscr..

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-28 Thread Agnello George
On Sat, May 28, 2011 at 2:24 PM, Agnello George wrote: > > > On Fri, May 27, 2011 at 6:21 PM, Agnello George > wrote: > >> >> >> On Fri, May 27, 2011 at 6:05 PM, Shlomi Fish wrote: >> >>> On Friday 27 May 2011 13:48:21 Agnello George wrote: >>> > Hi >>> > >>> > I am using TT to display my data f

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-28 Thread Agnello George
On Fri, May 27, 2011 at 6:21 PM, Agnello George wrote: > > > On Fri, May 27, 2011 at 6:05 PM, Shlomi Fish wrote: > >> On Friday 27 May 2011 13:48:21 Agnello George wrote: >> > Hi >> > >> > I am using TT to display my data from my db , >> > >> > >> > i insert the following data from a Front end

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-28 Thread Shlomi Fish
On Friday 27 May 2011 15:51:21 Agnello George wrote: > On Fri, May 27, 2011 at 6:05 PM, Shlomi Fish wrote: > > On Friday 27 May 2011 13:48:21 Agnello George wrote: > > > Hi > > > > > > > > > is there a way i can display on my browser with a new-line or > > > > First of all, make sure you avoi

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-27 Thread Agnello George
On Fri, May 27, 2011 at 6:05 PM, Shlomi Fish wrote: > On Friday 27 May 2011 13:48:21 Agnello George wrote: > > Hi > > > > I am using TT to display my data from my db , > > > > > > i insert the following data from a Front end using () > into > > my database the data is like this in mysql

Re: displaying data from mysql onto browser in correct format .. (using template toolkit )

2011-05-27 Thread Shlomi Fish
On Friday 27 May 2011 13:48:21 Agnello George wrote: > Hi > > I am using TT to display my data from my db , > > > i insert the following data from a Front end using () into > my database the data is like this in mysql : > > --

  1   2   3   4   5   6   >