Re: Perl version error

2023-05-31 Thread Olivier
OOps, I miss read the  version of Perl, sorry.

Olivier
-- 

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl version error

2023-05-31 Thread Olivier
"aziz.ogu...@eduline.com.tr"  writes:

> Hi Ken,
>
> I upgrade perl to the latest version that is 5.36.1, but I took same error.

The error message ask for Perl verion  5.37 and you only upgraded to
verion 5.36, so the error is still there.

You may have to download the source files for Perl and compile it
yourself. It takes time but usually is painless.

Regards,

Olivier

> On 5/31/23 10:46, Ken Peng wrote:
>> May 31, 2023 at 3:29 PM, "Aziz Öğütlü"  wrote:
>>
>>
>>> We are using mirdeep2 on our HPC system. When we try to call mirdeep2.pl, 
>>> it gives this error:
>>>
>>> Perl v5.35.7 required--this is only v5.26.3, stopped at 
>>> /opt/ohpc/pub/compiler/perl/5.36.0/lib/5.36.0/File/Copy.pm line 10.
>> It seems you need to upgrade perl to the latest version.
>>
>> regards.
>>
> -- 
> İyi çalışmalar,
> Aziz Öğütlü
>
> Eduline Bilişim Sanayi ve Ticaret Ltd. Şti.  www.eduline.com.tr
> Merkez Mah. Ayazma Cad. No:37 Papirus Plaza
> Kat:6 Ofis No:118 Kağıthane -  İstanbul - Türkiye 34406
> Tel : +90 212 324 60 61 Cep: +90 541 350 40 72

-- 

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Perl version error

2023-05-31 Thread Aziz Öğütlü
We are using mirdeep2 on our HPC system. When we try to call 
mirdeep2.pl, it gives this error:


Perl v5.35.7 required--this is only v5.26.3, stopped at 
/opt/ohpc/pub/compiler/perl/5.36.0/lib/5.36.0/File/Copy.pm line 10.
BEGIN failed--compilation aborted at 
/opt/ohpc/pub/compiler/perl/5.36.0/lib/5.36.0/File/Copy.pm line 10.
Compilation failed in require at 
/opt/ohpc/pub/apps/mirdeep2/0.1.3/bin/miRDeep2.pl line 25.
BEGIN failed--compilation aborted at 
/opt/ohpc/pub/apps/mirdeep2/0.1.3/bin/miRDeep2.pl line 25.


We asked to mirdeep2 github account, they said it was related to copy.pm 
and it was about perl.

Could you please help on this issue?

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Error when using the executable perl in client machine

2020-04-26 Thread Manikandan Narayan
Hi Mike
Thanks for your email and the and sharing more details, I will check out.

Once again Thanks

Regards,
Narayan

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_8364011968521704717_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sat, Apr 25, 2020 at 7:05 AM Mike  wrote:

>
> Hi Manikandan,
>
> I just received this response on the PAR list:
>
>
>  Forwarded Message 
> Subject: Re: Par with strawberry-Perl
> Date: Sat, 25 Apr 2020 09:44:13 +1000
> From: Shawn Laffan  
> To: Mike Flannigan  
> CC: p...@perl.org  
>
> Hello Mike,
>
> There are likely missing DLLs that need to be added to the pp call using
> the --link option.
>
> Finding these manually can be a pain, so have a look at pp_autolink or
> pp_simple (the former is mine, but adapted from the latter).
>
> https://github.com/shawnlaffan/perl-pp-autolink
> https://www.perlmonks.org/?node_id=1148802
>
> Shawn.
>
>
>
>
>
> On 4/17/20 12:00 PM, Manikandan Narayan wrote:
>
> Hi We are using  strawberry-perl
>
> Error when using the executable perl in client machine that does not have
> strawberry-perl in it
>
> Can't load
> 'C:\Users\Nuser\AppData\Local\Temp\par-30303030313137\cache-3610486
> 8c73148db1c60163c6ec837fe6a3b7c0d\9c557319.xs.dll' for module Net::SSH2:
> load_file:The specified module could not be found at
> /DynaLoader.pm line 193.
>   at /PAR/Heavy.pm line 140.
> Compilation failed in require at C:\Users\
> Nuser\AppData\Local\Temp\par-3030303
>
> 0313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/
> Backend/Net_SSH2.pm line 15.
> BEGIN failed--compilation aborted at C:\Users\ Nuser
> \AppData\Local\Temp\par-30303030313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm
> line 15.
> Compilation failed in require at script/SFTPdownload.pl line 13.
> BEGIN failed--compilation aborted at script/SFTPdownload.pl line 13.
>
> Any Help will be highly appreciated.
>
> Regards,
> Narayan
>
>
>
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


Re: Error when using the executable perl in client machine

2020-04-24 Thread Mike


Hi Manikandan,

I just received this response on the PAR list:


 Forwarded Message 
Subject:Re: Par with strawberry-Perl
Date:   Sat, 25 Apr 2020 09:44:13 +1000
From:   Shawn Laffan 
To: Mike Flannigan 
CC: p...@perl.org 



Hello Mike,

There are likely missing DLLs that need to be added to the pp call using 
the --link option.


Finding these manually can be a pain, so have a look at pp_autolink or 
pp_simple (the former is mine, but adapted from the latter).


https://github.com/shawnlaffan/perl-pp-autolink
https://www.perlmonks.org/?node_id=1148802

Shawn.





On 4/17/20 12:00 PM, Manikandan Narayan wrote:

Hi We are using strawberry-perl

Error when using the executable perl in client machine that does not 
have strawberry-perl in it


Can't load 
'C:\Users\Nuser\AppData\Local\Temp\par-30303030313137\cache-3610486
8c73148db1c60163c6ec837fe6a3b7c0d\9c557319.xs.dll' for module 
Net::SSH2: load_file:The specified module could not be found at 
/DynaLoader.pm line 193.

  at /PAR/Heavy.pm line 140.
Compilation failed in require at C:\Users\ 
Nuser\AppData\Local\Temp\par-3030303

0313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/
Backend/Net_SSH2.pm line 15.
BEGIN failed--compilation aborted at C:\Users\ Nuser 
\AppData\Local\Temp\par-30303030313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm 
line 15.

Compilation failed in require at script/SFTPdownload.pl line 13.
BEGIN failed--compilation aborted at script/SFTPdownload.pl line 13.

Any Help will be highly appreciated.

Regards,
Narayan




Re: Error when using the executable perl in client machine

2020-04-20 Thread Manikandan Narayan
Hi Rob

Thanks for your email

I will check the links provided by you

Mean while take care


Narayan

On Mon, 20 Apr 2020, 18:08 sisyphus,  wrote:

> Hi,
> See if there's anything helpful in
> https://www.perlmonks.org/?node_id=1229476
>
> If not, try posting your question at
> https://www.perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom
> (Just scroll down to the bottom of the page and you'll find the box you
> can fill in to ask your question.)
> Or try searching the perlmonks archive at
> https://www.perlmonks.org/?node=Super%20Search
>
> You might get better luck there. Apparently there's no-one here who is
> willing or able to help.
>
> I don't use PAR::Packer and have no interest in it.
>
> Cheers,
> Rob
>
> On Sat, Apr 18, 2020 at 3:01 AM Manikandan Narayan <
> narayanmanikan...@gmail.com> wrote:
>
>> Hi We are using  strawberry-perl
>>
>> Error when using the executable perl in client machine that does not have
>> strawberry-perl in it
>>
>> Can't load
>> 'C:\Users\Nuser\AppData\Local\Temp\par-30303030313137\cache-3610486
>> 8c73148db1c60163c6ec837fe6a3b7c0d\9c557319.xs.dll' for module Net::SSH2:
>> load_file:The specified module could not be found at
>> /DynaLoader.pm line 193.
>>   at /PAR/Heavy.pm line 140.
>> Compilation failed in require at C:\Users\
>> Nuser\AppData\Local\Temp\par-3030303
>>
>> 0313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/
>> Backend/Net_SSH2.pm line 15.
>> BEGIN failed--compilation aborted at C:\Users\ Nuser
>> \AppData\Local\Temp\par-30303030313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm
>> line 15.
>> Compilation failed in require at script/SFTPdownload.pl line 13.
>> BEGIN failed--compilation aborted at script/SFTPdownload.pl line 13.
>>
>> Any Help will be highly appreciated.
>>
>> Regards,
>> Narayan
>>
>


Re: Error when using the executable perl in client machine

2020-04-20 Thread sisyphus
Hi,
See if there's anything helpful in
https://www.perlmonks.org/?node_id=1229476

If not, try posting your question at
https://www.perlmonks.org/?node=Seekers%20of%20Perl%20Wisdom
(Just scroll down to the bottom of the page and you'll find the box you can
fill in to ask your question.)
Or try searching the perlmonks archive at
https://www.perlmonks.org/?node=Super%20Search

You might get better luck there. Apparently there's no-one here who is
willing or able to help.

I don't use PAR::Packer and have no interest in it.

Cheers,
Rob

On Sat, Apr 18, 2020 at 3:01 AM Manikandan Narayan <
narayanmanikan...@gmail.com> wrote:

> Hi We are using  strawberry-perl
>
> Error when using the executable perl in client machine that does not have
> strawberry-perl in it
>
> Can't load
> 'C:\Users\Nuser\AppData\Local\Temp\par-30303030313137\cache-3610486
> 8c73148db1c60163c6ec837fe6a3b7c0d\9c557319.xs.dll' for module Net::SSH2:
> load_file:The specified module could not be found at
> /DynaLoader.pm line 193.
>   at /PAR/Heavy.pm line 140.
> Compilation failed in require at C:\Users\
> Nuser\AppData\Local\Temp\par-3030303
>
> 0313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/
> Backend/Net_SSH2.pm line 15.
> BEGIN failed--compilation aborted at C:\Users\ Nuser
> \AppData\Local\Temp\par-30303030313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm
> line 15.
> Compilation failed in require at script/SFTPdownload.pl line 13.
> BEGIN failed--compilation aborted at script/SFTPdownload.pl line 13.
>
> Any Help will be highly appreciated.
>
> Regards,
> Narayan
>


Error when using the executable perl in client machine

2020-04-17 Thread Manikandan Narayan
Hi We are using  strawberry-perl

Error when using the executable perl in client machine that does not have
strawberry-perl in it

Can't load
'C:\Users\Nuser\AppData\Local\Temp\par-30303030313137\cache-3610486
8c73148db1c60163c6ec837fe6a3b7c0d\9c557319.xs.dll' for module Net::SSH2:
load_file:The specified module could not be found at
/DynaLoader.pm line 193.
  at /PAR/Heavy.pm line 140.
Compilation failed in require at C:\Users\
Nuser\AppData\Local\Temp\par-3030303
0313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/
Backend/Net_SSH2.pm line 15.
BEGIN failed--compilation aborted at C:\Users\ Nuser
\AppData\Local\Temp\par-30303030313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm
line 15.
Compilation failed in require at script/SFTPdownload.pl line 13.
BEGIN failed--compilation aborted at script/SFTPdownload.pl line 13.

Any Help will be highly appreciated.

Regards,
Narayan


Re: Help with "install_driver(Oracle) failed" error message

2019-03-12 Thread Uri Guttman

On 3/12/19 11:59 AM, Frank K. wrote:

Greeting,

In the infinite wisdom our company, without warning completely 
uninstalled Active Perl on all of our Windows servers (I believe it 
was v5.8).. They claimed it was a security risk, but I suspect new 
licensing fees were the main incentive..


Regardless,  I installed Strawberry Perl, 64 bit, and MOST everything 
is running “okay”.  I am getting the following error in one of our 
scripts (this was not a problem when Active State perl was installed):





hi,

