Re: What is the meaning of $normalize->{$1}

2023-06-16 Thread Freek de Kruijf
uot;. Now I understand that it is a test to assure certain lines in the input file should not be present more than once. > Assuming there isn't, most likely "$normalise->{$1}" is building out a > hash-table with "$1" as the key and a value of 1 at each entry.

Re: What is the meaning of $normalize->{$1}

2023-06-15 Thread Kang-min Liu
Freek de Kruijf writes: > Hi, > > I am trying to understand fully a perl program with the following lines: > >} elsif( /^(\#?\s*(?:pickup|qmgr)\s+)(?:fifo|unix)(\s+.*)/ ) { > if( defined $normalize->{$1} ) { next; } else { $normalize->{$1} = 1; } > I do und

Re: What is the meaning of $normalize->{$1}

2023-06-15 Thread Andy Bach
} elsif( /^(\#?\s*(?:pickup|qmgr)\s+)(?:fifo|unix)(\s+.*)/ ) { if( defined $normalize->{$1} ) { next; } else { $normalize->{$1} = 1; } if the string starting at the beginning of the line matches, $1 will contain "zero or one #, zero or more whitespaces, either the word "

What is the meaning of $normalize->{$1}

2023-06-15 Thread Freek de Kruijf
Hi, I am trying to understand fully a perl program with the following lines: } elsif( /^(\#?\s*(?:pickup|qmgr)\s+)(?:fifo|unix)(\s+.*)/ ) { if( defined $normalize->{$1} ) { next; } else { $normalize->{$1} = 1; } I do understand the first line, but I can not find what the second l

Re: What Happened to Net::DNS and a few others on December 1?

2014-12-02 Thread Martin G. McCormick
Shlomi Fish writes: > There could be several reasons: > > 1. The @INC of the installed module was perl-version-specific. E.g in my > perl > -V: > As you can see, some of them are versioned and if the previous versions > are not > added to the inc of the new perl, the

Re: What Happened to Net::DNS and a few others on December 1?

2014-12-02 Thread Shlomi Fish
Hi Martin, On Tue, 02 Dec 2014 11:45:58 -0600 "Martin G. McCormick" wrote: > We run some FreeBSD systems using FreeBSD9.1 and 9.3 and > the response to perl -version is: > > This is perl 5, version 18, subversion 4 (v5.18.4) built for > amd64-freebsd-thread-multi

What Happened to Net::DNS and a few others on December 1?

2014-12-02 Thread Martin G. McCormick
We run some FreeBSD systems using FreeBSD9.1 and 9.3 and the response to perl -version is: This is perl 5, version 18, subversion 4 (v5.18.4) built for amd64-freebsd-thread-multi On December 1 of 2014, we were alerted to the fact that some perl scripts were no longer working

Re: perlre(1) and substitution evaluations

2013-11-30 Thread Charles DeRykus
On 11/30/2013 5:16 AM, Lars Noodén wrote: On 11/30/2013 02:55 PM, Charles DeRykus wrote: [ .. Thanks. I see those in perlop and perlfunc. In perlfunc, it is grouped as "Regular expressions and pattern matching" though that man page just points to perlop. A really clear description in perlre

Re: perlre(1) and substitution evaluations

2013-11-30 Thread Lars Noodén
On 11/30/2013 02:55 PM, Charles DeRykus wrote: > See the substitution operator in perlop: > > |||| A |/e| will cause the > replacement portion to be treated as a full-fledged Perl expression and > evaluated right then and there. It is, however, syntax che

Re: perlre(1) and substitution evaluations

2013-11-30 Thread Charles DeRykus
On 11/30/2013 4:07 AM, Lars Noodén wrote: perlre(1) seems to be missing information about substitution evaluations with the /e option. The functionality is present in perl: perl -e '$_=2; s/2/1+3/e; print' But it is not listed in the pod documentation for v5.16.3 or v5

Re: perlre(1) and substitution evaluations

2013-11-30 Thread Rob Dixon
"Lars Noodén" wrote: >perlre(1) seems to be missing information about substitution >evaluations >with the /e option. The functionality is present in perl: > > perl -e '$_=2; s/2/1+3/e; print' > >But it is not listed in the pod documentation fo

perlre(1) and substitution evaluations

2013-11-30 Thread Lars Noodén
perlre(1) seems to be missing information about substitution evaluations with the /e option. The functionality is present in perl: perl -e '$_=2; s/2/1+3/e; print' But it is not listed in the pod documentation for v5.16.3 or v5.18.1. The modifier /e is described in "P

Re: Intermediate Perl - Chapter 7 Exercise 1 Question

2012-12-10 Thread Uri Guttman
On 12/10/2012 04:39 PM, Rich Johnson wrote: I am working my way through Intermediate Perl and have a question concerning one of the exercises (It's a long-ish exercise, so I won't bother typing it out as it's irrelevant to the question at hand). The author's solution contains the following code:

Intermediate Perl - Chapter 7 Exercise 1 Question

2012-12-10 Thread Rich Johnson
I am working my way through Intermediate Perl and have a question concerning one of the exercises (It's a long-ish exercise, so I won't bother typing it out as it's irrelevant to the question at hand). The author's solution contains the following code: ... code ... my ($gather, $yield) = gather_mt

My Long Script (1)

2012-09-15 Thread jmrhide-perl
ookie('lastnum'); $goodans = $cgi->cookie('goodans'); # IF NEW CATEGORY THEN (RE)START TUTORIAL, ELSE GET USER ANSWER if ( $cgi->param('Category') ) { $restart = 1; $topic = $cgi->param('Category'); $smarts= 0; $playlev

Re: strict subs" in use at -e line 1.

2012-03-06 Thread lina
On Tue, Mar 6, 2012 at 11:42 PM, Paul Johnson wrote: > On Tue, Mar 06, 2012 at 11:31:59PM +0800, lina wrote: >> $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}' >> >> Bareword "Ox394" not allowed while "strict subs" in use at -e li

Re: strict subs" in use at -e line 1.

2012-03-06 Thread Chris Stinemetz
On Tue, Mar 6, 2012 at 9:31 AM, lina wrote: > $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}' > > Bareword "Ox394" not allowed while "strict subs" in use at -e line 1. > Execution of -e aborted due to compilation errors. > >

Re: strict subs" in use at -e line 1.

2012-03-06 Thread Shawn H Corey
On 12-03-06 10:31 AM, lina wrote: $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}' Bareword "Ox394" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. I don't understand the above error

Re: strict subs" in use at -e line 1.

2012-03-06 Thread Paul Johnson
On Tue, Mar 06, 2012 at 11:31:59PM +0800, lina wrote: > $ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}' > > Bareword "Ox394" not allowed while "strict subs" in use at -e line 1. > Execution of -e aborted due to compilation errors. > >

strict subs" in use at -e line 1.

2012-03-06 Thread lina
$ perl -Mstrict -wle '{my $char = chr(Ox394) ; print $char;}' Bareword "Ox394" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. I don't understand the above error message well, Thanks ahead for any ex

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
I am highly motivated to reduce and contain the damage caused by misinformation. You were spreading misinformation to others. If my reply to you had no impact on you, that is sad, but at least the others reading this thread will be more enlightened. -- Randal L. Schwartz - Stonehenge Consu

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

2011-09-23 Thread Rob Dixon
On 21/09/2011 20:57, Randal L. Schwartz wrote: >> "Rob" == Rob Dixon writes: > > Rob> I don't have Try::Tiny installed, but will take a look. I am back at my desk, and have this horror from you to respond to. I had started to enjoy some of your posts, and hoped that your legendary brutal ne

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

2011-09-21 Thread Randal L. Schwartz
his. Again, read the referenced doc. It would have taken you about 5 minutes, and you wouldn't have had to write this entire ignorant reply or waste my time replying to it. :( -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stoneheng

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
27;s wrong with this: eval { ... }; if ($@) { ... } then you *need* to start using Try::Tiny. See especially the section beginning "BACKGROUND" on the Try::Tiny manpage. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.com/merlyn/&g

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: File::path the option keep_root => 1 does not seem to work

2011-04-21 Thread Rob Dixon
On 19/04/2011 10:42, Agnello George wrote: File::path the option keep_root => 1 does not seem to work for me use File::Path; rmtree( '/temp/auto', { verbose =>1 , keep_root => 1}); it throw me the output unlink /temp/auto/test6 unlink /temp/auto/test5 unlink /te

File::path the option keep_root => 1 does not seem to work

2011-04-19 Thread Agnello George
hi File::path the option keep_root => 1 does not seem to work for me use File::Path; rmtree( '/temp/auto', { verbose =>1 , keep_root => 1}); it throw me the output unlink /temp/auto/test6 unlink /temp/auto/test5 unlink /temp/auto/test4 rmdir /temp/auto the op

Re: Behavior of minimal when applied to - {1,}? ot to - {0,}?

2011-02-02 Thread Chris Charley
is the '.+?' behavior. I had guessed that it would attempt to match the empty brackets and fail, (because it requires 1 or more characters). Instead, it captures the right bracket and the left opening bracket and contents (date) of the second bracket pair. Does the regex first consu

Re: Behavior of minimal when applied to - {1,}? ot to - {0,}?

2011-02-01 Thread Rob Dixon
e, ' ', "'$dt'", "\n"; } __END__ C:\Old_Data\perlp>perl t5.pl ^\[(.+?)\] '][12/21/10 18:39:22' ^\[(.*?)\] '' C:\Old_Data\perlp> My question in the code above is the '.+?' behavior. I had guessed that it would attempt to mat

Re: Behavior of minimal when applied to - {1,}? ot to - {0,}?

2011-02-01 Thread Uri Guttman
)\] '' CC> C:\Old_Data\perlp> CC> My question in the code above is the '.+?' behavior. I had guessed CC> that it would attempt to match the empty brackets and fail, CC> (because it requires 1 or more characters). Instead, it captures CC> the right bra

