Re: Script that spans multiple files

2005-04-20 Thread Offer Kaye
On 4/21/05, Daniel Kasak wrote: > Hi all. > > I have a large script ( 6000 lines ) that I'd like to break into logical > units. Is there a way I can tell perl to 'append' a list of files into 1 > script so that I can call subs from any of the files and have them > treated as if they were all from

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread FreeFall
On Thu, 21 Apr 2005 08:31:27 +0300 Offer Kaye <[EMAIL PROTECTED]> wrote: > On 4/21/05, FreeFall wrote: > > > 3. But there's an even easier way, without having to use map: > > > my @record = split /\s*\|\s*/,$date; > > > > -->this seems it cant delete spaces of the last element. > > > > Have

RE: Script that spans multiple files

2005-04-20 Thread Charles K. Clarkson
Daniel Kasak wrote: : : I have a large script ( 6000 lines ) that I'd like to break into : logical units. Is there a way I can tell perl to 'append' a list : of files into 1 script so that I can call subs from any of the : files and have them treated as if they were all

Re: Script that spans multiple files

2005-04-20 Thread Ramprasad A Padmanabhan
On Thu, 2005-04-21 at 11:09, Daniel Kasak wrote: > Hi all. > > I have a large script ( 6000 lines ) that I'd like to break into logical > units. Is there a way I can tell perl to 'append' a list of files into 1 > script so that I can call subs from any of the files and have them > treated as if th

Script that spans multiple files

2005-04-20 Thread Daniel Kasak
Hi all. I have a large script ( 6000 lines ) that I'd like to break into logical units. Is there a way I can tell perl to 'append' a list of files into 1 script so that I can call subs from any of the files and have them treated as if they were all from the same script ( ie all my variables will b

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread Offer Kaye
On 4/21/05, FreeFall wrote: > > 3. But there's an even easier way, without having to use map: > > my @record = split /\s*\|\s*/,$date; > > -->this seems it cant delete spaces of the last element. > Have you tried it? -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: PDF::API2

2005-04-20 Thread Daniel Kasak
Peter Rabbitson wrote: >Hi everyone, >Today I am stuck with PDF::API2. Although seeming very powerful, the module >documentation is horridly lacking. I was able to figure a great deal of what >I need by directly examining the source, however some issues are left >unsolved: > >1. Is there a way to

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread FreeFall
On Wed, 20 Apr 2005 17:04:50 +0300 Offer Kaye <[EMAIL PROTECTED]> wrote: > On 4/20/05, Paul Kraus wrote: > > Why does this work > > my $date = 'one | two |three |'; > > my @record = map ( whitespace($_), (split /\|/,$_) ); > > No, it won't work - you need to replace the $_ at the en

Re: Copy and rename files

2005-04-20 Thread JupiterHost.Net
Brian Milbrandt wrote: Please dont' top post :) I appreciate the help, is there a way to do it by taking the source and target directory's as command line arguments? that is how the unix script is written that I am trying to convert. my $source = $ARGV[0]; my $target = $ARGV[1]; may want to add

Re: Copy and rename files

2005-04-20 Thread Brian Milbrandt
I appreciate the help, is there a way to do it by taking the source and target directory's as command line arguments? that is how the unix script is written that I am trying to convert. Thanks. - Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 20,

Re: PDF::API2

2005-04-20 Thread Owen
On Wed, 20 Apr 2005 10:27:47 -0500 Peter Rabbitson <[EMAIL PROTECTED]> wrote: > Today I am stuck with PDF::API2. Although seeming very powerful, the module > documentation is horridly lacking. I was able to figure a great deal of what > I need by directly examining the source, however some issues

Re: Need help match feet and inches

2005-04-20 Thread John W. Krahn
Keith Worthington wrote: Hi All, Hello, Here is my code so far. I am really getting frustrated with my inability to get this right. I didn't understand Chris' earlier suggestion about using defined but I tried using it anyway. I cannot seem to get the pattern match to properly handle a dimension t

Re: Holidays