i am sorry for your pain (in multiple dimensions! :). i can't help you 
but i would say this is somewhat beyond the purview of the beginner's 
list. there could be someone who could help but i would suggest finding 
other resources. try p5p (the perl developer's list) or a DBI list. 
below are links to how to subscribe to those lists.


https://lists.perl.org/list/perl5-porters.html
https://lists.perl.org/list/dbi-users.html

uri

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Help with "install_driver(Oracle) failed" error message

2019-03-12 Thread Frank K.
Greeting,

In the infinite wisdom our company, without warning completely uninstalled
Active Perl on all of our Windows servers (I believe it was v5.8).. They
claimed it was a security risk, but I suspect new licensing fees were the
main incentive..

Regardless,  I installed Strawberry Perl, 64 bit, and MOST everything is
running “okay”.  I am getting the following error in one of our scripts
(this was not a problem when Active State perl was installed):

=

D:\ALM tools\Atlassian>echo off

perl atlassianuserlister.pl recordatlassianappusers prod

Getting JIRA User access info...

install_driver(Oracle) failed: Can't load
'C:/Strawberry/perl/vendor/lib/auto/DBD/Oracle/Oracle.xs.dll' for module
DBD::Oracle: load_file:%1 is not a valid Win32 application at
C:/Strawberry/perl/lib/DynaLoader.pm line 193.

at (eval 10) line 3.

Compilation failed in require at (eval 10) line 3.

Perhaps a required shared library or dll isn't installed where expected

at atlassianuserlister.pl line 1565.
=

We have 64 bit Perl, and ORACLE_HOME is pointing to the 64 bit drivers so I
am at a bit of a loss as to why it’s expecting a 32 bit dll.  I have
verified the dll is in that path.  Any ideas?  I’ve Googled a bit and can
find a bunch of hacks but….Any help would be most appreciated.. flk k


Re: slurp error

2018-08-06 Thread Shlomi Fish
Hi all!

On Fri, 27 Jul 2018 14:42:35 -0400
Uri Guttman  wrote:

> On 07/27/2018 02:37 PM, Rick T wrote:
> > I tried to implement some advice about slurping that I read on this 
> > mailing list (using local) but cannot get it to work. I get the 
> > message “Value of  construct can be "0"; test with defined() 
> > at line 23” (the $slurp = <$fh1> line). I’m using perl version 5.18.2 
> > installed in 2014.
> >
> > I’ve googled this error and think (ha!) I understand it, but though 
> > I’ve tried many changes, I cannot make the error go away. I need the 
> > advice of folks who are way ahead of me!
> >
> > Rick Triplett
> >
> >
> >  
> use File::Slurp ; #from cpan
> 

Please see
http://blogs.perl.org/users/leon_timmermans/2015/08/fileslurp-is-broken-and-wrong.html
and
https://www.reddit.com/r/perl/comments/3hfsqt/fileslurp_is_broken_and_wrong/
for better alternatives to File::Slurp .



> my $text = read_file( $file_to_convert ) ;
> $text =~ s/\r/\n/g;
> $text =~ s/\x0b//g ;
> 
> no need for xms if you aren't using those features.
> 
> uri
> 
> 
> 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
My Aphorisms - http://www.shlomifish.org/humour.html

Don't worry over what other people are thinking about you.  They're too
busy worrying over what you are thinking about them.
— Unknown Source

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: slurp error

2018-07-29 Thread perl
Many thanks to Andy and Uri for their helpful comments. My problem is solved, 
plus I learned a lot in the process! — Rick


> On Jul 27, 2018, at 1:56 PM, Andy Bach  wrote:
> 
> open my $fh1, '<', $file_to_convert
> or die "Can't open $file_to_convert: $!\n"; 
> $slurp = <$fh1>
> or die "Could not slurp $file_to_convert: $!";
> 
> It's just a warning (the code works) that you're using $fh1 untested. This 
> doesn't complain
> if ( open my $fh1, '<', $file_to_convert ) {
> $slurp = <$fh1>;
> close $fh1;
> } 
> else { 
> die "Can't open $file_to_convert: $!\n"; 
> }
> 
> note: the "close" has to be in the "if" block.  Good idea to close handles, 
> though, as soon as you're done with them. 
> 
> I guess it's not seeing the "or die" as a good enough test.
> 
> Uri wrote:
> > no need for xms if you aren't using those features.
> 
> Yaybut - I though D.Conway's Best Practice was to always include those, 
> unless you specifically didn't want one. Smacks of cargo cult but I'd never 
> argue with him.
> 
> On Fri, Jul 27, 2018 at 1:37 PM, Rick T  <mailto:p...@reason.net>> wrote:
> I tried to implement some advice about slurping that I read on this mailing 
> list (using local) but cannot get it to work. I get the message “Value of 
>  construct can be "0"; test with defined() at line 23” (the $slurp = 
> <$fh1> line). I’m using perl version 5.18.2 installed in 2014.
> 
> I’ve googled this error and think (ha!) I understand it, but though I’ve 
> tried many changes, I cannot make the error go away. I need the advice of 
> folks who are way ahead of me!
> 
> Rick Triplett
> 
> 
> use warnings;
> use strict;
> use DB_File; # module for Berkeley DBM w/ DB_HASH file type
> use CGI::Carp qw ( fatalsToBrowser );
> 
> # Declare some globals
> my $server = 'exploringmyself'; 
> my $file_to_convert = 'Untitled.tab'; 
> 
> chdir "/big/dom/x$server/data/courses/"
> or die "Can't chdir to /courses: $!\n";
> if (! -e "$file_to_convert") {
> die "Can't find $file_to_convert: $!\n"
> };
> 
> my $slurp;
> {
> local $/;
> open my $fh1, '<', $file_to_convert
> or die "Can't open $file_to_convert: $!\n"; 
> $slurp = <$fh1>
> or die "Could not slurp $file_to_convert: $!";
> $slurp =~ s/\r/\n/xmsg; # swap Mac's CR for LF
> $slurp =~ s/\x0b//xmsg; # swap Filemaker paragraph marker VT for html
> close $fh1;
> }
> 
> 
> 
> 
> -- 
> 
> a
> 
> Andy Bach,
> afb...@gmail.com <mailto:afb...@gmail.com>
> 608 658-1890 cell
> 608 261-5738 wk



Re: slurp error

2018-07-27 Thread Andy Bach
open my $fh1, '<', $file_to_convert
or die "Can't open $file_to_convert: $!\n";
$slurp = <$fh1>
or die "Could not slurp $file_to_convert: $!";

It's just a warning (the code works) that you're using $fh1 untested. This
doesn't complain
if ( open my $fh1, '<', $file_to_convert ) {
$slurp = <$fh1>;
close $fh1;
}
else {
die "Can't open $file_to_convert: $!\n";
}

note: the "close" has to be in the "if" block.  Good idea to close handles,
though, as soon as you're done with them.

I guess it's not seeing the "or die" as a good enough test.

Uri wrote:
> no need for xms if you aren't using those features.

Yaybut - I though D.Conway's Best Practice was to always include those,
unless you specifically didn't want one. Smacks of cargo cult but I'd never
argue with him.

On Fri, Jul 27, 2018 at 1:37 PM, Rick T  wrote:

> I tried to implement some advice about slurping that I read on this
> mailing list (using local) but cannot get it to work. I get the message
> “Value of  construct can be "0"; test with defined() at line 23”
> (the $slurp = <$fh1> line). I’m using perl version 5.18.2 installed in 2014.
>
> I’ve googled this error and think (ha!) I understand it, but though I’ve
> tried many changes, I cannot make the error go away. I need the advice of
> folks who are way ahead of me!
>
> Rick Triplett
>
>
> use warnings;
> use strict;
> use DB_File; # module for Berkeley DBM w/ DB_HASH file type
> use CGI::Carp qw ( fatalsToBrowser );
>
> # Declare some globals
> my $server = 'exploringmyself';
> my $file_to_convert = 'Untitled.tab';
>
> chdir "/big/dom/x$server/data/courses/"
> or die "Can't chdir to /courses: $!\n";
> if (! -e "$file_to_convert") {
> die "Can't find $file_to_convert: $!\n"
> };
>
> my $slurp;
> {
> local $/;
> open my $fh1, '<', $file_to_convert
> or die "Can't open $file_to_convert: $!\n";
> $slurp = <$fh1>
> or die "Could not slurp $file_to_convert: $!";
> $slurp =~ s/\r/\n/xmsg; # swap Mac's CR for LF
> $slurp =~ s/\x0b//xmsg; # swap Filemaker paragraph marker VT for
> html
> close $fh1;
> }
>
>


-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk


Re: slurp error

2018-07-27 Thread Uri Guttman

On 07/27/2018 02:37 PM, Rick T wrote:
I tried to implement some advice about slurping that I read on this 
mailing list (using local) but cannot get it to work. I get the 
message “Value of  construct can be "0"; test with defined() 
at line 23” (the $slurp = <$fh1> line). I’m using perl version 5.18.2 
installed in 2014.


I’ve googled this error and think (ha!) I understand it, but though 
I’ve tried many changes, I cannot make the error go away. I need the 
advice of folks who are way ahead of me!


Rick Triplett




use File::Slurp ; #from cpan

my $text = read_file( $file_to_convert ) ;
$text =~ s/\r/\n/g;
$text =~ s/\x0b//g ;

no need for xms if you aren't using those features.

uri





slurp error

2018-07-27 Thread Rick T
I tried to implement some advice about slurping that I read on this mailing 
list (using local) but cannot get it to work. I get the message “Value of 
 construct can be "0"; test with defined() at line 23” (the $slurp = 
<$fh1> line). I’m using perl version 5.18.2 installed in 2014.

I’ve googled this error and think (ha!) I understand it, but though I’ve tried 
many changes, I cannot make the error go away. I need the advice of folks who 
are way ahead of me!

Rick Triplett


use warnings;
use strict;
use DB_File; # module for Berkeley DBM w/ DB_HASH file type
use CGI::Carp qw ( fatalsToBrowser );

# Declare some globals
my $server = 'exploringmyself'; 
my $file_to_convert = 'Untitled.tab'; 

chdir "/big/dom/x$server/data/courses/"
or die "Can't chdir to /courses: $!\n";
if (! -e "$file_to_convert") {
die "Can't find $file_to_convert: $!\n"
};

my $slurp;
{
local $/;
open my $fh1, '<', $file_to_convert
or die "Can't open $file_to_convert: $!\n"; 
$slurp = <$fh1>
or die "Could not slurp $file_to_convert: $!";
$slurp =~ s/\r/\n/xmsg; # swap Mac's CR for LF
$slurp =~ s/\x0b//xmsg; # swap Filemaker paragraph marker VT for html
close $fh1;
}



Re: Distinguish module loading error: Compilation fail vs. not existing

2017-11-17 Thread Chas. Owens
Try::Tiny is a good, if flaky option. It has several obscure failure modes.
You might want to look at some of the newer keyword based modules. I
haven't tried them yet, so I don't have a strong opinion.

On Fri, Nov 17, 2017, 13:45 Simon Reinhardt  wrote:

> Thanks for your answer.
> Maybe I should use Try::Tiny:
>
> #!/usr/bin/env perl
> use 5.020;
> use warnings;
> use strict;
>
> use Try::Tiny;
> use Module::Load;
>
> my $module= 'AB::CD';
>
> try {
> autoload($module);
> }
> catch {
> if ($_ =~ /Compilation failed in require/) {
> say "compilation failed";
> }
> elsif ($_ =~ /Can't locate .* in \@INC/) {
> say "module not found";
> }
> };
>
>
> Am 17.11.2017 um 18:06 schrieb Chas. Owens:
> > This is probably the best technique to use.  I would note that your code
> > is not handling exceptions in the safest way.
> >
> > You can increase the safety of your code by saying:
> >
> > eval {
> > autoload($module);
> > 1; #force true value on success
> > } or do {
> > if ($@ =~ /Compilation failed in require/) {
> > say "compilation failed";
> > }
> > elsif ($@ =~ /Can't locate (.*) in \@INC/) {
> > say "module $1 not found";
> > } else {
> > say "unknown error: $@"
> > };
> >
> > This isn't 100% safe, but it covers the most common issue.  You can read
> > more at https://metacpan.org/pod/Try::Tiny#BACKGROUND
> >
> > On Fri, Nov 17, 2017 at 11:31 AM Simon Reinhardt  > <mailto:si...@keinstein.org>> wrote:
> >
> > Hi list,
> >
> > I need to check the cause of a module loading error.
> > Currently I'm parsing the text of the thrown exception (see below).
> This
> > seems to work, but is there a more idiomatic way?
> >
> > Best,
> > Simon
> >
> > #!/usr/bin/env perl
> > use 5.020;
> > use warnings;
> > use strict;
> >
> > use Module::Load;
> >
> > my $module= 'AB::CD';
> >
> > eval {
> > autoload($module);
> > };
> >
> > if ($@) {
> > if ($@ =~ /Compilation failed in require/) {
> > say "compilation failed";
> > }
> > elsif ($@ =~ /Can't locate .* in \@INC/) {
> > say "module not found";
> > }
> > }
> >
> > --
> > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> > <mailto:beginners-unsubscr...@perl.org>
> > For additional commands, e-mail: beginners-h...@perl.org
> > <mailto:beginners-h...@perl.org>
> > http://learn.perl.org/
> >
> >
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Re: Distinguish module loading error: Compilation fail vs. not existing

2017-11-17 Thread Simon Reinhardt
Thanks for your answer.
Maybe I should use Try::Tiny:

#!/usr/bin/env perl
use 5.020;
use warnings;
use strict;

use Try::Tiny;
use Module::Load;

my $module= 'AB::CD';

try {
autoload($module);
}
catch {
if ($_ =~ /Compilation failed in require/) {
say "compilation failed";
}
elsif ($_ =~ /Can't locate .* in \@INC/) {
say "module not found";
}
};


Am 17.11.2017 um 18:06 schrieb Chas. Owens:
> This is probably the best technique to use.  I would note that your code
> is not handling exceptions in the safest way.
> 
> You can increase the safety of your code by saying:
> 
> eval {
>     autoload($module);
>     1; #force true value on success
> } or do {
>     if ($@ =~ /Compilation failed in require/) {
>         say "compilation failed";
>     }
>     elsif ($@ =~ /Can't locate (.*) in \@INC/) {
>         say "module $1 not found";
>     } else {
>         say "unknown error: $@"
> };
> 
> This isn't 100% safe, but it covers the most common issue.  You can read
> more at https://metacpan.org/pod/Try::Tiny#BACKGROUND
> 
> On Fri, Nov 17, 2017 at 11:31 AM Simon Reinhardt  <mailto:si...@keinstein.org>> wrote:
> 
> Hi list,
> 
> I need to check the cause of a module loading error.
> Currently I'm parsing the text of the thrown exception (see below). This
> seems to work, but is there a more idiomatic way?
> 
> Best,
> Simon
> 
> #!/usr/bin/env perl
> use 5.020;
> use warnings;
> use strict;
> 
> use Module::Load;
> 
> my $module= 'AB::CD';
> 
> eval {
>     autoload($module);
> };
> 
> if ($@) {
>     if ($@ =~ /Compilation failed in require/) {
>         say "compilation failed";
>     }
>     elsif ($@ =~ /Can't locate .* in \@INC/) {
>         say "module not found";
>     }
> }
> 
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> <mailto:beginners-unsubscr...@perl.org>
> For additional commands, e-mail: beginners-h...@perl.org
> <mailto:beginners-h...@perl.org>
> http://learn.perl.org/
> 
> 

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Distinguish module loading error: Compilation fail vs. not existing

2017-11-17 Thread Chas. Owens
This is probably the best technique to use.  I would note that your code is
not handling exceptions in the safest way.

You can increase the safety of your code by saying:

eval {
autoload($module);
1; #force true value on success
} or do {
if ($@ =~ /Compilation failed in require/) {
say "compilation failed";
}
elsif ($@ =~ /Can't locate (.*) in \@INC/) {
say "module $1 not found";
} else {
    say "unknown error: $@"
};

This isn't 100% safe, but it covers the most common issue.  You can read
more at https://metacpan.org/pod/Try::Tiny#BACKGROUND

On Fri, Nov 17, 2017 at 11:31 AM Simon Reinhardt 
wrote:

> Hi list,
>
> I need to check the cause of a module loading error.
> Currently I'm parsing the text of the thrown exception (see below). This
> seems to work, but is there a more idiomatic way?
>
> Best,
> Simon
>
> #!/usr/bin/env perl
> use 5.020;
> use warnings;
> use strict;
>
> use Module::Load;
>
> my $module= 'AB::CD';
>
> eval {
> autoload($module);
> };
>
> if ($@) {
> if ($@ =~ /Compilation failed in require/) {
> say "compilation failed";
> }
> elsif ($@ =~ /Can't locate .* in \@INC/) {
> say "module not found";
> }
> }
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Distinguish module loading error: Compilation fail vs. not existing

2017-11-17 Thread Simon Reinhardt
Hi list,

I need to check the cause of a module loading error.
Currently I'm parsing the text of the thrown exception (see below). This
seems to work, but is there a more idiomatic way?

Best,
Simon

#!/usr/bin/env perl
use 5.020;
use warnings;
use strict;

use Module::Load;

my $module= 'AB::CD';

eval {
autoload($module);
};

if ($@) {
if ($@ =~ /Compilation failed in require/) {
say "compilation failed";
}
elsif ($@ =~ /Can't locate .* in \@INC/) {
say "module not found";
}
}

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Getting error- connect to Bugzilla(Certificate Authorities to trust)

2015-09-10 Thread Jitendra B
Thanks David, it resolved.

I am new to Bugzilla. I am really do not know where it went wrong in below
code snippet.
Error:


not well-formed (invalid token) at line 23, column 29, byte 846:

  enc1 = chr1 >> 2;

  enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);

^

  enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);

 at /Library/Perl/5.18/RPC/XML/Client.pm line 402. at
/Library/Perl/5.18/RPC/XML/Client.pm line 407.


Code Snnipet:

*

!/usr/bin/perl

#use strict;

use vars qw($VERSION);

use LEOCHARRE::CLI2 ':all','u:p:s:';

use LEOCHARRE::Dir ':all';

$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g;

use WWW::Bugzilla3;

use Net::SSL;

#use Smart::Comments '###';


$ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;


#$opt_u or die("Missing username");

#$opt_p or die("Missing password");

#$opt_s or die("Missing site");


my $b = WWW::Bugzilla3->new( site => 'https://bugzilla.mysite.com' );

my $r = $b->login( "jbarik","xxx" ) or die("Could not login");

### $r

print "HI--HI : $r\n";

On Thu, Sep 10, 2015 at 11:30 AM, Omega -1911 <1911...@gmail.com> wrote:

> http://www.perlmonks.org/?node_id=892166
>
> Goggle is your friend.
>
> On Thu, Sep 10, 2015 at 1:54 AM, Jitendra B  wrote:
>
>> Dear Sir/Madam,
>>
>> while I try to connect and query some data from bugzilla, I am getting
>> following error.
>>
>> Error:
>>
>> RPC::XML::Client::send_request: HTTP server error: Can't verify SSL peers
>> without knowing which Certificate Authorities to trust at
>> /Library/Perl/5.18/RPC/XML/Client.pm line 416.
>>
>>
>> Script:
>>
>>
>> #!/usr/bin/perl
>>
>> use strict;
>>
>> use vars qw($VERSION);
>>
>> use LEOCHARRE::CLI2 ':all','u:p:s:';
>>
>> use LEOCHARRE::Dir ':all';
>>
>> $VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g;
>>
>> use WWW::Bugzilla3;
>>
>> use Net::SSL;
>>
>> use Smart::Comments '###';
>>
>>
>> $opt_u or die("Missing username");
>>
>> $opt_p or die("Missing password");
>>
>> $opt_s or die("Missing site");
>>
>>
>> my $b = WWW::Bugzilla3->new( site => $opt_s );
>>
>> my $r = $b->login( $opt_u, $opt_p ) or die("Could not login");
>>
>> ### $r
>>
>>
>> my @pids = $b->get_selectable_products(); # product ids
>>
>> ### product ids: @pids
>>
>> # get descriptive.. hashes..
>>
>>
>> my %product;
>>
>> for (@pids){
>>
>>my $p = ($b->get_products($_))[0];
>>
>>$product{$_} = $p;
>>
>> }
>>
>> ### %product
>>
>> my @all_bugs = $b->search;
>>
>> ### @all_bugs;
>>
>> my $count = scalar @all_bugs;
>>
>> warn("Have $count bugs");
>>
>> $count or exit;
>>
>> my @bugs = $b->get_bugs( @all_bugs ); # bug ids
>>
>> ## @bugs
>>
>> #my $c = scalar @bugs;
>>
>> #($c == 1) or warn("Got $c bugs in id $id, expected 1 only?");
>>
>> # get_bugs is weird
>>
>> BUG: for my $bug ( @bugs ){
>>
>>$bug->{internals}->{resolution} ||= 'OPEN';
>>
>>$bug->{internals}->{resolution}=~/INVALID|DUPLICATE/ and next BUG;
>>
>># example return for $bug
>>
>>
>>
>> ##   {
>>
>> ##alias => '',
>>
>> ##creation_time => '20090623T15:34:00',
>>
>> ##id => '15',
>>
>> ##internals => {
>>
>> ##   alias => '',
>>
>> ##   assigned_to => '1',
>>
>> ##   bug_file_loc => '',
>>
>> ##   bug_id => '15',
>>
>> ##   bug_severity => 'enhancement',
>>
>> ##   bug_status => 'RESOLVED',
>>
>> ##   cclist_accessible => '1',
>>
>> ##   cf_web_browser => '---',
>>
>> ##   component_id => '4',
>>
>> ##   creation_

Re: Getting error- connect to Bugzilla(Certificate Authorities to trust)

2015-09-09 Thread Jitendra B
As already I have install Net::SSL. and I am new user to Bugzilla. I am not
sure how to authenticate the certification.

Regards,
Jitendra

On Thu, Sep 10, 2015 at 11:30 AM, Omega -1911 <1911...@gmail.com> wrote:

> http://www.perlmonks.org/?node_id=892166
>
> Goggle is your friend.
>
> On Thu, Sep 10, 2015 at 1:54 AM, Jitendra B  wrote:
>
>> Dear Sir/Madam,
>>
>> while I try to connect and query some data from bugzilla, I am getting
>> following error.
>>
>> Error:
>>
>> RPC::XML::Client::send_request: HTTP server error: Can't verify SSL peers
>> without knowing which Certificate Authorities to trust at
>> /Library/Perl/5.18/RPC/XML/Client.pm line 416.
>>
>>
>> Script:
>>
>>
>> #!/usr/bin/perl
>>
>> use strict;
>>
>> use vars qw($VERSION);
>>
>> use LEOCHARRE::CLI2 ':all','u:p:s:';
>>
>> use LEOCHARRE::Dir ':all';
>>
>> $VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g;
>>
>> use WWW::Bugzilla3;
>>
>> use Net::SSL;
>>
>> use Smart::Comments '###';
>>
>>
>> $opt_u or die("Missing username");
>>
>> $opt_p or die("Missing password");
>>
>> $opt_s or die("Missing site");
>>
>>
>> my $b = WWW::Bugzilla3->new( site => $opt_s );
>>
>> my $r = $b->login( $opt_u, $opt_p ) or die("Could not login");
>>
>> ### $r
>>
>>
>> my @pids = $b->get_selectable_products(); # product ids
>>
>> ### product ids: @pids
>>
>> # get descriptive.. hashes..
>>
>>
>> my %product;
>>
>> for (@pids){
>>
>>my $p = ($b->get_products($_))[0];
>>
>>$product{$_} = $p;
>>
>> }
>>
>> ### %product
>>
>> my @all_bugs = $b->search;
>>
>> ### @all_bugs;
>>
>> my $count = scalar @all_bugs;
>>
>> warn("Have $count bugs");
>>
>> $count or exit;
>>
>> my @bugs = $b->get_bugs( @all_bugs ); # bug ids
>>
>> ## @bugs
>>
>> #my $c = scalar @bugs;
>>
>> #($c == 1) or warn("Got $c bugs in id $id, expected 1 only?");
>>
>> # get_bugs is weird
>>
>> BUG: for my $bug ( @bugs ){
>>
>>$bug->{internals}->{resolution} ||= 'OPEN';
>>
>>$bug->{internals}->{resolution}=~/INVALID|DUPLICATE/ and next BUG;
>>
>># example return for $bug
>>
>>
>>
>> ##   {
>>
>> ##alias => '',
>>
>> ##creation_time => '20090623T15:34:00',
>>
>> ##id => '15',
>>
>> ##internals => {
>>
>> ##   alias => '',
>>
>> ##   assigned_to => '1',
>>
>> ##   bug_file_loc => '',
>>
>> ##   bug_id => '15',
>>
>> ##   bug_severity => 'enhancement',
>>
>> ##   bug_status => 'RESOLVED',
>>
>> ##   cclist_accessible => '1',
>>
>> ##   cf_web_browser => '---',
>>
>> ##   component_id => '4',
>>
>> ##   creation_ts => '2009.06.23 15:34',
>>
>> ##   delta_ts => '2009-06-23 15:55:39',
>>
>> ##   everconfirmed => '1',
>>
>> ##   op_sys => 'All',
>>
>> ##   priority => 'P5',
>>
>> ##   product_id => '3',
>>
>> ##   qa_contact => '',
>>
>> ##   rep_platform => 'All',
>>
>> ##   reporter_accessible => '1',
>>
>> ##   reporter_id => '1',
>>
>> ##   resolution => 'FIXED',
>>
>> ##   short_desc => 'branding all the clients in
>> the dms',
>>
>> ##   status_whiteboard => '',
>>
>> ##   target_milestone => '---',
>>
>> ##   version => 'DMS2'
>>
>> ## },
>>
>> ##last_change_time => '20090623T15:55:39',
>>
>> ##summary => 'branding all the clients in the dms'
>>
>> ##  }
>>
>> ##]
>>
>>printf "---
>>
>> title: %s
>>
>> id: %0.3d
>>
>> product: %s
>>
>> status: %s
>>
>>
>> ",
>>
>>   $bug->{summary},
>>
>>   $bug->{id},
>>
>>   $product{ $bug->{internals}->{product_id} }->{name},
>>
>>   ( $bug->{internals}->{resolution} || 'OPEN'),
>>
>>
>>
>>;
>>
>>
>>
>> }
>>
>>
>> exit;
>>
>> sub usage {
>>
>>qq{$0 [OPTION]..
>>
>> Show bugzilla summary for bureaucracy.
>>
>>
>>-d  debug
>>
>>-h  help
>>
>>-v  version
>>
>>-p string   password
>>
>>-u string   username
>>
>>-s string   url of bugzilla website
>>
>>
>> Example Usage:
>>
>>
>>$0 -u jbarik -p hahaha -s https://bugzilla.mysite.com/
>>
>>
>> }}
>>
>>
>


Re: Getting error- connect to Bugzilla(Certificate Authorities to trust)

2015-09-09 Thread Omega -1911
http://www.perlmonks.org/?node_id=892166

Goggle is your friend.

On Thu, Sep 10, 2015 at 1:54 AM, Jitendra B  wrote:

> Dear Sir/Madam,
>
> while I try to connect and query some data from bugzilla, I am getting
> following error.
>
> Error:
>
> RPC::XML::Client::send_request: HTTP server error: Can't verify SSL peers
> without knowing which Certificate Authorities to trust at
> /Library/Perl/5.18/RPC/XML/Client.pm line 416.
>
>
> Script:
>
>
> #!/usr/bin/perl
>
> use strict;
>
> use vars qw($VERSION);
>
> use LEOCHARRE::CLI2 ':all','u:p:s:';
>
> use LEOCHARRE::Dir ':all';
>
> $VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g;
>
> use WWW::Bugzilla3;
>
> use Net::SSL;
>
> use Smart::Comments '###';
>
>
> $opt_u or die("Missing username");
>
> $opt_p or die("Missing password");
>
> $opt_s or die("Missing site");
>
>
> my $b = WWW::Bugzilla3->new( site => $opt_s );
>
> my $r = $b->login( $opt_u, $opt_p ) or die("Could not login");
>
> ### $r
>
>
> my @pids = $b->get_selectable_products(); # product ids
>
> ### product ids: @pids
>
> # get descriptive.. hashes..
>
>
> my %product;
>
> for (@pids){
>
>my $p = ($b->get_products($_))[0];
>
>$product{$_} = $p;
>
> }
>
> ### %product
>
> my @all_bugs = $b->search;
>
> ### @all_bugs;
>
> my $count = scalar @all_bugs;
>
> warn("Have $count bugs");
>
> $count or exit;
>
> my @bugs = $b->get_bugs( @all_bugs ); # bug ids
>
> ## @bugs
>
> #my $c = scalar @bugs;
>
> #($c == 1) or warn("Got $c bugs in id $id, expected 1 only?");
>
> # get_bugs is weird
>
> BUG: for my $bug ( @bugs ){
>
>$bug->{internals}->{resolution} ||= 'OPEN';
>
>$bug->{internals}->{resolution}=~/INVALID|DUPLICATE/ and next BUG;
>
># example return for $bug
>
>
>
> ##   {
>
> ##alias => '',
>
> ##creation_time => '20090623T15:34:00',
>
> ##id => '15',
>
> ##internals => {
>
> ##   alias => '',
>
> ##   assigned_to => '1',
>
> ##   bug_file_loc => '',
>
> ##   bug_id => '15',
>
> ##   bug_severity => 'enhancement',
>
> ##   bug_status => 'RESOLVED',
>
> ##   cclist_accessible => '1',
>
> ##   cf_web_browser => '---',
>
> ##   component_id => '4',
>
> ##   creation_ts => '2009.06.23 15:34',
>
> ##   delta_ts => '2009-06-23 15:55:39',
>
> ##   everconfirmed => '1',
>
> ##   op_sys => 'All',
>
> ##   priority => 'P5',
>
> ##   product_id => '3',
>
> ##   qa_contact => '',
>
> ##   rep_platform => 'All',
>
> ##   reporter_accessible => '1',
>
> ##   reporter_id => '1',
>
> ##   resolution => 'FIXED',
>
> ##   short_desc => 'branding all the clients in
> the dms',
>
> ##   status_whiteboard => '',
>
> ##   target_milestone => '---',
>
> ##   version => 'DMS2'
>
> ## },
>
> ##last_change_time => '20090623T15:55:39',
>
> ##summary => 'branding all the clients in the dms'
>
> ##  }
>
> ##]
>
>printf "---
>
> title: %s
>
> id: %0.3d
>
> product: %s
>
> status: %s
>
>
> ",
>
>   $bug->{summary},
>
>   $bug->{id},
>
>   $product{ $bug->{internals}->{product_id} }->{name},
>
>   ( $bug->{internals}->{resolution} || 'OPEN'),
>
>
>
>;
>
>
>
> }
>
>
> exit;
>
> sub usage {
>
>qq{$0 [OPTION]..
>
> Show bugzilla summary for bureaucracy.
>
>
>-d  debug
>
>-h  help
>
>-v  version
>
>-p string   password
>
>-u string   username
>
>-s string   url of bugzilla website
>
>
> Example Usage:
>
>
>$0 -u jbarik -p hahaha -s https://bugzilla.mysite.com/
>
>
> }}
>
>


Getting error- connect to Bugzilla(Certificate Authorities to trust)

2015-09-09 Thread Jitendra B
Dear Sir/Madam,

while I try to connect and query some data from bugzilla, I am getting
following error.

Error:

RPC::XML::Client::send_request: HTTP server error: Can't verify SSL peers
without knowing which Certificate Authorities to trust at
/Library/Perl/5.18/RPC/XML/Client.pm line 416.


Script:


#!/usr/bin/perl

use strict;

use vars qw($VERSION);

use LEOCHARRE::CLI2 ':all','u:p:s:';

use LEOCHARRE::Dir ':all';

$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g;

use WWW::Bugzilla3;

use Net::SSL;

use Smart::Comments '###';


$opt_u or die("Missing username");

$opt_p or die("Missing password");

$opt_s or die("Missing site");


my $b = WWW::Bugzilla3->new( site => $opt_s );

my $r = $b->login( $opt_u, $opt_p ) or die("Could not login");

### $r


my @pids = $b->get_selectable_products(); # product ids

### product ids: @pids

# get descriptive.. hashes..


my %product;

for (@pids){

   my $p = ($b->get_products($_))[0];

   $product{$_} = $p;

}

### %product

my @all_bugs = $b->search;

### @all_bugs;

my $count = scalar @all_bugs;

warn("Have $count bugs");

$count or exit;

my @bugs = $b->get_bugs( @all_bugs ); # bug ids

## @bugs

#my $c = scalar @bugs;

#($c == 1) or warn("Got $c bugs in id $id, expected 1 only?");

# get_bugs is weird

BUG: for my $bug ( @bugs ){

   $bug->{internals}->{resolution} ||= 'OPEN';

   $bug->{internals}->{resolution}=~/INVALID|DUPLICATE/ and next BUG;

   # example return for $bug



##   {

##alias => '',

##creation_time => '20090623T15:34:00',

##id => '15',

##internals => {

##   alias => '',

##   assigned_to => '1',

##   bug_file_loc => '',

##   bug_id => '15',

##   bug_severity => 'enhancement',

##   bug_status => 'RESOLVED',

##   cclist_accessible => '1',

##   cf_web_browser => '---',

##   component_id => '4',

##   creation_ts => '2009.06.23 15:34',

##   delta_ts => '2009-06-23 15:55:39',

##   everconfirmed => '1',

##   op_sys => 'All',

##   priority => 'P5',

##   product_id => '3',

##   qa_contact => '',

##   rep_platform => 'All',

##   reporter_accessible => '1',

##   reporter_id => '1',

##   resolution => 'FIXED',

##   short_desc => 'branding all the clients in the
dms',

##   status_whiteboard => '',

##   target_milestone => '---',

##   version => 'DMS2'

## },

##last_change_time => '20090623T15:55:39',

##summary => 'branding all the clients in the dms'

##  }

##]

   printf "---

title: %s

id: %0.3d

product: %s

status: %s


",

  $bug->{summary},

  $bug->{id},

  $product{ $bug->{internals}->{product_id} }->{name},

  ( $bug->{internals}->{resolution} || 'OPEN'),



   ;



}


exit;

sub usage {

   qq{$0 [OPTION]..

Show bugzilla summary for bureaucracy.


   -d  debug

   -h  help

   -v  version

   -p string   password

   -u string   username

   -s string   url of bugzilla website


Example Usage:


   $0 -u jbarik -p hahaha -s https://bugzilla.mysite.com/


}}


Re: Why doesn't this script error?

2015-03-14 Thread John SJ Anderson
Try again with 'use strict' and 'use warnings' turned on.

On Sat, Mar 14, 2015 at 1:40 PM, Sherman Willden 
wrote:

> I am new to Eclipse and Epic so I wrote the below script which I thought
> would error but it runs. Why?
>
> #!/usr/bin/perl
>
> use 5.18.2;
>
> print "Hello World \n";
>
> print this
>
> 1
>
> Thank you;
>
> Sherman
>


Why doesn't this script error?

2015-03-14 Thread Sherman Willden
I am new to Eclipse and Epic so I wrote the below script which I thought
would error but it runs. Why?

#!/usr/bin/perl

use 5.18.2;

print "Hello World \n";

print this

1

Thank you;

Sherman


Re: Need more helpful error messages from Perl

2014-11-19 Thread Ron Bergin
Kevin Walzer wrote:
> Running this code in Perl:
>
> use LWP::Simple;
> my $url= "http://mywebsite.com/foo.ini";;
> my $page = get($url);
>
> produced this error:
>
> sh: -c: line 0: unexpected EOF while looking for matching `''
> sh: -c: line 1: syntax error: unexpected end of file

Those error messages are coming from your shell, not perl i.e., your sh
shell is attempting to run the script and not perl.

Do you have a shebang line in the script and is it pointing to perl?

How did you execute the script?

>
> The error message in question refers to unbalanced quotes, but there
> were no unbalanced quotes in my code.
>
> This error was driving me crazy until I tried to see what was happening
> using curl. This was more helpful:
>
> curl http://mywebsite.com/foo.ini > foo.ini
>
> yielded a 404 error:  the page was missing.
>
> OK, that explains the unexpected EOF. But why the "mismatched quote"
> error in Perl? Is there any way to get more helpful error messages, i.e.
> "missing page"?
>
> --Kevin
>
>
> --
> Kevin Walzer
> Code by Kevin/Mobile Code by Kevin
> http://www.codebykevin.com
> http://www.wtmobilesoftware.com
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Need more helpful error messages from Perl

2014-11-19 Thread Mike D
use diagnostics;
On Nov 19, 2014 8:23 AM, "Kevin Walzer"  wrote:

> Running this code in Perl:
>
> use LWP::Simple;
> my $url= "http://mywebsite.com/foo.ini";;
> my $page = get($url);
>
> produced this error:
>
> sh: -c: line 0: unexpected EOF while looking for matching `''
> sh: -c: line 1: syntax error: unexpected end of file
>
> The error message in question refers to unbalanced quotes, but there were
> no unbalanced quotes in my code.
>
> This error was driving me crazy until I tried to see what was happening
> using curl. This was more helpful:
>
> curl http://mywebsite.com/foo.ini > foo.ini
>
> yielded a 404 error:  the page was missing.
>
> OK, that explains the unexpected EOF. But why the "mismatched quote" error
> in Perl? Is there any way to get more helpful error messages, i.e. "missing
> page"?
>
> --Kevin
>
>
> --
> Kevin Walzer
> Code by Kevin/Mobile Code by Kevin
> http://www.codebykevin.com
> http://www.wtmobilesoftware.com
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Need more helpful error messages from Perl

2014-11-19 Thread Kevin Walzer

Running this code in Perl:

use LWP::Simple;
my $url= "http://mywebsite.com/foo.ini";;
my $page = get($url);

produced this error:

sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file

The error message in question refers to unbalanced quotes, but there 
were no unbalanced quotes in my code.


This error was driving me crazy until I tried to see what was happening 
using curl. This was more helpful:


curl http://mywebsite.com/foo.ini > foo.ini

yielded a 404 error:  the page was missing.

OK, that explains the unexpected EOF. But why the "mismatched quote" 
error in Perl? Is there any way to get more helpful error messages, i.e. 
"missing page"?


--Kevin


--
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: module installation error from cpan cli

2014-07-14 Thread Benjamin Fernandis
Thx, it works. I just reinstalled with CENTOS 7. After installing
Test::More from cpan it works now.



On Tue, Jul 15, 2014 at 12:22 AM, David Precious 
wrote:

> On Tue, 15 Jul 2014 00:07:16 +1200
> Benjamin Fernandis  wrote:
>
> > Hi,
> >
> > I got below error while installing Devel::Trace module to trace each
> > line of script like sh -x.
> [...]
> > cpan[1]> install Devel::Trace
> [...]
> > t/compile.t .. Can't locate Test/More.pm in @INC (@INC contains:
> [...]
>
> > what could be wrong ?
>
> Hmm - I'd say it looks like you need to install Test::More first - but
> corelist says Test::More has been in core since perl 5.6.2 (unless your
> distro's packaging installs perl but not the core modules, or
> something).
>
> Either way - looks like installing Test::More first should get you
> going.
>
>
>
> --
> David Precious ("bigpresh") 
> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
> www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook
> www.preshweb.co.uk/cpanwww.preshweb.co.uk/github
>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Re: module installation error from cpan cli

2014-07-14 Thread David Precious
On Tue, 15 Jul 2014 00:07:16 +1200
Benjamin Fernandis  wrote:

> Hi,
> 
> I got below error while installing Devel::Trace module to trace each
> line of script like sh -x.
[...]
> cpan[1]> install Devel::Trace
[...]
> t/compile.t .. Can't locate Test/More.pm in @INC (@INC contains:
[...]
 
> what could be wrong ?

Hmm - I'd say it looks like you need to install Test::More first - but
corelist says Test::More has been in core since perl 5.6.2 (unless your
distro's packaging installs perl but not the core modules, or
something).

Either way - looks like installing Test::More first should get you
going.



-- 
David Precious ("bigpresh") 
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook
www.preshweb.co.uk/cpanwww.preshweb.co.uk/github



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




module installation error from cpan cli

2014-07-14 Thread Benjamin Fernandis
Hi,

I got below error while installing Devel::Trace module to trace each line
of script like sh -x.

[root@ahc151l backup]# cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.

cpan[1]> install Devel::Trace
Reading '/root/.cpan/Metadata'
  Database was generated on Sun, 13 Jul 2014 23:06:14 GMT
Running install for module 'Devel::Trace'
Running make for M/MJ/MJD/Devel-Trace-0.12.tar.gz
Checksum for
/root/.cpan/sources/authors/id/M/MJ/MJD/Devel-Trace-0.12.tar.gz ok
Scanning cache /root/.cpan/build for sizes
DONE

  CPAN.pm: Building M/MJ/MJD/Devel-Trace-0.12.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Devel::Trace
Could not read metadata file. Falling back to other methods to determine
prerequisites
cp Trace.pm blib/lib/Devel/Trace.pm
cp demo.pl blib/lib/Devel/demo.pl
Manifying blib/man3/Devel::Trace.3pm
  MJD/Devel-Trace-0.12.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/compile.t .. Can't locate Test/More.pm in @INC (@INC contains:
/root/.cpan/build/Devel-Trace-0.12-0NPl4l/blib/lib
/root/.cpan/build/Devel-Trace-0.12-0NPl4l/blib/arch /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at
t/compile.t line 2.
BEGIN failed--compilation aborted at t/compile.t line 2.
t/compile.t .. Dubious, test returned 2 (wstat 512, 0x200)
No subtests run

Test Summary Report
---
t/compile.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  0 wallclock secs ( 0.02 usr +  0.01 sys =  0.03 CPU)
Result: FAIL
Failed 1/1 test programs. 0/0 subtests failed.
make: *** [test_dynamic] Error 2
  MJD/Devel-Trace-0.12.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MJD/Devel-Trace-0.12.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 MJD/Devel-Trace-0.12.tar.gz  : make_test NO

cpan[2]>


what could be wrong ?

Regards
Ben


Re: uninitialized error for hash printing

2014-06-22 Thread Shaji Kalidasan
Hi Sunita,

As per Uri's suggestions, here's one way to make it work by surrounding the
variable with curly braces

[code]
%hash = ("abc" => 123, "dfg" => 456, "xsd" => 34);

foreach $k (keys %hash){
 print "key ${k}:: value $hash{$k}\n";
 }
[/code]

[output]
key abc:: value 123
key dfg:: value 456
key xsd:: value 34
[/output]

Hope it helps.


On Mon, Jun 23, 2014 at 1:31 AM, Sunita Pradhan <
sunita.pradhan.2...@hotmail.com> wrote:

> I have following code for printing a simple hash.
>
> #!/usr/bin/perl -w
>
>
> %hash = ("abc" => 123, "dfg" => 456, "xsd" => 34);
>
> foreach $k (keys %hash){
>  print "key $k:: value $hash{$k}\n";
>  }
>
>
> It does not print keys and displays following warnings:
>
> --
> Use of uninitialized value $k:: in concatenation (.) or string at
> hash_test2.pl
> line 7.
> key  value 34
> Use of uninitialized value $k:: in concatenation (.) or string at
> hash_test2.pl
> line 7.
> key  value 123
> Use of uninitialized value $k:: in concatenation (.) or string at
> hash_test2.pl
> line 7.
> key  value 456
>
>
> Never happened like this with hash . I am not sure where I am going wrong .
>
>
>
>
>
> -Sunita
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


-- 
best,
Shaji
--
Your talent is God's gift to you. What you do with it is your gift back to
God.
--


Re: uninitialized error for hash printing

2014-06-22 Thread Uri Guttman

On 06/22/2014 04:01 PM, Sunita Pradhan wrote:

I have following code for printing a simple hash.

#!/usr/bin/perl -w


%hash = ("abc" => 123, "dfg" => 456, "xsd" => 34);

foreach $k (keys %hash){
  print "key $k:: value $hash{$k}\n";
  }


It does not print keys and displays following warnings:

--
Use of uninitialized value $k:: in concatenation (.) or string at hash_test2.pl
line 7.


your bug is putting ::after the $k. that makes it a package variable in 
the k:: namespace and there is nothing there. remove the :: or use some 
other marker or a space before the ::.


uri


--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: uninitialized error for hash printing

2014-06-22 Thread John Delacour

On 22 Jun 2014, at 21:01, Sunita Pradhan  
wrote:

> I have following code for printing a simple hash.
> 
> #!/usr/bin/perl -w
> %hash = ("abc" => 123, "dfg" => 456, "xsd" => 34);
> foreach $k (keys %hash){
>  print "key $k:: value $hash{$k}\n";
>  }
> --
> Use of uninitialized value $k:: in concatenation (.) or string at 
> hash_test2.pl

Try this:

#!/usr/bin/perl -w
use strict;
my %hash = (
"abc" => 123,
"dfg" => 456,
"xsd" => 34
);
foreach my $k (keys %hash){
print "key $k\:: value $hash{$k}\n";
}

#JD



uninitialized error for hash printing

2014-06-22 Thread Sunita Pradhan
I have following code for printing a simple hash.

#!/usr/bin/perl -w
 

%hash = ("abc" => 123, "dfg" => 456, "xsd" => 34);

foreach $k (keys %hash){
 print "key $k:: value $hash{$k}\n";
 }


It does not print keys and displays following warnings:

--
Use of uninitialized value $k:: in concatenation (.) or string at hash_test2.pl
line 7.
key  value 34
Use of uninitialized value $k:: in concatenation (.) or string at hash_test2.pl
line 7.
key  value 123
Use of uninitialized value $k:: in concatenation (.) or string at hash_test2.pl
line 7.
key  value 456


Never happened like this with hash . I am not sure where I am going wrong .





-Sunita































































  

Re: perlbrew error

2014-06-15 Thread John SJ Anderson
On Sun, Jun 15, 2014 at 10:31 AM, Subinoy Biswas  wrote:
> Hi,
> I am having a trouble installing any module with cpanm in perlbrew
> perl-5.20.0 in an test1 local lib. Below I am pasting the verbose. Please
> help me to solve this issue

So, you need to install Tie::Hash::Indexed:

> Can't locate Tie/Hash/Indexed.pm in @INC (you may need to install the
> Tie::Hash::Indexed module)

Which you tried to do:

> subinoybiswas@sunymacs:~/work_ubc/seq$ cpanm Tie::Hash::Indexed
[ snip ]

Which failed:

> ! Installing Tie::Hash::Indexed failed. See
> /Users/subinoybiswas/.cpanm/build.log for details.

So the contents of that file might be helpful.

Additionally:

> cannot unlink file for
> /Users/subinoybiswas/.cpanm/work/1383165137.7601/build.log: Permission
> denied at /loader/0x7fd8d10320a0/App/cpanminus/script.pm line 1.
> cannot restore permissions to 0100644 for
> /Users/subinoybiswas/.cpanm/work/1383165137.7601/build.log: Permission
> denied at /loader/0x7fd8d10320a0/App/cpanminus/script.pm line 1.
> cannot remove directory for
> /Users/subinoybiswas/.cpanm/work/1383165137.7601: Directory not empty at
> /loader/0x7fd8d10320a0/App/cpanminus/script.pm line 1.

Those errors suggest something is messed up in your ~/.cpanm directory
hierarchy. If I had to bet, I'd bet that you ran something as root,
once upon a time, and the above errors are from root-owned files that
got produced at that point.

You should just be able to 'rm -rfv ~/.cpanm' without issue.


j.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




perlbrew error

2014-06-15 Thread Subinoy Biswas
Hi,
I am having a trouble installing any module with cpanm in perlbrew  perl-5.20.0 
in an test1 local lib. Below I am pasting the verbose. Please help me to solve 
this issue.subinoybiswas@sunymacs:~/work_ubc/seq$ which perl
/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/bin/perl
subinoybiswas@sunymacs:~/work_ubc/seq$ perl -v

This is perl 5, version 20, subversion 0 (v5.20.0) built for darwin-2level

Copyright 1987-2014, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

subinoybiswas@sunymacs:~/work_ubc/seq$ perl -V
Summary of my perl5 (revision 5 version 20 subversion 0) configuration:

 Platform:
   osname=darwin, osvers=11.4.2, archname=darwin-2level
   uname='darwin sunymacs.local 11.4.2 darwin kernel version 11.4.2: thu aug 23 
16:25:48 pdt 2012; root:xnu-1699.32.7~1release_x86_64 x86_64 '
   config_args='-de 
-Dprefix=/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0 
-Aeval:scriptdir=/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/bin'
   hint=recommended, useposix=true, d_sigaction=define
   useithreads=undef, usemultiplicity=undef
   use64bitint=define, use64bitall=define, uselongdouble=undef
   usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='cc', ccflags ='-fno-common -DPERL_DARWIN -fwrapv -fno-strict-aliasing 
-pipe -fstack-protector -I/usr/local/include',
   optimize='-O3',
   cppflags='-fno-common -DPERL_DARWIN -fwrapv -fno-strict-aliasing -pipe 
-fstack-protector -I/usr/local/include'
   ccversion='', gccversion='4.8.3', gccosandvers=''
   intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
   ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
   alignbytes=8, prototype=define
 Linker and Libraries:
   ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector 
-L/usr/local/lib'
   libpth=/usr/local/lib 
/usr/local/Cellar/gcc48/4.8.3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.3/include-fixed
 /usr/lib
   libs=-lgdbm -ldbm -ldl -lm -lutil -lc
   perllibs=-ldl -lm -lutil -lc
   libc=, so=dylib, useshrplib=false, libperl=libperl.a
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
   cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup 
-L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl): 
 Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
   PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
   PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
   USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES
   USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
   USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
 Built under darwin
 Compiled at Jun  6 2014 11:45:46
 %ENV:
   
PERL5LIB="/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1/lib/perl5:/Users/subinoybiswas/perl5/lib/perl5"
   PERLBREW_BASHRC_VERSION="0.58"
   PERLBREW_HOME="/Users/subinoybiswas/.perlbrew"
   PERLBREW_LIB="test1"
   
PERLBREW_MANPATH="/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1/man:/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/man"
   
PERLBREW_PATH="/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1/bin:/Users/subinoybiswas/perl5/perlbrew/bin:/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/bin"
   PERLBREW_PERL="perl-5.20.0"
   PERLBREW_ROOT="/Users/subinoybiswas/perl5/perlbrew"
   PERLBREW_VERSION="0.59"
   PERL_LOCAL_LIB_ROOT="/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1"
   PERL_MB_OPT="--install_base 
/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1"
   
PERL_MM_OPT="INSTALL_BASE=/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1"
 @INC:
   /Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1/lib/perl5
   /Users/subinoybiswas/perl5/lib/perl5/darwin-2level
   /Users/subinoybiswas/perl5/lib/perl5
   
/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/darwin-2level
   /Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0
   
/Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/lib/5.20.0/darwin-2level
   /Users/subinoybiswas/perl5/perlbrew/perls/perl-5.20.0/lib/5.20.0
   .
subinoybiswas@sunymacs:~/work_ubc/seq$ vi cds_7_25.pl 
subinoybiswas@sunymacs:~/work_ubc/seq$ perl cds_7_25.pl 
Can't locate Tie/Hash/Indexed.pm in @INC (you may need to install the 
Tie::Hash::Indexed module) (@INC contains: 
/Users/subinoybiswas/.perlbrew/libs/perl-5.20.0@test1/lib/perl5 
/Users/subinoybiswas/perl5/lib/perl5/darwin-2level 
/Users/subinoybiswas/perl5/lib/perl5 
/Users/subinoybiswas/per

RE: Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-29 Thread Priyal Jain
Hello,

I am still getting error, Following is the error message:

root@priyal:/usr/local/share/perl/5.14.2# cpanm Net::Netconf
--> Working on Net::Netconf
Fetching 
http://search.cpan.org/CPAN/authors/id/J/JP/JPRIYAL/Net-Netconf-0.01.zip ... OK
! Bad archive: [testing: Net-Netconf-0.01/CHANGES   OK] Net-Netconf-0.01.zip
! Failed to unpack Net-Netconf-0.01.zip: no directory
! Failed to fetch distribution Net-Netconf-0.01

Kindly help

Thanks
Regards
Priyal

From: Sebastien Feugere [mailto:seb.feug...@gmail.com]
Sent: Thursday, May 29, 2014 11:56 AM
To: Priyal Jain
Cc: beginners@perl.org
Subject: Re: Error in installing "Bundle::Expect" as dependency for some other 
module using CPAN

Successfully installed it using "cpanm Net::Netconf". You should take a look at 
cpanminus, it will make your working life easier.
https://metacpan.org/pod/App::cpanminus

Note that it fails if you omit the capital "N" in "Netconf".
If it don't work for you, you could maybe post the full failure log ?



~$&bast1

On Thu, May 29, 2014 at 12:32 PM, Priyal Jain 
mailto:jpri...@juniper.net>> wrote:
Hello,

I have uploaded my Perl module in CPAN, 
http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf, but when I am 
trying to install it using 'cpan Net::netconf' its saying don't know what it is 
/Net::Netconf/ , cannot install it.

Please suggest something, what is the issue.


Regards,
Thanks,
Priyal

_
From: Priyal Jain
Sent: Friday, May 16, 2014 2:11 PM
To: 'beginners@perl.org<mailto:beginners@perl.org>'
Subject: Error in installing "Bundle::Expect" as dependency for some other 
module using CPAN


Hello,

I am uploading my module Net::Netconf 
http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf in CPAN, but its 
giving error of dependency not found for Bundle::Expect. I am mentioning all my 
dependency in Makefile.Pl
"use ExtUtils::MakeMaker;
our $VERSION ='0.01';
use 5.006;
WriteMakefile(
NAME => 'Net-Netconf',
AUTHOR   => 'Juniper Networks, Inc',
VERSION_FROM => 'Makefile.PL',
    PREREQ_PM => {'XML::LibXML'=> '0', 'File::Which'=> '0', 
'Bundle::Expect'=>'0',},
ABSTRACT => 'netconf libraries for perl',

);"

But its giving error. Kindly help me.


Thnanks,
Priyal




Re: Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-28 Thread Sebastien Feugere
Successfully installed it using "cpanm Net::Netconf". You should take a
look at cpanminus, it will make your working life easier.
https://metacpan.org/pod/App::cpanminus

Note that it fails if you omit the capital "N" in "Netconf".

If it don't work for you, you could maybe post the full failure log ?




~$&bast1


On Thu, May 29, 2014 at 12:32 PM, Priyal Jain  wrote:

>  Hello,
>
> I have uploaded my Perl module in CPAN,
> *http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf*<http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf>,
> but when I am trying to install it using 'cpan Net::netconf' its saying
> don't know what it is /Net::Netconf/ , cannot install it.
>
> Please suggest something, what is the issue.
>
>
> Regards,
> Thanks,
> Priyal
>
> _
> *From:* Priyal Jain
> *Sent:* Friday, May 16, 2014 2:11 PM
> *To:* 'beginners@perl.org'
> *Subject:* Error in installing "Bundle::Expect" as dependency for some
> other module using CPAN
>
>
> Hello,
>
> I am uploading my module Net::Netconf
> *http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf*<http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf>in
>  CPAN, but its giving error of dependency not found for Bundle::Expect. I
> am mentioning all my dependency in Makefile.Pl
> "use ExtUtils::MakeMaker;
>  our $VERSION ='0.01';
> use 5.006;
> WriteMakefile(
> NAME => 'Net-Netconf',
> AUTHOR   => 'Juniper Networks, Inc',
> VERSION_FROM => 'Makefile.PL',
> PREREQ_PM => {'XML::LibXML'=> '0', 'File::Which'=> '0',
> 'Bundle::Expect'=>'0',},
> ABSTRACT => 'netconf libraries for perl',
>
> );"
>
> But its giving error. Kindly help me.
>
>
> Thnanks,
> Priyal
>
>


RE: Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-28 Thread Priyal Jain
Hello,

I have uploaded my Perl module in CPAN, 
http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf, but when I am 
trying to install it using 'cpan Net::netconf' its saying don't know what it is 
/Net::Netconf/ , cannot install it.

Please suggest something, what is the issue.


Regards,
Thanks,
Priyal

_
From: Priyal Jain
Sent: Friday, May 16, 2014 2:11 PM
To: 'beginners@perl.org'
Subject: Error in installing "Bundle::Expect" as dependency for some other 
module using CPAN


Hello,

I am uploading my module Net::Netconf 
http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf in CPAN, but its 
giving error of dependency not found for Bundle::Expect. I am mentioning all my 
dependency in Makefile.Pl
"use ExtUtils::MakeMaker;
 our $VERSION ='0.01';
use 5.006;
WriteMakefile(
NAME => 'Net-Netconf',
AUTHOR   => 'Juniper Networks, Inc',
VERSION_FROM => 'Makefile.PL',
PREREQ_PM => {'XML::LibXML'=> '0', 'File::Which'=> '0', 
'Bundle::Expect'=>'0',},
ABSTRACT => 'netconf libraries for perl',

);"

But its giving error. Kindly help me.


Thnanks,
Priyal



Re: Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-17 Thread Shlomi Fish
Hi Priyal,

On Fri, 16 May 2014 11:15:25 +
Priyal Jain  wrote:

> Hello,
> 
> I am getting following message when I run "cpan Net::Netconf"
> 
> Checking if EOF on pty slave is correctly reported to master...
> (this fails on about 50% of the supported systems, so don't panic!
>  Expect will work anyway!)
> TIMEOUT
> Sorry, you may not notice if the spawned process closes the pty.
> Passed 42 of 42 tests.
> RGIERSIG/Expect-1.21.tar.gz
> Tests succeeded but 2 dependencies missing (IO:ty,IO::Tty)
> RGIERSIG/Expect-1.21.tar.gz
> [dependencies] -- NA
> Running make install
> make test had returned bad status, won't install without force
> Running install for module 'File::Which'
> Running make for A/AD/ADAMK/File-Which-1.09.tar.gz
> Fetching with HTTP::Tiny:
> http://www.planet-elektronik.de/CPAN/authors/id/A/AD/ADAMK/File-Which-1.09.tar.gz
> Fetching with HTTP::Tiny:
> http://www.planet-elektronik.de/CPAN/authors/id/A/AD/ADAMK/CHECKSUMS
> Checksum for /root/.cpan/sources/authors/id/A/AD/ADAMK/File-Which-1.09.tar.gz
> ok .
> .
>   CPAN.pm: Going to build A/AD/ADAMK/File-Which-1.09.tar.gz
> 
> CPAN.pm: Going to build A/AD/ADAMK/File-Which-1.09.tar.gz
> 
> Checking if your kit is complete...
> Looks good
> Warning: prerequisite Test::Script 1.05 not found.
> Generating a Unix-style Makefile
> Writing Makefile for File::Which
> Writing MYMETA.yml and MYMETA.json
>  Unsatisfied dependencies detected during 
>    ADAMK/File-Which-1.09.tar.gz   
> Test::Script [requires]
> Running make test
>   Delayed until after prerequisites
> Running make install
>   Delayed until after prerequisites
> Running install for module 'Test::Script'
> Running make for A/AD/ADAMK/Test-Script-1.07.tar.gz
> Fetching with HTTP::Tiny:
> 
> Warning: prerequisite IPC::Run3 0.034 not found.
> Warning: prerequisite Probe:erl 0.01 not found.
> Generating a Unix-style Makefile
> Writing Makefile for Test::Script
> Writing MYMETA.yml and MYMETA.json
>  Unsatisfied dependencies detected during 
>    ADAMK/Test-Script-1.07.tar.gz  
> Probe:erl [requires]
> IPC::Run3 [requires]
> Running make test
>   Delayed until after prerequisites
> Running make install
>   Delayed until after prerequisites
> Running install for module 'Probe:erl'
> .
> ...
> 
>   JPRIYAL/Net-Netconf-0.01.tar.gz
>   /usr/bin/make -- OK
> Running make test
> No tests defined for Net-Netconf extension.
>   JPRIYAL/Net-Netconf-0.01.tar.gz
> Tests succeeded but one dependency not OK (Bundle::Expect)
>   JPRIYAL/Net-Netconf-0.01.tar.gz
>   [dependencies] -- NA
> Running make install
>   make test had returned bad status, won't install without force
> 
> 
> But when I install all the three dependencies manually, this command works
> and installed Net::Netconf module in my system.

What is your operating system, distribution, perl version, etc.? Perhaps you
should be using native OS packages:

* http://perl-begin.org/topics/cpan/wrappers-for-distributions/

* http://perl-begin.org/topics/cpan/

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Apple Inc. is Evil - http://www.shlomifish.org/open-source/anti/apple/

*shlomif:* hack, hack, hack ; save ; make ; make test; commit. And start over.

*mrjink:* hack, hack, hack; save; make; swear; fix typos; save; make; make
test; swear some more; hack some more; save; make; make test; cheer; commit.

*meep:* hack, make, test, segfault, oh noes, revert to previous revision

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




RE: Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-16 Thread Priyal Jain
Hello,

I am getting following message when I run "cpan Net::Netconf"

Checking if EOF on pty slave is correctly reported to master...
(this fails on about 50% of the supported systems, so don't panic!
 Expect will work anyway!)
TIMEOUT
Sorry, you may not notice if the spawned process closes the pty.
Passed 42 of 42 tests.
RGIERSIG/Expect-1.21.tar.gz
Tests succeeded but 2 dependencies missing (IO:ty,IO::Tty)
RGIERSIG/Expect-1.21.tar.gz
[dependencies] -- NA
Running make install
make test had returned bad status, won't install without force
Running install for module 'File::Which'
Running make for A/AD/ADAMK/File-Which-1.09.tar.gz
Fetching with HTTP::Tiny:
http://www.planet-elektronik.de/CPAN/authors/id/A/AD/ADAMK/File-Which-1.09.tar.gz
Fetching with HTTP::Tiny:
http://www.planet-elektronik.de/CPAN/authors/id/A/AD/ADAMK/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/A/AD/ADAMK/File-Which-1.09.tar.gz ok
.
.
  CPAN.pm: Going to build A/AD/ADAMK/File-Which-1.09.tar.gz

CPAN.pm: Going to build A/AD/ADAMK/File-Which-1.09.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Test::Script 1.05 not found.
Generating a Unix-style Makefile
Writing Makefile for File::Which
Writing MYMETA.yml and MYMETA.json
 Unsatisfied dependencies detected during 
   ADAMK/File-Which-1.09.tar.gz   
Test::Script [requires]
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module 'Test::Script'
Running make for A/AD/ADAMK/Test-Script-1.07.tar.gz
Fetching with HTTP::Tiny:

Warning: prerequisite IPC::Run3 0.034 not found.
Warning: prerequisite Probe:erl 0.01 not found.
Generating a Unix-style Makefile
Writing Makefile for Test::Script
Writing MYMETA.yml and MYMETA.json
 Unsatisfied dependencies detected during 
   ADAMK/Test-Script-1.07.tar.gz  
Probe:erl [requires]
IPC::Run3 [requires]
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module 'Probe:erl'
.
...

  JPRIYAL/Net-Netconf-0.01.tar.gz
  /usr/bin/make -- OK
Running make test
No tests defined for Net-Netconf extension.
  JPRIYAL/Net-Netconf-0.01.tar.gz
Tests succeeded but one dependency not OK (Bundle::Expect)
  JPRIYAL/Net-Netconf-0.01.tar.gz
  [dependencies] -- NA
Running make install
  make test had returned bad status, won't install without force


But when I install all the three dependencies manually, this command works and 
installed Net::Netconf module in my system.


Thanks,
Regards,
Priyal
-Original Message-
From: Shlomi Fish [mailto:shlo...@shlomifish.org] 
Sent: Friday, May 16, 2014 3:16 PM
Cc: beginners@perl.org
Subject: Re: Error in installing "Bundle::Expect" as dependency for some other 
module using CPAN

Hi Priyal,

please reply to all recipients / to the list.

On Fri, 16 May 2014 08:41:02 +
Priyal Jain  wrote:

> Hello,
> 
> I am uploading my module Net::Netconf
> http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf in CPAN, 
> but its giving error of dependency not found for Bundle::Expect. I am 
> mentioning all my dependency in Makefile.Pl

It's "Makefile.PL" with a capital "L" - not "Makefile.Pl".


use ExtUtils::MakeMaker;
 our $VERSION ='0.01';
use 5.006;
WriteMakefile(
NAME => 'Net-Netconf',
AUTHOR   => 'Juniper Networks, Inc',
VERSION_FROM => 'Makefile.PL',
PREREQ_PM => {'XML::LibXML'=> '0', 'File::Which'=> '0',
'Bundle::Expect'=>'0',}, ABSTRACT => 'netconf libraries for perl',

);


> 
> But its giving error. Kindly help me.
> 
> 
> Thnanks,
> Priyal
> 

1. You need "use strict;" and "use warnings;" there.

2. "VERSION_FROM" => "Makefile.PL" is a bad idea - put it in the 
lib/Net/Netconf.pm module.

3. CPAN Testers is happy enough - do you have good test coverage:
http://www.cpantesters.org/distro/N/Net-Netconf.html?oncpan=1&distmat=1&version=0.01

4. Which error are you getting?

5. CPANTS is not happy at all - see
http://cpants.cpanauthors.org/dist/Net-Netconf - you should correct most of 
these problems.

6. I'm not sure one can easily depend on Bundle::Expect. Maybe specify the 
modules that you actually use (always a good idea).

7. See http://perl-begin.org/tutorials/bad-elements/ (note: perl-begin.org is a 
domain I originated).

