Re: Incrementing letters in for loop

2010-04-12 Thread Shlomi Fish
Hi Magne, On Tuesday 13 Apr 2010 06:35:51 Magne Sandøy wrote: > Hi. > > I'm new to perl, and I stumbled across a strange behavior in my for loop. > In the following code, the second for loop actually counts way passed > what I expected, and actually stops at "yz" and not "z" as expected. > As sho

Re: html print

2010-04-12 Thread Shlomi Fish
Hi Shawn, Thanks for your message. Thanks for trimming my message so carefully and not replying to all my points. (That was sarcasm.) On Monday 12 Apr 2010 17:50:14 Shawn H Corey wrote: > Shlomi Fish wrote: > > Because people often don't know for sure what is the right way, and > > confuse it.

Re: about split and \d or . (.)

2010-04-12 Thread Dr.Ruud
Harry Putnam wrote: Shawn H Corey writes: my $var = 'ev 100421 4'; my @numbers = $var =~ /(\d+)/g; print Dumper \...@numbers; Nice... that's a nifty way to get some clean numbers. If you only want to match [0-9], then best use that in stead of \d, because \d matches 250+ codepoints. Unl

Copy file from one server to another

2010-04-12 Thread Chris Coggins
I need to copy a small config file from one server to another. I'm generating the file on one server with a pretty complex script. I need to put that file on another server for immediate user access via html. I've tried just writing the file straight to the new server over the network using abs

Re: Incrementing letters in for loop

2010-04-12 Thread Owen
On Tue, 13 Apr 2010 05:35:51 +0200 Magne Sandøy wrote: > Hi. > > I'm new to perl, and I stumbled across a strange behavior in my for > loop. In the following code, the second for loop actually counts way > passed what I expected, and actually stops at "yz" and not "z" as > expected. As shown by

RE: about split and \d or . (.)

2010-04-12 Thread Hack, Gabi (ext)
hi all, > Harry Putnam wrote: > > Shawn H Corey writes: > > > >> Harry Putnam wrote: > >>> What I'm working on will eventually be a script that > reads an `events' > >>> file and lets me know about events I've entered there. > It's my own > >>> primitive but hopefully effective calendar remi

Re: Pattern matching problem - Why won't this work?

2010-04-12 Thread Owen Chavez
Thank you for the feedback. I do apologize for not posting a working example; I can't post the full code and I was attempting to extract the offending sections. I have no particular fondness for grep. A search of postings on perlmonks revealed a variation of the code I employed. I am learning p

Incrementing letters in for loop

2010-04-12 Thread Magne Sandøy
Hi. I'm new to perl, and I stumbled across a strange behavior in my for loop. In the following code, the second for loop actually counts way passed what I expected, and actually stops at "yz" and not "z" as expected. As shown by the third for loop, incrementing the letters, seems to give me the

Re: Pattern matching problem - Why won't this work?

2010-04-12 Thread Peter Scott
On Mon, 12 Apr 2010 21:06:58 -0500, Owen Chavez wrote: > I have a pattern matching question using Perl 5.10, Windows 7. Suppose > I have a file containing the following block of text: > > Hello there TODD > I my We Us ourselves OUr I. > > The file has 10 words, including 7 first-person pronouns

Pattern matching problem - Why won't this work?

2010-04-12 Thread Owen Chavez
Hello! I have a pattern matching question using Perl 5.10, Windows 7. Suppose I have a file containing the following block of text: Hello there TODD I my We Us ourselves OUr I. The file has 10 words, including 7 first-person pronouns (and 3 non-pronouns that I have no interest in). I've scrabb

[Meta] On style disagreements

2010-04-12 Thread Peter Scott
Personal opinion and personal plea here on practices for experts to follow on a beginners' list. Please take it in its intended constructive spirit from someone who's been teaching Perl for 11 years. Follow the old adage of "be strict in what you emit and liberal in what you accept." In parti

Re: about split and \d or . (.)

