Class using a class: "new" confusion and strange print behavior

2003-03-19 Thread Rob Richardson
Greetings! I have the following class in a .pm file: use warnings; use strict; package ScheduleDay; use Train; sub new { my $self = {}; # $self is a reference to an anonymous, empty (for now) hash bless $self; return $self; } sub AddTrain { my $self = shift;

Re: Need Help with File Processing

2003-03-19 Thread R. Joseph Newton
"R. Joseph Newton" wrote: Correction: > Huh? Where did this come from? After 20 minutes or so of contemplation, it occured > to me that one of the two fields [0.60] that you split 2.00 into, is equivalent to > the parameter for that field [0.3] time the quantity listed Joseph -- To un

Re: Need Help with File Processing

2003-03-19 Thread R. Joseph Newton
Gufranul Haque wrote: [snip] > I will try to explain the problem I am facing in detail: > > File to be processed (Input File) > > 10111 2.00 2.00 2.00 2.00 > 10111 2.00 2.00 2.00 2.00 > > Restriction First field to remain same. > > Parameter File > 1,0.3,0.5,1 > Each filed in the parameter file co

Re: Need Help with File Processing

2003-03-19 Thread John W. Krahn
[ Please do not top-post. Please remove the quoted text that is not applicable. Please use single-spaced formatting and indent your code properly. ] Gufranul Haque wrote: > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > > If you do need to modify the fields: > > > > use warnings; > > use

Re: substring problems

2003-03-19 Thread tao wang
thanks a lot. - tao --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Tao Wang wrote: > > > > thanks a lot. But there is one problem - this is > my > > fault. The KEY1, KEY2 don't exactly look like > this. > > There are six KEYS. Three are related to KEYS, but > the > > rest of them are A_BEG A

Re: substring problems

2003-03-19 Thread Rob Dixon
Tao Wang wrote: > thanks a lot. But there is one problem - this is my > fault. The KEY1, KEY2 don't exactly look like this. > There are six KEYS. Three are related to KEYS, but the > rest of them are A_BEG A_END, B_OPTIONS, and I need to > extract information between them. I used one variable > $o

Re: substring problems

2003-03-19 Thread tao wang
no special order. thanks. - tao --- Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > > > tao wang wrote: > > thanks a lot. But there is one problem - this is > my > > fault. The KEY1, KEY2 don't exactly look like > this. > > There are six KEYS. Three are related to KEYS, but > the > > rest of

Re: substring problems

2003-03-19 Thread Wiggins d'Anconia
tao wang wrote: thanks a lot. But there is one problem - this is my fault. The KEY1, KEY2 don't exactly look like this. There are six KEYS. Three are related to KEYS, but the rest of them are A_BEG A_END, B_OPTIONS, and I need to extract information between them. I used one variable $op=KEY1|

Re: substring problems

2003-03-19 Thread John W. Krahn
Tao Wang wrote: > > thanks a lot. But there is one problem - this is my > fault. The KEY1, KEY2 don't exactly look like this. > There are six KEYS. Three are related to KEYS, but the > rest of them are A_BEG A_END, B_OPTIONS, and I need to > extract information between them. I used one variable >

Re: Need Help with File Processing

2003-03-19 Thread Gufranul Haque
John, Thanks for the mail. Yes you are right, I need to modify the contents of the file. But need some clarification with some of the statements you have used my @data = map [ /(\S+)(\s*)/ ], /\S+\s*/g; - what exactly is happening over here? $_->[0] += 5 for @data; ? and my $lead = $1 if /^

Re: substring problems

2003-03-19 Thread tao wang
thanks a lot. But there is one problem - this is my fault. The KEY1, KEY2 don't exactly look like this. There are six KEYS. Three are related to KEYS, but the rest of them are A_BEG A_END, B_OPTIONS, and I need to extract information between them. I used one variable $op=KEY1|KEY2|KEY3|A_BEG|A_

Re: Fork ?

2003-03-19 Thread david
Jeroen Lodewijks wrote: > > Basically, I want to spawn a process which does something (call a > subroutine) > The main process should just continue pumping data which is spawned up to > 10 processes. > Else it should wait until 1 of the 10 processes finishes. > > Any code examples out there?? >

Re: pb of listing and renaming files

2003-03-19 Thread John W. Krahn
"Scott R. Godin" wrote: > > Rob Dixon wrote: > > > Hi Scott. > > > > Scott R. Godin wrote: > >> John W. Krahn wrote: > >> > >> > chomp; > >> > if ( /(.*)\.BMP/ ) { > >> > print "processing image $_ ..\n"; > >> > system( 'mv', $_, "$1.bmp" ) == 0 or die "system 'mv $_' > >>

Re: press any key

2003-03-19 Thread John W. Krahn
James Kipp wrote: > > > > Quite a simple request, but I've had trouble finding an answer. > > > > > > I'd like my program to wait until the user presses any key, and then > > > just continue. Is there an easy way to do this? A way without > > > modules? > > > > This will do the trick: > > > >

Re: PERL OSX --- reading a local text file

2003-03-19 Thread John W. Krahn
David Gilden wrote: > > Thanks for all of the help, > > Here is what I am currently going with: > > my $prices = '../paul_s/data/prices.txt'; > > open (FH,$prices) || die "could not open $prices $!"; > > while( ) { > s/^\s*(.+)\s*$/$1/; # clean the front of each line > next if /^\s*$/;

Help installing XML::Parser 2.31

2003-03-19 Thread Brad Fike
Hello, I'm trying to install XML::Parser on my workstation. Win 2000 Perl 5 (revision 5 version 6 subversion 1) After "perl makefile.pl" I run "nmake" and get this error... --- Microsoft (R) Program Maintenance Utility Version 6

Re: Fork ?

2003-03-19 Thread Mark G
Ok I wrote you a quick example jeroe. I only had time to test it on a Xp box, this should work on *nix as well since most of my coding is on *nix. What you are looking for is a set of exec and waitpid call's to do the trick for you. Basicly this is how its usually don with forking. a: parents fork

RE: Fork ?

2003-03-19 Thread Kipp, James
> > It doesn't do what I want at all. It spawns way too many processes. > (and I get errors in win 2000). > > Basically, I want to spawn a process which does something (call a > subroutine) > The main process should just continue pumping data which is > spawned up to 10 > processes. > Else it sh

Re: Fork ?

2003-03-19 Thread Paul Johnson
On Wed, Mar 19, 2003 at 08:03:09PM -, Jeroen Lodewijks wrote: > And there is my problem. I tried fork() but it doesn't do what I want > or I got it wrong. (maybe it's not the appropriate thing to use > anyway) > It doesn't do what I want at all. It spawns way too many processes. > (and I get

Fork ?

2003-03-19 Thread Jeroen Lodewijks
Hi all, Not sure if this appropriate for the beginners list but there is no intermediate list :) I am writing a program in Perl to 'move' output from one process. The program looks in a database which contains lists of files. These files are either FTP'ed to mailed to recipients. I actually ma

Re: Urgent: How do I find real file instead of link

2003-03-19 Thread Brett W. McCoy
On Wed, 19 Mar 2003, Ohad Ohad wrote: > I have a link and want the real file that it is pointing to. > > This means also if I have a linked list of links I want to get the real file > at the end. That's a bit tricky, but it can be done. You'll need to use the stat builtin to get at the file info

Thanks!!! Re: Urgent: How do I find real file instead of link

2003-03-19 Thread Ohad Ohad
From: david <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Urgent: How do I find real file instead of link Date: Wed, 19 Mar 2003 10:08:01 -0800 Ohad Ohad wrote: > I have a link and want the real file that it is pointing to. > > This means also if I have a lin

RE: UNIX file system free space, used space, total space

2003-03-19 Thread Tony Esposito
Good suggestion.now I just need to get Filesys.pm installed on my system. Thanks! -Original Message- From: david [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 11:52 AM To: [EMAIL PROTECTED] Subject: Re: UNIX file system free space, used space, total space Tony Esposito wr

Re: Urgent: How do I find real file instead of link

2003-03-19 Thread david
Ohad Ohad wrote: > I have a link and want the real file that it is pointing to. > > This means also if I have a linked list of links I want to get the real > file at the end. > try readlink and -l: #!/usr/bin/perl -w use strict; for(qw(file1 file2 file3)){ print "$_ -> ",readlink,"\n"

Re: Urgent: How do I find real file instead of link

2003-03-19 Thread Ohad Ohad
Thought it was obvious, but I guess not . . . What I want is : I have a symbolic link (to file - Unix), and I want to get the real file it is pointing to. 10x From: "Ohad Ohad" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Urgent: How do I find real file instead of link Date: Wed, 19 Mar

RE: Urgent: How do I find real file instead of link

2003-03-19 Thread NYIMI Jose (BMB)
> Maybe it's just me but I have no idea what any of that means. Not just you, me too :) José. > Could you be a little more specific/detailed. Any examples? > > Are you talking about html links or *nix soft and hard links? > > What are you trying to use Perl to do? DISCLAIMER "T

Re: press any key

2003-03-19 Thread Nigel Wetters
On Wednesday 19 March 2003 10:24, Nick Drage wrote: > Quite a simple request, but I've had trouble finding an answer. Not a simple request, I'm afraid. Niether using getc, nor reading will work unless the user presses 'enter'. > I'd like my program to wait until the user presses any key, and th

Re: How to use IO::Socket

2003-03-19 Thread Robert Rendler
On Wed, 19 Mar 2003 09:01:28 -0500 Bob Showalter <[EMAIL PROTECTED]> wrote: > > That can't work. You need a port at least. Where are you checking for failed > connection? Do you have "use strict" and -w in your program. > That was just a VERY basic example of creating $client and yes I do use s

RE: Urgent: How do I find real file instead of link

2003-03-19 Thread Dan Muey
> I have a link and want the real file that it is pointing to. > > This means also if I have a linked list of links I want to > get the real file > at the end. > Maybe it's just me but I have no idea what any of that means. Could you be a little more specific/detailed. Any examples? Are you

Re: UNIX file system free space, used space, total space

2003-03-19 Thread david
Tony Esposito wrote: > Anyone have an idea about getting UNIX file system free space, used space, > total space numbers without having to resort to something like the > following ( which gets the percent of used space for a command-line > supplied file system name stored in the variable ${file_sys

RE: hide password on sign-in

2003-03-19 Thread Dan Muey
> > How do I perform subject above? [EMAIL PROTECTED] > Put your hand over the screen. ;p A little more detail may help. Hide it in what way from who when signing into what? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Urgent: How do I find real file instead of link

2003-03-19 Thread Ohad Ohad
I have a link and want the real file that it is pointing to. This means also if I have a linked list of links I want to get the real file at the end. 10x _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.

Re: PERL OSX --- reading a local text file

2003-03-19 Thread Randal L. Schwartz
> "Scott" == Scott R Godin <[EMAIL PROTECTED]> writes: >> my %hash = map {/\w+/g} >> >> :-) Scott> grin away. This shortcut deserves to be in the perldocs Scott> somewhere. I wish I'd seen this before. The problem is that it is very intolerant of mis-formatted data. If I had a line that h

defining constant values

2003-03-19 Thread Ruben Montes
hello, can I define constants in perl like in C? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Saving STDERR into a variable

2003-03-19 Thread zentara
On 18 Mar 2003 23:48:25 -, [EMAIL PROTECTED] (Steve Grazzini) wrote: >James Kipp <[EMAIL PROTECTED]> wrote: >> Navid M. <[EMAIL PROTECTED]> writes: >>> >>> I was wondering if it's possible to save the error of >>> a DOS command from the error stream into a variable. >>> >> you could try the

Re:cr/lf in perl

2003-03-19 Thread JGONCALV
Hi, i have this: #perl use strict; use warnings; while ( ) { chomp; my @data = map { s/^\s+//; s/\s+$//; $_ } split /;/; reformat ( @data ); } sub reformat { format = PROBTRAC: Continuous Problem Tracking System Submittal Form !crstatus = @

RE: javascript and perl dbi

2003-03-19 Thread Dan Muey
> Hi, > > I have a web page where I've used Java Script to set up some > relational You mean wher if they choose something from menu 1 ,then menu 2 changes accordingly, right? However javascript script is client side so it doesn't matter to the scripts as long as the Data is submitted proper

RE: networking with perl

2003-03-19 Thread Dan Muey
> Hi All, > Howdy > As a naive perl programmer, I want to get rid of a > problem, for that, I am keen, awaiting your > suggestions. I doubt, I could not present my case in > front of you properly. Anyway, my problem spins around > the following. > > The module I am working with, need some netw

RE: Saving STDERR into a variable

2003-03-19 Thread Kipp, James
> >> > >> I was wondering if it's possible to save the error of > >> a DOS command from the error stream into a variable. > >> > > you could try the old 2>&1 trick > > $out = `$cmd 2>&1`; > > as others have mentioned, the above may depend on your which win32 OS you are using. works fine on my

RE: press any key

2003-03-19 Thread Kipp, James
> > Quite a simple request, but I've had trouble finding an answer. > > > > I'd like my program to wait until the user presses any key, and then > > just continue. Is there an easy way to do this? A way without > > modules? > > Hi Nick. > > This will do the trick: > > while (1) { >

RE: How to use IO::Socket

2003-03-19 Thread Bob Showalter
Robert Rendler wrote: > Over the long haul I've made a couple of programs that use sockets > but still I don't understand to very basics of it yet. That is how to > properly send and receive the data. So far what I have been doing is > thus: > > $client = IO::Socket::INET->new('server'); That ca

How to use IO::Socket

2003-03-19 Thread Robert Rendler
Over the long haul I've made a couple of programs that use sockets but still I don't understand to very basics of it yet. That is how to properly send and receive the data. So far what I have been doing is thus: $client = IO::Socket::INET->new('server'); while (<$client>) { chomp; next un

Re: press any key

2003-03-19 Thread Rob Dixon
Nick Drage wrote: > Hi, > > Quite a simple request, but I've had trouble finding an answer. > > I'd like my program to wait until the user presses any key, and then > just continue. Is there an easy way to do this? A way without > modules? Hi Nick. This will do the trick: while (1) {

Re: PERL OSX --- reading a local text file

2003-03-19 Thread Rob Dixon
Scott R. Godin wrote: > John W. Krahn wrote: > > > > Yes, there is. :-) > > > > my %hash = do { local $/; =~ /[^\n,]+/g }; > > Holy Handgrenades, Batman! > > but where's the implicit split of key and value there? forgive me for > asking, but I just don't see it. is there some magic going on here?

Re: PERL OSX --- reading a local text file

2003-03-19 Thread Sudarshan Raghavan
On Tue, 18 Mar 2003, Scott R. Godin wrote: > John W. Krahn wrote: > > > David Gilden wrote: > >> > >> OK, one problem is solved, which was the path to the data file. > >> I know there is a simple way to read in a file like the following: > >> > >> apple,2 > >> banana,4 > >> kiwi,1 > >> > >> an

Re: PERL OSX --- reading a local text file

2003-03-19 Thread Scott R. Godin
Rob Dixon wrote: > John W. Krahn wrote: >> David Gilden wrote: >> > >> > OK, one problem is solved, which was the path to the data file. >> > I know there is a simple way to read in a file like the following: >> > >> > apple,2 >> > banana,4 >> > kiwi,1 >> > >> > and produce a HASH. The code below

Re: pb of listing and renaming files

2003-03-19 Thread Scott R. Godin
Rob Dixon wrote: > Hi Scott. > > Scott R. Godin wrote: >> John W. Krahn wrote: >> >> > chomp; >> > if ( /(.*)\.BMP/ ) { >> > print "processing image $_ ..\n"; >> > system( 'mv', $_, "$1.bmp" ) == 0 or die "system 'mv $_' >> > failed: $?"; >> > } >> >> next unless /

press any key

2003-03-19 Thread Nick Drage
Hi, Quite a simple request, but I've had trouble finding an answer. I'd like my program to wait until the user presses any key, and then just continue. Is there an easy way to do this? A way without modules? -- FunkyJesus System Administration Team -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: Saving STDERR into a variable

2003-03-19 Thread Steve Grazzini
James Kipp <[EMAIL PROTECTED]> wrote: > Navid M. <[EMAIL PROTECTED]> writes: >> >> I was wondering if it's possible to save the error of >> a DOS command from the error stream into a variable. >> > you could try the old 2>&1 trick > $out = `$cmd 2>&1`; > > or use system() and read the docs for

Re: PERL OSX --- reading a local text file

2003-03-19 Thread Scott R. Godin
John W. Krahn wrote: > David Gilden wrote: >> >> OK, one problem is solved, which was the path to the data file. >> I know there is a simple way to read in a file like the following: >> >> apple,2 >> banana,4 >> kiwi,1 >> >> and produce a HASH. The code below works I get the feeling there is a