8. Also see http://perl-begin.org/topics/cpan/ .

9. It's good that you're using XML::LibXML instead of parsing XML using regexes 
or using XML::Simple .

---

Regards,

Shlomi Fish

--
-

Re: Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-16 Thread Shlomi Fish
Hi Priyal,

please reply to all recipients / to the list.

On Fri, 16 May 2014 08:41:02 +
Priyal Jain  wrote:

> Hello,
> 
> I am uploading my module Net::Netconf
> http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf in CPAN, but
> its giving error of dependency not found for Bundle::Expect. I am mentioning
> all my dependency in Makefile.Pl 

It's "Makefile.PL" with a capital "L" - not "Makefile.Pl".


use ExtUtils::MakeMaker;
 our $VERSION ='0.01';
use 5.006;
WriteMakefile(
NAME => 'Net-Netconf',
AUTHOR   => 'Juniper Networks, Inc',
VERSION_FROM => 'Makefile.PL',
PREREQ_PM => {'XML::LibXML'=> '0', 'File::Which'=> '0',
'Bundle::Expect'=>'0',}, ABSTRACT => 'netconf libraries for perl',

);


> 
> But its giving error. Kindly help me.
> 
> 
> Thnanks,
> Priyal
> 

1. You need "use strict;" and "use warnings;" there.

