Re: Elegant sequencing

2004-08-27 Thread Bryan Harris
Nice, Bob, very elegant indeed! I do have a question, I notice you use "and" like an if..then. What if you wanted to do two things if that =~ held true? Is that possible? Thanks. - Bryan > Bryan Harris wrote: >> One of my favorite things about perl is that long and tedious >> solutions c

RE: using Calendar.pm

2004-08-27 Thread Dalton Marris
On Fri, 27 Aug 2004, Roberts Mr Richard L wrote: On Fri, 27 Aug 2004, Chris Devers wrote: > On Fri, 27 Aug 2004, Roberts Mr Richard L wrote: > >> All, > >> does anyone have any experience w/ calendar.pm? Usage and or >> examples. Cpan is very vague in showing the actual calendar(s) and >> functio

Re: "best" way to invoke command line

2004-08-27 Thread Wiggins d Anconia
> I call command line tools constantly as the third-party application's API is > not exposed to Perl any other way. > Sometimes it is unavoidable, sounds like you have done your homework and tried, kudos. > I am wondering why there are at least three options for executing a command > line (inc

"best" way to invoke command line

2004-08-27 Thread perl.org
I call command line tools constantly as the third-party application's API is not exposed to Perl any other way. I am wondering why there are at least three options for executing a command line (including backticks, system() and pipe), if there is a "best" way to invoke a command line, or what fa