Behavior of minimal when applied to - {1,}? ot to - {0,}?

2011-02-01 Thread Chris Charley
27;", "\n"; } __END__ C:\Old_Data\perlp>perl t5.pl ^\[(.+?)\] '][12/21/10 18:39:22' ^\[(.*?)\] '' C:\Old_Data\perlp> My question in the code above is the '.+?' behavior. I had guessed that it would attempt to match the empty brackets and fail,

Re: Help with script How to prepend 2 lines instead of 1

2011-01-21 Thread Rob Dixon
On 20/01/2011 19:10, steve1040 wrote: Using the script below I need to add a second line with the following text: "STAGEHDR|Barcoded" #!perl use strict; use warnings; my $file = 'path/to/Access.csv'; my $newline = "ENTHDR|1|3.0"; { local @ARGV = ($file);

Re: Help with script How to prepend 2 lines instead of 1

2011-01-21 Thread Shlomi Fish
Hi Steve, On Thursday 20 Jan 2011 21:10:39 steve1040 wrote: > Using the script below I need to add a second line with the following > text: > "STAGEHDR|Barcoded" > > #!perl > use strict; > use warnings; > my $file = 'path/to/Access.csv'; > my

Help with script How to prepend 2 lines instead of 1

2011-01-21 Thread steve1040
Using the script below I need to add a second line with the following text: "STAGEHDR|Barcoded" #!perl use strict; use warnings; my $file = 'path/to/Access.csv'; my $newline = "ENTHDR|1|3.0"; { local @ARGV = ($file); local $^I = '.bac'; while(