2010-04-12 Thread Uri Guttman
> "HP" == Harry Putnam writes: HP> Shawn H Corey writes: HP> [...] >>> Yikes, I'll be a week with perlre to get even close to following that. >>> In fact I don't really understand whats happening there at all. >>> >>> Also it doesn't appear to work with the data I posted unless

Re: about split and \d or . (.)

2010-04-12 Thread Harry Putnam
Shawn H Corey writes: [...] >> Yikes, I'll be a week with perlre to get even close to following that. >> In fact I don't really understand whats happening there at all. >> >> Also it doesn't appear to work with the data I posted unless the >> $extra is present, and that is supposed to be up to

Re: about split and \d or . (.)

2010-04-12 Thread Harry Putnam
> Harry Putnam wrote: >> I mean it looks like a heck of a lot more typing.. Or a much more >> complex abbrev expansion. >> > > Sorry but if you plan a career in programming, you're going to be > doing a lot of typing. :) Hehe... there is that. seriously though, this is a personal use only even

Re: String length limits?

2010-04-12 Thread John W. Krahn
Owen wrote: On Mon, 12 Apr 2010 13:52:16 +0200 Rene Schickbauer wrote: Perl has no string length limit. You are only limited by the amount of memory that is available. If your program is misbehaving then I fear it is the programs error (or well the person that wrote it ;-) rather then perl o

Re: String length limits?

2010-04-12 Thread Owen
On Mon, 12 Apr 2010 13:52:16 +0200 Rene Schickbauer wrote: > Hi! > > > Perl has no string length limit. You are only limited by the amount > > of memory that is available. > > > > If your program is misbehaving then I fear it is the programs error > > (or well the person that wrote it ;-) rathe

Re: Getting a subroutine reference from an object instance

2010-04-12 Thread Eric Veith1
Peter Scott wrote on 04/10/2010 03:33:46 PM: > You'd probably benefit from taking this to a Moose list. Good idea. Thanks for all the help, especially to Shlomi, who pointed out the $instance->can('foo') solution. Eric -- Eric MSP Veith Hechtsheimer Str. 2 DE-55131 Ma

Re: [Was XS linker]

2010-04-12 Thread Rene Schickbauer
Jenda Krynicky wrote: Hi! Many of us can't deal with the changes that happen in the past decade, either because we are old or because we are perfectionist, or both. I used to be one of those people, but i have grown up. Grown up or grown tired? A little of both, i guess. When i was younge

Re: [Was XS linker]

2010-04-12 Thread Jenda Krynicky
From: Rene Schickbauer > Some of the rules doesn't even make sense anymore, like the > four-line-signature: Most people - when using their company mail account > - are forced by local law to include a number of information (address, > telephone number, company chairman, commercial registration

Re: about split and \d or . (.)

2010-04-12 Thread Shawn H Corey
Harry Putnam wrote: I mean it looks like a heck of a lot more typing.. Or a much more complex abbrev expansion. Sorry but if you plan a career in programming, you're going to be doing a lot of typing. :) -- Just my 0.0002 million dollars worth, Shawn Programming is as much about or

Re: about split and \d or . (.)

2010-04-12 Thread Brandon McCaig
On Mon, Apr 12, 2010 at 9:45 AM, Harry Putnam wrote: > Shawn H Corey writes: >> Perhaps you should consider writing the data in XML: > I guess you're thinking of some automated way to enter the necessary > info eh? > > I mean it looks like a heck of a lot more typing.. Or a much more > complex ab

Re: html print

2010-04-12 Thread John W. Krahn
Shlomi Fish wrote: On Monday 12 Apr 2010 12:06:16 Chris Coggins wrote: print < You should always say <<"STOPHTML" <<'STOPHTML' <<`STOPHTML` etc. with explicit quotes depending on what you say. Otherwise, you may not be sure that it's doing the right thing (nor will your readers). As a rea

Re: Subroutine doesn't write to file

2010-04-12 Thread Philip Potter
On 12 April 2010 16:39, Uri Guttman wrote: >> "PP" == Philip Potter writes: > >  PP> On 12 April 2010 11:34, Shlomi Fish wrote: >  >> Hi Uri and Philip (and Abimael), >  >> On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote: >  >>>   PP> Where did I say PBP was always right? I just didn't want