2005-04-20 Thread Offer Kaye
On 4/20/05, Robert <[EMAIL PROTECTED]> wrote: > I need to populate a Pg database with holidays (US, Federal, Christian, > Islamic, and Jewish). I didn't find anything on CPAN (but you have to know > what to search for). The Islamic and Jewish ones are a little problematic > because they can shift f

Address cpan repository

2005-04-20 Thread Gilberto Garcia S.
Hello all, I know a little english and I need the address to add the CPAN repository with ppm in windows. very thanks Gilberth

Re: Need help match feet and inches

2005-04-20 Thread Offer Kaye
On 4/20/05, Keith Worthington wrote: > Hi All, > > Here is my code so far. I am really getting frustrated with my inability to > get this right. > > I didn't understand Chris' earlier suggestion about using defined but I tried > using it anyway. > > I cannot seem to get the pattern match to pro

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread John W. Krahn
Paul Kraus wrote: Why does this work my $date = 'one | two |three |'; my @record = map ( whitespace($_), (split /\|/,$_) ); sub whitespace { my $string = shift; $string =~ s/^\s+|\s+$//g; return $string; } but this does not my @record = map ( $_=~ s/^\s+|\s+$//g,(split /\|/

Re: Copy and rename files

2005-04-20 Thread Chris Charley
A correction to the code for 1 line below :-( Chris Hello Brian, I did what you wanted to do on my computer, (Windows XP). The code is pasted below, followed by some explanations. You should be able to get the same results by plugging in abc and xyz where I had html and txt. Also, with source a

Re: Holidays

2005-04-20 Thread Chris Devers
On Wed, 20 Apr 2005, Robert wrote: > I need to populate a Pg database with holidays (US, Federal, > Christian, Islamic, and Jewish). I didn't find anything on CPAN (but > you have to know what to search for). The Islamic and Jewish ones are > a little problematic because they can shift for year

Holidays

2005-04-20 Thread Robert
I need to populate a Pg database with holidays (US, Federal, Christian, Islamic, and Jewish). I didn't find anything on CPAN (but you have to know what to search for). The Islamic and Jewish ones are a little problematic because they can shift for year to year. Do you know of a resource I can l

Re: Need help match feet and inches

2005-04-20 Thread Chris Devers
On Wed, 20 Apr 2005, Keith Worthington wrote: > I had thought that as I progressed the problems should be addressed > seperately. If the problems are isolated, sure, that makes sense. In this case though, you're exploring the evolution of one umbrella issue, so it makes sense to keep things co

Re: Copy and rename files

2005-04-20 Thread Chris Charley
- Original Message - From: "Brian Milbrandt" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Tuesday, April 19, 2005 6:22 PM Subject: Copy and rename files I am trying to convert a unix script to perl. The script takes 2 command line arguments, source and target. I am unable

Re: Need help match feet and inches

2005-04-20 Thread Keith Worthington
On Wed, 20 Apr 2005 15:34:37 -0400, Paul Kraus wrote > Hello, > Please stop making new threads for the same topic. Reply to the same > thread. Keeps the group organized as well as our inboxes and archive > searches. > If someone else who had a simliar issue and did a google search they > could clic

Re: Need help match feet and inches

2005-04-20 Thread Paul Kraus
Hello, Please stop making new threads for the same topic. Reply to the same thread. Keeps the group organized as well as our inboxes and archive searches. If someone else who had a simliar issue and did a google search they could click one link and see all of your efforts. By splitting them up it o

copy and change extension

2005-04-20 Thread Brian Milbrandt
I am trying to get a script to copy and change the extension for files with a non-zero file size. I have tried everything I can think of but I can't seem to get the copy files part right. All I get is the output 0 files copied. Here is the code if anyone can help. The print function in the

Need help match feet and inches

2005-04-20 Thread Keith Worthington
Hi All, Here is my code so far. I am really getting frustrated with my inability to get this right. I didn't understand Chris' earlier suggestion about using defined but I tried using it anyway. I cannot seem to get the pattern match to properly handle a dimension that is just feet or just inch

Re: More help with split

2005-04-20 Thread Jay Savage
On 4/20/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > Hi All, > > I continue to work on my first perl program. :-) I am stuck again and could > use your guidance. > > Here is the code snippet that I am working on right now. The problem that I > have is that when processing a size like 30"

Re: default value from match

2005-04-20 Thread Chris Devers
On Wed, 20 Apr 2005, Keith Worthington wrote: > Having written the following code I am now troubled by v_feet_str or > v_inch_str being undefined. If there is no match can I return a > default value? In my case if there is no dimension then I want to > move ahead using a zero in that position

default value from match

2005-04-20 Thread Keith Worthington
Hi All, I am still slugging it out. Many thanks to those that have helped me thus far. :-) Having written the following code I am now troubled by v_feet_str or v_inch_str being undefined. If there is no match can I return a default value? In my case if there is no dimension then I want to move

