Re: One line variable declaration with multiple conditions

2004-01-07 Thread R. Joseph Newton
Dan Muey wrote: > BTW - I'm not really using these variable names, only using them here ot help > clarify my goal. Why not? They looked very good to me, at least in the context of the question at hand. One of the best aspects of Perl, IMHO, is that it allows you to just say what you mean. I

Re: One line variable declaration with multiple conditions

2004-01-07 Thread R. Joseph Newton
Dan Muey wrote: > Howdy list. > I'm trying to one lineify this: > > my $guts = $firstchoice || ''; > if(!$guts && $use_second_choice_if_first_is_empty) { > $guts = $secondchoice; > } > > Basically > my $guts = $firstchoice || $secondchoic || ''; > Would be perfect except I only want to let

Re: stop

2004-01-07 Thread R. Joseph Newton
Casey West wrote: > It was Wednesday, January 07, 2004 when Dan Muey took the soap box, saying: > : Please tell me this thread will stay in the archives! It's hilarious! > : > : I feel kinda bad for Mr. Kapp though, but if you're rude for no good > : reason what can you expect. > > Well, around th

Re: utc to local time

2004-01-07 Thread Owen
On Wed, 7 Jan 2004 15:43:05 -0500 "Paul Kraus" <[EMAIL PROTECTED]> wrote: > How can I convert a utc time stamp to a perl standard time stamp for my > timezone? Can you show what *your* UTC timestamp looks like Can you give an example of a perl standard time stamp format -- Owen -- To uns

Re: coping txt files over a peer to peer.

2004-01-07 Thread david
Tino Arellano wrote: > Hello folks, > > How do I send the file name used by the client so that the server uses the > same file name When it is writing it own file. this can't be done without the client and server agree on how to retrive the file name. one reasonable approach is let the client s

RE: coping txt files over a peer to peer.

2004-01-07 Thread Bakken, Luke
> Howdy, > Funny I was just thinking about Sockets today. > I don't use them nitty gritty like this but I would assume > you need to do multiple send/receive/accept in a little > session via your own prtocol. > > Something like: > > Client> hello > Server> howdy > Client> NAME fred.txt > Serve

RE: coping txt files over a peer to peer.

2004-01-07 Thread Dan Muey
> Hello folks, Howdy, Funny I was just thinking about Sockets today. I don't use them nitty gritty like this but I would assume you need to do multiple send/receive/accept in a little session via your own prtocol. Something like: Client> hello Server> howdy Client> NAME fred.txt Server> NAMEIS

RE: One line variable declaration with multiple conditions

2004-01-07 Thread Dan Muey
> > Howdy list. > > I'm trying to one lineify this: > > > > my $guts = $firstchoice || ''; > > if(!$guts && $use_second_choice_if_first_is_empty) { > > $guts = $secondchoice; > > } > > > > Basically > > my $guts = $firstchoice || $secondchoic || ''; > > Would be perfect except I only want t

RE: One line variable declaration with multiple conditions

2004-01-07 Thread Dan Muey
> Dan Muey wrote: > > Howdy list. > > I'm trying to one lineify this: > > > > my $guts = $firstchoice || ''; > > if(!$guts && $use_second_choice_if_first_is_empty) {$guts = > > $secondchoice; } > > > > Basically > > my $guts = $firstchoice || $secondchoic || ''; > > Would be perfect excep

RE: One line variable declaration with multiple conditions

2004-01-07 Thread Dan Muey
> > Howdy list. > > I'm trying to one lineify this: > > > > my $guts = $firstchoice || ''; > > if(!$guts && $use_second_choice_if_first_is_empty) { > > $guts = $secondchoice; > > } > > > > Basically > > my $guts = $firstchoice || $secondchoic || ''; > > Would be perfect except I only want t

RE: One line variable declaration with multiple conditions

2004-01-07 Thread Dan Muey
> > On Jan 7, 2004, at 2:20 PM, Dan Muey wrote: > > > > > Is that possible to do with one line? > > technically no, because you needed > my ($firstchoice, $use_second_choice_if_first_is_empty); > my $secondchoice = 's2'; Sorry, I figured we could assume they were declared earlier so as not to