Re: Subroutine doesn't write to file

2010-04-12 Thread Uri Guttman
> "PP" == Philip Potter writes: PP> On 12 April 2010 11:34, Shlomi Fish wrote: >> Hi Uri and Philip (and Abimael), >> On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote: >>>   PP> Where did I say PBP was always right? I just didn't want to let your >>>   PP> style argument be the onl

Re: about beginner perl site and developing skill

2010-04-12 Thread Shlomi Fish
Hi Harry! On Tuesday 06 Apr 2010 18:56:44 Harry Putnam wrote: > [This message was inadvertently originally posted in a totally > inappropriate group, so reposted here where it was supposed to have > gone] [SNIP] > > On the other hand, I am capable of writing semi complex programs and > have writt

Re: html print

2010-04-12 Thread Shawn H Corey
Shlomi Fish wrote: Because people often don't know for sure what is the right way, and confuse it. On the other hand, people don't normally think that "shift;" How do you know what people think? You're assuming because it's easy for you, it will be easy for everyone. -- Just my 0.0002

Re: about split and \d or . (.)

2010-04-12 Thread Shawn H Corey
Harry Putnam wrote: Shawn H Corey writes: Harry Putnam wrote: What I'm working on will eventually be a script that reads an `events' file and lets me know about events I've entered there. It's my own primitive but hopefully effective calendar reminder type of tool. The format of entries loo

Re: html print

2010-04-12 Thread Shlomi Fish
Hi Shawn, I hope it's OK that I CC the list on it. On Monday 12 Apr 2010 15:37:02 Shawn H Corey wrote: > Shlomi Fish wrote: > > {{{ > > my $hash = shift; > > }}} > > Always put the array after a shift: > >my $hash = shift @_; > Well, you don't need to in this case as <> inside a subroutin

Re: about split and \d or . (.)

2010-04-12 Thread Harry Putnam
Shawn H Corey writes: > Harry Putnam wrote: >> What I'm working on will eventually be a script that reads an `events' >> file and lets me know about events I've entered there. It's my own >> primitive but hopefully effective calendar reminder type of tool. >> >> The format of entries look like t

Re: Subroutine doesn't write to file

2010-04-12 Thread Shlomi Fish
On Monday 12 Apr 2010 13:59:31 Philip Potter wrote: > On 12 April 2010 11:34, Shlomi Fish wrote: > > Hi Uri and Philip (and Abimael), > > > > On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote: > >> PP> Where did I say PBP was always right? I just didn't want to let > >> your PP> style argument b

Re: about split and \d or . (.)

2010-04-12 Thread Harry Putnam
"John W. Krahn" writes: [...] >> ev 100411 4 >> Wash behind ears >> ev >> >> ev 100421 4 >> Avoid a beating by taking out the garbage >> this evening. >> ev >> >> [...] >> >> The multidigit numbers represents YYMMDD, > John K. wrote: > If we have learned anything from Y2K

Re: [Was XS linker]

2010-04-12 Thread Rene Schickbauer
Pry, Jeffrey wrote: Indeed. Patience and a willingness to repeat one's self was one of this list assets but that seems to be in short supply these days. We also seem to have lost one or two regular contributors. I can attest to this. After having the LAW passed to me by Rudd telling me I need

Re: about split and \d or . (.)

2010-04-12 Thread Shawn H Corey
Harry Putnam wrote: What I'm working on will eventually be a script that reads an `events' file and lets me know about events I've entered there. It's my own primitive but hopefully effective calendar reminder type of tool. The format of entries look like this: cat ~/.events ev 100411 4

Re: String length limits?

2010-04-12 Thread Rene Schickbauer
Hi! Perl has no string length limit. You are only limited by the amount of memory that is available. If your program is misbehaving then I fear it is the programs error (or well the person that wrote it ;-) rather then perl or any limit on the length of a string. And as for the current implem

parse xml

