Re: error print on closed file handle

2011-09-14 Thread John W. Krahn
Rajeev Prasad wrote: plz. advice why am i getting this error? Because the filehandle OUT_FH has NOT been opened correctly! I have checked: varilable outfile has proper path/filename How have you checked that? array allrecords has data How have you checked that? open(OUT_FH,">","$ou

Re[2]: running perl script from inside another script & collecting output in array

2011-09-14 Thread Jeff Pang
15 сентября 2011, 08:38 от Rajeev Prasad : > I am now using: > > my @outfiles = `thecalledscript.pl $filename`; > > i am getting right results. > > now question is: is this the best method in terms of efficiency? > Not the good way. It's better to write the called script as a module, then u

Re: running perl script from inside another script & collecting output in array

2011-09-14 Thread Brandon McCaig
On Thu, Sep 15, 2011 at 12:07 AM, Rajeev Prasad wrote: > here is how i am calling it from a thecalling_script: *snip* >     require "thecalledscript.pl"; *snip* > issue is, the called script prints some filenames after completion to STDOUT. > how can i collect them into an array variable? You co

Re: running perl script from inside another script & collecting output in array

2011-09-14 Thread Rajeev Prasad
I am now using: my @outfiles = `thecalledscript.pl $filename`; i am getting right results. now question is: is this the best method in terms of efficiency? From: Rajeev Prasad To: Perl Beginners Sent: Wednesday, September 14, 2011 11:07 PM Subject: running

running perl script from inside another script & collecting output in array

2011-09-14 Thread Rajeev Prasad
i am doing like below: thecalledscript.pl needs a filename as argument. here is how i am calling it from a thecalling_script: {     local @ARGV;     @ARGV = ("$filename");     require "thecalledscript.pl"; } issue is, the called script prints some filenames after completion to STDOUT. how

Re: error print on closed file handle

2011-09-14 Thread Rajeev Prasad
thx. Shawn that fixed the issue. From: Shawn H Corey To: beginners@perl.org Sent: Wednesday, September 14, 2011 8:40 PM Subject: Re: error print on closed file handle On 11-09-14 08:38 PM, Rajeev Prasad wrote: > plz. advice why am i getting this error? > > >

Re: Help, About Global variable.

2011-09-14 Thread Uri Guttman
> "BM" == Brandon McCaig writes: BM> [1] I personally find it very petty when Uri mentions his work as a BM> Perl "recruitment agent" (for lack of a better description right now) BM> and implies that he'll never consider you as a potential candidate BM> with regards to that because of

Re: Help, About Global variable.

2011-09-14 Thread Brandon McCaig
On Wed, Sep 14, 2011 at 8:57 PM, Uri Guttman wrote: > it was topical as your (self admitted) blowup happened here. and it > caused a small ruckus until you calmed down. I'd say you're both out to lunch on this. I don't even recall this subject so if I even read the affected threads then I obvious

Re: error print on closed file handle

2011-09-14 Thread Shawn H Corey
On 11-09-14 08:38 PM, Rajeev Prasad wrote: plz. advice why am i getting this error? I have checked: varilable outfile has proper path/filename array allrecords has data open(OUT_FH,">","$outfile"); print OUT_FH "@allrecords"; close OUT_FH; # You should test all your opens; your problem prob

Re: error print on closed file handle

2011-09-14 Thread Jeff Pang
15 сентября 2011, 04:39 от Rajeev Prasad : > plz. advice why am i getting this error? >   >   > I have checked: > varilable outfile has proper path/filename > array allrecords has data >   >   > open(OUT_FH,">","$outfile"); > print OUT_FH "@allrecords"; > close OUT_FH; >   You should always be

Re: error print on closed file handle

2011-09-14 Thread William
On Sep 15, 8:38 am, rp.ne...@yahoo.com (Rajeev Prasad) wrote: > plz. advice why am i getting this error? >   >   > I have checked: > varilable outfile has proper path/filename > array allrecords has data >   >   > open(OUT_FH,">","$outfile"); > print OUT_FH "@allrecords"; > close OUT_FH; >   >   >

Re: Help, About Global variable.

2011-09-14 Thread Uri Guttman
> "RD" == Rob Dixon writes: RD> On 14/09/2011 21:30, Uri Guttman wrote: >> >>> Uri we are all privileged with your thoughts on variable naming. My last >>> attempt to say that perhaps you weren't always right wrong resulted in a >>> personal attack saying "you had that blowup a few

error print on closed file handle

2011-09-14 Thread Rajeev Prasad
plz. advice why am i getting this error?     I have checked: varilable outfile has proper path/filename array allrecords has data     open(OUT_FH,">","$outfile"); print OUT_FH "@allrecords"; close OUT_FH;     error: print() on closed filehandle OUT_FH at /...     thank you.

how to use Net::OpenSSH::Parallel

2011-09-14 Thread Rajeev Prasad
trying to use this module now. but i guess i have a very basic issue: currently i am running following in a loop for all hosts (and a inner loop for all commands for a host):     my ($MFSSH) = Net::OpenSSH->new($HOST,                             user => $USER,                             pass

Re: Help, About Global variable.

2011-09-14 Thread Rob Dixon
On 14/09/2011 21:30, Uri Guttman wrote: Uri we are all privileged with your thoughts on variable naming. My last attempt to say that perhaps you weren't always right wrong resulted in a personal attack saying "you had that blowup a few months ago. are you doing that again?" Given that you choos

Re: Help, About Global variable.

2011-09-14 Thread Jim Gibson
On 9/14/11 Wed Sep 14, 2011 5:04 AM, "William" scribbled: > On Sep 14, 5:39 am, chrisstinem...@gmail.com (Chris Stinemetz) wrote: ...For more information see: >> >>>        #!/usr/local/bin/perl >>>        use strict; >>>        $a = 1; >>>        $b = 2; >>>        print qq($a, $b\n); >

Re: Help, About Global variable.

2011-09-14 Thread William
On Sep 14, 5:39 am, chrisstinem...@gmail.com (Chris Stinemetz) wrote: > >> ...For more information see: > > >>http://perl.plover.com/FAQs/Namespaces.html > > > Useful article. > > > Now can you explain why I get no error with this little routine? - > > >        #!/usr/local/bin/perl > >        use

Re: Help, About Global variable.

2011-09-14 Thread Uri Guttman
> "RD" == Rob Dixon writes: RD> On 14/09/2011 16:51, Uri Guttman wrote: >>> "PJ" == Paul Johnson writes: >> PJ> On Tue, Sep 13, 2011 at 11:34:34PM -0400, Uri Guttman wrote: >> >> here is another good reason to stay aways from single letter var >> >> names. they are hard to

Re: Help, About Global variable.

2011-09-14 Thread Rob Dixon
On 14/09/2011 16:51, Uri Guttman wrote: "PJ" == Paul Johnson writes: PJ> On Tue, Sep 13, 2011 at 11:34:34PM -0400, Uri Guttman wrote: >> here is another good reason to stay aways from single letter var >> names. they are hard to search for as other vars which start with those >>

Re: hi

2011-09-14 Thread Brandon McCaig
On Wed, Sep 14, 2011 at 12:35 PM, Brandon McCaig wrote: > #/usr/bin/perl Silly me, I forgot the bang. --- a Wed Sep 14 12:38:40 2011 +++ b Wed Sep 14 12:38:46 2011 @@ -1,4 +1,4 @@ -#/usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -- Brandon McCaig V zrn

Re: hi

2011-09-14 Thread Brandon McCaig
On Tue, Sep 13, 2011 at 10:00 AM, pradeep wrote: > Can anyone help me in this Of course we can! #/usr/bin/perl use strict; use warnings; my $input = <>; chomp $input; if($input eq '1,2,3,4,5,6') { print <<'EOF'; 1-2,3-4,5-6 1-2,3-5,4-6 1-2,3-6,4-5 1-3,2-4,5-6 1-3,2-5,4-6 1-3,2-6,4-5

Re: Help, About Global variable.

2011-09-14 Thread Shawn H Corey
On 11-09-14 11:51 AM, Uri Guttman wrote: show me a tool that can search for single letter names cleanly and with little effort as compared to longer names. also this isn't the only reason, just one of several. ViM. Put the cursor on the variable and press * Also: press # to search backward.

Re: Help, About Global variable.

2011-09-14 Thread Uri Guttman
> "PJ" == Paul Johnson writes: PJ> On Tue, Sep 13, 2011 at 11:34:34PM -0400, Uri Guttman wrote: >> here is another good reason to stay aways from single letter var >> names. they are hard to search for as other vars which start with those >> letters will also be found. PJ> This may

Re: hi

2011-09-14 Thread Paul Johnson
On Tue, Sep 13, 2011 at 07:00:42AM -0700, pradeep wrote: > Hi, > I do have a doubt , > Input: > 1,2,3,4,5,6 > output: > 1-2,3-4,5-6 > 1-2,3-5,4-6 > 1-2,3-6,4-5 > > 1-3,2-4,5-6 > 1-3,2-5,4-6 > 1-3,2-6,4-5 > > 1-4,2-3,5-6 > 1-4,2-5,3-6 > 1-4,2-6,3-5 > > 1-5,2-3,4-6 > 1-5,2-4,3-6 > 1-5,2-6,3-4 > >

Re: Help, About Global variable.

2011-09-14 Thread Paul Johnson
On Tue, Sep 13, 2011 at 11:34:34PM -0400, Uri Guttman wrote: > here is another good reason to stay aways from single letter var > names. they are hard to search for as other vars which start with those > letters will also be found. This may be the worst argument I have ever heard against using si

Re: Help, About Global variable.

2011-09-14 Thread William
On 9月13日, 下午8时33分, shlo...@shlomifish.org (Shlomi Fish) wrote: > Hello William, > > On Mon, 12 Sep 2011 20:05:38 -0700 (PDT) > > William wrote: > > My Code: > > use strict ; > > use warnings ; > > > chomp($input = ) ; > > > I compile this but has a error. say:Globla symbol "@input" requires > > ex

hi

2011-09-14 Thread pradeep
Hi, I do have a doubt , Input: 1,2,3,4,5,6 output: 1-2,3-4,5-6 1-2,3-5,4-6 1-2,3-6,4-5 1-3,2-4,5-6 1-3,2-5,4-6 1-3,2-6,4-5 1-4,2-3,5-6 1-4,2-5,3-6 1-4,2-6,3-5 1-5,2-3,4-6 1-5,2-4,3-6 1-5,2-6,3-4 1-6,2-3,4-5 1-6,2-4,3-5 1-6,2-5,3-4 Can anyone help me in this -- To unsubscribe, e-mail: be