PDF::API2

2005-04-20 Thread Peter Rabbitson
Hi everyone, Today I am stuck with PDF::API2. Although seeming very powerful, the module documentation is horridly lacking. I was able to figure a great deal of what I need by directly examining the source, however some issues are left unsolved: 1. Is there a way to get the (x,y) pos and maybe mor

RE: Find a specific record based on time

2005-04-20 Thread christopher . l . hood
Well here is what I have so far to get the previous day, the current day, next day, and this works fine but could return 25 results, I am not even sure how to go about getting only the one that the offense falls within. The database entries have a date/time that the user stopped having that IP. Th

Re: Recommendations of module to use on tab-delimited file?

2005-04-20 Thread Chris Devers
On Wed, 20 Apr 2005, KEVIN ZEMBOWER wrote: > I'm inclined to use Text::xSV because of it's recent update. I've used > Text::CSV_XS successfully before, but it hasn't been revised lately > (maybe it doesn't need to be revised?) and it seems more complex than > the others, requiring the use of IO

More help with split

2005-04-20 Thread Keith Worthington
Hi All, I continue to work on my first perl program. :-) I am stuck again and could use your guidance. Here is the code snippet that I am working on right now. The problem that I have is that when processing a size like 30" x 150'6" it sees the first dimension as a number of feet. How can I ge

Recommendations of module to use on tab-delimited file?

