Re: ? getting appended to file name while writing o file

2015-03-20 Thread Carl Inglis
Please don't piggyback on an existing thread. Start a new thread with an email to the group address. On 20 Mar 2015 11:34, "Uday Vernekar" wrote: > when i use $numberOfPingPackets=2; > > I get following warning? > > PING 192.168.240.55 (192.168.240.55) 56(84) bytes of data. > > --- 192.168.240.5

Re: ? getting appended to file name while writing o file

2015-03-20 Thread Uday Vernekar
when i use $numberOfPingPackets=2; I get following warning? PING 192.168.240.55 (192.168.240.55) 56(84) bytes of data. --- 192.168.240.55 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 11000ms Use of uninitialized value in index at ./pinglog.pl line 26, line 4.

Re: ? getting appended to file name while writing o file

2015-03-19 Thread Satya Prasad Nemana
Bill, Carl, Andrew, Thanks a lot for your answers. yes, i will make the change to use the perl utilities as it will make the code platform independent. Regards, Satya On 19 March 2015 at 16:58, Carl Inglis wrote: > It's not actually ending up with a ? character at the end - it's ending up >

Re: ? getting appended to file name while writing o file

2015-03-19 Thread Carl Inglis
It's not actually ending up with a ? character at the end - it's ending up with a new line character. Your terminal is (as Andrew implied) displaying a ? character for a character code outside the range of characters it knows it can display. Regards, Carl On 19 March 2015 at 11:19, Andrew Solomo

Re: ? getting appended to file name while writing o file

2015-03-19 Thread Andrew Solomon
No - that one's a mystery to me:) I suspect it's something to do with the terminal and character encoding http://stackoverflow.com/questions/5306153/how-to-get-terminals-character-encoding Andrew On Thu, Mar 19, 2015 at 7:41 AM, Satya Prasad Nemana wrote: > Great Andrew. > it is all good now.

Re: ? getting appended to file name while writing o file

2015-03-19 Thread Satya Prasad Nemana
Great Andrew. it is all good now. Could you please tell how new line ended up as ? in the file name Thanks, Satya On 19 March 2015 at 12:53, Andrew Solomon wrote: > my $logFileName="log_ping_".`date +"%d_%b_%y_%H_%M_%S"`; > > should be followed by > > chomp($logFileName) > > otherwise there's

Re: ? getting appended to file name while writing o file

2015-03-19 Thread Andrew Solomon
my $logFileName="log_ping_".`date +"%d_%b_%y_%H_%M_%S"`; should be followed by chomp($logFileName) otherwise there's a trailing newline character in $logFileName on account of the call to date Andrew On Thu, Mar 19, 2015 at 6:08 AM, Satya Prasad Nemana wrote: > Hi > > I have a small program

? getting appended to file name while writing o file

2015-03-18 Thread Satya Prasad Nemana
Hi I have a small program listed below where i am writing ping results to a file. The program works file except that the file name in the output file is coming as log_ping_19_Mar_15_11_27_49? (please note the ? at the end of the name) The initial output looks like bats3 snemana/perlprogs> perl pi

Re: Increasing a counter while matching against list of given words.

2014-05-13 Thread Mike Dunaway
That makes sense, thanks. On 05/13/2014 01:46 PM, Shlomi Fish wrote: Hi Mike, please reply to the list. On Tue, 13 May 2014 12:49:42 -0500 Mike Dunaway wrote: Actually, can you tell me what's going on here: my %words_lookup = (map { $_ => 1 } @words_to_look_for); I build a hash called %w

Re: Increasing a counter while matching against list of given words.

2014-05-13 Thread Shlomi Fish
Hi Mike, please reply to the list. On Tue, 13 May 2014 12:49:42 -0500 Mike Dunaway wrote: > Actually, can you tell me what's going on here: > > my %words_lookup = (map { $_ => 1 } @words_to_look_for); > I build a hash called %words_lookup whose keys are the entries of @words_to_look_for and

Re: Increasing a counter while matching against list of given words.

2014-05-13 Thread Mike Dunaway
Thanks, I'll look into this and give it a try. On 05/13/2014 03:08 AM, Shlomi Fish wrote: Hi Mike, On Tue, 13 May 2014 02:36:30 -0500 Mike Dunaway wrote: Hello everyone. Let's say I have a user provide @list of words and I want to match each words against a file or a another @list of words a

Re: Increasing a counter while matching against list of given words.