Re: Image::Magick (Can't do inplace edit)

2004-08-27 Thread Wiggins d Anconia
> Hi All, > > I'm trying to slurp a directory of JPEG images. The script is able to read > the directory but I can not get the files to open. Anyone have any > suggestions? > > Thanks! > > Brian > > Here is the output when I run the script: > > Can't open images/.: No such file or directory

Re: system call

2004-08-27 Thread Wiggins d Anconia
Please bottom post... > > sorry about assuming! Wait a second I though in Perl, a rc of 0 is false > and 1 is true? > It is in *Perl*, but you are talking to an outside program. When you are interacting with another program it can decide whatever it wants its exit value to be, which is why 's

Re: system call

2004-08-27 Thread DBSMITH
sorry about assuming! Wait a second I though in Perl, a rc of 0 is false and 1 is true? Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams 614-566-4145 "Wiggins d Anconia" <[EMAIL PROTECTED]> 08/27/2004 05:18 PM To: [EMAIL PROTECTED], "Wiggins d Anconia" <[EMAIL PROTECTED]>,

Re: system call

2004-08-27 Thread Wiggins d Anconia
Please bottom post > > yes I do understand but it is not working. You need to tell us that originally, we are not mind readers. In other words when cat > /tmp/foo fails the blah blah blah is not ran. 0 is success (in program return values *usually*), so if it fails, $? will not == 0, s

Image::Magick (Can't do inplace edit)

2004-08-27 Thread Brian Volk
Hi All, I'm trying to slurp a directory of JPEG images. The script is able to read the directory but I can not get the files to open. Anyone have any suggestions? Thanks! Brian Here is the output when I run the script: Can't open images/.: No such file or directory at rezise~1.pl line 17. C

Re: system call

2004-08-27 Thread DBSMITH
yes I do understand but it is not working. In other words when cat /tmp/foo fails the blah blah blah is not ran. What I do not understand is the notes from the cookbook specifically $exit_value = $? >> 8; How would I code this so that my if works b/c it sounds like to me as the notes say th

Re: Parsing really large sgml files

2004-08-27 Thread Kevin Old
On Fri, 27 Aug 2004 13:23:15 -0700 (PDT), J. Goodleaf <[EMAIL PROTECTED]> wrote: > Any ideas appreciated. > > I need to parse some really large (> 25MB) sgml files. The files are > just database dumps essentially, with each record looking something > like this: > > STUFF > >

Re: system call

2004-08-27 Thread Wiggins d Anconia
> > All, > > I want to capture the exit value of a system call. How can I do this? > My code is: > > system ( " cat /tmp/foo" ); > if ( $? == 0 ) { > > blah blah blah > } > > > I read the cookbook and it says : > > Both wait and waitpid return the process

Parsing really large sgml files

2004-08-27 Thread J. Goodleaf
Any ideas appreciated. I need to parse some really large (> 25MB) sgml files. The files are just database dumps essentially, with each record looking something like this: STUFF stuff The records are not overly complicated, but I've never tried XML or SGML

system call

2004-08-27 Thread DBSMITH
All, I want to capture the exit value of a system call. How can I do this? My code is: system ( " cat /tmp/foo" ); if ( $? == 0 ) { blah blah blah } I read the cookbook and it says : Both wait and waitpid return the process ID that they just reaped and set

Re: split up long string with spaces

2004-08-27 Thread John W. Krahn
JP wrote: $string =~ s/(\S{40}/\1 /g; Only use \1 (and \2, \3, etc.) in regular expressions. Use $1 (and $2, $3, etc.) in double quoted strings. $string =~ s/(\S{40})/$1 /g; does exactly the trick I need. now I wonder if it is possible to print the resulting spaced string without changing $stri

Re: split up long string with spaces

2004-08-27 Thread JP
> : $string =~ s/(\S{40}/\1 /g; > > You should really consider turning warnings on. > > #!/usr/bin/perl -w I always use warnings, though I am developping on one system, and reading my news on another (NNTP-enabled) one. therefore I can't copy and paste. it was a typo indeed but only in my post

Re: split up long string with spaces

2004-08-27 Thread JP
yeah, I think I will add the (?=.) Thanks "Mark Maunder" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > G'day. > > $string =~ s/(.{4})(?=.)/$1 /g; > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
On Friday 27 Aug 2004 20:00, Damon Allen Davison wrote: > Dear Gavin, > > Gavin Henry wrote: > > Kind of a perl question, how do I get VIM to indent perl code? > > Have a look here: > > http://mamchenkov.net/blog/item/vim_for_perl_developers > > IIRC, it was originally posted in some form at http:

Re: OT: VIM perl indentaton

2004-08-27 Thread Damon Allen Davison
Dear Gavin, Gavin Henry wrote: > Kind of a perl question, how do I get VIM to indent perl code? Have a look here: http://mamchenkov.net/blog/item/vim_for_perl_developers IIRC, it was originally posted in some form at http://www.perlmonks.org, but it's the same author either way. Best, Damon -- Da

RE: split up long string with spaces

2004-08-27 Thread Charles K. Clarkson
From: JP wrote: : Got it! : : $string =~ s/(\S{40}/\1 /g; You should really consider turning warnings on. #!/usr/bin/perl -w or: use warnings; : does exactly the trick I need. There's a typo. The parenthesis doesn't close. When you post code, try to cut an

RE: using Calendar.pm

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Roberts Mr Richard L wrote: On Fri, 27 Aug 2004, Chris Devers wrote: > On Fri, 27 Aug 2004, Roberts Mr Richard L wrote: > >> All, > >> does anyone have any experience w/ calendar.pm? Usage and or >> examples. Cpan is very vague in showing the actual calendar(s) and >> functio

RE: using Calendar.pm

2004-08-27 Thread Roberts Mr Richard L
Generate a online calendar w/ input/edit abilities based on day to day type transactions. thnx -Original Message- From: Chris Devers [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 11:21 AM To: Roberts Mr Richard L Cc: perl beginners Subject: Re: using Calendar.pm On Fri, 27 Aug

Re: split up long string with spaces

2004-08-27 Thread JP
Got it! $string =~ s/(\S{40}/\1 /g; does exactly the trick I need. now I wonder if it is possible to print the resulting spaced string without changing $string itself? do I really need a temporary variable or is it possible to do something like: print $string s/(\S{40}/\1 /g; "Jp" <[EMAIL PR

Re: OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
Craig Turner said: > (replying to digest) > >> > Gavin -- what happens if you just put >> > >> > set autoindent >> > >> > in your ~/.vimrc ? Does that not work ? >> >> No Doesnt work for me , I am using vim 6.2 on linux ( redhat AS 3 ). >> Any clue ? > > This may be a confusion over definition

Re: OT: VIM perl indentaton

2004-08-27 Thread Wiggins d Anconia
> > Fortunately, he specifically said "VIM", not Vi. > > > > Vim is a very nice improvement over traditional Vi that can do, among a > > great many other things, syntax highlighting and automatic indentation. > > > > Gavin -- what happens if you just put > > > > set autoindent > > > > in your

Re: using Calendar.pm

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Roberts Mr Richard L wrote: All, does anyone have any experience w/ calendar.pm? Usage and or examples. Cpan is very vague in showing the actual calendar(s) and functionality. I can't find a "Calendar.pm" in CPAN -- where did you get this from? There are a number of modules rel

Re: OT: VIM perl indentaton

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Gavin Henry wrote: Last question, Do you need to press any keys to indent? Well, "enter", I suppose. The behavior I see is that Vim will preserve the indentation level of the previous line of code, unless it detects a left brace (which denotes a new block of code and so is in

using Calendar.pm

2004-08-27 Thread Roberts Mr Richard L
All, does anyone have any experience w/ calendar.pm? Usage and or examples. Cpan is very vague in showing the actual calendar(s) and functionality. thanks Richard -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: OT: VIM perl indentaton

2004-08-27 Thread Craig Turner
(replying to digest) > > Gavin -- what happens if you just put > > > > set autoindent > > > > in your ~/.vimrc ? Does that not work ? > > No Doesnt work for me , I am using vim 6.2 on linux ( redhat AS 3 ). > Any clue ? This may be a confusion over definitions. Gavin, Ram, if you do the fol

Re: OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
Last question, Do you need to press any keys to indent? -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regular expression generator/creator

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Mark Maunder wrote: I've google'd and CPAN'd and no luck. Is there a tool out there that will generate a regular expression based on a series of string inputs that are similar but have parts that differ[?] I suspect that this is a Hard problem, as in NP-Hard/NP-Incomplete, as

Re: OT: VIM perl indentaton

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Ramprasad A Padmanabhan wrote: No Doesnt work for me , I am using vim 6.2 on linux ( redhat AS 3 ). Any clue ? My ~/.vimrc is available at . I wrote that file two or three years ago, and honestly don't remember what everything in there d

Re: OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
Chris Devers said: > On Fri, 27 Aug 2004, Gavin Henry wrote: > >> Ramprasad A Padmanabhan said: >>> >>> Anyway on a serious note , I dont think there is any auto indent >>> possible in vi. You will have to set tab value and hit tabs as many >>> times you want to indent. >> >> Oh well :-( > > This i

Re: OT: VIM perl indentaton

2004-08-27 Thread Ramprasad A Padmanabhan
On Fri, 2004-08-27 at 18:14, Chris Devers wrote: > On Fri, 27 Aug 2004, Ramprasad A Padmanabhan wrote: > > > On Fri, 2004-08-27 at 17:53, Gavin Henry wrote: > >> Hi all, > >> > >> Kind of a perl question, how do I get VIM to indent perl code? > > > > Use emacs :-) > > Har har har > > > Anyway on

Re: OT: VIM perl indentaton

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Gavin Henry wrote: Ramprasad A Padmanabhan said: Anyway on a serious note , I dont think there is any auto indent possible in vi. You will have to set tab value and hit tabs as many times you want to indent. Oh well :-( This is incorrect. Straight Vi may not be able to indent

Re: OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
> Fortunately, he specifically said "VIM", not Vi. > > Vim is a very nice improvement over traditional Vi that can do, among a > great many other things, syntax highlighting and automatic indentation. > > Gavin -- what happens if you just put > > set autoindent > > in your ~/.vimrc ? Does that

Re: OT: VIM perl indentaton

2004-08-27 Thread Chris Devers
On Fri, 27 Aug 2004, Ramprasad A Padmanabhan wrote: On Fri, 2004-08-27 at 17:53, Gavin Henry wrote: Hi all, Kind of a perl question, how do I get VIM to indent perl code? Use emacs :-) Har har har Anyway on a serious note , I dont think there is any auto indent possible in vi. You will have to set

Re: OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
Ramprasad A Padmanabhan said: > On Fri, 2004-08-27 at 17:53, Gavin Henry wrote: >> Hi all, >> >> Kind of a perl question, how do I get VIM to indent perl code? >> >> >> -- >> Just getting into the best language ever... >> Fancy a [EMAIL PROTECTED] Just ask!!! > > Use emacs :-) > > Anyway on a serio

Re: OT: VIM perl indentaton

2004-08-27 Thread Ramprasad A Padmanabhan
On Fri, 2004-08-27 at 17:53, Gavin Henry wrote: > Hi all, > > Kind of a perl question, how do I get VIM to indent perl code? > > > -- > Just getting into the best language ever... > Fancy a [EMAIL PROTECTED] Just ask!!! Use emacs :-) Anyway on a serious note , I dont think there is any auto i

OT: VIM perl indentaton

2004-08-27 Thread Gavin Henry
Hi all, Kind of a perl question, how do I get VIM to indent perl code? -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

problems while building Tk

2004-08-27 Thread Christian Stalp
Hello out there... I have some trouble building the Tk for HPUX. My Eviroment is: HPUX 10.20 on PA-RISC Perl V 5.8.3 gcc 3.3.2 After the call of perl Makefile.PL I got this dumped: perl is installed in /usr/local/lib/perl5/5.8.3/PA-RISC2.0 okay PPM for perl5.008003 Test Compiling config/signedcha

RE: Elegant sequencing

2004-08-27 Thread Bob Showalter
Bryan Harris wrote: > One of my favorite things about perl is that long and tedious > solutions can often be replaced by incredibly elegant and concise > ones. > > I'm writing a sequence generator. I've got most of it handled, but > this part bugs me. I want it to take the variable $field conta

Re: split up long string with spaces

2004-08-27 Thread Mark Maunder
G'day. $string =~ s/(.{4})(?=.)/$1 /g; FYI, the ?= at the end is a zero-width look ahead assertion that stops a space from being inserted after the last 4 chars. Please see 'perldoc perlre' for details. Mark. On Fri, 2004-08-27 at 05:51, JP wrote: > I am trying to split up a given string of unk

split up long string with spaces

2004-08-27 Thread JP
I am trying to split up a given string of unknown length with spaces at a given interval. eg.: $length=4; $string="MIICWwIBAAKBgQDGz8+vl9M4z0a0f/slusZ+mkBO7c9QuiV7yNAlBPiXZv8E/6yX"; should become: $new_string="MIIC WwIB AAKB gQDG z8+v l9M4 z0a0 f/sl usZ+ mkBO 7c9Q uiV7 yNAl BPiX Zv8E /6yX" in

DBI and Mysql error 2006

2004-08-27 Thread Yannick Warnier
Hi there, I'm having a problem with MySQL with a Perl::DBI usage. I've turned it upside-down and cannot find what it's related to (be it MySQL or DBI). My script creates multiple databases and populates them with tables. The problem appears when creating the second database (in the foreach statem

Regular expression generator/creator

2004-08-27 Thread Mark Maunder
Hi, I've google'd and CPAN'd and no luck. Is there a tool out there that will generate a regular expression based on a series of string inputs that are similar but have parts that differ. Ideally I'd like to be able to create an regex generator object into which I can feed strings. Then call a met