2. "VERSION_FROM" => "Makefile.PL" is a bad idea - put it in the
lib/Net/Netconf.pm module.

3. CPAN Testers is happy enough - do you have good test coverage:
http://www.cpantesters.org/distro/N/Net-Netconf.html?oncpan=1&distmat=1&version=0.01

4. Which error are you getting?

5. CPANTS is not happy at all - see
http://cpants.cpanauthors.org/dist/Net-Netconf - you should correct most of
these problems.

6. I'm not sure one can easily depend on Bundle::Expect. Maybe specify the
modules that you actually use (always a good idea).

7. See http://perl-begin.org/tutorials/bad-elements/ (note: perl-begin.org is a
domain I originated).

8. Also see http://perl-begin.org/topics/cpan/ .

9. It's good that you're using XML::LibXML instead of parsing XML using regexes
or using XML::Simple .

---

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
UNIX Fortune Cookies - http://www.shlomifish.org/humour/fortunes/

Chuck Norris is the reason why OpenBSD is called OpenBSD. They wanted to
call it LockedDownBSD but couldn't find a way to keep Chuck Norris out!
(By Andrew Brehm) — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Error in installing "Bundle::Expect" as dependency for some other module using CPAN

2014-05-16 Thread Priyal Jain
Hello,

I am uploading my module Net::Netconf 
http://search.cpan.org/search?mode=all&query=net%3A%3Anetconf in CPAN, but its 
giving error of dependency not found for Bundle::Expect. I am mentioning all my 
dependency in Makefile.Pl
"use ExtUtils::MakeMaker;
 our $VERSION ='0.01';