2014-05-13 Thread Shlomi Fish
Hi Mike, On Tue, 13 May 2014 02:36:30 -0500 Mike Dunaway wrote: > Hello everyone. Let's say I have a user provide @list of words and I > want to match each words against a file or a another @list of words and > increase a counter every time a word in the given list appears in what > I'm match

Increasing a counter while matching against list of given words.

2014-05-13 Thread Mike Dunaway
Hello everyone. Let's say I have a user provide @list of words and I want to match each words against a file or a another @list of words and increase a counter every time a word in the given list appears in what I'm matching against, what might a possible solution look like for that? The only t

Re: Question regarding while loops for reading files

2013-02-14 Thread Tiago Hori
through the file twice, once with a the search value set >> to AS5 and a second time to AS9. It works for AS5, but for some reason, the >> foreach loop sets $test to AS9 the second time, but it doesn't go through >> the while loop. What am I doing wrong? >> >>

Re: Question regarding while loops for reading files

2013-02-14 Thread Tiago Hori
use a >> foreach loop to go through the file twice, once with a the search value set >> to AS5 and a second time to AS9. It works for AS5, but for some reason, the >> foreach loop sets $test to AS9 the second time, but it doesn't go through >> the while loop. What am I

Re: Fwd: Question regarding while loops for reading files

2013-02-13 Thread John W. Krahn
, the other doesn't). So I tried to use a foreach loop to go through the file twice, once with a the search value set to AS5 and a second time to AS9. It works for AS5, but for some reason, the foreach loop sets $test to AS9 the second time, but it doesn't go through the while loop. What

Re: Question regarding while loops for reading files

2013-02-13 Thread Jim Gibson
$test to AS9 the second time, but it doesn't go through > the while loop. What am I doing wrong? > > here is the code: > > #! /usr/bin/perl > use strict; > use warnings; > > my $file = $ARGV[0]; > my @family = ('AS5','AS9'); > my $i; >

Fwd: Question regarding while loops for reading files

2013-02-13 Thread Tiago Hori
tried to use a foreach loop to go through the file twice, once with a the search value set to AS5 and a second time to AS9. It works for AS5, but for some reason, the foreach loop sets $test to AS9 the second time, but it doesn't go through the while loop. What am I doing wrong? here i

Re: how to display commands while perl script executing

2012-05-15 Thread Torqued
Regards.../om On 15-May-2012, at 18:23, Bob McConnell wrote: >> From: Sunita.Pradhan >> >>I want to print the command during script execution . >> Example : >> >> >> === >> $ls = `ls`; >> >> Print "$ls\n"; >> == >> >> In the above script I w

RE: how to display commands while perl script executing

2012-05-15 Thread Bob McConnell
> From: Sunita.Pradhan > > I want to print the command during script execution . > Example : > > > === > $ls = `ls`; > > Print "$ls\n"; > == > > In the above script I want to print "ls" command before 'ls' command gets > executed . Like "set -x"

Re: how to display commands while perl script executing

2012-05-15 Thread Michael Rasmussen
On Tue, May 15, 2012 at 07:40:44AM -0400, sunita.prad...@emc.com wrote: > Hi > > I want to print the command during script execution . > Example : > > === > $ls = `ls`; > > Print "$ls\n"; > == A straightforward way to do this is to run your script

Re: how to display commands while perl script executing

2012-05-15 Thread Shlomi Fish
Hi Sunita, On Tue, 15 May 2012 07:40:44 -0400 wrote: > Hi > > I want to print the command during script execution . > Example : > > > === > $ls = `ls`; > > Print "$ls\n"; > == > I should note that trapping the output of "ls" is pretty silly

RE: how to display commands while perl script executing

2012-05-15 Thread Sunita.Pradhan
It is working for one line program . How can we implement in a script ? -Sunita -Original Message- From: CloudWebDNS.com [mailto:supp...@cloudwebdns.com] Sent: Tuesday, May 15, 2012 5:27 PM To: beginners@perl.org Subject: Re: how to display commands while perl script executing Hello

Re: how to display commands while perl script executing

2012-05-15 Thread CloudWebDNS.com
Hello, Try this: $ perl -le '$c="ls -l";print $c;system $c' ls -l total 16 drwxr-xr-x 4 pyh pyh 4096 2012-05-12 17:08 backup drwxr-xr-x 2 pyh pyh 4096 2012-05-13 08:29 bin drwxr-xr-x 5 pyh pyh 4096 2012-05-03 11:03 ipdata drwxr-xr-x 4 pyh pyh 4096 2012-05-14 10:34 tmp Hi I