AW:FW: 1--.

2010-12-01 Thread Poonam Pahil
Dear, I have tried to purchase some products from a business company, I have attracted by high quality products, low price and enthusiastic services, I think if you are free, you can go to see: styleele.com ,picking your interesting. ~--. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

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 an

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: \1 in character class?

2010-07-15 Thread C.DeRykus
On Jul 14, 2:59 pm, chas.ow...@gmail.com ("Chas. Owens") wrote: > On Wed, Jul 14, 2010 at 00:50, C.DeRykus wrote: > > snip>> s/(\w+)\s/$1 /g; > snip > > Neat.  Using the \K construct available in 5.10, you can even > > eliminate the need for the capture

Re: \1 in character class?

2010-07-14 Thread Uri Guttman
> "BRH" == Bryan R Harris writes: BRH> I think most of the response pointed to "non-greedy" matches, is BRH> that right? Are those deprecated or discouraged? nope, they are very useful and stable (not experimental in the least). non-greedy vs greedy is one of those things that newbies a

Re: \1 in character class?

2010-07-14 Thread Bryan R Harris
wrote: > snip >>> s/(\w+)\s/$1 /g; > snip >> Neat.  Using the \K construct available in 5.10, you can even >> eliminate the need for the capture: >> >>   s/  \w+  \K \s / /gx; > snip > > Yeah, but both of these are fragile, the following string won&

Re: \1 in character class?