Re: setPalette doesnt work in win32

2004-01-07 Thread James Osborn
I dug through the archive and found a similar problem posted regarding setPalette under Solaris. So I tried the suggested workaround in that post: 1. Issue the setPalette call right after creating the main window. 2. Use the 'interactive' priority option. So for example: $mainwidget = Tk::Ma

Re: One line variable declaration with multiple conditions

2004-01-07 Thread drieux
On Jan 7, 2004, at 2:20 PM, Dan Muey wrote: Is that possible to do with one line? technically no, because you needed my ($firstchoice, $use_second_choice_if_first_is_empty); my $secondchoice = 's2'; then you can do my $guts = ($use_second_choice_if_first_is_empty)? $secondchoice : $firstchoice |

coping txt files over a peer to peer.

2004-01-07 Thread Tino Arellano
Hello folks, How do I send the file name used by the client so that the server uses the same file name When it is writing it own file. thank you. here's the client: use IO::Socket; my $server = IO::Socket::INET->ne­w( PeerAddr => 'localhost', PeerPort

Re: One line variable declaration with multiple conditions

2004-01-07 Thread Wiggins d Anconia
> Howdy list. > I'm trying to one lineify this: > > my $guts = $firstchoice || ''; > if(!$guts && $use_second_choice_if_first_is_empty) { > $guts = $secondchoice; > } > > Basically > my $guts = $firstchoice || $secondchoic || ''; > Would be perfect except I only want to let it use $se

RE: One line variable declaration with multiple conditions

2004-01-07 Thread Bob Showalter
Dan Muey wrote: > Howdy list. > I'm trying to one lineify this: > > my $guts = $firstchoice || ''; > if(!$guts && $use_second_choice_if_first_is_empty) { $guts = > $secondchoice; } > > Basically > my $guts = $firstchoice || $secondchoic || ''; > Would be perfect except I only want to let it use

One line variable declaration with multiple conditions

2004-01-07 Thread Dan Muey
Howdy list. I'm trying to one lineify this: my $guts = $firstchoice || ''; if(!$guts && $use_second_choice_if_first_is_empty) { $guts = $secondchoice; } Basically my $guts = $firstchoice || $secondchoic || ''; Would be perfect except I only want to let it use $seconchoice if $use_sec

Re: Question about CPAN's Text::Diff

2004-01-07 Thread Rob Dixon
Stuart Clemons wrote: > > This newbie would like to compare two files, let's say File1 and File2. I > want to put the difference from File2 only, into a new file, File3. > > For example: > > File1.txt > oranges > apples > bananas > > File2.txt > apples > kiwi > bananas > > The result I want for

Re: PERL debuggers

2004-01-07 Thread William.Ampeh
No, I love perldebug, I was just wondering if I there were any other "neat tools" unknown to me. __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: PERL debuggers

2004-01-07 Thread Wiggins d Anconia
> I've created a module that I am planning on eventually releasing to CPAN > which provides a good framework for debugging. Basically you can have > your code report 4 types of warnings: > > INFO > WARNING > ERROR > FATAL_ERROR > > You can also assign a "class" to each and turn on or off all

Re: -t and STDIN was Re: What is the source of my input, file or STDIN?

2004-01-07 Thread drieux
On Jan 7, 2004, at 12:42 PM, Steve Grazzini wrote: On Jan 7, 2004, at 2:57 PM, drieux wrote: But simply because there is no controlling terminal does NOT mean that there is nothing on STDIN. Were you reading that code backwards? die usage() if @ARGV == 0 and -t; # if ((THERE ARE NO FILENAMES

Re: PERL debuggers

2004-01-07 Thread Dan Anderson
I'd like to add that it's not a debugger like the one someone else posted for stepping through your code and setting breakpoints. It's designed to allow you to create a log with the state of your script and what has been done, so that way you can have somebody who is not a programmer and who is us

Re: PERL debuggers

2004-01-07 Thread Dan Anderson
I've created a module that I am planning on eventually releasing to CPAN which provides a good framework for debugging. Basically you can have your code report 4 types of warnings: INFO WARNING ERROR FATAL_ERROR You can also assign a "class" to each and turn on or off all of one type or all of

RE: PERL debuggers