use 5.006;
WriteMakefile(
NAME => 'Net-Netconf',
AUTHOR   => 'Juniper Networks, Inc',
VERSION_FROM => 'Makefile.PL',
PREREQ_PM => {'XML::LibXML'=> '0', 'File::Which'=> '0', 
'Bundle::Expect'=>'0',},
ABSTRACT => 'netconf libraries for perl',

);"

But its giving error. Kindly help me.


Thnanks,
Priyal



Re: error installing catalyst via cpan

2014-02-10 Thread Octavian Rasnita
There is more than one way to do it. Some of them work in some cases, other 
ways in other cases... :-)

I found some modules that installed well only with cpan and not with cpanm, or 
the other way around.

--Octavian

- Original Message - 
From: "Luca Ferrari" 
To: "Octavian Rasnita" 
Cc: 
Sent: Tuesday, February 11, 2014 9:00 AM
Subject: Re: error installing catalyst via cpan


> On Mon, Feb 10, 2014 at 6:22 PM, Octavian Rasnita  wrote:
>> Try installing  Catalyst with cpanm. Or join Catalyst mailing list and ask
>> there. There may be more that know the answer.
> 
> Thanks, I was able to install it via cpanm, even if I wonder why CPAN
> should not work
> Luca

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: error installing catalyst via cpan

2014-02-10 Thread Luca Ferrari
On Mon, Feb 10, 2014 at 6:22 PM, Octavian Rasnita  wrote:
> Try installing  Catalyst with cpanm. Or join Catalyst mailing list and ask
> there. There may be more that know the answer.

Thanks, I was able to install it via cpanm, even if I wonder why CPAN
should not work
Luca

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: error installing catalyst via cpan

2014-02-10 Thread Luca Ferrari
On Mon, Feb 10, 2014 at 5:24 PM, Rodney Simioni
 wrote:
> Can you upgrade CPAN?

I did. I reloaded the CPAN shell and try it again, but the error
remains the same.
I was able to install it via cpanm.

Luca

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: error installing catalyst via cpan

2014-02-10 Thread Octavian Rasnita
Try installing  Catalyst with cpanm. Or join Catalyst mailing list and ask 
there. There may be more that know the answer.


--Octavian

- Original Message - 
From: "Luca Ferrari" 

To: 
Sent: Monday, February 10, 2014 5:01 PM
Subject: error installing catalyst via cpan



Hi all,
while installing Catalyst::Devel on my machine I got the following:

Fetching with LWP:
http://www.planet-elektronik.de/CPAN/authors/id/D/DC/DCANTRELL/CHECKSUMS
Catching error: "'' trapped by operation mask at (eval 308)
line 1.\cJ at /usr/share/perl/5.14/CPAN/Distribution.pm line
1463.\cJ\cICPAN::Distribution::CHECKSUM_check_file(CPAN::Distribution=HASH(0xce99ee8),
\"/home/luca/.cpan/sources/authors/id/D/DC/DCANTRELL/CHECKSUMS\")
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
1397\cJ\cICPAN::Distribution::verifyCHECKSUM(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
406\cJ\cICPAN::Distribution::check_integrity(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
349\cJ\cICPAN::Distribution::get(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
1748\cJ\cICPAN::Distribution::make(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
3061\cJ\cICPAN::Distribution::test(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
3463\cJ\cICPAN::Distribution::install(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Module.pm line 479\cJ\cIeval {...}
called at /usr/share/perl/5.14/CPAN/Module.pm line
478\cJ\cICPAN::Module::rematein(CPAN::Module=HASH(0xbb0e158),
\"install\") called at /usr/share/perl/5.14/CPAN/Module.pm line
578\cJ\cICPAN::Module::install(CPAN::Module=HASH(0xbb0e158)) called at
/usr/share/perl/5.14/CPAN/Shell.pm line
1796\cJ\cICPAN::Shell::rematein(\"CPAN::Shell\", \"install\",
\"Catalyst::Devel\") called at /usr/share/perl/5.14/CPAN/Shell.pm line
1976\cJ\cICPAN::Shell::__ANON__(\"CPAN::Shell\", \"Catalyst::Devel\")
called at /usr/share/perl/5.14/CPAN.pm line 375\cJ\cIeval {...} called
at /usr/share/perl/5.14/CPAN.pm line 372\cJ\cICPAN::shell() called at
-e line 1\cJ" at /usr/share/perl/5.14/CPAN.pm line 391.
   CPAN::shell() called at -e line 1


while Catalust has installed seamlessly a few seconds before. A clue?

Thanks,
Luca

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/





--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




error installing catalyst via cpan

2014-02-10 Thread Luca Ferrari
Hi all,
while installing Catalyst::Devel on my machine I got the following:

Fetching with LWP:
http://www.planet-elektronik.de/CPAN/authors/id/D/DC/DCANTRELL/CHECKSUMS
Catching error: "'' trapped by operation mask at (eval 308)
line 1.\cJ at /usr/share/perl/5.14/CPAN/Distribution.pm line
1463.\cJ\cICPAN::Distribution::CHECKSUM_check_file(CPAN::Distribution=HASH(0xce99ee8),
\"/home/luca/.cpan/sources/authors/id/D/DC/DCANTRELL/CHECKSUMS\")
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
1397\cJ\cICPAN::Distribution::verifyCHECKSUM(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
406\cJ\cICPAN::Distribution::check_integrity(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
349\cJ\cICPAN::Distribution::get(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
1748\cJ\cICPAN::Distribution::make(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
3061\cJ\cICPAN::Distribution::test(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Distribution.pm line
3463\cJ\cICPAN::Distribution::install(CPAN::Distribution=HASH(0xce99ee8))
called at /usr/share/perl/5.14/CPAN/Module.pm line 479\cJ\cIeval {...}
called at /usr/share/perl/5.14/CPAN/Module.pm line
478\cJ\cICPAN::Module::rematein(CPAN::Module=HASH(0xbb0e158),
\"install\") called at /usr/share/perl/5.14/CPAN/Module.pm line
578\cJ\cICPAN::Module::install(CPAN::Module=HASH(0xbb0e158)) called at
/usr/share/perl/5.14/CPAN/Shell.pm line
1796\cJ\cICPAN::Shell::rematein(\"CPAN::Shell\", \"install\",
\"Catalyst::Devel\") called at /usr/share/perl/5.14/CPAN/Shell.pm line
1976\cJ\cICPAN::Shell::__ANON__(\"CPAN::Shell\", \"Catalyst::Devel\")
called at /usr/share/perl/5.14/CPAN.pm line 375\cJ\cIeval {...} called
at /usr/share/perl/5.14/CPAN.pm line 372\cJ\cICPAN::shell() called at
-e line 1\cJ" at /usr/share/perl/5.14/CPAN.pm line 391.
CPAN::shell() called at -e line 1


while Catalust has installed seamlessly a few seconds before. A clue?

Thanks,
Luca

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Uri Guttman

On 01/03/2014 02:28 PM, Rob Dixon wrote:

On 02/01/2014 15:21, mani kandan wrote:

Hi,

We have file size of huge size 500MB, Need to Manipulate the file, some
replacement and then write the file, I have used File::slurp and works
for file size of 300MB (Thanks Uri) but for this huge size 500MB it is
not processing and come out with error. I have also used Tie::file
module same case as not processing, any guidance.


Slurping entire files into memory is usually overkill, and you should
only do it if you can aford the memory and *really need* random access
to the entire file at once. Most of the time a simple sequential
read/modify/write is appropriate, and Perl will take care of buffering
the input and output files in reasonable amounts.



of course i differ on that opinion. slurping is almost always faster and 
in many cases the code is simpler than line by line i/o. also you can do 
much easier parsing and processing of whole files in single scalar than 
line by line. and reasonable size has shifted dramatically over the 
decades. in the olden days line by line was mandated due to small 
amounts of ram. the typical file size (code, configs, text, markup, 
html, etc) has not grown much since then but ram has gotten so large and 
cheap. slurping is the way to go today other than for genetics, logs and 
similar super large files.




According to your later posts you have just 2GB of memory, and although
Windows XP *can* run in 500MB I wouldn't like to see a program that
slurped a quarter of the entire memory.

I haven't seen you describe what processing you want to do on the file.
If the input is a text file and the changes can be done line by line,
then you are much better off with a program that looks like this

use strict;
use warnings;

open my $in, '<', 'myfile.txt' or die $!;
open my $out, '>', 'outfile.txt' or die $!;

while (<$in>) {
   s/from string/to string/g;
   print $out $_;
}

__END__

But if you need more, then I would guess that Tie::File is your best
bet. You don't say what problems you are getting using this module, so
please explain.


tie::file will be horrible for editing a large file like that. your line 
by line or similar code would be much better. tie::file does so much 
seeking and i/o, much more than linear access buffering would do. when 
lines wrap over block boundaries (much more likely than not), tie::file 
does extra amounts of i/o.


uri

--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Rob Dixon

On 02/01/2014 15:21, mani kandan wrote:

Hi,

We have file size of huge size 500MB, Need to Manipulate the file, some
replacement and then write the file, I have used File::slurp and works
for file size of 300MB (Thanks Uri) but for this huge size 500MB it is
not processing and come out with error. I have also used Tie::file
module same case as not processing, any guidance.


Slurping entire files into memory is usually overkill, and you should
only do it if you can aford the memory and *really need* random access
to the entire file at once. Most of the time a simple sequential
read/modify/write is appropriate, and Perl will take care of buffering
the input and output files in reasonable amounts.

According to your later posts you have just 2GB of memory, and although
Windows XP *can* run in 500MB I wouldn't like to see a program that
slurped a quarter of the entire memory.

I haven't seen you describe what processing you want to do on the file.
If the input is a text file and the changes can be done line by line,
then you are much better off with a program that looks like this

use strict;
use warnings;

open my $in, '<', 'myfile.txt' or die $!;
open my $out, '>', 'outfile.txt' or die $!;

while (<$in>) {
  s/from string/to string/g;
  print $out $_;
}

__END__

But if you need more, then I would guess that Tie::File is your best
bet. You don't say what problems you are getting using this module, so
please explain.

Rob




---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Uri Guttman

On 01/03/2014 12:48 PM, Shawn H Corey wrote:

On Fri, 03 Jan 2014 12:22:48 -0500
Uri Guttman  wrote:


i haven't seen that before but it was last touched in 2005.


That means it has no bugs. A better metric of a modules quality is how
many outstanding bugs are? See
https://rt.cpan.org//Dist/Display.html?Queue=File-Inplace


it also means it may be rotting on the vine. or no one uses it to report 
bugs. or it is an orphan module. or no requests for new features 
(popular modules always get that). stable doesn't always mean it is 
good. considering i wrote edit_file_lines and never heard of that until 
now. it says the module isn't known or used. in fact metacpan says it 
has no reverse dependencies (not one module or distribution uses it). 
not bragging but file::slurp has over 600 reverse dependencies. that 
means i get feature requests, more bug reports, etc.


you may need to look at the whole picture before you decide to use a 
module. if this module was so useful, why isn't it being used by anyone 
since 2005? i think a major negative is the very odd api which i already 
mentioned. you have to do a lot of work to use it and it doesn't gain 
much because of that. it does have a commit/rollback thing but again, 
that is easy to code up yourself. just write to a temp file and either 
rename it or delete it. not much of a win there.


uri


--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Shawn H Corey
On Fri, 03 Jan 2014 12:22:48 -0500
Uri Guttman  wrote:

> i haven't seen that before but it was last touched in 2005.

That means it has no bugs. A better metric of a modules quality is how
many outstanding bugs are? See
https://rt.cpan.org//Dist/Display.html?Queue=File-Inplace


-- 
Don't stop where the ink does.
Shawn

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Uri Guttman

On 01/03/2014 12:10 PM, mani kandan wrote:

Hi,

Thanks for all your guidance, The Error was "Perl Command Line
Intepretar has encountered a problem and needs to close,


that isn't the real error. you need to run this in a command window that 
won't close after it fails so you can see the real error message.


Also increased the virtual memory, No use, My system configuration OS
XP SP3 Intel Core 2 duo with 2 GB Ram.


that isn't a lot of ram for a 500MB file to be slurped. increasing the 
virtual ram won't help as it will likely be mostly in swap. i don't know 
windows much so i can't say how to really check/set the virtual size of 
a process. try doing this on linux or on a box with much more ram. 
otherwise use a perl -p one liner loop and it should work.


uri

--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Uri Guttman

On 01/03/2014 10:22 AM, Janek Schleicher wrote:



A short look to CPAN brings out https://metacpan.org/pod/File::Inplace
what looks to do what OP wants.

Honestly I never used, and it can be that it has also a performance
problem, but for at least I looked to it's source code and it implements
it via a temporary file without saving the whole file.


i haven't seen that before but it was last touched in 2005. its api 
requires method calls to get each line, another method call to replace a 
line and such. i would call that somewhat clunky compared to 
edit_file_lines and its primary arg of a code block modifies $_. likely 
it will be much slower for typical files as well.


now for very large files, we can't tell. we still haven't heard back 
from the OP about the actual error. my conjecture of a resource limit 
still feels right. neither perl nor file::slurp would have any errors on 
a large file other than limited resources. and that can be fixed with a 
ulimit call or similar.


uri



--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread mani kandan
Hi,

Thanks for all your guidance, The Error was "Perl Command Line Intepretar has 
encountered a problem and needs to close,

 Also increased the virtual memory, No use, My system configuration OS XP SP3 
Intel Core 2 duo with 2 GB Ram.


regards
Manikandan N



On Friday, 3 January 2014 9:06 PM, Janek Schleicher  
wrote:
 
Am 02.01.2014 18:08, schrieb David Precious:

> Oh, I was thinking of a wrapper that would:
>
> (a) open a new temp file
> (b) iterate over the source file, line-by-line, calling the provided
> coderef for each line
> (c) write $_ (potentially modified by the coderef) to the temp file
> (d) finally, rename the temp file over the source file
>
> Of course, it's pretty easy to write such code yourself, and as it
> doesn't slurp the file in, it could be considered out of place in
> File::Slurp.  I'd be fairly surprised if such a thing doesn't already
> exist on CPAN, too.  (If it didn't, I might actually write such a
> thing, as a beginner-friendly "here's how to easily modify a file, line
> by line, with minimal effort" offering.)

A short look to CPAN brings out https://metacpan.org/pod/File::Inplace
what looks to do what OP wants.

Honestly I never used, and it can be that it has also a performance 
problem, but for at least I looked to it's source code and it implements 
it via a temporary file without saving the whole file.


Greetings,
Janek


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Re: Gigantic file size processing error

2014-01-03 Thread Janek Schleicher

Am 02.01.2014 18:08, schrieb David Precious:


Oh, I was thinking of a wrapper that would:

(a) open a new temp file
(b) iterate over the source file, line-by-line, calling the provided
coderef for each line
(c) write $_ (potentially modified by the coderef) to the temp file
(d) finally, rename the temp file over the source file

Of course, it's pretty easy to write such code yourself, and as it
doesn't slurp the file in, it could be considered out of place in
File::Slurp.  I'd be fairly surprised if such a thing doesn't already
exist on CPAN, too.  (If it didn't, I might actually write such a
thing, as a beginner-friendly "here's how to easily modify a file, line
by line, with minimal effort" offering.)


A short look to CPAN brings out https://metacpan.org/pod/File::Inplace
what looks to do what OP wants.

Honestly I never used, and it can be that it has also a performance 
problem, but for at least I looked to it's source code and it implements 
it via a temporary file without saving the whole file.



Greetings,
Janek

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread Jan Gruber
Hi List,

On Friday, January 03, 2014 10:57:13 AM kurtz le pirate wrote:

> have you try this kind of command :
>   perl -p -i -e "s/oneThing/otherThing/g" yourFile

I was about to post the same thing. My suggestion: Create a backup file just 
in case something goes wrong.

perl -pi.bak -e "s/oneThing/otherThing/g" yourFile

This creates a backup named "yourFile.bak" prior to processing yourFile.

> hang or not ?
I have processed files > 2G this way, no problems encountered.

Regards,
Jan
-- 
When a woman marries again it is because she detested her first husband. 
When a man marries again, it is because he adored his first wife. -- Oscar 
Wilde
- 


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-03 Thread kurtz le pirate
In article 
<1388676082.98276.yahoomail...@web193403.mail.sg3.yahoo.com>,
 mani_nm...@yahoo.com (mani kandan) wrote:

> Hi,

We have file size of huge size 500MB, Need to Manipulate the file, some 
> replacement and then write the file, I have used File::slurp and works for 
> file size of 300MB (Thanks Uri) but for this huge size 500MB it is not 
> processing and come out with error. I have also used Tie::file module same 
> case as not processing, any guidance.

regards
Manikandan


Hi,


have you try this kind of command :

  perl -p -i -e "s/oneThing/otherThing/g" yourFile

hang or not ?


and, 500MB is not a "gigantic" file :)


-- 
klp

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread David Precious
On Thu, 02 Jan 2014 12:19:16 -0500
Uri Guttman  wrote:
> On 01/02/2014 12:08 PM, David Precious wrote:
> > Oh, I was thinking of a wrapper that would:
> >
> > (a) open a new temp file
> > (b) iterate over the source file, line-by-line, calling the provided
> > coderef for each line
> > (c) write $_ (potentially modified by the coderef) to the temp file
> > (d) finally, rename the temp file over the source file

[...]
> it wouldn't be a bad addition to file::slurp. call it something like 
> edit_file_loop. if you write it, i will add it to the module. you can 
> likely steal the code from edit_file_lines and modify that. i would 
> document it as an alternative to edit_file_lines for very large files.
> 
> it will need pod, test files and good comments for me to add it.
> credit will be given :)

Righto - I'll add it to my list of things awaiting tuit resupply :)



-- 
David Precious ("bigpresh") 
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook
www.preshweb.co.uk/cpanwww.preshweb.co.uk/github



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread Uri Guttman

On 01/02/2014 12:33 PM, David Precious wrote:

On Thu, 02 Jan 2014 12:19:16 -0500
Uri Guttman  wrote:

On 01/02/2014 12:08 PM, David Precious wrote:

Oh, I was thinking of a wrapper that would:

(a) open a new temp file
(b) iterate over the source file, line-by-line, calling the provided
coderef for each line
(c) write $_ (potentially modified by the coderef) to the temp file
(d) finally, rename the temp file over the source file


[...]

it wouldn't be a bad addition to file::slurp. call it something like
edit_file_loop. if you write it, i will add it to the module. you can
likely steal the code from edit_file_lines and modify that. i would
document it as an alternative to edit_file_lines for very large files.

it will need pod, test files and good comments for me to add it.
credit will be given :)


Righto - I'll add it to my list of things awaiting tuit resupply :)



who is your tuit supplier? i am looking for a better and cheaper one.

uri


--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread Uri Guttman

On 01/02/2014 12:08 PM, David Precious wrote:

On Thu, 02 Jan 2014 11:56:26 -0500
Uri Guttman  wrote:


Part of me wonders if File::Slurp should provide an in-place (not
slurping into RAM) editing feature which works like edit_file_lines
but line-by-line using a temp file, but that's probably feature
creep :)


that IS tie::file which i didn't want for efficiency reasons. it has
to read/write back and forth every time you modify an element.
edit_file (and _lines) are meant to be fast and simple to use for
common editing of files. as with slurping, i didn't expect them to be
used on .5GB files! :)


Oh, I was thinking of a wrapper that would:

(a) open a new temp file
(b) iterate over the source file, line-by-line, calling the provided
coderef for each line
(c) write $_ (potentially modified by the coderef) to the temp file
(d) finally, rename the temp file over the source file

Of course, it's pretty easy to write such code yourself, and as it
doesn't slurp the file in, it could be considered out of place in
File::Slurp.  I'd be fairly surprised if such a thing doesn't already
exist on CPAN, too.  (If it didn't, I might actually write such a
thing, as a beginner-friendly "here's how to easily modify a file, line
by line, with minimal effort" offering.)




it wouldn't be a bad addition to file::slurp. call it something like 
edit_file_loop. if you write it, i will add it to the module. you can 
likely steal the code from edit_file_lines and modify that. i would 
document it as an alternative to edit_file_lines for very large files.


it will need pod, test files and good comments for me to add it. credit 
will be given :)


thanx,

uri

--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread David Precious
On Thu, 02 Jan 2014 11:56:26 -0500
Uri Guttman  wrote:

> > Part of me wonders if File::Slurp should provide an in-place (not
> > slurping into RAM) editing feature which works like edit_file_lines
> > but line-by-line using a temp file, but that's probably feature
> > creep :)  
> 
> that IS tie::file which i didn't want for efficiency reasons. it has
> to read/write back and forth every time you modify an element.
> edit_file (and _lines) are meant to be fast and simple to use for
> common editing of files. as with slurping, i didn't expect them to be
> used on .5GB files! :)

Oh, I was thinking of a wrapper that would:

(a) open a new temp file
(b) iterate over the source file, line-by-line, calling the provided
coderef for each line
(c) write $_ (potentially modified by the coderef) to the temp file
(d) finally, rename the temp file over the source file

Of course, it's pretty easy to write such code yourself, and as it
doesn't slurp the file in, it could be considered out of place in
File::Slurp.  I'd be fairly surprised if such a thing doesn't already
exist on CPAN, too.  (If it didn't, I might actually write such a
thing, as a beginner-friendly "here's how to easily modify a file, line
by line, with minimal effort" offering.)


-- 
David Precious ("bigpresh") 
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook
www.preshweb.co.uk/cpanwww.preshweb.co.uk/github



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread Uri Guttman

On 01/02/2014 11:48 AM, David Precious wrote:

On Thu, 02 Jan 2014 11:18:31 -0500
Uri Guttman  wrote:

On 01/02/2014 10:39 AM, David Precious wrote:



Secondly - do you need to work on the file as a whole, or can you
just loop over it, making changes, and writing them back out?  In
other words, do you *need* to hold the whole file in memory at one
time? More often than not, you don't.

If it's per-line changes, then File::Slurp::edit_file_lines should
work
- for e.g.:

use File::Slurp qw(edit_file_lines);
my $filename = '/tmp/foo';
edit_file_lines(sub { s/badger/mushroom/g }, $filename);

The above would of course replace every occurrence of 'badger' with
'mushroom' in the file.


if there is a size issue, that would be just as bad as slurping in
the whole file and it would use even more storage as it will be an
array of all the lines internally.


Oh - my mistake, I'd believed that edit_file_lines edited the file
line-by-line, writing the results to a temporary file and then
renaming the temporary file over the original at the end.

In that case, I think the docs are a little unclear:

"These subs read in a file into $_, execute a code block which should
modify $_ and then write $_ back to the file. The difference between
them is that edit_file reads the whole file into $_ and calls the code
block one time. With edit_file_lines each line is read into $_ and the
code is called for each line..."



good point. i should emphasize that it does slurp in the file. tie::file 
only reads in chunks and moves around as you access elements. 
edit_file_lines slurps into an array and loops over those elements 
aliasing each one to $_. it definitely eats its own dog food!



and

"These subs are the equivalent of the -pi command line options of
Perl..."

... to me, that sounds like edit_file_lines reads a line at a time
rather than slurping the whole lot - but looking at the code, it does
indeed read the entire file contents into RAM.  (I probably should have
expected anything in File::Slurp to, well, slurp the file... :) )


as i said, dog food is good! :)

i wrote edit_file and edit_file_lines as interesting wrappers around 
read_file and write_file. i assumed it was obvious they used those slurp 
functions.





Part of me wonders if File::Slurp should provide an in-place (not
slurping into RAM) editing feature which works like edit_file_lines but
line-by-line using a temp file, but that's probably feature creep :)


that IS tie::file which i didn't want for efficiency reasons. it has to 
read/write back and forth every time you modify an element. edit_file 
(and _lines) are meant to be fast and simple to use for common editing 
of files. as with slurping, i didn't expect them to be used on .5GB 
files! :)


uri



--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread David Precious
On Thu, 02 Jan 2014 11:18:31 -0500
Uri Guttman  wrote:
> On 01/02/2014 10:39 AM, David Precious wrote:

> > Secondly - do you need to work on the file as a whole, or can you
> > just loop over it, making changes, and writing them back out?  In
> > other words, do you *need* to hold the whole file in memory at one
> > time? More often than not, you don't.
> >
> > If it's per-line changes, then File::Slurp::edit_file_lines should
> > work
> > - for e.g.:
> >
> >use File::Slurp qw(edit_file_lines);
> >my $filename = '/tmp/foo';
> >edit_file_lines(sub { s/badger/mushroom/g }, $filename);
> >
> > The above would of course replace every occurrence of 'badger' with
> > 'mushroom' in the file.
> 
> if there is a size issue, that would be just as bad as slurping in
> the whole file and it would use even more storage as it will be an
> array of all the lines internally.

Oh - my mistake, I'd believed that edit_file_lines edited the file
line-by-line, writing the results to a temporary file and then
renaming the temporary file over the original at the end.

In that case, I think the docs are a little unclear:

"These subs read in a file into $_, execute a code block which should
modify $_ and then write $_ back to the file. The difference between
them is that edit_file reads the whole file into $_ and calls the code
block one time. With edit_file_lines each line is read into $_ and the
code is called for each line..."

and 

"These subs are the equivalent of the -pi command line options of
Perl..."

... to me, that sounds like edit_file_lines reads a line at a time
rather than slurping the whole lot - but looking at the code, it does
indeed read the entire file contents into RAM.  (I probably should have
expected anything in File::Slurp to, well, slurp the file... :) )

Part of me wonders if File::Slurp should provide an in-place (not
slurping into RAM) editing feature which works like edit_file_lines but
line-by-line using a temp file, but that's probably feature creep :)

OP - what didn't work about Tie::File?



-- 
David Precious ("bigpresh") 
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook
www.preshweb.co.uk/cpanwww.preshweb.co.uk/github



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread Uri Guttman

On 01/02/2014 10:39 AM, David Precious wrote:

On Thu, 2 Jan 2014 23:21:22 +0800 (SGT)
mani kandan  wrote:


Hi,

We have file size of huge size 500MB, Need to Manipulate the file,
some replacement and then write the file, I have used File::slurp and
works for file size of 300MB (Thanks Uri) but for this huge size
500MB it is not processing and come out with error. I have also used
Tie::file module same case as not processing, any guidance.


Firstly, be specific - "come out with error" doesn't help us - what is
the error?

Secondly - do you need to work on the file as a whole, or can you just
loop over it, making changes, and writing them back out?  In other
words, do you *need* to hold the whole file in memory at one time?
More often than not, you don't.

If it's per-line changes, then File::Slurp::edit_file_lines should work
- for e.g.:

   use File::Slurp qw(edit_file_lines);
   my $filename = '/tmp/foo';
   edit_file_lines(sub { s/badger/mushroom/g }, $filename);

The above would of course replace every occurrence of 'badger' with
'mushroom' in the file.


if there is a size issue, that would be just as bad as slurping in the 
whole file and it would use even more storage as it will be an array of 
all the lines internally. slurping in 500MB is not a smart thing unless 
you have many gigs of free ram. otherwise it will just be going to disk 
on the swap and you don't gain much other than simpler logic.


but i agree, knowing the error message and who is generating it will be 
valuable. it could be a virtual ram limitation on the OS which can be 
changed with the ulimit utility (or BSD::Resource if you have that module).


uri


--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Gigantic file size processing error

2014-01-02 Thread David Precious
On Thu, 2 Jan 2014 23:21:22 +0800 (SGT)
mani kandan  wrote:

> Hi,
> 
> We have file size of huge size 500MB, Need to Manipulate the file,
> some replacement and then write the file, I have used File::slurp and
> works for file size of 300MB (Thanks Uri) but for this huge size
> 500MB it is not processing and come out with error. I have also used
> Tie::file module same case as not processing, any guidance.

Firstly, be specific - "come out with error" doesn't help us - what is
the error?

Secondly - do you need to work on the file as a whole, or can you just
loop over it, making changes, and writing them back out?  In other
words, do you *need* to hold the whole file in memory at one time?
More often than not, you don't.

If it's per-line changes, then File::Slurp::edit_file_lines should work
- for e.g.:

  use File::Slurp qw(edit_file_lines);
  my $filename = '/tmp/foo';
  edit_file_lines(sub { s/badger/mushroom/g }, $filename);

The above would of course replace every occurrence of 'badger' with
'mushroom' in the file.

Cheers

Dave P


-- 
David Precious ("bigpresh") 
http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter
www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook
www.preshweb.co.uk/cpanwww.preshweb.co.uk/github



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Gigantic file size processing error

2014-01-02 Thread mani kandan
Hi,

We have file size of huge size 500MB, Need to Manipulate the file, some 
replacement and then write the file, I have used File::slurp and works for file 
size of 300MB (Thanks Uri) but for this huge size 500MB it is not processing 
and come out with error. I have also used Tie::file module same case as not 
processing, any guidance.

regards
Manikandan

Re: raise an error

2013-09-25 Thread John SJ Anderson
On Wed, Sep 25, 2013 at 6:45 PM, Ken Peng  wrote:
> Does perl have a way to raise a error in module/class then from caller use
> Try::Tiny etc to catch them? Thanks.

You can throw an exception with 'die()' -- see 'perldoc -f die' for
calling syntax.

chrs,
john.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: raise an error

2013-09-25 Thread Ken Peng

On 2013-9-26 14:22, Shlomi Fish wrote:

I'm not using Try::Tiny (though many people recommend it), but I use
https://metacpan.org/release/Exception-Class  and it works fine. It's not clear
what exactly you're trying to do.


what I asked is how to raise an error from a module/class correctly? 
using die or croak?


Regards.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: raise an error

2013-09-25 Thread Shlomi Fish
Hi Ken,

On Thu, 26 Sep 2013 09:45:45 +0800
Ken Peng  wrote:

> Does perl have a way to raise a error in module/class then from caller 
> use Try::Tiny etc to catch them? Thanks.
> 

I'm not using Try::Tiny (though many people recommend it), but I use
https://metacpan.org/release/Exception-Class and it works fine. It's not clear
what exactly you're trying to do.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
http://www.shlomifish.org/humour/ways_to_do_it.html

Hackers bend the rules, so the NSA hates them. Instead, the NSA accumulates
rules, observes them, and accepts their fate: death.
— http://www.shlomifish.org/humour/bits/facts/NSA

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




raise an error

2013-09-25 Thread Ken Peng
Does perl have a way to raise a error in module/class then from caller 
use Try::Tiny etc to catch them? Thanks.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




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.14.2/
DateTime/Format/Builder.pm line 154.
Invalid date format:  at ./logbook.pl <http://logbook.pl> line 29




my $sth = $dbh->prepare("select l.id, l.date_added, l.username,
 l.entry, c.comment_date_added, c.username as cuser,
 c.comment from logbook as l
 left join comments as c on l.id = c.logbook_id
 order by l.date_added desc");


Run that query inside the mysql client, and you will probably see that 
c.comment_date_added is NULL.


--
Ruud


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




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 second
one, it throws me this error:

Use of uninitialized value $input in concatenation (.) or string at
/usr/local/share/perl/5.14.2/
DateTime/Format/Builder.pm line 154.
Invalid date format:  at ./logbook.pl line 29

Here's my code:

#! /usr/bin/perl

#use strict;
use DBI;
use DateTime::Format::MySQL;


my $dbh = DBI->connect(
"dbi:mysql:dbname=dbname",
"user",
"password",
{ RaiseError => 1 },
) or die $DBI::errstr;

my $sth = $dbh->prepare("select l.id, l.date_added, l.username,
l.entry, c.comment_date_added, c.username as cuser,
c.comment from logbook as l
left join comments as c on l.id = c.logbook_id
order by l.date_added desc");
$sth->execute();


my $row;
while ($row = $sth->fetchrow_hashref()) {
my  $id = $row->{id};
my  $date_added =
DateTime::Format::MySQL->parse_timestamp($row->{date_added});
my  $username = $row->{username};
my  $entry = $row->{entry};
my  $comment_date =
DateTime::Format::MySQL->parse_timestamp($row->{comment_date_added});
my  $comment_username = $row->{cuser};
my  $comment = $row->{comment};

print "Entry Id: $id, Entry Date: " . $date_added->strftime("%a, %d
%b %Y at %l:%M %p") . "\nUsername: $username\n\n\t$entry\n\n";
if($row->{comment} ne '') {
print "\t\tDate: " . $comment_date->strftime("%a, %d %b %Y
at %l:%M %p") . "\n";
print "\t\tUsername: $username\n";
print "\t\t\t $comment\n\n";
}
}


$sth->finish();
$dbh->disconnect();


Can anyone give me a tip? I've no idea what I'm doing wrong here... if I
run this without the 2nd timestamp format it works great, I'd just like the
readability.


RE: Excel Sheet Gen Code gives error

2013-07-15 Thread Tom, Jentil Kuriakose
Thanks Pritish/jing!

From: Pritish Pattanaik [mailto:pattanaikprit...@gmail.com]
Sent: Monday, July 15, 2013 4:47 PM
To: Tom, Jentil Kuriakose; beginners@perl.org
Subject: Re: Excel Sheet Gen Code gives error

Hello Jentil,
Have you installed SpreadSheet::WriteExcel module ? ,

if no =>  then install it from cpan shell or you can download it from 
(http://search.cpan.org/CPAN/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.39.tar.gz
 link)

follow the instruction:
wget link
tar -xzvf file.gz
cd newlycreateddir
perl Makefile.PL PREFIX="/path/to/your/testing/area"
make
make test
if yes => then search WriteExcel.pm file from your machine
find / -name "WriteExcel.pm"
/find/path/WriteExcel.pm

add this line in your main code
use lib "/find/path/"
[https://mail.google.com/mail/u/0/images/cleardot.gif]

On Mon, Jul 15, 2013 at 4:44 PM, Pritish Pattanaik 
mailto:pattanaikprit...@gmail.com>> wrote:
Hello Jentil,
Have you installed SpreadSheet::WriteExcel module ? ,

if no =>  then install it from cpan shell or you can download it from 
(http://search.cpan.org/CPAN/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.39.tar.gz
 link)

follow the instruction:
wget link
tar -xzvf file.gz
perl ./DIR/Makefile.PL prefix="/path/to/your/testing/area"
make
make test
if yes => then search WriteExcel.pm file from your machine
find / -name "WriteExcel.pm"
/find/path/WriteExcel.pm

add this line in your main code
use lib "/find/path/"

















On Mon, Jul 15, 2013 at 4:31 PM, Tom, Jentil Kuriakose 
mailto:c_j...@qti.qualcomm.com>> wrote:

Hi,

I have written simple EXCEL sheet gen PEARL code:

#!/usr/bin/perl

use strict;
use Spreadsheet::WriteExcel;

my $workbook = Spreadsheet::WriteExcel->new("simple.xls");
my $SUMMARY = $workbook->add_worksheet("SUMMARY");

$SUMMARY->write(0, 0, "START");
$SUMMARY->write(0, 2, "A");

But it gives following error when I execute through:

>perl excel_sheet.pl<http://excel_sheet.pl>
Can't locate Spreadsheet/WriteExcel.pm in @INC (@INC contains: 
/usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib 
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 
/usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int 
/usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at 
excel_sheet.pl<http://excel_sheet.pl> line 4.
BEGIN failed--compilation aborted at excel_sheet.pl<http://excel_sheet.pl> line 
4.

Kindly help.


Thanks,
Jentil.


--
To unsubscribe, e-mail: 
beginners-unsubscr...@perl.org<mailto:beginners-unsubscr...@perl.org>
For additional commands, e-mail: 
beginners-h...@perl.org<mailto:beginners-h...@perl.org>
http://learn.perl.org/





Re: Excel Sheet Gen Code gives error

2013-07-15 Thread Pritish Pattanaik
Hello Jentil,

Have you installed SpreadSheet::WriteExcel module ? ,

if no =>  then install it from cpan shell or you can download it from (
http://search.cpan.org/CPAN/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.39.tar.gzlink)


follow the instruction:

wget link
tar -xzvf file.gz
cd newlycreateddir
perl Makefile.PL PREFIX="/path/to/your/testing/area"
make
make test

if yes => then search WriteExcel.pm file from your machine

find / -name "WriteExcel.pm"
/find/path/WriteExcel.pm


add this line in your main code

use lib "/find/path/"


On Mon, Jul 15, 2013 at 4:44 PM, Pritish Pattanaik <
pattanaikprit...@gmail.com> wrote:

> Hello Jentil,
>
> Have you installed SpreadSheet::WriteExcel module ? ,
>
> if no =>  then install it from cpan shell or you can download it from (
> http://search.cpan.org/CPAN/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcel-2.39.tar.gzlink)
>
>
> follow the instruction:
>
> wget link
> tar -xzvf file.gz
> perl ./DIR/Makefile.PL prefix="/path/to/your/testing/area"
> make
> make test
>
> if yes => then search WriteExcel.pm file from your machine
>
> find / -name "WriteExcel.pm"
> /find/path/WriteExcel.pm
>
>
> add this line in your main code
>
> use lib "/find/path/"
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Jul 15, 2013 at 4:31 PM, Tom, Jentil Kuriakose <
> c_j...@qti.qualcomm.com> wrote:
>
>>
>> Hi,
>>
>> I have written simple EXCEL sheet gen PEARL code:
>>
>> #!/usr/bin/perl
>>
>> use strict;
>> use Spreadsheet::WriteExcel;
>>
>> my $workbook = Spreadsheet::WriteExcel->new("simple.xls");
>> my $SUMMARY = $workbook->add_worksheet("SUMMARY");
>>
>> $SUMMARY->write(0, 0, "START");
>> $SUMMARY->write(0, 2, "A");
>>
>> But it gives following error when I execute through:
>>
>> >perl excel_sheet.pl
>> Can't locate Spreadsheet/WriteExcel.pm in @INC (@INC contains:
>> /usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib
>> /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4
>> /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
>> /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at excel_sheet.plline 
>> 4.
>> BEGIN failed--compilation aborted at excel_sheet.pl line 4.
>>
>> Kindly help.
>>
>>
>> Thanks,
>> Jentil.
>>
>>
>> --
>> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
>> For additional commands, e-mail: beginners-h...@perl.org
>> http://learn.perl.org/
>>
>>
>>
>


Re: Excel Sheet Gen Code gives error

2013-07-15 Thread Jing Yu
Hi Jentil,

You do not seem to have the module installed. If you have cpanm, you may try:

$ cpanm Spreadsheet::WriteExcel

Cheers,

Jing
On 15 Jul 2013, at 19:01, "Tom, Jentil Kuriakose"  
wrote:

> 
> Hi, 
> 
> I have written simple EXCEL sheet gen PEARL code: 
> 
>   #!/usr/bin/perl
> 
>   use strict;
>   use Spreadsheet::WriteExcel;
> 
>   my $workbook = Spreadsheet::WriteExcel->new("simple.xls");
>   my $SUMMARY = $workbook->add_worksheet("SUMMARY");
> 
>   $SUMMARY->write(0, 0, "START");
>   $SUMMARY->write(0, 2, "A");
> 
> But it gives following error when I execute through: 
> 
>> perl excel_sheet.pl
> Can't locate Spreadsheet/WriteExcel.pm in @INC (@INC contains: 
> /usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib 
> /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 
> /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int 
> /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at excel_sheet.pl line 
> 4.
> BEGIN failed--compilation aborted at excel_sheet.pl line 4.
> 
> Kindly help. 
> 
> 
> Thanks,
> Jentil. 
> 
> 
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
> 
> 


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Excel Sheet Gen Code gives error

2013-07-15 Thread Tom, Jentil Kuriakose

Hi, 

I have written simple EXCEL sheet gen PEARL code: 

#!/usr/bin/perl

use strict;
use Spreadsheet::WriteExcel;

my $workbook = Spreadsheet::WriteExcel->new("simple.xls");
my $SUMMARY = $workbook->add_worksheet("SUMMARY");

$SUMMARY->write(0, 0, "START");
$SUMMARY->write(0, 2, "A");

But it gives following error when I execute through: 

>perl excel_sheet.pl
Can't locate Spreadsheet/WriteExcel.pm in @INC (@INC contains: 
/usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib 
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 
/usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int 
/usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at excel_sheet.pl line 4.
BEGIN failed--compilation aborted at excel_sheet.pl line 4.

Kindly help. 


Thanks,
Jentil. 


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl error codes and warnings

2013-05-29 Thread *Shaji Kalidasan*
Warren,

Sure, I will definitely share the document.
 
best,
Shaji 
---
Your talent is God's gift to you. What you do with it is your gift back to God.
---



 From: Warren James - jawarr 
To: '*Shaji Kalidasan*' ; timothy adigun 
<2teezp...@gmail.com>; Charles DeRykus  
Cc: Perl Beginners  
Sent: Wednesday, 29 May 2013 7:38 PM
Subject: RE: Perl error codes and warnings
 


 
Shaji - Upon completion, is this something which you could please consider 
providing to us/the list audience as well?:
“…a document with suitable code snippets which includes the most common Perl 
programming errors and warnings.”
 
THANKS
JJW
 
From:*Shaji Kalidasan* [mailto:shajiin...@yahoo.com] 
Sent: Wednesday, May 29, 2013 2:34 AM
To: timothy adigun; Charles DeRykus
Cc: Perl Beginners
Subject: Re: Perl error codes and warnings
 
Thanks a bunch Timothy and Charles for guiding me to wonderful resources within 
the Perl system.

use diagnostics qw/-verbose/; it slipped my attention. (Courtesy : Charles)
'perldoc -f qw (Courtesy : Timothy)
 
Actually I am a guiding junior Perl programmers (having little or no prior 
experience in Perl) and I am in the process of preparing a document with 
suitable code snippets which includes the most common Perl programming errors 
and warnings.
 
Your valuable input is highly appreciated and I cherish the treasure which I 
learned from you.
 
best,
Shaji 
---
Your talent is God's gift to you. What you do with it is your gift back to God.
---


 
From:timothy adigun <2teezp...@gmail.com>
To: *Shaji Kalidasan*  
Cc: Perl Beginners  
Sent: Wednesday, 29 May 2013 9:26 AM
Subject: Re: Perl error codes and warnings
 
Hi Shaji,
 
On Wed, May 29, 2013 at 4:19 AM, *Shaji Kalidasan*  wrote:
Greetings,
 
Where can I get more information on Perl's most common error codes? Is there a 
single source (repository/resource) for such most frequently encountered error 
codes?
 
[code-1]
use strict;
use warnings;

my @names = qw/bat, ball, %&!*, king, (^@), eagle, zebra/;
   
 with "qw", you don't use a 'comma' to separate the element of the array. 
Because, the element are separated by space. 
So, the correct thing to do is:
 
my @names = qw/bat  ball  %&!*  king (^@) eagle zebra/;
 
foreach (@names) {
>    print "$_\n" if /\w/;
>}
>[/code-1]
> 
>[output-1]
>Possible attempt to separate words with commas at C:/Users/shaji 
>kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>bat,
>ball,
>king,
>eagle,
>zebra
>[/output-1]
> 
>[code-2]
>use strict;
>use warnings;
>
>my @names = qw/orange apple %&!*# banana (^@) grapes mango/;
 
 Also, with "qw", you can't use '#', the use warnings gives a warning that the 
string contain '#'.
So, to use your expression, you can do like so:
my @names = split/\s/, q/orange apple %&!*# banana (^@) grapes mango/;  
foreach (@names) {
>    print "$_\n" if /\w/;
>}
>[/code-2]
> 
>[output-2]
>orange
>apple
>banana
>grapes
>mango
>Possible attempt to put comments in qw() list at C:/Users/shaji 
>kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>[/output-2]
> 
>So considering these two programs mentioned above, I am getting the following 
>warning messages
> 
>1) Possible attempt to separate words with commas at C:/Users/shaji 
>kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
> 
>2) Possible attempt to put comments in qw() list at C:/Users/shaji 
>kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
> 
>Please suggest some pointers or resources for this type of frequently 
>encountered error codes/warnings and its possible meanings.
 
 In fact, if you do 'perldoc -f qw' from the Command Line Interface, the last 
paragraph says:
 
                   A common mistake is to try to separate the words with comma
                   or to put comments into a multi-line "qw"-string.  For this
                   reason, the "use warnings" pragma and the --ww switch (that
                   is, the $^W variable) produces warnings if the STRING
                   contains the "," or the "#" character.  
 
Hope this helps
 
***
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privil

RE: Perl error codes and warnings

2013-05-29 Thread Warren James - jawarr
Shaji - Upon completion, is this something which you could please consider 
providing to us/the list audience as well?:
"...a document with suitable code snippets which includes the most common Perl 
programming errors and warnings."

THANKS
JJW

From: *Shaji Kalidasan* [mailto:shajiin...@yahoo.com]
Sent: Wednesday, May 29, 2013 2:34 AM
To: timothy adigun; Charles DeRykus
Cc: Perl Beginners
Subject: Re: Perl error codes and warnings

Thanks a bunch Timothy and Charles for guiding me to wonderful resources within 
the Perl system.

use diagnostics qw/-verbose/; it slipped my attention. (Courtesy : Charles)
'perldoc -f qw (Courtesy : Timothy)

Actually I am a guiding junior Perl programmers (having little or no prior 
experience in Perl) and I am in the process of preparing a document with 
suitable code snippets which includes the most common Perl programming errors 
and warnings.

Your valuable input is highly appreciated and I cherish the treasure which I 
learned from you.

best,
Shaji
---
Your talent is God's gift to you. What you do with it is your gift back to God.
---

From: timothy adigun <2teezp...@gmail.com>
To: *Shaji Kalidasan* 
Cc: Perl Beginners 
Sent: Wednesday, 29 May 2013 9:26 AM
Subject: Re: Perl error codes and warnings

Hi Shaji,

On Wed, May 29, 2013 at 4:19 AM, *Shaji Kalidasan* 
mailto:shajiin...@yahoo.com>> wrote:
Greetings,

Where can I get more information on Perl's most common error codes? Is there a 
single source (repository/resource) for such most frequently encountered error 
codes?

[code-1]
use strict;
use warnings;

my @names = qw/bat, ball, %&!*, king, (^@), eagle, zebra/;

 with "qw", you don't use a 'comma' to separate the element of the array. 
Because, the element are separated by space.
So, the correct thing to do is:

my @names = qw/bat  ball  %&!*  king (^@) eagle zebra/;

foreach (@names) {
print "$_\n" if /\w/;
}
[/code-1]

[output-1]
Possible attempt to separate words with commas at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl<http://hari.pl/> 
line 4.
bat,
ball,
king,
eagle,
zebra
[/output-1]

[code-2]
use strict;
use warnings;

my @names = qw/orange apple %&!*# banana (^@) grapes mango/;

 Also, with "qw", you can't use '#', the use warnings gives a warning that the 
string contain '#'.
So, to use your expression, you can do like so:
my @names = split/\s/, q/orange apple %&!*# banana (^@) grapes mango/;
foreach (@names) {
print "$_\n" if /\w/;
}
[/code-2]

[output-2]
orange
apple
banana
grapes
mango
Possible attempt to put comments in qw() list at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl<http://hari.pl/> 
line 4.
[/output-2]

So considering these two programs mentioned above, I am getting the following 
warning messages

1) Possible attempt to separate words with commas at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl<http://hari.pl/> 
line 4.

2) Possible attempt to put comments in qw() list at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl<http://hari.pl/> 
line 4.

Please suggest some pointers or resources for this type of frequently 
encountered error codes/warnings and its possible meanings.

 In fact, if you do 'perldoc -f qw' from the Command Line Interface, the last 
paragraph says:

   A common mistake is to try to separate the words with comma
   or to put comments into a multi-line "qw"-string.  For this
   reason, the "use warnings" pragma and the --ww switch (that
   is, the $^W variable) produces warnings if the STRING
   contains the "," or the "#" character.

Hope this helps

***
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.



Re: Perl error codes and warnings

2013-05-29 Thread *Shaji Kalidasan*
Thanks a bunch Timothy and Charles for guiding me to wonderful resources within 
the Perl system.

use diagnostics qw/-verbose/; it slipped my attention. (Courtesy : Charles)
'perldoc -f qw (Courtesy : Timothy)

Actually I am a guiding junior Perl programmers (having little or no prior 
experience in Perl) and I am in the process of preparing a document with 
suitable code snippets which includes the most common Perl programming errors 
and warnings.

Your valuable input is highly appreciated and I cherish the treasure which I 
learned from you.

 
best,
Shaji 
---
Your talent is God's gift to you. What you do with it is your gift back to God.
---



 From: timothy adigun <2teezp...@gmail.com>
To: *Shaji Kalidasan*  
Cc: Perl Beginners  
Sent: Wednesday, 29 May 2013 9:26 AM
Subject: Re: Perl error codes and warnings
 


Hi Shaji,



On Wed, May 29, 2013 at 4:19 AM, *Shaji Kalidasan*  wrote:

Greetings,
>
>
>Where can I get more information on Perl's most common error codes? Is there a 
>single source (repository/resource) for such most frequently encountered error 
>codes?
>
>
>[code-1]
>use strict;
>use warnings;
>
>my @names = qw/bat, ball, %&!*, king, (^@), eagle, zebra/;
>
   
 with "qw", you don't use a 'comma' to separate the element of the array. 
Because, the element are separated by space. 
So, the correct thing to do is:

my @names = qw/bat  ball  %&!*  king (^@) eagle zebra/;

 
foreach (@names) {
>    print "$_\n" if /\w/;
>}
>[/code-1]
>
>
>[output-1]
>Possible attempt to separate words with commas at C:/Users/shaji 
>kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>bat,
>ball,
>king,
>eagle,
>zebra
>[/output-1]
>
>
>[code-2]
>use strict;
>use warnings;
>
>my @names = qw/orange apple %&!*# banana (^@) grapes mango/;
>

 Also, with "qw", you can't use '#', the use warnings gives a warning that the 
string contain '#'.
So, to use your expression, you can do like so:
my @names = split/\s/, q/orange apple %&!*# banana (^@) grapes mango/;  
foreach (@names) {
>    print "$_\n" if /\w/;
>}
>[/code-2]
>
>
>[output-2]
>orange
>apple
>banana
>grapes
>mango
>Possible attempt to put comments in qw() list at C:/Users/shaji 
>kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>
>[/output-2]
>
>
>So considering these two programs mentioned above, I am getting the following 
>warning messages
>
>
>1) Possible attempt to separate 
words with commas at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>
>
>2) Possible attempt to put 
comments in qw() list at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>
>
>Please suggest some pointers or resources for this type of frequently 
>encountered error codes/warnings and its possible meanings.
>

 In fact, if you do 'perldoc -f qw' from the Command Line Interface, the last 
paragraph says:

                   A common mistake is to try to separate the words with comma
                   or to put comments into a multi-line "qw"-string.  For this
                   reason, the "use warnings" pragma and the --ww switch (that
                   is, the $^W variable) produces warnings if the STRING
                   contains the "," or the "#" character.  

Hope this helps

Re: Perl error codes and warnings

2013-05-28 Thread timothy adigun
Hi Shaji,

On Wed, May 29, 2013 at 4:19 AM, *Shaji Kalidasan* wrote:

> Greetings,
>
> Where can I get more information on Perl's most common error codes? Is
> there a single source (repository/resource) for such most frequently
> encountered error codes?
>
> [code-1]
> use strict;
> use warnings;
>
> my @names = qw/bat, ball, %&!*, king, (^@), eagle, zebra/;
>

 with "qw", you don't use a 'comma' to separate the element of the array.
Because, the element are separated by space.
So, the correct thing to do is:

my @names = qw/bat  ball  %&!*  king (^@) eagle zebra/;


> foreach (@names) {
> print "$_\n" if /\w/;
> }
> [/code-1]
>
> [output-1]
> Possible attempt to separate words with commas at C:/Users/shaji
> kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
> bat,
> ball,
> king,
> eagle,
> zebra
> [/output-1]
>
> [code-2]
> use strict;
> use warnings;
>
> my @names = qw/orange apple %&!*# banana (^@) grapes mango/;
>

 Also, with "qw", you can't use '#', the use warnings gives a warning that
the string contain '#'.
So, to use your expression, you can do like so:
my @names = split/\s/, q/orange apple %&!*# banana (^@) grapes mango/;

> foreach (@names) {
> print "$_\n" if /\w/;
> }
> [/code-2]
>
> [output-2]
> orange
> apple
> banana
> grapes
> mango
> Possible attempt to put comments in qw() list at C:/Users/shaji
> kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
> [/output-2]
>
> So considering these two programs mentioned above, I am getting the
> following warning messages
>
> 1) Possible attempt to separate words with commas at C:/Users/shaji
> kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>
> 2) Possible attempt to put comments in qw() list at C:/Users/shaji
> kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
>
> Please suggest some pointers or resources for this type of frequently
> encountered error codes/warnings and its possible meanings.
>

 In fact, if you do 'perldoc -f qw' from the Command Line Interface, the
last paragraph says:

   A *common* mistake is to try to *separate the words with
comma*
   or *to put comments into a multi-line "qw"-string*.  For
this
   reason, the "use warnings" pragma and the --ww switch
(that
   is, the $^W variable) produces warnings if the STRING
   contains the "," or the "#" character.

Hope this helps


Re: Perl error codes and warnings

2013-05-28 Thread Charles DeRykus

On 5/28/2013 8:19 PM, *Shaji Kalidasan* wrote:

Greetings,

Where can I get more information on Perl's most common error codes? Is 
there a single source (repository/resource) for such most frequently 
encountered error codes?


[code-1]
use strict;
use warnings;

[ ...  ]

The warnings are fairly intuitive but you can add:

use diagnostics qw/-verbose/;

for added explanations.

--
Charles DeRykus




Perl error codes and warnings

2013-05-28 Thread *Shaji Kalidasan*
Greetings,

Where can I get more information on Perl's most common error codes? Is there a 
single source (repository/resource) for such most frequently encountered error 
codes?

[code-1]
use strict;
use warnings;

my @names = qw/bat, ball, %&!*, king, (^@), eagle, zebra/;
foreach (@names) {
    print "$_\n" if /\w/;
}
[/code-1]

[output-1]
Possible attempt to separate words with commas at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.
bat,
ball,
king,
eagle,
zebra
[/output-1]

[code-2]
use strict;
use warnings;

my @names = qw/orange apple %&!*# banana (^@) grapes mango/;
foreach (@names) {
    print "$_\n" if /\w/;
}
[/code-2]

[output-2]
orange
apple
banana
grapes
mango
Possible attempt to put comments in qw() list at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.

[/output-2]

So considering these two programs mentioned above, I am getting the following 
warning messages

1) Possible attempt to separate 
words with commas at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.

2) Possible attempt to put 
comments in qw() list at C:/Users/shaji 
kalidasan/workspace/juno-sr1/shaji/Shaji Code Snippets/hari.pl line 4.

Please suggest some pointers or resources for this type of frequently 
encountered error codes/warnings and its possible meanings.


Any help is highly appreciated.

 
best,
Shaji 
---
Your talent is God's gift to you. What you do with it is your gift back to God.
---

Re: dmake can't find config.h, and collector throws error when trying to compile perl-static.exe (perl-5.18.0 / mingw)

2013-05-26 Thread sisyphus1



-Original Message- 
From: R. S.



dmake -f makefile.mk
==
del /f config.h
Can not find D:\perl\win32\config.h.
copy config_H.gc config.h
Number of copied files: 1.


That looks pretty normal to me.
The 'del /f config.h' command is executed to remove any existing config.h - 
then config_H.gc is copied across to config.h.


At the time that 'del /f config.h' is run, 'config.h' does not exist, which 
produces the warning 'Can not find D:\perl\win32\config.h.'.


I get essentially the same:

#
C:\_32\comp\perl-5.18.0\win32>dmake -f makefile.mk
del /f config.h
Could Not Find C:\_32\comp\perl-5.18.0\win32\config.h
copy config_H.gc config.h
   1 file(s) copied.
#

Your problem is something else.
I haven't tried building a static perl for ages.

Btw, if you're intending to install your perl into D:/perl, it's not a good 
idea to compile perl in D:/perl. Better to place the source somewhere 
(anywhere) else and do the compiling there.


I think that the p5p (perl5 porters) mailing list would be a better forum 
for this. (The perlmonks web forum would also accommodate this quite 
happily.)


I use version 4.12 of dmake.

Cheers,
Rob




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: dmake can't find config.h, and collector throws error when trying to compile perl-static.exe (perl-5.18.0 / mingw)

2013-05-26 Thread Shlomi Fish
Hi R. S.,

please reply to all recipients as I specifically instruct in my signature. You
sent your last reply only to me.

On Sun, 26 May 2013 17:59:06 +0200
"R. S."  wrote:

> Hello Shlomi,
> Sunday, May 26, 2013, 5:37:29 PM, you wrote:
> 
> > What are you trying to do? Are you trying to build perl from source on WinXP
> > SP3? (32-bit or 64-bit?) If so, I'm not sure if this belongs on
> > beginners@perl.org .
> 
> I try to build 32b on 32b system.
> So on what mailing list should I put this question ? Perl has hundreds
> of these and I didn't found anything related with compiling.
> 

I'm not saying what you're asking is off-topic on beginners@perl.org, just that
it may be too advanced for us. You may have better luck with perl5-porters:

http://dev.perl.org/perl5/lists.html

But I'm not sure if it's on-topic there, so maybe ask on #p5p on irc.perl.org
first - http://www.irc.perl.org/ .

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
First stop for Perl beginners - http://perl-begin.org/

I may be a geek, but I’m a true Klingon geek‐warrior! And a true Klingon geek
warrior ALWAYS bottom‐posts.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: dmake can't find config.h, and collector throws error when trying to compile perl-static.exe (perl-5.18.0 / mingw)

2013-05-26 Thread Shlomi Fish
Hi R. S.,

On Sun, 26 May 2013 16:19:12 +0200
"R. S."  wrote:

> dmake -f makefile.mk
> == 
> del /f config.h
> Can not find D:\perl\win32\config.h.
> copy config_H.gc config.h
> Number of copied files: 1.
> 
> It is strange because both of these files are present in the win32 dir
> but only one is found.
> 
> Maybe the version of dmake I use is outdated
> http://code.google.com/a/apache-extras.org/p/dmake/downloads/detail?name=dmake-win32-4.12.zip&can=1&q=
> 
> system is windows xp sp3
> compiler:
> http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.0/32-bit/threads-posix/sjlj/x32-4.8.0-release-posix-sjlj-rev2.7z
> ,
> compiler works ok on my projects
> 
> perl: http://www.cpan.org/src/5.0/perl-5.18.0.tar.gz
> 

What are you trying to do? Are you trying to build perl from source on WinXP
SP3? (32-bit or 64-bit?) If so, I'm not sure if this belongs on
beginners@perl.org .

Regards,

Shlomi Fish

> my path:
> C:\WINDOWS\system32;C:\WINDOWS;d:\dmake;d:\mingw32\bin;d:\perl;d:\perl\win32
> 
> at the end of compilation I got this:
> 
> d:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe:
>  ..\libperl518s.a(perllib.o):
> bad reloc address 0x0 in section `.data' collect2.exe: error: ld returned 1
> exit status dmake:  Warning: -- Found file corresponding to virtual target
> [..\uudmap.h]. dmake:  Error code 129, while making '..\perl-static.exe'
> 
> I got uncommented these lines in makefile.mk:
> BUILD_STATIC*= define
> ALL_STATIC  *= define
> 
> 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Perl Humour - http://perl-begin.org/humour/

Selina: Quite a weird lot this supernatural underworld seems to be.
— http://www.shlomifish.org/humour/Selina-Mandrake/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




dmake can't find config.h, and collector throws error when trying to compile perl-static.exe (perl-5.18.0 / mingw)

2013-05-26 Thread R. S.
dmake -f makefile.mk
== 
del /f config.h
Can not find D:\perl\win32\config.h.
copy config_H.gc config.h
Number of copied files: 1.

It is strange because both of these files are present in the win32 dir
but only one is found.

Maybe the version of dmake I use is outdated
http://code.google.com/a/apache-extras.org/p/dmake/downloads/detail?name=dmake-win32-4.12.zip&can=1&q=

system is windows xp sp3
compiler:
http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.0/32-bit/threads-posix/sjlj/x32-4.8.0-release-posix-sjlj-rev2.7z
,
compiler works ok on my projects

perl: http://www.cpan.org/src/5.0/perl-5.18.0.tar.gz

my path:
C:\WINDOWS\system32;C:\WINDOWS;d:\dmake;d:\mingw32\bin;d:\perl;d:\perl\win32

at the end of compilation I got this:

d:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe:
 ..\libperl518s.a(perllib.o): bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
dmake:  Warning: -- Found file corresponding to virtual target [..\uudmap.h].
dmake:  Error code 129, while making '..\perl-static.exe'

I got uncommented these lines in makefile.mk:
BUILD_STATIC*= define
ALL_STATIC  *= define


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Permission error

2013-04-24 Thread Florian Huber
Ok, sorry for bothering you: when I tried renaming the file by hand I 
found out that Windows simply doesn't allow ":" in filenames - Could've 
thought about this earlier.


Cheers,
Florian

Am 24.04.2013 15:12, schrieb Florian Huber:

Hi all,

I want to rename all image files in a folder to a new name, only the 
number should be kept:


use strict;
use warnings;
use 5.014;

foreach my $file (glob "*.tif") {
$file =~ m/(\d\d?).tif/;
rename($file, "DAT:26032013--WEL:A2--ID:"."$1") || die("Could not 
rename file: $!\n");

}

I always get "permission denied". Strange enough, while writing the 
script I already tried renaming all the files to the same name so that 
at the end there would be just one file (for test purposes) and that 
worked. When I tried again with the pattern above I got the permission 
error. I read that sometimes open files cause problems but I already 
restarted the PC, turned off antivirus and backup and now I'm running 
the console as an administrator and still get the error. Plus, I read 
that closedir sometimes helps but there's not even a directory open 
here, or is there in the background?


Any suggestions on this?

Many thanks.

Florian




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Permission error

2013-04-24 Thread Florian Huber

Hi all,

I want to rename all image files in a folder to a new name, only the 
number should be kept:


use strict;
use warnings;
use 5.014;

foreach my $file (glob "*.tif") {
$file =~ m/(\d\d?).tif/;
rename($file, "DAT:26032013--WEL:A2--ID:"."$1") || die("Could not 
rename file: $!\n");

}

I always get "permission denied". Strange enough, while writing the 
script I already tried renaming all the files to the same name so that 
at the end there would be just one file (for test purposes) and that 
worked. When I tried again with the pattern above I got the permission 
error. I read that sometimes open files cause problems but I already 
restarted the PC, turned off antivirus and backup and now I'm running 
the console as an administrator and still get the error. Plus, I read 
that closedir sometimes helps but there's not even a directory open 
here, or is there in the background?


Any suggestions on this?

Many thanks.

Florian

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: use utf-8 results in error

2012-11-22 Thread Jim Gibson

On Nov 22, 2012, at 9:43 PM, boB Stepp wrote:

> Win7-64bit. DWIM Perl, Strawberry Perl 5.14. Padre 0.96.
> 
> I am using the 6th edition of Learning Perl. It recommends adding use
> utf-8 to all programs. So I gave it my first try:
> 
> #!/usr/bin/env perl
> use utf-8;
> 
> print "Hello world";
> 
> 
> This gives the result:
> 
> 
> E:\Programs\Perl\LearningPerl>perl helloworld.pl
> Can't locate utf.pm in @INC (@INC contains: E:/Dwimperl/perl/site/lib 
> E:/Dwimper
> l/perl/vendor/lib E:/Dwimperl/perl/lib .) at helloworld.pl line 2.
> BEGIN failed--compilation aborted at helloworld.pl line 2.
> 
> I am puzzled as to why utf.pm is being looked for. utf8.pm is
> available in E:\Dwimperl\perl\lib Googling the part of the error
> message that does not contain my personal file paths has not led me to
> anything that I find helpful. Thoughts?

I don't have a copy of that book, but I suspect that it is referring to 'use 
utf8;', with no dash. I think that Perl is not parsing the dash character as 
part of the module name and looking for the utf module, not the utf-8 module 
(or pragma).

In any case, if you do not have any UTF characters in your source code, you 
don't need to add that statement. With it, the Perl parser will accept UTF-8 
characters as part of the source program, so you can enter UTF strings directly 
in your source code.

Other mechanisms are used for reading and writing files with UTF characters, 
but I haven't used those, either.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: use utf-8 results in error

2012-11-22 Thread boB Stepp
On Thu, Nov 22, 2012 at 11:54 PM, ranveer raghuwanshi
 wrote:
> Its not utf-8 its utf8 without hyphen(-)
>
Thank you, Ranveer! Perhaps I should not do my Perl studies as the wee
morning hours (here) approach. The obvious once again escapes me...

boB

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




use utf-8 results in error

2012-11-22 Thread boB Stepp
Win7-64bit. DWIM Perl, Strawberry Perl 5.14. Padre 0.96.

I am using the 6th edition of Learning Perl. It recommends adding use
utf-8 to all programs. So I gave it my first try:

#!/usr/bin/env perl
use utf-8;

print "Hello world";


This gives the result:


E:\Programs\Perl\LearningPerl>perl helloworld.pl
Can't locate utf.pm in @INC (@INC contains: E:/Dwimperl/perl/site/lib E:/Dwimper
l/perl/vendor/lib E:/Dwimperl/perl/lib .) at helloworld.pl line 2.
BEGIN failed--compilation aborted at helloworld.pl line 2.

I am puzzled as to why utf.pm is being looked for. utf8.pm is
available in E:\Dwimperl\perl\lib Googling the part of the error
message that does not contain my personal file paths has not led me to
anything that I find helpful. Thoughts?

Thanks!
boB

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




RE: variable definition error not caught when using strict and warnings

2012-11-09 Thread Nemana, Satya


From: Rob Dixon [rob.di...@gmx.com]
Sent: 09 November 2012 17:17
To: beginners@perl.org
Cc: Nemana, Satya
Subject: Re: variable definition error not caught when using strict and warnings

On 09/11/2012 17:08, Nemana, Satya wrote:
> Hi
>
> I am a little confused with this program
>
> Program:
> use strict;
> use warnings;
>
> if ($999 == 1056)
> {
>  print ("\nequal");
> }
> else
> {
>  print ("\nnot equal");
> }
>
> What I expect: Perl to throw me an error as $999 variable is not defined, but 
> perl executes the code with a warning.(I don't expect the code to compile at 
> all)
>
> Output:
> Use of uninitialized value in numeric eq (==) at wrong1.pl line 4.
>
> not equal
>
>
> However, if I replace $999 with $num (which is not defined or initialized), I 
> get the following error
>
> Global symbol "$num" requires explicit package name at wrong1.pl line 4.
> Execution of wrong1.pl aborted due to compilation errors.
>
> What is happening with the top program?

Hello Satya

The variable $999 holds the 999th capture from the most recent regular
successful expression match. Since you have no regular expressions in
the program it is left undefined. It would be very unusual to have so
many captures in a regex but Perl does support it.

Rob


Hi Rob

Thank you. 
I will give a read of the perl regular expression manual.
Actually $999 resulted in a typo was i wanted to compare another variable with 
999.
Not from a regular expression.
But it took a while for me to find the culprit as the intended code was never 
hit.
I was trying to understand why I never got an error during the compile itself.

Thanks for answering.

Regards,
Satya

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: variable definition error not caught when using strict and warnings

2012-11-09 Thread Rob Dixon

On 09/11/2012 17:08, Nemana, Satya wrote:

Hi

I am a little confused with this program

Program:
use strict;
use warnings;

if ($999 == 1056)
{
 print ("\nequal");
}
else
{
 print ("\nnot equal");
}

What I expect: Perl to throw me an error as $999 variable is not defined, but 
perl executes the code with a warning.(I don't expect the code to compile at 
all)

Output:
Use of uninitialized value in numeric eq (==) at wrong1.pl line 4.

not equal


However, if I replace $999 with $num (which is not defined or initialized), I 
get the following error

Global symbol "$num" requires explicit package name at wrong1.pl line 4.
Execution of wrong1.pl aborted due to compilation errors.

What is happening with the top program?


Hello Satya

The variable $999 holds the 999th capture from the most recent regular
successful expression match. Since you have no regular expressions in
the program it is left undefined. It would be very unusual to have so
many captures in a regex but Perl does support it.

Rob


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: variable definition error not caught when using strict and warnings

2012-11-09 Thread Andy Bach
On Fri, Nov 9, 2012 at 11:08 AM, Nemana, Satya  wrote:

>
> if ($999 == 1056)
> {
> print ("\nequal");
> }
> else
> {
> print ("\nnot equal");
> }
>
> What I expect: Perl to throw me an error as $999 variable is not defined,
> but perl executes the code with a warning.(I don't expect the code to
> compile at all)


$999 is, in a sense, one of the Perl "magic" variables. This is why the
definition of a Perl variable name doesn't allow the first character to be
a digit. The $ variables are for the RE capture storage - in this
case, your asking for what was saved by 999th set of capture parens - try:
use strict;
use warnings;

"1056" =~ /(\d+)/;
if ($1 == 1056) {
print ("equal\n");
}
else {
print ("not equal\n");
}




-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk


Re: variable definition error not caught when using strict and warnings

2012-11-09 Thread Robert Wohlfarth
On Fri, Nov 9, 2012 at 11:08 AM, Nemana, Satya  wrote:

> Program:
> use strict;
> use warnings;
>
> if ($999 == 1056)
> {
> print ("\nequal");
> }
> else
> {
> print ("\nnot equal");
> }
>
> What I expect: Perl to throw me an error as $999 variable is not defined,
> but perl executes the code with a warning.(I don't expect the code to
> compile at all)
>

Perl interprets $999 as "the nine hundred and ninety-ninth sub-group of the
last regular expression". It's a special variable. It has no value, which
is what the warning tells you.

Perl expects program variables to start with a letter or underscore. So
"$a999" or "$num" work like you expected.

You can find more about variable names here:
http://perldoc.perl.org/perldata.html.

-- 
Robert Wohlfarth


variable definition error not caught when using strict and warnings

2012-11-09 Thread Nemana, Satya
Hi

I am a little confused with this program

Program:
use strict;
use warnings;

if ($999 == 1056)
{
print ("\nequal");
}
else
{
print ("\nnot equal");
}

What I expect: Perl to throw me an error as $999 variable is not defined, but 
perl executes the code with a warning.(I don't expect the code to compile at 
all)

Output:
Use of uninitialized value in numeric eq (==) at wrong1.pl line 4.

not equal


However, if I replace $999 with $num (which is not defined or initialized), I 
get the following error

Global symbol "$num" requires explicit package name at wrong1.pl line 4.
Execution of wrong1.pl aborted due to compilation errors.

What is happening with the top program?

Thanks in advance
sn


Fw: thread error

2012-10-15 Thread Shlomi Fish
Please reply to the list.

Regards,

Shlomi Fish

Begin forwarded message:

Date: Mon, 15 Oct 2012 21:20:02 +0800
From: xiyoulaoyuanjia 
To: Shlomi Fish 
Subject: Re: thread error


is there a way for  some threads using the same *Net::SSH::Perl*  connection

2012/10/15 Shlomi Fish 

> Hi,
>
> On Mon, 15 Oct 2012 19:48:46 +0800
> xiyoulaoyuanjia  wrote:
>
> > hi listers:
> > now i have a question is abort thread
> > i have a main process that have ssh a remote host and everything is
> > ok! but when i use thread  it have a error like that
> > -
> > Thread 1 terminated abnormally: DBD::mysql::db do failed: handle 2
> > is owned by thread 1182010 not current thread 1e3fa20 (handles
> > can't be shared between threads and your driver may need a CLONE
> > method added) at 。。
> > ---
>
> The error pretty much speaks for itself. You initialised a database
> handle in one thread and are using it in another, which DBD::mysql
> does not allow.
>
> You should also reconsider using thread in Perl. See:
>
>  rindolf: threads.pm is evil, please explain what you're
> trying to write so we can help you find a better way (see
> http://www.perlmonks.org/index.pl?node_id=288022 for details on
> "evil")
>
> Regards,
>
> Shlomi Fish
>
> --
> -
> Shlomi Fish   http://www.shlomifish.org/
> The Case for File Swapping - http://shlom.in/file-swap
>
> Knuth is not God! God has already released TeX version 4.0.
>
> Please reply to list if it's a mailing list post -
> http://shlom.in/reply .
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


-- 
继续上路。。
you can follow me at twitter
@xiyoulaoyuanjia


-- 
-
Shlomi Fish   http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

All Chuck Norris has to do is *look* at Perl code and it interprets itself
out of fear and respect. — DrForr

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Re: thread error

2012-10-15 Thread Shlomi Fish
Hi,

On Mon, 15 Oct 2012 19:48:46 +0800
xiyoulaoyuanjia  wrote:

> hi listers:
> now i have a question is abort thread
> i have a main process that have ssh a remote host and everything is
> ok! but when i use thread  it have a error like that
> -
> Thread 1 terminated abnormally: DBD::mysql::db do failed: handle 2 is
> owned by thread 1182010 not current thread 1e3fa20 (handles can't be
> shared between threads and your driver may need a CLONE method added)
> at 。。 
> ---

The error pretty much speaks for itself. You initialised a database handle 
in one thread and are using it in another, which DBD::mysql does not allow.

You should also reconsider using thread in Perl. See:

 rindolf: threads.pm is evil, please explain what you're
trying to write so we can help you find a better way (see
http://www.perlmonks.org/index.pl?node_id=288022 for details on
"evil")  

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

Knuth is not God! God has already released TeX version 4.0.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




  1   2   3   4   5   6   7   8   9   10   >