2010-07-14 Thread Chas. Owens
On Wed, Jul 14, 2010 at 00:50, C.DeRykus wrote: snip >> s/(\w+)\s/$1 /g; snip > Neat.  Using the \K construct available in 5.10, you can even > eliminate the need for the capture: > >   s/  \w+  \K \s / /gx; snip Yeah, but both of these are fragile, the following string won&#x

Re: \1 in character class?

2010-07-14 Thread C.DeRykus
On Jul 13, 8:09 am, jonesharring...@gmail.com (Jennifer Jones Harrington) wrote: > How about... > > #!/usr/bin/perl > use warnings; > $_ = "data: \"this is a string\" more: \"this is another\""; > s/(\w+)\s/$1 /g; > print "$_\n"; >

Re: \1 in character class?

2010-07-14 Thread Chris Charley
- Original Message - From: "Bryan R Harris" Subject: \1 in character class? I'm trying to temporarily deal with simple quoted strings by turning: data: "this is a string" more: "this is another" into... data: "this is a string" mo

Re: \1 in character class?

2010-07-13 Thread Chas. Owens
On Jul 13, 2010, at 11:32, Erez Schatz wrote: > On 13 July 2010 18:16, Shawn H Corey wrote: > >> Because [] define a character set; everything inside it is a character. >> That means it does not expand \1. > > That's not entirely correct. Character classes r

Re: \1 in character class?

2010-07-13 Thread Erez Schatz
On 13 July 2010 18:16, Shawn H Corey wrote: > Because [] define a character set;  everything inside it is a character. >  That means it does not expand \1. That's not entirely correct. Character classes recognize variables, escaped characters and some other regexp notation, but

Re: \1 in character class?

