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;
"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
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
[ 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
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
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
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
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|
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
>
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 /^
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_
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??
>
"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 $_'
> >>
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:
> >
> >
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*$/;
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
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
>
> 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
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
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
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
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
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
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"
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
> 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
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
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
> 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
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
>
> 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]
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.
> "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
hello, can I define constants in perl like in C?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
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
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 = @
> 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
> 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
> >>
> >> 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
> > 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) {
>
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
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
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) {
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?
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
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
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 /
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
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
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
50 matches
Mail list logo