Re: Having Module::Pluggable find plugins at runtime

2005-04-19 Thread Robin
On Wednesday 20 April 2005 04:24, Jay Savage wrote: > What does your current code look like, and what errors is it > returning.   Well, it's not returning any errors because I can't get it to the point where it can run, because I'm not sure how to go about this. Some of what I currently have look

Re: back to orininal question

2005-04-19 Thread Randal L. Schwartz
> "Charles" == Charles K Clarkson <[EMAIL PROTECTED]> writes: Charles> One problem I think you are having is defining what 'shift' does. Charles> 'shift' is short for 'shift @_'. Or 'shift @ARGV', outside of a subroutine. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1

Re: Programming exercises

2005-04-19 Thread Randal L. Schwartz
> "Stephen" == Stephen Day <[EMAIL PROTECTED]> writes: >> Yes. Funny enough they are in a book called "Learning Perl". : ) Stephen> I have that book and am going though them rather fast. Then read the sequel, "Learning Perl Objects, References and Modules". Otherwise known as the Alpaca boo

Re: Programming exercises

2005-04-19 Thread Gerard Robin
On Mon, Apr 18, 2005 at 06:47:44PM +0100 Stephen Day wrote: > > Hello, > > Does anyone know of a website that lists some programming exercises to help in > learning perl? > > I find it a lot easier to learning a language if I have exercises to apply it > to. I don't know if I reply exactly to

Re: Copy and rename files

2005-04-19 Thread Brian Milbrandt
The output is a filecount of zero and no files were copied. Brian - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]>; "Brian Milbrandt" <[EMAIL PROTECTED]>; S