2010-07-13 Thread Chas. Owens
more: "this is another" > > I thought this would work: > >  s/(['"])([^\1]*)\1/${1}.despace($2).$1/gse; > >  sub despace { >      my $t = shift; >      $t =~ s/\s/ /g; >      return $t; >  } > > ... but it doesn't.  It looks like the [^\1]* i

Re: \1 in character class?

2010-07-13 Thread Erez Schatz
On 13 July 2010 13:00, Bryan R Harris wrote: > > I thought this would work: > >  s/(['"])([^\1]*)\1/${1}.despace($2).$1/gse; > > ... but it doesn't.  It looks like the [^\1]* in the regexp isn't working > right. Character classes (characters inside

Re: \1 in character class?

2010-07-13 Thread Shawn H Corey
On 10-07-13 06:00 AM, Bryan R Harris wrote: I'm trying to temporarily deal with simple quoted strings by turning: data: "this is a string" more: "this is another" into... data: "this is a string" more: "this is another" I thought this wo

Re: \1 in character class?

2010-07-13 Thread Jennifer Jones Harrington
How about... #!/usr/bin/perl use warnings; $_ = "data: \"this is a string\" more: \"this is another\""; s/(\w+)\s/$1 /g; print "$_\n"; It prints: data: "this is a string" more: "this is another" On Tue, Jul 13, 2010 at 6:00 AM, Bryan

\1 in character class?

2010-07-13 Thread Bryan R Harris
I'm trying to temporarily deal with simple quoted strings by turning: data: "this is a string" more: "this is another" into... data: "this is a string" more: "this is another" I thought this would work: s/(['"])([^\1]*)\1/${1}.d

Re: What is the difference between: 'my $var = 1' vs. 'my ( $var ) = 1'?

2010-04-20 Thread Jim Gibson
On 4/20/10 Tue Apr 20, 2010 11:23 AM, "Marc Perry" scribbled: > At the introductory level it seems like I have often seen code like this: > > use strict; > > my $var = 1; > > And as I review other peoples' scripts I have often encountered code like >

Re: What is the difference between: 'my $var = 1' vs. 'my ( $var ) = 1'?

2010-04-20 Thread Brandon McCaig
context sensitive so you need to know what you're doing with it. If you're just declaring a normal variable, as in your example where you assign it 1, then it doesn't seem to technically matter which you use, but you're probably preferred to NOT use parenthesis because it'

What is the difference between: 'my $var = 1' vs. 'my ( $var ) = 1'?

2010-04-20 Thread Marc Perry
At the introductory level it seems like I have often seen code like this: use strict; my $var = 1; And as I review other peoples' scripts I have often encountered code like this: use strict; my ( $this, $that, $the_other ); Which I interpreted as a mechanism to declare a number of s

Re: 1-line datafile, need data for another routine

2010-02-06 Thread Jim Gibson
At 5:48 AM -0500 2/6/10, Chris Coggins wrote: 1. another script uses data passed into it from an html form. Some of the fields are empty, and my "print report file" subroutine prints the empty variables because I don't know how to filter them out, and they need to be removed

Re: 1-line datafile, need data for another routine

2010-02-06 Thread 7
ies to that message using the google >>> groups site and none of my posts have shown up on the list so let's >>> try this again the right way. >>> >>> I have a datafile with 1 line of data, 30 numbers delimited by >>> tildes. (Sample code below only uses 4

Re: 1-line text file with numbers, need to add to them

2010-02-06 Thread 7
e: >> >> > I need some help with this problem. >> > I've got a text file datafile with 1 line of data comprised of 30 >> > different numbers delimited with ~s. >> >> > I need to open this file, grab this line of data, split it into >> > in

Re: 1-line datafile, need data for another routine

2010-02-06 Thread Chris Coggins
the list so let's try this again the right way. I have a datafile with 1 line of data, 30 numbers delimited by tildes. (Sample code below only uses 4 numbers to save time) I need to open this file, grab this line of data, split it into individual numbers, perform some simple math (additio

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Uri Guttman
> "cc" == chaccou...@camcontacts com writes: cc> Please unsubscribe from chaccou...@camcontacts.com and h...@camcontacts.com i don't manage this list. you can follow the directions for subscribing which are in the headers of each email on the list. uri -- Uri Guttman -- u...@stem

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Uri Guttman
>>>>> "F" == Frank writes: F> #!/usr/bin/perl F> open(DATA,"data.txt"); F> while() { F> $number=$_; F> # print $number; F> while ($number =~ /([0-9]+)~s/g){ F> printf ("%d\n","$1"); F>

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread John W. Krahn
Frank wrote: On Feb 4, 4:35 pm, jwkr...@shaw.ca ("John W. Krahn") wrote: Chris wrote: I need some help with this problem. I've got a text file datafile with 1 line of data comprised of 30 different numbers delimited with ~s. I need to open this file, grab this line of data

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Frank
On Feb 4, 4:35 pm, jwkr...@shaw.ca ("John W. Krahn") wrote: > Chris wrote: > > I need some help with this problem. > > I've got a text file datafile with 1 line of data comprised of 30 > > different numbers delimited with ~s. > > > I need to open thi

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Chris
On Feb 4, 2:27 am, cacogg...@gmail.com (Chris) wrote: > I need some help with this problem. > I've got a text file datafile with 1 line of data comprised of 30 > different numbers delimited with ~s. > > I need to open this file, grab this line of data, split it into > indi

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread FrankCai
For instance, here is your data file. data.txt 12~s1~s314~s5677~s899~s0~s Then, here is the code. #!/usr/bin/perl open(DATA,"data.txt"); while() { $number=$_; # print $number; while ($number =~ /([0-9]+)~s/g){ printf ("%d\n","$1"); } } close(DATA);

Re: 1-line datafile, need data for another routine

2010-02-05 Thread Shlomi Fish
and none of my posts have shown up on the list so let's try > this again the right way. > > I have a datafile with 1 line of data, 30 numbers delimited by tildes. > (Sample code below only uses 4 numbers to save time) > > I need to open this file, grab this line of data,

Re: 1-line datafile, need data for another routine

2010-02-05 Thread Rob Dixon
x27;s try this again the right way. I have a datafile with 1 line of data, 30 numbers delimited by tildes. (Sample code below only uses 4 numbers to save time) I need to open this file, grab this line of data, split it into individual numbers, perform some simple math (addition) on each number

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Shlomi Fish
; > while ($number =~ /([0-9]+)~s/g){ > printf ("%d\n","$1"); > } > } > close(DATA); > This code snippet is wrong on so many levels: 1. No "use strict;" and no "use warnings". 2. No three-args open , lexical filehandles and a trailing

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Frank
For instance, the below is your data file --data.txt 12~s1~s314~s5677~s899~s0~s Here are the codes: #!/usr/bin/perl open(DATA,"data.txt"); while() { $number=$_; # print $number; while ($number =~ /([0-9]+)~s/g){ printf ("%d\n","$1"); } } close(DATA

Re: 1-line text file with numbers, need to add to them

2010-02-05 Thread Chris
've got a text file datafile with 1 line of data comprised of 30 > > different numbers delimited with ~s. > > > I need to open this file, grab this line of data, split it into > > individual numbers, perform some simple math (addition) on each > > number, and

Re: 1-line datafile, need data for another routine

2010-02-05 Thread Chris Coggins
n the right way. I have a datafile with 1 line of data, 30 numbers delimited by tildes. (Sample code below only uses 4 numbers to save time) I need to open this file, grab this line of data, split it into individual numbers, perform some simple math (addition) on each number, and then put the new v

Re: 1-line text file with numbers, need to add to them

2010-02-04 Thread John W. Krahn
Chris wrote: I need some help with this problem. I've got a text file datafile with 1 line of data comprised of 30 different numbers delimited with ~s. I need to open this file, grab this line of data, split it into individual numbers, perform some simple math (addition) on each number

Re: multiple onchange on 1 cgi file

2010-02-04 Thread Shlomi Fish
_label->prepare( $sql ); > $sth->execute( $searchterm . '%' ); Do you realise that doing «id_module = "mysearch%"» in the SQL won't actually do a search? You need LIKE. And beware of SQL wildcards injection: http://phroggy.com/weblog/63.html Also it is cu

Re: 1-line text file with numbers, need to add to them

2010-02-04 Thread Shlomi Fish
Hi Chris! Have you visited http://perl-begin.org/ yet and read a good introductory book or tutorial? On Thursday 04 Feb 2010 09:27:32 Chris wrote: > I need some help with this problem. > I've got a text file datafile with 1 line of data comprised of 30 > different numbers del

1-line text file with numbers, need to add to them

2010-02-04 Thread Chris
I need some help with this problem. I've got a text file datafile with 1 line of data comprised of 30 different numbers delimited with ~s. I need to open this file, grab this line of data, split it into individual numbers, perform some simple math (addition) on each number, and then put th

multiple onchange on 1 cgi file

2010-02-04 Thread salmia
}; my $dbh_label = $dbh_label; $form_base .=qq~ - Select One - ~; #--- get module ---# $sql = qq~ SELECT id, module FROM module ~; $sth = $dbh_label->prepare($sql); $sth->execute() or &common_er

Re: Can't use string ("1") as a HASH ref while "strict refs" in use at ./policy.sanitizer line 255.

2009-10-09 Thread Shawn H Corey
Noah wrote: > Hi there, > > I am trying to figure out why the following lines are giving me an error: > > > --- snip --- > > $found{filter}{$filter}{family}{$family} = 1; > print keys %{ $found{filter}{$filter}{family} }; > > >

Re: Can't use string ("1") as a HASH ref while "strict refs" in use at ./policy.sanitizer line 255.

2009-10-09 Thread Jim Gibson
On 10/9/09 Fri Oct 9, 2009 2:12 PM, "Noah" scribbled: > Hi there, > > I am trying to figure out why the following lines are giving me an error: > > > --- snip --- > > $found{filter}{$filter}{family}{$family} = 1; > print k

Can't use string ("1") as a HASH ref while "strict refs" in use at ./policy.sanitizer line 255.

2009-10-09 Thread Noah
Hi there, I am trying to figure out why the following lines are giving me an error: --- snip --- $found{filter}{$filter}{family}{$family} = 1; print keys %{ $found{filter}{$filter}{family} }; --- snip here's the error Can't use string ("1")

Re: "$| = 1" ???

2009-09-11 Thread Philip Potter
2009/9/11 Raymond Wan : > Perldoc is somewhat hard to get into...but it's the manual for a programming >  language, so that's expected; I don't think having pages to color and draw > on would be a feasible idea for the next update.  :-) I don't think you should tar every perldoc page with the same

Re: "$| = 1" ???

2009-09-10 Thread Chas. Owens
On Thu, Sep 10, 2009 at 20:55, Raymond Wan wrote: snip > Perldoc is somewhat hard to get into...but it's the manual for a programming >  language, so that's expected; I don't think having pages to color and draw > on would be a feasible idea for the next update.  :-) snip Oh, I don't know, perlco

Re: "$| = 1" ???

2009-09-10 Thread Raymond Wan
Shawn H Corey wrote: Uri Guttman wrote: newbies will never learn it unless coerced into doing so. I disagree. If they don't have the curiosity to read all they can, then perhaps a future in computer programming is not an ideal career path for them. That's somewhat of a harsh statement..

Re: "$| = 1" ???

2009-09-10 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> Uri Guttman wrote: >> newbies will never learn it unless coerced into >> doing so. SHC> I disagree. If they don't have the curiosity to read all they can, SHC> then perhaps a future in computer programming is not an ideal career SHC> path fo

Re: "$| = 1" ???

2009-09-10 Thread Shawn H Corey
Uri Guttman wrote: newbies will never learn it unless coerced into doing so. I disagree. If they don't have the curiosity to read all they can, then perhaps a future in computer programming is not an ideal career path for them. Some problems facing newbies: * They may not know perldoc eve

Re: "$| = 1" ???

2009-09-10 Thread Chas. Owens
On Thu, Sep 10, 2009 at 13:12, Bryan R Harris wrote: snip > My point is that-that's not obvious.  Why would anyone perldoc perl?  Isn't > perldoc already about perl?  Granted, just typing perldoc gets you started, > but it's at least 3 steps before you start getting c

Re: "$| = 1" ???

2009-09-10 Thread Bryan R Harris
> > that is a listing of all the perl docs and what they cover. perlvar is > listed there. My point is that-that's not obvious. Why would anyone perldoc perl? Isn't perldoc already about perl? Granted, just typing perldoc gets you started, but it's at least 3 steps befor

Re: "$| = 1" ???

2009-09-10 Thread Uri Guttman
> "BRH" == Bryan R Harris writes: BRH> Curiously the most helpful people on this list seem to think the BRH> perldoc system is great, but I've always found it to be rather BRH> hard to use. If I need to figure out what "$." means, how do I BRH> even start? I can't type "perldoc '$.'

Re: "$| = 1" ???

2009-09-10 Thread Gabor Szabo
On Thu, Sep 10, 2009 at 5:26 PM, Bryan R Harris wrote: > >>> "ES" == Erez Schatz writes: >> $| is a special variable. All perl special variables are listed in perldoc perlvar. See that document for a full explanation. >> >>   ES> This isn't really helping, sorry. >> >> sorry, but po

Re: "$| = 1" ???

2009-09-10 Thread Chas. Owens
I > need to figure out what "$." means, how do I even start?  I can't type > "perldoc '$.'" (well, I can, but it doesn't find anything).  How would I > ever know that "perlvar" is the place to go without asking? > > Everybody gets pointe

Re: "$| = 1" ???

2009-09-10 Thread Shawn H Corey
Bryan R Harris wrote: Curiously the most helpful people on this list seem to think the perldoc system is great, but I've always found it to be rather hard to use. Compared to most language documentation, perldoc is great; it's just not perfect. My pet peeve is the `perldoc -q` only searches

Re: "$| = 1" ???

2009-09-10 Thread Bryan R Harris
>> "ES" == Erez Schatz writes: > >>> $| is a special variable. All perl special variables are listed in >>> perldoc perlvar. See that document for a full explanation. > > ES> This isn't really helping, sorry. > > sorry, but pointing someone to the docs is helping more than directly > ans

Re: "$| = 1" ???

2009-09-10 Thread Philip Potter
2009/9/10 Erez Schatz : > 2009/9/10 Philip Potter : >> 2009/9/10 Tariq Doukkali : >>> Hi, >>> >>> i can not understand, what does this code: >>> >>> >>> $| = 1; > > This means the programmer wishes that the buffer will be

Re: "$| = 1" ???

2009-09-10 Thread Uri Guttman
> "ES" == Erez Schatz writes: >> $| is a special variable. All perl special variables are listed in >> perldoc perlvar. See that document for a full explanation. ES> This isn't really helping, sorry. sorry, but pointing someone to the docs is helping more than directly answering the q

Re: "$| = 1" ???

2009-09-10 Thread Erez Schatz
2009/9/10 Philip Potter : > 2009/9/10 Tariq Doukkali : >> Hi, >> >> i can not understand, what does this code: >> >> >> $| = 1; This means the programmer wishes that the buffer will be flushed after every write, or print. Normally (i.e. $| = 0), the compu

Re: "$| = 1" ???

2009-09-10 Thread Shlomi Fish
On Thursday 10 September 2009 11:17:33 Tariq Doukkali wrote: > Hi, > > i can not understand, what does this code: > > > $| = 1; > $| is a special variable. Reading its description from perldoc perlvar: <<<<<<<<<<<<<<<<<

  1   2   3   4   5   6   7   >