how to display commands while perl script executing

2012-05-15 Thread Sunita.Pradhan
Hi I want to print the command during script execution . Example : === $ls = `ls`; Print "$ls\n"; == In the above script I want to print "ls" command before 'ls' command gets executed . Like "set -x" does in shell scripts . Could you please

Re: while: both syntaxes cant solve my problem

2012-03-13 Thread Shawn H Corey
On 12-03-13 12:11 PM, oxy wrote: I have a problem with the following structure: while(){$thevariable=$1 if (/variable1=(.*)/)}; Now I wanna be sure that variable1 was really set in the above statement (it could have an old value from a previous embracing loop). Then I tried: while(){if

Re: while: both syntaxes cant solve my problem

2012-03-13 Thread Jim Gibson
On 3/13/12 Tue Mar 13, 2012 9:11 AM, "oxy" scribbled: > hi all, > > I have a problem with the following structure: > > while(){$thevariable=$1 if (/variable1=(.*)/)}; > > Now I wanna be sure that variable1 was really set in the above > statement (it could

while: both syntaxes cant solve my problem

2012-03-13 Thread oxy
hi all, I have a problem with the following structure: while(){$thevariable=$1 if (/variable1=(.*)/)}; Now I wanna be sure that variable1 was really set in the above statement (it could have an old value from a previous embracing loop). Then I tried: while(){if (/variable1

Re: while: one supresses the other?

2012-03-12 Thread timothy adigun
I run the code: > > = begin code == > > #!/usr/bin/perl -w > > $AG2 = non; > > $AG3 = non; > > open (file , " use open function three-arugment, then beware of barewords like file you used in the your code. > > > > while(){if (/(.*)\s*=

Re: while: one supresses the other?

2012-03-12 Thread Jim Gibson
On 3/12/12 Mon Mar 12, 2012 10:17 AM, "oxy" scribbled: > Hi, > > i have the following file content: numbers = one two three four > > I run the code: > = begin code == > #!/usr/bin/perl -w > $AG2 = non; > $AG3 = non; > o

while: one supresses the other?

2012-03-12 Thread oxy
Hi, i have the following file content: numbers = one two three four I run the code: = begin code == #!/usr/bin/perl -w $AG2 = non; $AG3 = non; open (file , "){if (/(.*)\s*=\s*.*three.*/) {$AG3 = $1} else {$AG3 ='not found 3'};}; while(){if (/(.*

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-27 Thread Rob Dixon
On 27/09/2011 17:35, Randal L. Schwartz wrote: "Rob" == Rob Dixon writes: Rob> Randal, as I opened, I had started to enjoy and respect your posts here Rob> and elsewhere. You were never required to reply to my 'ignorant post', Rob> yet you chose to show your foolish emptiness once again. B

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-27 Thread Randal L. Schwartz
> "Rob" == Rob Dixon writes: Rob> Randal, as I opened, I had started to enjoy and respect your posts here Rob> and elsewhere. You were never required to reply to my 'ignorant post', Rob> yet you chose to show your foolish emptiness once again. But I am highly motivated to reduce and contain

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-23 Thread Rob Dixon
semantics that you have to get right, > not just the syntax. I am sure you know the answer to that. It matters because the presentation of the mechanism is deceptive. It looks very like while () { : } continue : } but instead is something very different. As I have described, it am

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-21 Thread Randal L. Schwartz
> "Rob" == Rob Dixon writes: Rob> I don't have Try::Tiny installed, but will take a look. I have an addressbar query shortcut of: http://search.cpan.org/perldoc/#query# aliased to "perldoc", so I can type "perldoc Try::Tiny" and get the latest manpage on it directly from the CPAN without

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-21 Thread Rob Dixon
On 20/09/2011 15:57, Randal L. Schwartz wrote: "Rob" == Rob Dixon writes: Rob> For me, the bottom line is that try / catch is a funky showpiece that Rob> pushes Perl syntax beyond its limits. No one who sees your code will Rob> thank you for using it, and you should remove it in preference

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-20 Thread Randal L. Schwartz
> "Rob" == Rob Dixon writes: Rob> For me, the bottom line is that try / catch is a funky showpiece that Rob> pushes Perl syntax beyond its limits. No one who sees your code will Rob> thank you for using it, and you should remove it in preference of a Rob> simple check on $@. Completely disag

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-19 Thread Rob Dixon
longer getting this error (Can't use string ("1") as a HASH ref while "strict refs") try { something } catch some_exception { do something }; My questions is I have quite a few scripts that are using the SAME try-catch block without a semi-colon but those are working s

Re: Can't use string ("1") as a HASH ref while "strict refs"

2011-09-19 Thread Jim Gibson
ing > } catch some_exception { > do something > } > > After I placed the semi-colon, I am no longer getting this error (Can't use > string ("1") as a HASH ref while "strict refs") > > try { >something > } catch some_exception { > do s

Can't use string ("1") as a HASH ref while "strict refs"

2011-09-19 Thread Parag Kalra
tring ("1") as a HASH ref while "strict refs") try { something } catch some_exception { do something }; My questions is I have quite a few scripts that are using the SAME try-catch block without a semi-colon but those are working seamlessly. They why was I getting the erro

Re: Sandboxing while I am learning

2011-09-01 Thread flebber
On Sep 1, 4:54 am, byu...@langly.dyndns.org ("Brian F. Yulga") wrote: > Marc wrote: > > Shawn, > > >> if you use perlbrew and local::lib you > >> can test different perl versions and then different environments. > > >    I haven't looked into local::lib yet.  What advantage does that give you > >

Re: Sandboxing while I am learning

2011-08-31 Thread Brian F. Yulga
Marc wrote: Shawn, if you use perlbrew and local::lib you can test different perl versions and then different environments. I haven't looked into local::lib yet. What advantage does that give you over a plain perlbrew install? Marc I haven't used local::lib very much

Re: Sandboxing while I am learning

2011-08-30 Thread Marc
Shawn, > if you use perlbrew and local::lib you > can test different perl versions and then different environments. I haven't looked into local::lib yet. What advantage does that give you over a plain perlbrew install? Marc -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For

Re: Sandboxing while I am learning

2011-08-30 Thread shawn wilson
On Tue, Aug 30, 2011 at 05:02, flebber wrote: > On Aug 29, 10:18 pm, flebber.c...@gmail.com (flebber) wrote: >> I have a new debian install and am continuing to learn perl. >> >> Whilst I know I should use perlbrew to keep my perl version separate >> from my system version is there anyway to sandb

Re: Sandboxing while I am learning

2011-08-30 Thread Marc
Rob, > The multiple cpan installations is not bad it is dangerous in my opinion. I > have seen people go white as a sheet of paper once they realized that they > where not on the test but on the production machine and they just executed an > rm -rf on the application server directory... > The r

Re: Sandboxing while I am learning

2011-08-30 Thread Rob Coops
On Tue, Aug 30, 2011 at 4:44 PM, Marc wrote: > Sayth, > > > So basically If I want to experiment and toy with different cpan apps > > and so forth I can without messing up my perl install. > > All you have to do is install cpanm for each version of Perl and > then you don't have to worry

Re: Sandboxing while I am learning

2011-08-30 Thread flebber
On Aug 29, 10:18 pm, flebber.c...@gmail.com (flebber) wrote: > I have a new debian install and am continuing to learn perl. > > Whilst I know I should use perlbrew to keep my perl version separate > from my system version is there anyway to sandbox the perlbrew > environments. > > So basically If I

Re: Sandboxing while I am learning

2011-08-30 Thread Marc
Sayth, > So basically If I want to experiment and toy with different cpan apps > and so forth I can without messing up my perl install. All you have to do is install cpanm for each version of Perl and then you don't have to worry about them stepping on each other. With cpan configured

Sandboxing while I am learning

2011-08-29 Thread flebber
I have a new debian install and am continuing to learn perl. Whilst I know I should use perlbrew to keep my perl version separate from my system version is there anyway to sandbox the perlbrew environments. So basically If I want to experiment and toy with different cpan apps and so forth I can w

Re: while(@data) works but why

2011-08-12 Thread Tony Esposito
rl.org Sent: Fri, 12 August, 2011 14:13:26 Subject: Re: while(@data) works but why On 8/12/11 Fri Aug 12, 2011 12:02 PM, "Tony Esposito" scribbled: > . > . > . > while(@dat = $sth->fetchrow) { > print "@dat\n"; > . > . > . > > This cod

Re: while(@data) works but why

2011-08-12 Thread Tony Esposito
got it ... thank you. cheers! From: Brandon McCaig To: Tony Esposito Cc: beginners@perl.org Sent: Fri, 12 August, 2011 14:08:52 Subject: Re: while(@data) works but why On Fri, Aug 12, 2011 at 3:02 PM, Tony Esposito wrote: > . > . > . > while

Re: while(@data) works but why

2011-08-12 Thread Jim Gibson
On 8/12/11 Fri Aug 12, 2011 12:02 PM, "Tony Esposito" scribbled: > . > . > . > while(@dat = $sth->fetchrow) { > print "@dat\n"; > . > . > . > > This code works yet there is no 'my @dat' defined anywhere in the code. >

Re: while(@data) works but why

2011-08-12 Thread Brandon McCaig
On Fri, Aug 12, 2011 at 3:02 PM, Tony Esposito wrote: > . > . > . > while(@dat = $sth->fetchrow) { >        print "@dat\n"; > . > . > . > > This code works yet there is no 'my @dat' defined anywhere in the code. > Using Perl 5.8.x - 5.1

while(@data) works but why

2011-08-12 Thread Tony Esposito
. . . while(@dat = $sth->fetchrow) { print "@dat\n"; . . . This code works yet there is no 'my @dat' defined anywhere in the code. Using Perl 5.8.x - 5.14.x Q: Why does the variable @dat not need a 'my' in front? Cheers!

Re: Unintended behavior: Range operator inside a while loop continues to pattern match on the subsequent file

2011-04-21 Thread Marc Perry
*.html > > > > my $accumulator; > > my $capture_counter; > > > > while ( <> ) { > > if ( //.../labelsub/ ) { > > $accumulator .= $_ unless /labelsub/; > > if ( /labelsub/ && !$capture_counter ) { > >

Re: Unintended behavior: Range operator inside a while loop continues to pattern match on the subsequent file

2011-04-21 Thread Marc Perry
2:42 PM, Marc Perry wrote: > >> Hi, >> >> I was parsing a collection of HTML files where I wanted to extract a >> certain >> block from each file, like this: >> >> > ./script.pl *.html >> >> my $accumulator; >> my $capture_counter; &

Re: Unintended behavior: Range operator inside a while loop continues to pattern match on the subsequent file

2011-04-21 Thread Paul Johnson
.pl *.html > > my $accumulator; > my $capture_counter; > > while ( <> ) { > if ( //.../labelsub/ ) { > $accumulator .= $_ unless /labelsub/; > if ( /labelsub/ && !$capture_counter ) { > print $accumulator; >

Re: Unintended behavior: Range operator inside a while loop continues to pattern match on the subsequent file

2011-04-21 Thread Brian Fraser
gt; > my $accumulator; > my $capture_counter; > > while ( <> ) { >if ( //.../labelsub/ ) { >$accumulator .= $_ unless /labelsub/; >if ( /labelsub/ && !$capture_counter ) { >print $accumulator; >$capture_counter = 1; >

Unintended behavior: Range operator inside a while loop continues to pattern match on the subsequent file

2011-04-21 Thread Marc Perry
Hi, I was parsing a collection of HTML files where I wanted to extract a certain block from each file, like this: > ./script.pl *.html my $accumulator; my $capture_counter; while ( <> ) { if ( //.../labelsub/ ) { $accumulator .= $_ unless /labelsub/; if (

RE: Alternative to while ()

2010-09-30 Thread Ken Slater
-Original Message- >From: Owen Chavez [mailto:owen.chavez314...@gmail.com] >Sent: Thursday, September 30, 2010 2:41 AM >To: beginners@perl.org >Subject: Alternative to while () > >Hey y'all, > >I suspect that I'm struggling with something that has a *re

Re: Alternative to while ()

2010-09-29 Thread Uri Guttman
>>>>> "OC" == Owen Chavez writes: OC> while () { OC> if ($input = 'this') { OC> # Do some things. OC> last; OC> } OC> elsif ($input = 'that') { OC> # Do some other

Alternative to while ()

2010-09-29 Thread Owen Chavez
user enters some desired input. My question is what control structure I should be using for greatest efficiency and clarity? What I'm using now is something like this: while () { if ($input = 'this') { # Do some things. last; } elsif ($input

Re: Insecure $ENV{PATH} while running with -T switch at /usr/local/share/perl5/MIME/Lite.pm

2010-08-19 Thread Jim Gibson
whether my code is > causing this exception or the underlying MIME::Lite::TT::HTML or > MIME::Lite. > > Insecure $ENV{PATH} while running with -T switch at > /usr/local/share/perl5/MIME/Lite.pm line 2689., referer: > http://192.168.0.88/cgi-bin/dashboard.cgi > (Program sn

RE: Strange behaviour while using DBI with binding

2010-08-19 Thread Babale Fongo
tman; beginners@perl.org => Subject: Re: Strange behaviour while using DBI with binding => => On Wed, Aug 18, 2010 at 19:55, Babale Fongo => wrote: => snip => > In the first example, DBI always passed the value for offset and => ignored the => > second value after the c

Insecure $ENV{PATH} while running with -T switch at /usr/local/share/perl5/MIME/Lite.pm

2010-08-19 Thread Mimi Cafe
::Lite. Insecure $ENV{PATH} while running with -T switch at /usr/local/share/perl5/MIME/Lite.pm line 2689., referer: http://192.168.0.88/cgi-bin/dashboard.cgi In my mobile I have this sub for sending mail and it has always worked until I switched on the -T. sub sendmail { my (%params

Re: Strange behaviour while using DBI with binding

2010-08-19 Thread Dr.Ruud
Babale Fongo wrote: 2) This works fine (with or without space in the string). my $sth = $dbh->prepare(qq{ Select fname, lname, dob, substr(desc, 1, 200) from user left join personal_data on user.id = personal_data.id where gender = ? and position = ? order by lname limit $l

Re: Strange behaviour while using DBI with binding

2010-08-19 Thread Chas. Owens
t;NAME_lc", } ) or die DBI->errstr; $dbh->do("CREATE TABLE foo (n INTEGER)"); my $insert = $dbh->prepare("INSERT INTO foo (n) VALUES (?)"); for my $n (1 .. 100) { $insert->execute($n); } my $select = $dbh->prepare("SELECT n FROM foo ORDE

Re: Strange behaviour while using DBI with binding

2010-08-19 Thread Robert Wohlfarth
On Wed, Aug 18, 2010 at 6:55 PM, Babale Fongo wrote: > Below are 2 pieces of code. Both have been tested with space in the string > and again without space. > > $limit = "$offset,$number_rows" or $limit = "$offset, $number_rows"; > > [snip...] > > 2) This works fine (with or without space in the

RE: Strange behaviour while using DBI with binding

2010-08-18 Thread Babale Fongo
>From your last comments, I am not sure where this is leading to, but here is all I have to say. Below are 2 pieces of code. Both have been tested with space in the string and again without space. $limit = "$offset,$number_rows" or $limit = "$offset, $number_rows"; 1) This does not work (with

Re: Strange behaviour while using DBI with binding

2010-08-18 Thread Uri Guttman
> "MC" == Mimi Cafe writes: MC> You asked why I am concatenating the 2 scalars, comma and the space below? MC> my $limit = "$offset" . ', ' . "$number_rows"; MC> I agree your suggestion below should work as well, but I was desperate to find the error, so I tried several option to se

RE: Strange behaviour while using DBI with binding

2010-08-18 Thread Mimi Cafe
rom: Uri Guttman [mailto:u...@stemsystems.com] => Sent: 18 August 2010 04:15 => To: Mimi Cafe => Cc: beginners@perl.org => Subject: Re: Strange behaviour while using DBI with binding => => >>>>> "MC" == Mimi Cafe writes: => => MC> I experienced a

Re: Strange behaviour while using DBI with binding

2010-08-17 Thread Uri Guttman
>>>>> "MC" == Mimi Cafe writes: MC> I experienced a strange behaviour while using DBI binding for MySQL query MC> with LIMIT clause. My CGI program behaved so strange and the result was MC> always unpredictable and it took me several hours before I f

Strange behaviour while using DBI with binding

2010-08-17 Thread Mimi Cafe
I experienced a strange behaviour while using DBI binding for MySQL query with LIMIT clause. My CGI program behaved so strange and the result was always unpredictable and it took me several hours before I finally detected the problem. In my program I use binding as in the example below

Re: problem while installing bugzilla

2010-08-11 Thread Shlomi Fish
On Wednesday 11 August 2010 16:39:52 perl pra wrote: > Hi All, > > I am having a problem while isntalling Bugzilla , Checksetup.pl throws > errors and exits.Below is the detail. > > when I run checksetup.pl in bugzilla folder I get the following error, > Though I have

perl DBI problem while installing bugzilla

2010-08-11 Thread perl pra
> Hi All, > > I am having a problem while isntalling Bugzilla , Checksetup.pl throws > errors and exits.Below is the detail. > > when I run checksetup.pl in bugzilla folder I get the following error, > Though I have installed latest DBD-mysql which is availab

problem while installing bugzilla

2010-08-11 Thread perl pra
Hi All, I am having a problem while isntalling Bugzilla , Checksetup.pl throws errors and exits.Below is the detail. when I run checksetup.pl in bugzilla folder I get the following error, Though I have installed latest DBD-mysql which is available in CPAN. ERROR

Re: Can't use string 1 as HASH ref while strict refs in use

2010-07-20 Thread Uri Guttman
> "D" == Dermot writes: D> I hope Uri will forgive me but I will expand a little. partially forgive! :) D> $received_arg = @_; D> You want to shift the argument list but you are actually assigned the D> argument array to a scalar value and that will render it's size (1). D> You

RE: Can't use string 1 as HASH ref while strict refs in use

2010-07-20 Thread Mimi Cafe
July 2010 04:44 => To: Mimi Cafe => Cc: 'Perl Beginners' => Subject: Re: Can't use string 1 as HASH ref while strict refs in use => => >>>>> "MC" == Mimi Cafe writes: => => MC> $received_arg = @_; => => read perldoc perl

Re: Can't use string 1 as HASH ref while strict refs in use

2010-07-20 Thread Dermot
On 20 July 2010 04:40, Mimi Cafe wrote: > I passed a has reference to my sub and tried dereferencing it within the sub > and get an exception Can't use string ("1") as HASH ref while strict refs in > use. > > > my %mail_parameters = ( >        'Fname

Re: Can't use string 1 as HASH ref while strict refs in use

2010-07-19 Thread Uri Guttman
> "MC" == Mimi Cafe writes: MC> $received_arg = @_; read perldoc perldata and see what happens when you assign an array to a scalar. you don't get what you think you are getting. context is VERY important to learn in perl and this is a critical context situation that is very common. i

Can't use string 1 as HASH ref while strict refs in use

2010-07-19 Thread Mimi Cafe
I passed a has reference to my sub and tried dereferencing it within the sub and get an exception Can't use string ("1") as HASH ref while strict refs in use. my %mail_parameters = ( 'Fname' => "$nickname_db_exist[1]", 'Lname&#

RE: A problem while using XML::Parser::PerlSAX

2010-07-01 Thread Jason Feng
2010 18:09:01 -0500 Subject: Re: A problem while using XML::Parser::PerlSAX From: greg.jar...@gmail.com To: q15...@hotmail.com Jason, I have not worked with PerlSAX, however I played around with SAX in Java and have an idea you can try out. I'm not sure if you can do this in PerlSAX, but in J

RE: A problem while using XML::Parser::PerlSAX

2010-07-01 Thread Jason Feng
1 Jul 2010 08:09:20 +0200 > Subject: Re: A problem while using XML::Parser::PerlSAX > > From: Jason Feng > > I am using XML::Parser::PerlSAX > > to parse a 300M XML file. I meet a strange issue with handler characters. > > This handler is supposed to return > >

Re: A problem while using XML::Parser::PerlSAX

2010-06-30 Thread Jenda Krynicky
From: Jason Feng > I am using XML::Parser::PerlSAX > to parse a 300M XML file. I meet a strange issue with handler characters. > This handler is supposed to return > all the contents between start markup and end markup. But sometimes it just > returns one part of the whole contents. On the second

A problem while using XML::Parser::PerlSAX

2010-06-30 Thread Jason Feng
Hi there, I am using XML::Parser::PerlSAX to parse a 300M XML file. I meet a strange issue with handler characters. This handler is supposed to return all the contents between start markup and end markup. But sometimes it just returns one part of the whole contents. On the second call, perh

Re: while and eval

2010-04-21 Thread Shawn H Corey
Uri Guttman wrote: "JWK" == John W Krahn writes: >> Also, how does 'eval' work and when is it useful? What is the difference if >> we put a block inside eval like: eval ( }; JWK> eval interprets a string as Perl code and compiles and runs it. If JWK> you are using a block eval then

Re: while and eval

2010-04-21 Thread Uri Guttman
> "JWK" == John W Krahn writes: >> Also, how does 'eval' work and when is it useful? What is the difference if >> we put a block inside eval like: eval ( }; JWK> eval interprets a string as Perl code and compiles and runs it. If JWK> you are using a block eval then the block must b

Re: while and eval

2010-04-21 Thread John W. Krahn
Arun P Menon wrote: Hello All, Hello, Could you tell me what does the following do? 1 while (<>); That reads through all the files listed on the command line, or if there are no files listed on the command line then it reads through STDIN, and does nothing with the lines read, bu

while and eval

2010-04-21 Thread Arun P Menon
Hello All, Could you tell me what does the following do? 1 while (<>); Also, how does 'eval' work and when is it useful? What is the difference if we put a block inside eval like: eval ( }; -- Regards, Arun.P.Menon

Re: error while installing win32::Registry module

2010-03-31 Thread Alan Haggai Alavi
Hi, > Can't locate Win32/Registry.pm in @INC (@INC contains: > C:/strawberry/perl/lib C: > /strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .) at GETIP.pl line > 1. > BEGIN failed--compilation aborted at GETIP.pl line 1. It means that perl is unable to find the module Win32::Registry. So,

Re: error while installing win32::Registry module

2010-03-30 Thread Sisyphus
- Original Message - From: "Jyoti" To: Sent: Tuesday, March 30, 2010 5:50 PM Subject: error while installing win32::Registry module Dear All, I was trying to run my script getip.pl . But when i run this script it gives following error C:\strawberry\perl\Test>perl G

Re: error while installing win32::Registry module

2010-03-30 Thread Shlomi Fish
Hi Jyoti! Next time, please hit reply-to-all. You've sent a reply only to me. I'm CCing the list. On Tuesday 30 Mar 2010 11:42:30 Jyoti wrote: > hello shlomi, > yes...but i'm not able to run script in which I use win32::Registry. > Well, as opposed to some languages (BASIC/VB-Classic, Fortran,

Re: error while installing win32::Registry module

2010-03-30 Thread Shlomi Fish
Hi Jyoti, On Tuesday 30 Mar 2010 09:50:39 Jyoti wrote: > Dear All, > I was trying to run my script getip.pl . But when i run this script it > gives following error > > C:\strawberry\perl\Test>perl GETIP.pl > Can't locate Win32/Registry.pm in @INC (@INC contains: > C:/strawberry/perl/lib C: > /st

error while installing win32::Registry module

2010-03-29 Thread Jyoti
Dear All, I was trying to run my script getip.pl . But when i run this script it gives following error C:\strawberry\perl\Test>perl GETIP.pl Can't locate Win32/Registry.pm in @INC (@INC contains: C:/strawberry/perl/lib C: /strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .) at GETIP.pl line

Re: why on while?

2010-03-11 Thread Uri Guttman
;> only way a <> without defined would lose some data as it is false. >> JP> No. Even having just 0 in a line won't make the line lost without defined. JP> $ perl -e 'print "1\n2\n3\n0"' > a.txt JP> $ perl -e 'open FD,"a.

Re: why on while?

2010-03-11 Thread Jeff Peng
No. Even having just 0 in a line won't make the line lost without defined. $ perl -e 'print "1\n2\n3\n0"' > a.txt $ perl -e 'open FD,"a.txt"; while(my $line=) { print $line }' 1 2 3 0 -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperso

Re: why on while?

2010-03-11 Thread Uri Guttman
>>>>> "SHC" == Shawn H Corey writes: SHC> Dr.Ruud wrote: >> Jeff Peng wrote: >> >>> so how about while (my $line = ) instead of using $_? >> >> Evil! An empty line, or a line with only a "0" in it. >>

Re: why on while?

2010-03-11 Thread Uri Guttman
>>>>> "R" == Ruud writes: R> Jeff Peng wrote: >> so how about while (my $line = ) instead of using $_? R> Evil! An empty line, or a line with only a "0" in it. empty lines (a single newline) is always true. the defined case only handles th

Re: why on while?

2010-03-11 Thread Peter Scott
On Wed, 10 Mar 2010 10:49:16 +0100, Dr.Ruud wrote: > Jeff Peng wrote: > >> so how about while (my $line = ) instead of using $_? > > Evil! An empty line, or a line with only a "0" in it. Not so: $ perl -MO=Deparse -e 'while(my $l=) {}&#x

Re: why on while?

2010-03-11 Thread Shawn H Corey
John W. Krahn wrote: > That is not "evil"... I was being facetious. No technology is evil, just the uses you put it to. :) -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. I like Perl; it's the only langu

  1   2   3   4   5   6   7   8   >