2004-01-07 Thread Esposito, Anthony
There is Open Perl IDE. Check out http://open-perl-ide.sourceforge.net. Unfortunately, it is for Windows only. HTH :-) Tony Esposito Oracle Developer, Enterprise Business Intelligence XO Communications Plano, TX  75074 Work Phone: 972-516-5344 Work Cell: 972-670-6144 Email: [EMAIL PROTECTED]

Re: stop

2004-01-07 Thread Casey West
It was Wednesday, January 07, 2004 when Dan Muey took the soap box, saying: : Please tell me this thread will stay in the archives! It's hilarious! : : I feel kinda bad for Mr. Kapp though, but if you're rude for no good : reason what can you expect. Well, around these parts we don't *expect* ru

RE: Question about CPAN's Text::Diff

2004-01-07 Thread Paul Kraus
Why not just use the diff command? Man diff Paul Kraus --- PEL Supply Company Network Administrator > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 07, 2004 3:22 PM > To: [EMAIL PROTECTED] > Subject: Question abou

utc to local time

2004-01-07 Thread Paul Kraus
How can I convert a utc time stamp to a perl standard time stamp for my timezone? Paul Kraus --- PEL Supply Company Network Administrator --- 800 321-1264 Toll Free 216 267-5775 Voice 216 267-6176 Fax www.pelsupply.com --- --

Re: -t and STDIN was Re: What is the source of my input, file or STDIN?

2004-01-07 Thread Steve Grazzini
On Jan 7, 2004, at 2:57 PM, drieux wrote: But simply because there is no controlling terminal does NOT mean that there is nothing on STDIN. Were you reading that code backwards? die usage() if @ARGV == 0 and -t; # if ((THERE ARE NO FILENAMES IN ARGV) && # (STDIN IS HOOKED UP TO A TERMIN

Re: PERL debuggers

2004-01-07 Thread Jenda Krynicky
From: <[EMAIL PROTECTED]> > Are there any free PERL debuggers? http://world.std.com/~aep/ptkdb/ Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Te

Re: PERL debuggers

2004-01-07 Thread James Edward Gray II
On Jan 7, 2004, at 2:35 PM, <[EMAIL PROTECTED]> wrote: Beside perldebug, ... Why? This is a very capable debugger. Why would it be a choice to avoid? James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: stop

2004-01-07 Thread Dan Muey
Please tell me this thread will stay in the archives! It's hilarious! I feel kinda bad for Mr. Kapp though, but if you're rude for no good reason what can you expect. > - Original Message - > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Sent: Wednesday, January 07, 2004 14:31 > S

Question about CPAN's Text::Diff

2004-01-07 Thread stuart_clemons
Hi all: This newbie would like to compare two files, let's say File1 and File2. I want to put the difference from File2 only, into a new file, File3. For example: File1.txt oranges apples bananas File2.txt apples kiwi bananas The result I want for File3 is the new entry in File2, which

Re: PERL debuggers

2004-01-07 Thread Wiggins d Anconia
> > Are there any free PERL debuggers? > > I once came across pvdb (a vi-aware front-end for the PERL debugger > developed by Tom Christainsen), but I never got it to work. > perldoc perldebtut perldoc perldebug Have you had a look at those? http://danconia.org p.s. perldoc -q '"Perl"' --

RE: PERL debuggers

2004-01-07 Thread Dan Muey
> Are there any free PERL debuggers? Have you tried use strict and use warnigns in your scripts? Also perl -c script.pl is helpfule and then the perl debugger itself: perl -d I'm sure their's thrid party stuff but I never use any, the above does plenty for my needs. HTH Dmuey > > I once came

RE: stop

2004-01-07 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : : Oh well. An amusing message. I see them all the time in : the Linux mail lists I participate in. Pity people can't : follow directions :-) Be careful what you wish for. If everyone could follow directions we would be one step closer to e

PERL debuggers

2004-01-07 Thread William.Ampeh
Are there any free PERL debuggers? I once came across pvdb (a vi-aware front-end for the PERL debugger developed by Tom Christainsen), but I never got it to work. __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: stop