2010-04-12 Thread vyomesh Kulkarni
hello I am trying to parse my xml file which looks like below. its a test case structure. each test case can have multiple actions. the code i could write to parse is below... i am new to perl. #!/usr/bin/perl use Net::Telnet; use Expect; use XML::Simple qw(:strict); use Data::Du

Re: Fifo Queue Job Scheduler

2010-04-12 Thread Rene Schickbauer
Him Joseph! I need something to read max 30 or so chars from a named pipe and execute my script with that keyword. Something that I can daemonize with an init script. Seen anything similar that can be bent into shape? Hmm, daemonizing perl scripts was discussed on PerlMonks, for example

Re: html print

2010-04-12 Thread Chris Coggins
Shlomi Fish wrote: Hi Chris, A few comments on your code - some of which may help you. On Monday 12 Apr 2010 12:06:16 Chris Coggins wrote: I'm having trouble getting a piece of data from a form input to print in html. Here's the relevant portion of my code sub subroutine { I hope

Re: Subroutine doesn't write to file

2010-04-12 Thread Philip Potter
On 12 April 2010 11:34, Shlomi Fish wrote: > Hi Uri and Philip (and Abimael), > On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote: >>   PP> Where did I say PBP was always right? I just didn't want to let your >>   PP> style argument be the only one in this thread, since there are >> clearly PP> peo

Re: html print

2010-04-12 Thread Shlomi Fish
Hi Chris, A few comments on your code - some of which may help you. On Monday 12 Apr 2010 12:06:16 Chris Coggins wrote: > I'm having trouble getting a piece of data from a form input to print in > html. Here's the relevant portion of my code > > sub subroutine { I hope you didn't call your subr

Re: Subroutine doesn't write to file

2010-04-12 Thread Shlomi Fish
Hi Uri and Philip (and Abimael), On Monday 12 Apr 2010 10:32:36 Uri Guttman wrote: > > "PP" == Philip Potter writes: > PP> On 12 April 2010 07:55, Uri Guttman wrote: > >>> "PP" == Philip Potter writes: > >> PP> On 12 April 2010 04:31, Uri Guttman wrote: > >> >>> "AM" == A

Re: How ro specify path in "use lib qw()"

2010-04-12 Thread Shlomi Fish
Hi Mimi, On Monday 12 Apr 2010 02:32:12 Mimi Cafe wrote: > My program is in the same directory as my module directory, but when I use > relative path in use lib, Perl doesn't find the module. > > > > use lib qw(MyModule/), use lib qw(./MyModule/), use lib qw(MyModule) or use > lib qw(./MyModule

AW: html print

2010-04-12 Thread Thomas Bätzler
Chris Coggins asked: > I'm having trouble getting a piece of data from a form input to print > in html. Here's the relevant portion of my code > > sub subroutine { > my($hash) = shift; > my($data) = "$hash->{'expl'}"; > > print "Content-type: text/html\n\n"; > print < This employee has $data > S

html print

2010-04-12 Thread Chris Coggins
I'm having trouble getting a piece of data from a form input to print in html. Here's the relevant portion of my code sub subroutine { my($hash) = shift; my($data) = "$hash->{'expl'}"; print "Content-type: text/html\n\n"; print

Re: Subroutine doesn't write to file

2010-04-12 Thread Uri Guttman
> "PP" == Philip Potter writes: PP> On 12 April 2010 07:55, Uri Guttman wrote: >>> "PP" == Philip Potter writes: >> >>  PP> On 12 April 2010 04:31, Uri Guttman wrote: >>  >>> "AM" == Abimael Martinez writes: >>  >> >>  >>  AM>   print {$tmp} "$div_start"; >>  >>

Re: Subroutine doesn't write to file

2010-04-12 Thread Philip Potter
On 12 April 2010 07:55, Uri Guttman wrote: >> "PP" == Philip Potter writes: > >  PP> On 12 April 2010 04:31, Uri Guttman wrote: >  >>> "AM" == Abimael Martinez writes: >  >> >  >>  AM>   print {$tmp} "$div_start"; >  >> >  >> no need for the {} around a single scalar handle. > >  PP> Bu