RE: How to create arrays of arrays?

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Siegfried Heintze wrote: > See comments in line: > >>> sub concat { >>> # All arguments are assumed to be strings or nested arrays of >>> strings. # Concatenate all elements of all arguments. >>> return join "", map ref eq "ARRAY" ? concat( @$_ ) : $_, @_ } >>> >>> my @sResult = (); >>> pus

RE: Copy and rename files

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Wagner, David --- Senior Programmer Analyst --- WGO wrote: > Brian Milbrandt wrote: >> I am trying to convert a unix script to perl. The script takes 2 >> command line arguments, source and target. I am unable to get the >> file copy and rename function working properly. Here is what I have >> t

RE: How to create arrays of arrays?

2005-04-19 Thread Siegfried Heintze
See comments in line: >> sub concat { >> # All arguments are assumed to be strings or nested arrays of >> strings. # Concatenate all elements of all arguments. >> return join "", map ref eq "ARRAY" ? concat( @$_ ) : $_, @_ } >> >> my @sResult = (); >> push @sResult, "string 1"; >> push @sR

RE: Copy and rename files

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Brian Milbrandt wrote: > I am trying to convert a unix script to perl. The script takes 2 > command line arguments, source and target. I am unable to get the > file copy and rename function working properly. Here is what I have > that is not working properly. > > $target is the target direct

Copy and rename files

2005-04-19 Thread Brian Milbrandt
I am trying to convert a unix script to perl. The script takes 2 command line arguments, source and target. I am unable to get the file copy and rename function working properly. Here is what I have that is not working properly. $target is the target directory variable $source is the source d

RE: How to create arrays of arrays?

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Siegfried Heintze wrote: > Hey Perlers! > > This code used to work and then I changed something and it no longer > works! The problem is the output no longer includes "string 2a" and > "string 2b". What am I doing wrong? > > How do explicitly assign an array (not an array reference, but an > arra

How to create arrays of arrays?

2005-04-19 Thread Siegfried Heintze
Hey Perlers! This code used to work and then I changed something and it no longer works! The problem is the output no longer includes "string 2a" and "string 2b". What am I doing wrong? How do explicitly assign an array (not an array reference, but an array) to an array cell? Thanks, Sieg sub

Re: regex lying to me

2005-04-19 Thread Offer Kaye
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";} >

Re: Reading last 10 lines in file on Win32 Systems

2005-04-19 Thread Offer Kaye
On 4/19/05, Dave Adams wrote: > I have a 2 gig log file and I need to read only the last 10 lines. > > I was also thinking something like: > > 1. Read in File > 2. Get number of lines > 3. Print last ten lines > > or something like that. > On a 2gig file, that is very inefficient. Much better

Re: sub declarations

2005-04-19 Thread Offer Kaye
On 4/19/05, M. Kristall wrote: > > If that doesn't help, definitely use perldoc.com :-) (if it's up). > See: http://perldoc.perl.org/ Instead. It not only has a search box, it is even up :-) You can also use Google to search it and ignore PDF files .Just type in the google search box the followi

Re: What is the best way to release memory from data structure?

2005-04-19 Thread Offer Kaye
On 4/19/05, Ley, Chung wrote: > Hi, > > I have a complex data structure using hash of hash of hash that I need to > hold one unit of > data that I need to process. After finishing processing this unit, I need to > go to the 2nd > unit; each unit will be approx. 10Meg of data. > > What is the

Re: mkdir? system? split?

2005-04-19 Thread Offer Kaye
On 4/19/05, JupiterHost.Net wrote: > > I'm not sure all those steps below are necessary. Have you looked at > File::Copy::Recursive > ? > > http://search.cpan.org/~dmuey/File-Copy-Recursive-0.06/Recursive.pm > There's also the "mkpath" function from File::Path, that can be used to create a di

RE: regex lying to me

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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";} > } > > @tables contains

regex lying to me

2005-04-19 Thread angie ahl
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";} } @tables contains 2 items (correctly) but s

MIME::Lite Net::SMTP_auth

2005-04-19 Thread Paul Kraus
How can i create a message with mime::lite but send it with net::smpt_auth? My attempt below... use strict; use warnings; use MIME::Lite; use Net::SMTP_auth; my $msg = MIME::Lite -> new ( From => '[EMAIL PROTECTED]', TO => '[EMAIL PROTECTED]',

RE: Reading last 10 lines in file on Win32 Systems

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dave Adams wrote: > I have a 2 gig log file and I need to read only the last 10 lines. > > I was also thinking something like: > > 1. Read in File > 2. Get number of lines > 3. Print last ten lines > > or something like that. > > DA > You may want to think this out in that you want to

Re: Reading last 10 lines in file on Win32 Systems

2005-04-19 Thread Dave Adams
I have a 2 gig log file and I need to read only the last 10 lines. I was also thinking something like: 1. Read in File 2. Get number of lines 3. Print last ten lines or something like that. DA On 4/19/05, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > Dave Ada

Re: sub declarations

2005-04-19 Thread M. Kristall
Manish Sapariya wrote: Thanks fxn, This certainly should help. List, Is there a search tool which can give me perldoc pages given a string. --- perldoc-q Search the text of questions (not answers) in perlfaq[1-9] --- does not seems to be powerful enough. Thanks and Regards, Manish On 04/08/2

Re: Help with split Was Need RE. New to Perl

2005-04-19 Thread Keith Worthington
On Tue, 19 Apr 2005 13:19:31 -0400, Jay Savage wrote > On 4/19/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > > On Tue, 19 Apr 2005 10:23:00 -0400, Jay Savage wrote > > > On 4/19/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > > > > > Many thanks to Jay for his examples

What is the best way to release memory from data structure?

2005-04-19 Thread Ley, Chung
Hi, I have a complex data structure using hash of hash of hash that I need to hold one unit of data that I need to process. After finishing processing this unit, I need to go to the 2nd unit; each unit will be approx. 10Meg of data. What is the "quick" and "efficient" way for me to release the

Re: Help with split Was Need RE. New to Perl

2005-04-19 Thread Jay Savage
On 4/19/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > On Tue, 19 Apr 2005 10:23:00 -0400, Jay Savage wrote > > On 4/19/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > > > Hi All, > > > > > > Many thanks to Jay for his examples I have now written a perl script > > > that is munging a text fi

Re: mkdir? system? split?

2005-04-19 Thread JupiterHost.Net
Bliss, Thomas W wrote: Hello all, I am new to this list and appreciate all of your help. I am trying to write a Windows perl script to move files from Windows volume A to Windows volume B and keep the directory structure. I tried to use mkdir but it will only create one directory deep. I'm not s

RE: Reading last 10 lines in file on Win32 Systems

2005-04-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dave Adams wrote: > I am new to PERL but how would I write a script that would read in a > file and output the last 10 lines? > > I guess it is sort of like the UNIX command of Tail. > > Any ideas, much appreciated. > > DA I did a cpan search and got File::ReadBackwards . What type of

mkdir? system? split?

2005-04-19 Thread Bliss, Thomas W
Hello all, I am new to this list and appreciate all of your help. I am trying to write a Windows perl script to move files from Windows volume A to Windows volume B and keep the directory structure. I tried to use mkdir but it will only create one directory deep. I am reading a file that contai

Reading last 10 lines in file on Win32 Systems

2005-04-19 Thread Dave Adams
I am new to PERL but how would I write a script that would read in a file and output the last 10 lines? I guess it is sort of like the UNIX command of Tail. Any ideas, much appreciated. DA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help with split Was Need RE. New to Perl

2005-04-19 Thread Keith Worthington
On Tue, 19 Apr 2005 10:23:00 -0400, Jay Savage wrote > On 4/19/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > Many thanks to Jay for his examples I have now written a perl script > > that is munging a text file. Eventually I will move the perl code > > into a function inside

Re: Having Module::Pluggable find plugins at runtime

2005-04-19 Thread Jay Savage
On 4/19/05, Robin <[EMAIL PROTECTED]> wrote: > Hi, I'm using Module::Pluggable to give a program plugin support. > Basically, I'll have a directory full of .pm files and I want them to be > loaded and instantiated. That's all well and good, however all the > examples at > http://search.cpan.org/dis

Re: Find a specific record based on time

2005-04-19 Thread Jay Savage
On 4/19/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Ok, basically I have a list of start times, stop times, usernames, and > ip's in a database, I currently have code in place that will take in a > date and ip address and return a list of people that had that IP address, > with the time that

Find a specific record based on time

2005-04-19 Thread christopher . l . hood
Ok, basically I have a list of start times, stop times, usernames, and ip's in a database, I currently have code in place that will take in a date and ip address and return a list of people that had that IP address, with the time that they acquired the ip and the time that they released the ip. Wh

Re: Match a pattern

2005-04-19 Thread José J. Cintrón
An example of what your session.in file and output will look like might help! lio lop wrote: Thanks for the answer , the problem is how to get the first word into some kind of variable . Suppose i call the programn with >_perl my_prog.pl session1.in > OUT.out I have to get the FIRST word of the

RE: Match a pattern

2005-04-19 Thread lio lop
Thanks for the answer , the problem is how to get the first word into some kind of variable . Suppose i call the programn with >_perl my_prog.pl session1.in > OUT.out I have to get the FIRST word of the session1.in then check if there is another one in the text, then print the text between that wo

Re: Help with split Was Need RE. New to Perl

2005-04-19 Thread Jay Savage
On 4/19/05, Keith Worthington <[EMAIL PROTECTED]> wrote: > Hi All, > > Many thanks to Jay for his examples I have now written a perl script that is > munging a text file. Eventually I will move the perl code into a function > inside a postgresql database. > > I am processing inputs like the foll

Re: Programming exercises

2005-04-19 Thread Jay Savage
On 4/18/05, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: > Stephen Day wrote: > > : I have that book and am going though them rather fast. > : > : I was hoping for a link to a website that has a few more. > > Go to perlmonks.com. Try to answer any question in the

Re: Programming exercises

2005-04-19 Thread Peter Scott
On Mon, 18 Apr 2005 21:41:46 +0100, Stephen Day wrote: > On Monday 18 April 2005 7:39 pm, Robert wrote: >> "Stephen Day" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > Does anyone know of a website that lists some programming exercises to >> > help in >> > learning perl? >> > >

Help with split Was Need RE. New to Perl

2005-04-19 Thread Keith Worthington
Hi All, Many thanks to Jay for his examples I have now written a perl script that is munging a text file. Eventually I will move the perl code into a function inside a postgresql database. I am processing inputs like the following: 815 HTPP Black 2in sq Border: RMFP025BK Size: 7'10" x 16' Tag:

RE: Match a pattern

2005-04-19 Thread Manav Mathur
|-Original Message- |From: lio lop [mailto:[EMAIL PROTECTED] |Sent: Tuesday, April 19, 2005 5:44 PM |To: beginners@perl.org |Subject: Match a pattern | | |I need to print the text between two words | that are in different |lines. | Assuming you want to get all

Re: Match a pattern

2005-04-19 Thread Peter Rabbitson
On Tue, Apr 19, 2005 at 03:32:22PM +0300, Offer Kaye wrote: > On 4/19/05, lio lop wrote: > > I need to print the text between two words > > that are in different > > lines. > > > If you have: This is a nasty, multilined chunk of text and you want to get everything

Re: Match a pattern

2005-04-19 Thread Offer Kaye
On 4/19/05, lio lop wrote: > I need to print the text between two words > that are in different > lines. > print "\n"; -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Multiple programs output to separate log files + to STDOUT

2005-04-19 Thread Offer Kaye
On 4/19/05, Ambikesh Chaurasia wrote: > Hi All, > > I am calling many "C" programs from my perl script. I want to log > output of each of these "C" programs in DIFFERENT log files as well as > I want to display this output to STDOUT. > > Please send me your sugesstion how to do this. > > Please

Match a pattern

2005-04-19 Thread lio lop
I need to print the text between two words that are in different lines. _ Do You

Having Module::Pluggable find plugins at runtime

2005-04-19 Thread Robin
Hi, I'm using Module::Pluggable to give a program plugin support. Basically, I'll have a directory full of .pm files and I want them to be loaded and instantiated. That's all well and good, however all the examples at http://search.cpan.org/dist/Module-Pluggable/lib/Module/Pluggable.pm seem to

Re: pushing to an array reference

2005-04-19 Thread Robin
On Tuesday 19 April 2005 22:43, Octavian Rasnita wrote: > push($hash{var1}, 'new_element'); > > But it gives an error telling that the first parameter of the push > function must be an array and not a hash element. I use: push @{$hash{var1}}, 'new_element'; which dereferences the hash element and t

pushing to an array reference

2005-04-19 Thread Octavian Rasnita
Hi, I have a perl hash that contains arrays, something like: my %hash = ( 'var1' => ['one', 'two', 'three'], 'var2' => ['1', '2', '3'], #... ); I would like to push new elements to the array references from this hash. Is this possible? I have tried something like: push($hash{var1}, 'new_elemen

perl for nokia/symbian

2005-04-19 Thread Ing. Branislav Gerzo
Hello all, I have nokia 6600 (series 60,symbian) and I found there is port to it. just look at: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-04/msg00439.html kinda cool :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: RE : Capturing the integer return value of a "C" program, called inside perl script

2005-04-19 Thread M. Kristall
Jose Nyimi wrote: -Message d'origine- De : Ambikesh Chaurasia [mailto:[EMAIL PROTECTED] Envoyé : dimanche 10 avril 2005 18:30 À : perl Objet : Capturing the integer return value of a "C" program, called inside perl script Hi Guys, I want to capture the return value of a "C" program call