2004-01-07 Thread Morbus Iff
For the sake of: * giving the guy a break. * expecting some intellect. * realizing he's probably not reading your responses. Notice he didn't say whether he requested to the list, or to the proper email unsubscribe address: just that he had requested multiple times to be removed. The flip si

Re: stop

2004-01-07 Thread u235sentinel
After being part of this list for a month, I don't recall seeing more than just this email requesting removal from the list. Oh well. An amusing message. I see them all the time in the Linux mail lists I participate in. Pity people can't follow directions :-) > Uhhh...at the bottom of every

Re: symbolic references and hashes

2004-01-07 Thread Gary Stainburn
Hi Rob, On Wednesday 07 January 2004 1:48 pm, Rob Dixon wrote: > "Gary Stainburn" <[EMAIL PROTECTED]> wrote in message [snip] > You're trying to dereference $_BLOCKS as a hash reference. Use > > return sort keys %{"_$key"}; > > and it should work. But note that it won't return the keys from > th

Re: stop

2004-01-07 Thread Dan Anderson
Uhhh...at the bottom of every list message is: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: stop

2004-01-07 Thread jeff
you could always change your email address!  Just a thought. - Original Message - From: David Kapp To: [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 14:31 Subject: stop

-t and STDIN was Re: What is the source of my input, file or STDIN?

2004-01-07 Thread drieux
On Jan 7, 2004, at 10:37 AM, Steve Grazzini wrote: [..] I want to test whether STDIN (the default argument for -t) is hooked up to the terminal (which is what -t tells you) so that doesn't block waiting for user input. [..] I have absolutely no problem with the idea that one wants to use '-t' to

RE: putting $1 into a var

2004-01-07 Thread Dan Muey
> Thanks to everyone who helped me with this one, I had a > deadline to meet that is now met. > > It was a missing ~ and me failing to use s on the end of my pattern > > may be of use to other users but for some reason my Linux > server needs s///s; to match over newlines and my OSX set up >

RE: stop

2004-01-07 Thread Dan Muey
> > I've requested 50 times to be taken off your mailing list, > > but you still send me this unwanted mail. > > You've sent 50 emails to [EMAIL PROTECTED] > What a fun thread, I wanted to go off in my usual flare but didn't :( Maybe next time :) > I get no spam from this list ever, maybe it's

Re: putting $1 into a var

2004-01-07 Thread angie ahl
Thanks to everyone who helped me with this one, I had a deadline to meet that is now met. It was a missing ~ and me failing to use s on the end of my pattern may be of use to other users but for some reason my Linux server needs s///s; to match over newlines and my OSX set up doesn't, that didn'

RE: stop

2004-01-07 Thread Dan Muey
> I've requested 50 times to be taken off your mailing list, > but you still send me this unwanted mail. You've sent 50 emails to [EMAIL PROTECTED] I get no spam from this list ever, maybe it's coming from someone who harvested your email address from a web site or something? > I will now repo

RE: [OT] stop

2004-01-07 Thread Ned Cunningham
Yeah or taking the time to blame the users of the list. Happy New Year!!! Ned Cunningham POS Systems Development Monro Muffler Brake 200 Holleder Parkway Rochester, NY 14615 (585) 647-6400 ext. 310 [EMAIL PROTECTED] -Original Message- From: Tim Johnson [

[ADMIN] Re: stop

2004-01-07 Thread Casey West
It was Wednesday, January 07, 2004 when David Kapp took the soap box, saying: : I've requested 50 times to be taken off your mailing list, but you still : send me this unwanted mail. : I will now report all mail sent to me by you as SPAM : Stop sending me spam. You can send a m

RE:[OT] stop

2004-01-07 Thread Tim Johnson
Wow. 50 times. That's some stamina. I imagine that's almost as annoying as getting a humongous Christmas picture background HTML mail in your Perl mailing list... From: David Kapp [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:31 AM To: [E

stop

2004-01-07 Thread David Kapp
I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. I will now report all mail sent to me by you as SPAM Stop sending me spam. 2003 www.hushport.com

Re: Integrating perl scripts into KDE / Gnome

2004-01-07 Thread drieux
On Jan 7, 2004, at 9:00 AM, Dan Anderson wrote: I was curious if anyone knows a good resource on integrating Perl scripts into KDE (and I suppose gnome). I want to start doing things like adding my scripts to my taskbar, and was curious if that was possible without compiling C extensions. ok, I'm

Re: case and functions

2004-01-07 Thread drieux
On Jan 6, 2004, at 2:08 PM, [EMAIL PROTECTED] wrote: Yo. what Up. I read in Learning Perl that there are no such constructs like a case statement. Is there something similar or did I misread this? As folks have already pointed to both the classic perlfaq, and implied that one should consult

Re: What is the source of my input, file or STDIN?

2004-01-07 Thread Steve Grazzini
On Jan 7, 2004, at 1:10 PM, drieux wrote: On Jan 6, 2004, at 12:53 PM, Steve Grazzini wrote: die usage() if @ARGV == 0 and -t; You might not want to test if there is a controlling terminal I want to test whether STDIN (the default argument for -t) is hooked up to the terminal (which is what -t te

Pipe and STDIN - Re: What is the source of my input, file or STDIN?

2004-01-07 Thread drieux
On Jan 6, 2004, at 12:17 PM, [EMAIL PROTECTED] wrote: [..] It just dawned on me that I may not be using the correct terminology since "pipe" and "STDIN" probably imply much more than I mean for them to convey. [..] This is a good angst point to raise. Technically STDIN|STDOUT|STDERR denote merely

Re: Fixed Length Text Extract, Write to Excel

2004-01-07 Thread Wiggins d Anconia
Please bottom post... > Thanks for your reply Joseph, I am reading perlref now. If you can offer > some pointers on how to access the key value pairs of the reference object > %item. I would appreciate it. > May I also suggest the little easier reading of, perldoc perlreftut perldoc perldsc

Re: What is the source of my input, file or STDIN?

2004-01-07 Thread drieux
On Jan 6, 2004, at 1:07 PM, david wrote: [EMAIL PROTECTED] wrote: Case 3. (this is the difficult case for me) the script is invoked with no file and no pipe to it. I would like the script to end quietly, such as test.input.source Instead, it waits for input. test.input.source no command line a

Re: Fixed Length Text Extract, Write to Excel

2004-01-07 Thread Rob Dixon
William Martell wrote: > > I am trying to work with the code I have to extract fields from a text file > report, and write the values into excel. > > I am having trouble. > > When I get to push @order_detail, %item Looking at your code, you mean push @order_detail, \%item > I understand that t

RE: Fixed Length Text Extract, Write to Excel

2004-01-07 Thread NYIMI Jose (BMB)
while(my($key,$val)=each %item){ #do stuff } HTH, José. -Original Message- From: William Martell [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 6:46 PM To: R. Joseph Newton; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Fixed Length Text Extract, Write to Excel

Re: Fixed Length Text Extract, Write to Excel

2004-01-07 Thread William Martell
Thanks for your reply Joseph, I am reading perlref now. If you can offer some pointers on how to access the key value pairs of the reference object %item. I would appreciate it. - Original Message - From: "R. Joseph Newton" <[EMAIL PROTECTED]> To: "William Martell" <[EMAIL PROTECTED]>

Re: Fixed Length Text Extract, Write to Excel

2004-01-07 Thread R. Joseph Newton
William Martell wrote: > Hello All, > > I am trying to work with the code I have to extract fields from a text file report, > and write the values into excel. > > I am having trouble. > > When I get to push @order_detail, %item > I understand that this is pushing an associative array onto a list.

Integrating perl scripts into KDE / Gnome

2004-01-07 Thread Dan Anderson
I was curious if anyone knows a good resource on integrating Perl scripts into KDE (and I suppose gnome). I want to start doing things like adding my scripts to my taskbar, and was curious if that was possible without compiling C extensions. Thanks in advance, Dan -- To unsubscribe, e-mail: [

RE: Drawing an Arc at an angle.

2004-01-07 Thread Dan Muey
> On Wed, 7 Jan 2004 08:55:56 -0600, [EMAIL PROTECTED] (Dan Muey) > wrote: > >> > >> Have you thought about trying to do this on a Tk canvas? > >> The oval item lets you specify the diagonal corners of the oval's > >> bounding box. Tk::canvas can export itself as postscript, so you > >> could do

Re: Perl equivalent of Ruby/DL?

2004-01-07 Thread David Garamond
Rob Dixon wrote: Ruby/DL is a Ruby module that enables one to load a .DLL/.so and start using exported functions available in the DLL. It's a nice alternative of using an external library without messing with XS or writing real C files. Ruby/DL has been included in the standard Ruby distribution si

Array Manipulations

2004-01-07 Thread binhqnguyen
Hello Everyone, I am a Perl newbie trying to learn as much Perl as I can. I am trying to combine specific array elements into one single array element so that I can write to an Excel cell, where all the data will fit. For instance I have, array[0] = "F1: blue"; array[1] = "F2: green"; array[2]

RE: Using File::Find to generate playlists

2004-01-07 Thread Dan Muey
> Ok, please don't laugh. This is my very first shot at Perl and if I > learn something, I'll be putting it to use for more important tasks. > > Thanks in advance for any comments. > > > #!/usr/bin/perl > > # A dorkey little perl scr

RE: Drawing an Arc at an angle.

2004-01-07 Thread Dan Muey
> On Tue, 6 Jan 2004 11:03:14 -0600, [EMAIL PROTECTED] (Dan Muey) > wrote: > > >> Dan Muey wrote: > >> > > >> > I've made a funtion to calculate the Fresnal zone for wireless > >> > connections. > >> > > >> > What I'd like to do is generate an image based on that. > >> Something like > >> > the ex

Re: Perl equivalent of Ruby/DL?

2004-01-07 Thread Jenda Krynicky
From: David Garamond <[EMAIL PROTECTED]> > Ruby/DL is a Ruby module that enables one to load a .DLL/.so and start > using exported functions available in the DLL. It's a nice alternative > of using an external library without messing with XS or writing real C > files. Ruby/DL has been included in t

Re: putting $1 into a var

2004-01-07 Thread R. Joseph Newton
angie ahl wrote: > hi people > > I'm trying to get the value of $1 into a var, the following don't work > and I can't figure out why > > $_ = $html_body; > my ($resrow) = m#(.*?)#; > #print $1; > print $resrow; > > $resrow holds nothing, however if I print $1 I do have a match How

Post Script - Hylafax - Text File - perl

2004-01-07 Thread Paul Kraus
I want to write a script that takes piped input and then fills out a purchase order form that can then be sent to Hylafax as a postscript file. Is there a way to write postscript with perl? I know very little about it. Picture an empty purchase order form. I guess this would be saved as a template

Re: case and functions

2004-01-07 Thread William.Ampeh
You can do something like this: my $flip = "something"; SWITCH: { ( $flip =~ /^0$/ || $flip =~ /^1$/ || $flip =~ /^2$/ ) && do { $local_pref = "FL"; last SWITCH; }; ( $flip =~ /^3$/ || $flip =~ /^4$/ || $flip =~ /^5$/ ) && do { $local_pref = "FU"; las

Fixed Length Text Extract, Write to Excel

2004-01-07 Thread William Martell
Hello All, I am trying to work with the code I have to extract fields from a text file report, and write the values into excel. I am having trouble. When I get to push @order_detail, %item I understand that this is pushing an associative array onto a list. (array of hashes) I am trying to wri

Re: symbolic references and hashes

2004-01-07 Thread Rob Dixon
"Gary Stainburn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi folks, > > I've got the code: > > package Trainset; > > my %_BLOCKS=(); # blocks of track > my %_TRAINS=(); # trains > my %_BOXS=(); # signalboxes > > sub blocks { # Return list of blocks > sort keys %_BLOCKS; >

Re: putting $1 into a var

2004-01-07 Thread Rob Dixon
Angie Ahl wrote: > > I'm trying to get the value of $1 into a var, the following don't work > and I can't figure out why > > $_ = $html_body; > my ($resrow) = m#(.*?)#; >m#(.*?)#; > #print $1; > print $resrow; > > $resrow holds nothing, however if I print $1 I do

RE: putting $1 into a var

2004-01-07 Thread Charles K. Clarkson
angie ahl <[EMAIL PROTECTED]> wrote: : : I'm trying to get the value of $1 into a var, the following : don't work and I can't figure out why : : $_ = $html_body; : my ($resrow) = m#(.*?)#; : #print $1; : print $resrow; : : $resrow holds nothing, however if I print $1 I do have a

putting $1 into a var

2004-01-07 Thread angie ahl
hi people I'm trying to get the value of $1 into a var, the following don't work and I can't figure out why $_ = $html_body; my ($resrow) = m#(.*?)#; #print $1; print $resrow; $resrow holds nothing, however if I print $1 I do have a match $_ = $html_body; m#(.*?)#; m

symbolic references and hashes

2004-01-07 Thread Gary Stainburn
Hi folks, I've got the code: package Trainset; my %_BLOCKS=(); # blocks of track my %_TRAINS=(); # trains my %_BOXS=(); # signalboxes sub blocks { # Return list of blocks sort keys %_BLOCKS; } sub trains { # Return list of trains sort keys %_TRAINS; } sub boxes { # Return list of signalbo

Re: Compare two array's

2004-01-07 Thread Rob Dixon
Jerry Preston wrote: > > I know that this is a no brainer, but I cannot not get it! I want to > compare two arrays and delete the same values in one array. > > foreach $j ( @a1 ) { > foreach $p ( @a2 ) { > $a2[ $p ] = undef if $a1[ $j ] == $a2 $p ]; > } > } > > What is wrong and is there

Re: Perl equivalent of Ruby/DL?

2004-01-07 Thread Rob Dixon
David Garamond wrote: > > Ruby/DL is a Ruby module that enables one to load a .DLL/.so and start > using exported functions available in the DLL. It's a nice alternative > of using an external library without messing with XS or writing real C > files. Ruby/DL has been included in the standard Ruby

Using File::Find to generate playlists

2004-01-07 Thread Alan
Ok, please don't laugh. This is my very first shot at Perl and if I learn something, I'll be putting it to use for more important tasks. Thanks in advance for any comments. #!/usr/bin/perl # A dorkey little perl script using File::Fi

Re: Compare two array's

2004-01-07 Thread John W. Krahn
Jerry Preston wrote: > > Hi!, Hello, > I know that this is a no brainer, but I cannot not get it! I want to > compare two arrays and delete the same values in one array. > > foreach $j ( @a1 ) { > foreach $p ( @a2 ) { > $a2[ $p ] = undef if $a1[ $j ] == $a2 $p ]; > } > } > > What is

Re: Compare two array's

2004-01-07 Thread Jan Eden
Maybe the missing opening bracket on the third line? >$a2[$p] = undef if $a1[$j] == $a2[$p]; Being a beginner myself, I cannot recommend a better way. - Jan Jerry Preston wrote: >Hi!, > >I know that this is a no brainer, but I cannot not get it! I want to >compare two arrays and delete the s

Re: Adding white spaces

2004-01-07 Thread John W. Krahn
Jakob Kofoed wrote: > > Hi All, Hello, > I have a file looking like (where \n is new line): > > blabla\n > blablablablablabla\n > blablablablablablablablablabla\n > blabla\n > > but I need every line to have 80 characters - in this case filled with white > space. > > I can figure out how to d

Re: Learning Objects, destroy methods

2004-01-07 Thread Gary Stainburn
On Tuesday 06 January 2004 6:09 pm, Randal L. Schwartz wrote: > > "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: > > Gary> My idea is to keep only the %_BLOCKS as a strong ref and weaken > Gary> all others. That way, I can guarantee that when I delete that > Gary> ref the object will be

Re: What is the source of my input, file or STDIN?

2004-01-07 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > As I understand it, <> operator will open all items in @ARGV allowing > one to do a shell command line of > >perl.script file1 file2 file3 > > and inside perl.script you only need > > while (<>) { ... syntax to read all the files on the command line. > > <> wil

Compare two array's

2004-01-07 Thread Jerry Preston
Hi!, I know that this is a no brainer, but I cannot not get it! I want to compare two arrays and delete the same values in one array. foreach $j ( @a1 ) { foreach $p ( @a2 ) { $a2[ $p ] = undef if $a1[ $j ] == $a2 $p ]; } } What is wrong and is there a better, PERL way to do this? Tha