2005-04-20 Thread KEVIN ZEMBOWER
I have to process a tab-delimited file, similar to a comma-delimited file (.csv). I found these modules which would seem to work: Text::Delimited at http://search.cpan.org/~bennie/Text-Delimited-1.93/lib/Text/Delimited.pm (Jul 2004) Text::TabFile at http://search.cpan.org/~bennie/Text-TabFile-1

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread Offer Kaye
On 4/20/05, Paul Kraus wrote: > Why does this work > my $date = 'one | two |three |'; > my @record = map ( whitespace($_), (split /\|/,$_) ); No, it won't work - you need to replace the $_ at the end with $date > sub whitespace { > my $string = shift; > $string =~ s/^\s+|\s+$//g

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread Paul Kraus
> but this does not > my @record = map ( $_=~ s/^\s+|\s+$//g,(split /\|/,$_) ); Ok i get it. I just need to have it based on a block. Not sure why both will not work though. my @record = map {$_=~s/^\s+|\s+$//g}(split/\|/,$_); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: GetOpt::Long

2005-04-20 Thread Offer Kaye
On 4/20/05, Olivier, Wim W wrote: > Hi all, > > Is it possible to use GetOpt::Long (or something similar) in a subroutine Getargs::Long - http://search.cpan.org/dist/Getargs-Long/ HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

WhiteSpace - Map, search replace, split

2005-04-20 Thread Paul Kraus
Why does this work my $date = 'one | two |three |'; my @record = map ( whitespace($_), (split /\|/,$_) ); sub whitespace { my $string = shift; $string =~ s/^\s+|\s+$//g; return $string; } but this does not my @record = map ( $_=~ s/^\s+|\s+$//g,(split /\|/,$_) ); Paul --

Re: mkdir? system? split?

2005-04-20 Thread JupiterHost.Net
Bliss, Thomas W wrote: I looks interesting. Thanks. np, please don't top post and always reply to the list and not an individual :) The learning curve is hell in this language because there is 300 ways to do anything. actually that makes it easier to use as you will likley see later :) -- To un

RE: GetOpt::Long

2005-04-20 Thread Bob Showalter
Olivier, Wim W wrote: > Hi all, > > Is it possible to use GetOpt::Long (or something similar) in a > subroutine > using @_ instead of in the standard way (using @ARGV)? This should work: sub foo { local @ARGV = @_; GetOptions(...blah...); ... } -- To unsubscribe, e-

Re: regex lying to me

2005-04-20 Thread John W. Krahn
angie ahl wrote: On 4/19/05, angie ahl wrote: The following regex is failing strangely: my @tables = $content =~ m#\[table\](.*?)\[/table\]#g; foreach (@tables) { my $table = $_; if ($content =~ m#$table#) {print "yes old table is there!\n";} } @t

Re: regex lying to me

2005-04-20 Thread angie ahl
Thanks I know that there are metachars in the result. non printing chars that I need to leave there until a later part of the processing. I don't get why this would affect the result though. Cheers Angie > On 4/19/05, angie ahl wrote: > > The following regex is failing strangely: > > > >

Re: capture a carriage return from

2005-04-20 Thread John W. Krahn
D. J. Birkett wrote: I have a script that pauses while the reader reads the intro text, and askes them to press return to continue. At the moment I capture the input from STDIN into a variable called $waste, do nothing with it, and continue anyway. The script complains when it runs... Name "m

RE: capture a carriage return from

2005-04-20 Thread Moon, John
Subject: capture a carriage return from I have a script that pauses while the reader reads the intro text, and askes them to press return to continue. At the moment I capture the input from STDIN into a variable called $waste, do nothing with it, and continue anyway. The script complains whe

capture a carriage return from

2005-04-20 Thread D. J. Birkett
I have a script that pauses while the reader reads the intro text, and askes them to press return to continue. At the moment I capture the input from STDIN into a variable called $waste, do nothing with it, and continue anyway. The script complains when it runs... Name "main::waste" used only

Re: Need RE. New to Perl

2005-04-20 Thread John W. Krahn
Keith Worthington wrote: Hi All, Hello, I am new to the list and need some quick help. I have been kicking around with vi and sed for years but never took the time to learn Perl. Now I need to use Perl and could really use a jumpstart. I am writing a function in the Postgresql database using Perl

Re: Capatalisation Question

2005-04-20 Thread John W. Krahn
N. Ganesh Babu wrote: Dear All Hello, I want to do capitalisation of this text. I am using the following code. It works fine with all other lines. $line="Level A (Grade 1 reading level)"; @words=split(/ /,$line); for($i=0;$i<=$#words;$i++) { $words[$i]=~s!($words[$i])!\u\L$1!gi; pr

Re: How to create arrays of arrays?

2005-04-20 Thread John Doe
Hi Siegfried Am Dienstag, 19. April 2005 23.21 schrieb Siegfried Heintze: > Hey Perlers! > > This code used to work and then I changed something _What_ did you change? If you don't k know: Use some version control system, so you can reconstruct all changes. > and it no longer works! > The pr

RE: GetOpt::Long

2005-04-20 Thread Tim Johnson
How about something like this? It doesn't make it like GetOpt::Long, but it does handle what you want. Or you could just require that people pass an array to your subroutine and save yourself a little work. If there is only one recipient, then it's a one-element array. ###

GetOpt::Long

2005-04-20 Thread Olivier, Wim W
Hi all, Is it possible to use GetOpt::Long (or something similar) in a subroutine using @_ instead of in the standard way (using @ARGV)? I want to have the following scenario, but use GetOpt in a subrouting within the main script and pass options (and values) to the subroutine. The values ($recipi

Re: Having Module::Pluggable find plugins at runtime

2005-04-20 Thread Robin
OK, I now have: package PluginMgr; use strict; use warnings; use Module::Pluggable instantiate => 'new'; our @ISA=("Module::Pluggable"); sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { pluginDir => 'plugins', stateDir => 'pluginst