RE: Windows Text editor

2002-02-06 Thread Al Hospers
Which of these editors show the number of the current line in the status bar? OptiPerl can display line numbers. Al -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: splitting a vector... or something like that!?

2002-02-06 Thread Shawn
- Original Message - From: Terje Bremnes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 6:11 AM Subject: splitting a vector... or something like that!? Hi, I am a beginner in writing Perl-cgi scripts, and hope you can help me with the following

Re: Windows Text editor

2002-02-06 Thread Vinicius Jose Latorre
GNU Emacs for Windows NT/9x/2000: + can show line number + can show date/time + has a lot of mode editing (for almost all languages known) + has color highlight + deal with indentation + can edit via ftp + deal with different line break conventions + can open a lot of

Make Question

2002-02-06 Thread Stephen.Hurley
Hi, Vaguely Perl related question...after following some of the discussion about HTML::Template the other day, I decided to go and get myself a copy. I'm running on NT (...I know, I'm moving to linux soon) and I can't seem to get it installed. I'm using a copy of make that I got with the unxutils

Fetching a cookie

2002-02-06 Thread webmaster
Hello all, For some reason, the simple art of setting and retrieving a cookie is giving me a problem. I am using Perl 5.005_03 (using 5.6 is not something I can enforce, unfortunately). I have one CGI script that sets a cookie using the following code: $cookie = new CGI::Cookie(-name

printing an email address

2002-02-06 Thread Octavian Rasnita
I tried to print my email address when it is enclosed in and signs but it didn't print anything. The code: my $line; $line= orasnita\@yahoo.com; # I also tried with $line = \orasnita\@yahoo.com\; print $line; Nothing is printed. It prints only if I don't use the and signs. Thank you!

Re: printing an email address

2002-02-06 Thread Richard Crawford
Try this: $line = lt;[EMAIL PROTECTED]gt;; Alternatively, $line=htmlspecialchars([EMAIL PROTECTED]); On Wed, 2002-02-06 at 19:11, Octavian Rasnita wrote: I tried to print my email address when it is enclosed in and signs but it didn't print anything. The code: my $line; $line=

Re: printing an email address

2002-02-06 Thread Richard Crawford
D'oh! This won't work in Perl. For some reason I thought I was answering a PHP question. Damn flu. My apologies if I confused anyone. Richard On Wed, 2002-02-06 at 09:34, Richard Crawford wrote: Try this: $line = lt;[EMAIL PROTECTED]gt;; Alternatively,

RE: printing an email address

2002-02-06 Thread Hanson, Robert
It looks like that is the answer though, in a roundabout way. Teddy, if this is for output into an HTML page, no, it won't show up because and are special chars. You need to HTML encode them, manually or otherwise. This should work: $line = lt;orasnita\@yahoo.comgt;; print $line; Rob

Re: printing an email address

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Octavian Rasnita wrote: I tried to print my email address when it is enclosed in and signs but it didn't print anything. The code: my $line; $line= orasnita\@yahoo.com; # I also tried with $line = \orasnita\@yahoo.com\; print $line; No need for the double quotes

Re: printing an email address

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Brett W. McCoy wrote: On Wed, 6 Feb 2002, Octavian Rasnita wrote: I tried to print my email address when it is enclosed in and signs but it didn't print anything. The code: my $line; $line= orasnita\@yahoo.com; # I also tried with $line =

CGI Form Submit Buttons

2002-02-06 Thread Patrick
Is there any way to change the way a submit button looks on forms and CGI generated forms. I want to try to have them looking like the other buttons on my site instead of the standard grey buttons that come as default. PAT By the way thanks for all the tips on text editors Check out

RE: CGI Form Submit Buttons

2002-02-06 Thread Troy May
input type=image src=submit.gif alt=Submit Form Then just make a submit.gif for what you want to use as the submit image. -Original Message- From: Patrick [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 5:47 PM To: [EMAIL PROTECTED] Subject: CGI Form Submit Buttons Is

Re: CGI Form Submit Buttons

2002-02-06 Thread Andre` Niel Cameron
input type=image src=submit.gif alt=Submit Form I personaly have had trouble with this. what exactly tells it that it is the submit button and not just a button? Andre -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: CGI Form Submit Buttons

2002-02-06 Thread Troy May
The type attribute itself takes care of this. Other than standard form types you can only use the image attribute. This allows it to act as a submit button since there is no way to use an image for the Clear button. The default is submit for type=image within a form. -Original

RE: CGI Form Submit Buttons

2002-02-06 Thread Troy May
type=image defaults to submit within a form. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 6:34 PM To: [EMAIL PROTECTED] Subject: RE: CGI Form Submit Buttons Doesn't this button need a javascript onclick that does a

Re: CGI Form Submit Buttons

2002-02-06 Thread Andre` Niel Cameron
But what about cases of having two image buttons? Does the one that is clicked default as submit or does this require java script? Regards, André C. Technical Support Ô¿Ô¬ - Visit our support manual at

RE: CGI Form Submit Buttons

2002-02-06 Thread Troy May
I've never done a form with 2 image buttons meaning submit. But, there is NO way to make an image act like a true clear button of a form. If you want to do this, just link that clear image back to the current URL of the form. It acts like a simple refresh. In what other cases would you have 2

Re: CGI Form Submit Buttons

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Andre` Niel Cameron wrote: But what about cases of having two image buttons? Does the one that is clicked default as submit or does this require java script? You give them differnet names and have your script do different things based on the name that was clicked. --

making a dns record on the fly

2002-02-06 Thread Nate Brunson
Hi i need to make a perl script that will make DNS 'A' records on the fly, like i pass is the nameand it will make and A record according to the name, ie: i pass it dumbsub from and html file and it creates dumbsub A record in a specified zone, like cool.com, and points it to a specified ip

Re:How to delete a symlink

2002-02-06 Thread Jorge Goncalvez
Hi, I wanted to verify if a symlink exists and delete it if it exists My code is: my $program_path = c:\\cygwin\\bootp\\linux; my @program = ( $program_path\\$_Globals{LX_VERSION}, $program_path\\install, $program_path\\linux.ram, $program_path\\alize\\install,

flock with nfs

2002-02-06 Thread Alain
Hi, I need to use flock function with files on nfs partitions. I've read that flock only works with local files, and that perl needs to be configured to use fcntl by default, instead of flock. The only information I found is to use -Ud_flock with the Configure script. Does anyone know if

RE: Study group for motivated people wanting to learn Perl.

2002-02-06 Thread Mok T.Y.-r15382
Please count me in Regards, TY Mok -Original Message- From: Kevin Werckman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 7:27 PM To: [EMAIL PROTECTED] Subject: Study group for motivated people wanting to learn Perl. I'm hoping to get a small study group together

sockets help??

2002-02-06 Thread Hotmail - mrengc
Hello, Just wondering if you could give me a hand with sockets? If not I understand. I am trying to write winsock software to have one client connect to three different server computers (not simultaneously) by simple sock stream. I tried to create one socket and connect to each computer.

Illegal character error for blank line.

2002-02-06 Thread Student of Perl
Hi there, i have very strange problem. I have a simple script which I run on Windows98 (PC) and it executed properly. But when I sent it to someboday by email who uses Unix ; it give error. The first 3 lines of the script are comments in following format. # comment1 # comment2 # comment3

Re: Illegal character error for blank line.

2002-02-06 Thread Tanton Gibbs
You've run across the typical cross-platform issues that arise between Unix and Windows. The problem is that Windows uses \r\n to terminate a line while Unix just uses \n. When perl on unix sees \r it doesn't know what to do because it only expects \n. Therefore, to correct the problem, you

Re: sockets help??

2002-02-06 Thread walter valenti
I am trying to write winsock software to have one client connect to three different server computers (not simultaneously) by simple sock stream. I tried to create one socket and connect to each computer. Once the previous connection is completed with one of the computers, I would change

Re: Illegal character error for blank line.

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Tanton Gibbs wrote: You've run across the typical cross-platform issues that arise between Unix and Windows. The problem is that Windows uses \r\n to terminate a line while Unix just uses \n. When perl on unix sees \r it doesn't know what to do because it only expects

nonzero $! value after closing a pipe normally

2002-02-06 Thread gungor_o
Hi all, I have a code part like the following. open MYPROFILE, cat mytxtfile |; if ( $! != 0 ) { print h1 - $!\n; } while (MYPROFILE) { next if /^(tcp|udp)/; print; } close MYPROFILE or die bad: $! $?; if ( $! != 0 ) { pr_my_error_routine “close error in MYPROFILE with $!\n”; } As a

Re: nonzero $! value after closing a pipe normally

2002-02-06 Thread Shawn
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 6:07 AM Subject: nonzero $! value after closing a pipe normally Hi all, I have a code part like the following. open MYPROFILE, cat mytxtfile |; Why not say: open MYPROFILE, cat

socket help, last time i promise ;)

2002-02-06 Thread Scott L Ryan
I want to display a message when a client connects to the server. msg right now, I cannot seem to display that message until I have received something from the client and I want to display it before the client sends anything. puzzling.. #!/usr/local/bin/perl use Socket; if (!@ARGV) {

RE: nonzero $! value after closing a pipe normally

2002-02-06 Thread gungor_o
Thank you Shawn. I will use other alternatives for error checking. OKI -Original Message- From: Shawn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 2:22 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]

Re: Illegal character error for blank line.

2002-02-06 Thread William.Ampeh
In Unix, the person has to do two things 1./ On the very first line of the file, he/she has to insert the location of his/her PERL interpreter (the location of the PERL interpreter can be found with which PERL). For example; redhat1:/home/(38)% which perl /opt/local/bin/perl

Re:A more perlish way

2002-02-06 Thread Jorge Goncalvez
Hi, I have this : my $program_path = c:\\cygwin\\bootp\\linux; my $Symlink=$program_path\\install.lnk; my $Symlink2=$program_path\\linux.ram.lnk; my $Symlink3=$program_path\\alize\\install.lnk; my $Symlink4=$program_path\\alize\\startup.txt.lnk; if (-e

Re: socket help, last time i promise ;)

2002-02-06 Thread walter valenti
Scott L Ryan wrote: I want to display a message when a client connects to the server. msg right now, I cannot seem to display that message until I have received something from the client and I want to display it before the client sends anything. puzzling.. #!/usr/local/bin/perl use

Re: A more perlish way

2002-02-06 Thread Frank
On Wed, Feb 06, 2002 at 03:05:29PM +0100, Jorge wrote: I tried this: @Symlink=($program_path\\install.lnk, $program_path\\linux.ram.lnk, $program_path\\alize\\install.lnk, $program_path\\alize\\startup.txt.lnk);

RE: Perl and CGI

2002-02-06 Thread William.Ampeh
A CGI script could be a shell script, a compiled program written in C/C++/PASCAL (I even have a client whose CGI programs were developed in FORTRAN), PERL, PHP, EXPECT, TCL. Basically any program that can run on your WEB server (without going in details). CGI scripts,need not contain:

Re: A more perlish way

2002-02-06 Thread Matt C.
Also I think you need to put the call to phrase the system command like this: system(rm $_); But perl has unlink, which is cleaner and could give you style points (this coming from someone who has little perl style, of course!). So you could (should?) just say: foreach (@Symlink) { unlink if

Difference between == and eq

2002-02-06 Thread wim
Hello, I have a small question: what's the difference between == and eq? When I do: if ( $menuitem == modify_router) { print Modify routerbr; } else { print Add routerbr; } it doesn't work. But when I change it to: if ( $menuitem eq modify_router) { It works! How

Re: files

2002-02-06 Thread P0R0NG
hi andrea! thank you for your help - it did work. i have some extra problems though. in the code, i replaced nat with a variable (let's call it $section), here's my code snippet: ### start of snippet ### #this is the xml repository where all xml files where residing chdir $repository; #

Re: Difference between == and eq

2002-02-06 Thread walter valenti
eq: to use for the strings = : to use in numeric contest.(if you = in string contest in every true). If you don't know if are string or numerical use eq Walter Hello, I have a small question: what's the difference between == and eq? When I do: if ( $menuitem == modify_router)

Re: Difference between == and eq

2002-02-06 Thread Shawn
- Original Message - From: wim [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 8:39 AM Subject: Difference between == and eq Hello, I have a small question: what's the difference between == and eq? == is a numeric compare 1 == 1 eq is a stringwise

RE: Difference between == and eq

2002-02-06 Thread Murphy, Land
eq is used for comparing strings while == is used for numeric comparisons. HTH -Original Message- From: wim To: [EMAIL PROTECTED] Sent: 2/6/2002 8:39 AM Subject: Difference between == and eq Hello, I have a small question: what's the difference between == and eq? When I do: if (

LISTBOX Problem

2002-02-06 Thread Mike
I am trying to populate a list box in a form with using the following script and it works fine doing it this way: #!/usr/bin/perl print Content-type: text/html\n\n; print HTMLHEAD\n; print TITLE Current Weather Products/TITLE\n; print /HEAD\n; print BODY\n; #print select name=\select\\n; print

Not your average system() question...

2002-02-06 Thread kevin . schmidt
I understand how the system command works. I understand the difference between system() and backticks. My question is this: I want to make a call to an external program and I want the output printed to the command line as it is processing, BUT, I also want the output returned to me so that I

RE: Not your average system() question...

2002-02-06 Thread Nikola Janceski
use : $| =1; open(COMMAND, command | ); while(COMMAND){ print STDOUT; ## do whatever you want with $_ } close COMMAND; __END__ you can then read the output and print it and whatever. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent:

help for sed

2002-02-06 Thread r p
hi everyone. i am trying to use sed in order to change all my batch script. the pb is: i have the following batch: @echo on TIMETHIS.exe k:\Validation\Soft\abc.exe k:\test_1.sct k:\Validation\PlugIn\abc.link k:\test_1.log @echo off exit i want to delete

RE: LISTBOX Problem

2002-02-06 Thread Troy May
The first line of here-docs should end with a semi-colon: print END; blah, blah, blah END Try that. -Original Message- From: Mike [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 6:28 AM To: [EMAIL PROTECTED] Subject: LISTBOX Problem I am trying to populate a list box

Re: Illegal character error for blank line.

2002-02-06 Thread Dave Benware
Student of Perl wrote: Hi there, i have very strange problem. I have a simple script which I run on Windows98 (PC) and it executed properly. But when I sent it to someboday by email who uses Unix ; it give error. The first 3 lines of the script are comments in following format.

Re: Difference between == and eq

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, wim wrote: I have a small question: what's the difference between == and eq? == is for numeric comparisons, eq is for textual comparisons. See perldoc perlop -- Brett http://www.chapelperilous.net/

Re: Not your average system() question...

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002 [EMAIL PROTECTED] wrote: I understand how the system command works. I understand the difference between system() and backticks. My question is this: I want to make a call to an external program and I want the output printed to the command line as it is processing, BUT, I

Re: A more perlish way

2002-02-06 Thread Michael Lamertz
On Wed, Feb 06, 2002 at 03:05:29PM +0100, Jorge Goncalvez wrote: I tried this: @Symlink=($program_path\\install.lnk, $program_path\\linux.ram.lnk, $program_path\\alize\\install.lnk,

OO perl problem

2002-02-06 Thread Fitzpatrick, Matthew
Hello, my name is matthew fitzpatrick, and i am having some small difficulty in my implimentation of Mail::Sender. The problem is that when there are multiple calls to $sender-MailFile or $sender-MailMsg in my loop, only the first match for each MailFile or MailMsg actually gets sent with

Re: regex and pattern matching

2002-02-06 Thread Dave Benware
Jeff 'japhy' Pinyan wrote: On Feb 5, [EMAIL PROTECTED] said: Problem is I don't know how to escape the entire variable $value_a so that the . is not considered a quantifier. You have $value_a and $value_b in the wrong place in your example. Speaking of $a and $b, I seem to recall that

Text block switching or HTML Templating

2002-02-06 Thread Rashid Faraby
Dear Friends, I am faced with a dilemma related to a website I am in the process of redesigning. I have a number of pages which have extensive javascript to control my drop-down menues. The thing is I have modified this section after creating all the pages for the site because I added more

Re: regex and pattern matching

2002-02-06 Thread Brett W. McCoy
Problem is I don't know how to escape the entire variable $value_a so that the . is not considered a quantifier. You have $value_a and $value_b in the wrong place in your example. Speaking of $a and $b, I seem to recall that both of those are special variables in that they are exempt

RE: socket help, last time i promise ;)

2002-02-06 Thread Bob Showalter
-Original Message- From: Scott L Ryan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 7:29 AM To: [EMAIL PROTECTED] Subject: socket help, last time i promise ;) I want to display a message when a client connects to the server. msg right now, I cannot seem

Re: Study group for motivated people wanting to learn Perl.

2002-02-06 Thread Kevin Werckman
Mok T.Y.-r15382 wrote: Please count me in Regards, TY Mok We have about 11 people so far which is great. We could use more since we are going to limit scope and topic for the study group. Although to be honest, I'd be happy using this list if there was a a way identify scope and

RE: socket help, last time i promise ;)

2002-02-06 Thread Scott L Ryan
Thanks for the response... but It is now fixed ;) I have highlighted what was the issue - walter you are the don! #!/usr/local/bin/perl use Socket; if (!@ARGV) { print Script cannot be called with no Port Number doh!\n; } else { $server_port = $ARGV[0]; socket(SERVER, PF_INET,

sort on anonymous array elements as hash values

2002-02-06 Thread birgit kellner
my %hash = ( 'keyone' = ['firstvalueone', 'firstvaluetwo], 'secondkey' = ['anothervalueone', 'valuetwoforsecondkey'], 'keythree' = ['thirdvalueone', 'thirdvaluetwo'] ); Can I sort the hash on the second element of the anonymous array? Output should be:

RE: Text block switching or HTML Templating

2002-02-06 Thread Hanson, Robert
I always prefer using templates (actually HTML::Template like Scot mentioned), but it won't make you pages dynamic, each page would need to be accessed through a script. You could though use HTML::Template to create templates on your dev server (which would be your own PC, and then write a

RE: sort on anonymous array elements as hash values

2002-02-06 Thread Nikola Janceski
yes: @sorted_keys = sort { $hash{$a}[2] cmp $hash{$b}[2] } keys %hash; -Original Message- From: birgit kellner [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 11:36 AM To: [EMAIL PROTECTED] Subject: sort on anonymous array elements as hash values my %hash = (

Re: Not your average system() question...

2002-02-06 Thread William.Ampeh
I usually do not use system or command ticks. I always pipe the output to STDOUT if I wish to manipulate the output of any system command. Alternatively, you could redirect output to a TEMP file, then read from that file, but piping is more efficient. open MY_STDOUT, {system command} | or

RE: sort on anonymous array elements as hash values

2002-02-06 Thread Nikola Janceski
oops that should have been @sorted_keys = sort { $hash{$a}[1] cmp $hash{$b}[1] } keys %hash; -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 11:48 AM To: 'birgit kellner'; [EMAIL PROTECTED] Subject: RE: sort on anonymous array

Kinda OT.. Updating Perl/Installing modules on a large network

2002-02-06 Thread Carl Rogers
Good day; I work in an environment where the stuff that goes onto our network is tightly regulated. In my time of subscribing to this list, I have found there to be a bunch of modules available on CPAN that we don't have access to. (Our current baseline is v5.005_03 !!!). I would like to

Execute perl Script

2002-02-06 Thread Mike
How do you execute a perlscript within a perl script via the web? Mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sort on anonymous array elements as hash values

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, birgit kellner wrote: my %hash = ( 'keyone' = ['firstvalueone', 'firstvaluetwo], 'secondkey' = ['anothervalueone', 'valuetwoforsecondkey'], 'keythree' = ['thirdvalueone', 'thirdvaluetwo'] ); Can I sort the hash on the second element of the anonymous

Re: sort on anonymous array elements as hash values

2002-02-06 Thread Michael Lamertz
On Wed, Feb 06, 2002 at 05:35:44PM +0100, birgit kellner wrote: my %hash = ( 'keyone' = ['firstvalueone', 'firstvaluetwo], 'secondkey' = ['anothervalueone', 'valuetwoforsecondkey'], 'keythree' = ['thirdvalueone', 'thirdvaluetwo'] ); Can I sort the hash on the

RE: Execute perl Script

2002-02-06 Thread Hanson, Robert
It depends on exacly what you are trying to do. do executes a script. `perl foo.pl` runs the script and returns the output. system runs the script, no output returned. eval runs a piece of code (usually for dynamic code). Rob -Original Message- From: Mike [mailto:[EMAIL PROTECTED]]

Re: Kinda OT.. Updating Perl/Installing modules on a large network

2002-02-06 Thread Gary
Carl: This is an issue that I have been dealing with in one form or another for about 5 years. In my opinion the real issue here is one of configuration management. In my case we have about 10 FreeBSD boxes all with various perl scripts running on them. We also have 3 developmental (or

Re: Not your average system() question...

2002-02-06 Thread Christopher Solomon
On Wed, 6 Feb 2002 [EMAIL PROTECTED] wrote: I understand how the system command works. I understand the difference between system() and backticks. My question is this: I want to make a call to an external program and I want the output printed to the command line as it is processing, BUT, I

Re: help for sed

2002-02-06 Thread Michael Kelly
On 2/6/02 6:58 AM, r p [EMAIL PROTECTED] wrote: hi everyone. i am trying to use sed in order to change all my batch script. Is it just me, or is this a Perl list, not a sed list? -- Michael Kelly [EMAIL PROTECTED] http://www.jedimike.net -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Sorting an array of hashes

2002-02-06 Thread Tomasi, Chuck
Does anyone have any clever ideas for sorting an array of hashes based on a key such as an ID number? Example: @AoH = ( { ID = 10101, UserID = 1041, Status = 2 }, { ID = 10541, UserID = 1211, Status = 1 }, { ID = 10111, UserID = 1211, Status = 2 }, { ID = 10721,

RE: Sorting an array of hashes

2002-02-06 Thread Nikola Janceski
@sorted = sort { $a-{ID} = $b-{ID} ## remember that $a and $b become the element of the array ## so if it's a reference to a hash use a dereferencer '-' or # $$a{ID} = $$b{ID} # will work too! } @AoH; foreach $item (@sorted){ print $item-{ID},

command line arguments

2002-02-06 Thread ABhagwandin
This script gives me nothing: #!/usr/bin/perl -F/\t/ -ap print @F[14 .. 17] if $F[0] eq H and $F[5] = 1816; print @F[14 .. 17] if $F[0] eq H and $F[5] = 5380; print @F[14 .. 17] if $F[0] eq H and $F[5] = 5370; The file is indeed tab delimited, and the sixth field should have a number in it

Re: Sorting an array of hashes

2002-02-06 Thread Chas Owens
On Wed, 2002-02-06 at 14:17, Tomasi, Chuck wrote: Does anyone have any clever ideas for sorting an array of hashes based on a key such as an ID number? Example: @AoH = ( { ID = 10101, UserID = 1041, Status = 2 }, { ID = 10541, UserID = 1211, Status = 1 }, { ID =

Re: Sorting an array of hashes

2002-02-06 Thread Shawn
- Original Message - From: Tomasi, Chuck [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 06, 2002 1:17 PM Subject: Sorting an array of hashes Does anyone have any clever ideas for sorting an array of hashes based on a key such as an ID number? Example: @AoH =

Re: Sorting an array of hashes

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Tomasi, Chuck wrote: Does anyone have any clever ideas for sorting an array of hashes based on a key such as an ID number? Example: @AoH = ( { ID = 10101, UserID = 1041, Status = 2 }, { ID = 10541, UserID = 1211, Status = 1 }, { ID = 10111,

perl/tk: checkbutton value in array?

2002-02-06 Thread Kurt Werth
I've gotta be missing something simple here. How is it possible to store the values of multiple checkbuttons in an array? The code below acts like I've created a single checkbutton: for example, selecting one of ten selects all ten. for ($x = 0; $x = $file_counter-1; $x++) {

HANDLE Construct Question

2002-02-06 Thread mike . silver
Hello, Can anyone stand me up on this I keep getting a warning message: Value of HANDLE construct can be 0; test with defined() at mk_LNPTYPE_counts line 65535 What does this mean? What does line 65535 refer to? I only have about 20 lines of code.

RE: perl/tk: checkbutton value in array?

2002-02-06 Thread Nikola Janceski
for ($x = 0; $x = $file_counter-1; $x++) { $win_ckbox_array[$x] = $right2-Checkbutton(-background='blue',-variable=\$ckbox_stat[\$x])-pack (pady=2); } ## you got backslash happy I think shouldn't it be: $right2-Checkbutton(-background='blue',-variable=\$ckbox_stat[$x])-pack( pady=2); ##

Re: HANDLE Construct Question

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002 [EMAIL PROTECTED] wrote: Can anyone stand me up on this I keep getting a warning message: Value of HANDLE construct can be 0; test with defined() at mk_LNPTYPE_counts line 65535 What does this mean? What does line 65535 refer to? I

RE: perl2exe

2002-02-06 Thread Jenda Krynicky
From: Timothy Johnson [EMAIL PROTECTED] I think you are only supposed to get the nag message until you register, but yeah, it's still there. I have not tried lately, but last time I did you could get rid of the message very easily (it was about 3 years ago). You were only

RE: HANDLE Construct Question

2002-02-06 Thread mike . silver
Sorry about not including code. Basically, it is: open(REGION_NAME, region_file); while($region = REGION_NAME) { print $region; } close(REGION_NAME); Michael G. Silver Spec.- Internal Network Fort Wayne NSSC (219)-480-2751

RE: HANDLE Construct Question

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002 [EMAIL PROTECTED] wrote: Sorry about not including code. Basically, it is: open(REGION_NAME, region_file); You should test to see if the open failed: open(REGION_NAME, 'region_file') or die Could not open region_file: $!\n; while($region =

Re: HANDLE Construct Question

2002-02-06 Thread Shawn
[snip] close(REGION_NAME); You should also test to make sure the close worked, like you do for the opening. I have never heard of such a thing? Is it a common problem to have files not close? And if it does not close, what problems would you have (assuming that the file would close

system info

2002-02-06 Thread Jesse Ahrens
Is there a perl function that'll return system info such as total RAM or other dmesg info aside from regexing dmesg itself? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Sorting an array of hashes

2002-02-06 Thread Tomasi, Chuck
Thanks all for the reply! This worked wonderfully. I also tried reverse() and switching the a/b around to get a reverse sorted order with equal success. Thanks again! --Chuck -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002

RE: HANDLE Construct Question

2002-02-06 Thread mike . silver
I am using the -w option and yes, I do make checks for open and close. The input file is only 6 lines long. The only thing not included in the code I gave was the open/close file checks. Is this Solaris specific problem? Thanks to all for the

RE: HANDLE Construct Question

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002 [EMAIL PROTECTED] wrote: I am using the -w option and yes, I do make checks for open and close. The input file is only 6 lines long. The only thing not included in the code I gave was the open/close file checks. Well, I guess using die on a

Re: help for sed

2002-02-06 Thread Bill Akins
I believe Perl has all of the funtionality of sed so why not use the substr() function? I have not tested it and I'm sure others here can do this in one line, but couldn't you do something like this? if ($string =~ / /i) { $ll = (length($string) - 3); $string = substr($string, 1, $ll); } With

what have I gotten myself into and how do I get out

2002-02-06 Thread John
I believe that what my application requires is a hash of hashes that each reference an array of hashes. What is the best way to rewrite this structure or the access to it so that I do not need one foreach within another? #!/usr/bin/perl -w use Strict; my %cfg = ( outer_key1 = {

use Strict/use strict (was Re: what have I...)

2002-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, John said: #!/usr/bin/perl -w use Strict; You are using Windows (sorry). Please change that line to use strict; Because Windows is case-INsensitive, 'use Strict' loads strict.pm, but because Perl is case-sensitive, the effects of strict.pm are never enabled. -- Jeff japhy

Accessing previous element of an array in a 'foreach' loop

2002-02-06 Thread Carl Rogers
Good day; I'm using foreach to do something to an array. is there a way I can reference a previously 'seen' element without having to traverse the array with a for(;;) statement? ie. I'd like this to work: foreach(@array) { if ($_ =~/somecondition/) { # I want to do

RE: Accessing previous element of an array in a 'foreach' loop

2002-02-06 Thread Nikola Janceski
I can only think of setting a variable at the end of the foreach like foreach my $file (@files) { ## do stuff my $last = $file; } -Original Message- From: Carl Rogers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 4:40 PM To: [EMAIL

Using require()

2002-02-06 Thread Naveen Parmar
Does require() work only twice? I've tried multiple loops only to get this to work a third time. After every time, however, it automatically exits. Here's an example: if (a = true) { require 'naveen.pl; } else { print You are not Naveen.\n; exit; As long as a = true, it should call

Re: Accessing previous element of an array in a 'foreach' loop

2002-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, Carl Rogers said: I'm using foreach to do something to an array. is there a way I can reference a previously 'seen' element without having to traverse the array with a for(;;) statement? ie. I'd like this to work: foreach(@array) { if ($_ =~/somecondition/) { # I

Re: Accessing previous element of an array in a 'foreach' loop

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Carl Rogers wrote: Good day; I'm using foreach to do something to an array. is there a way I can reference a previously 'seen' element without having to traverse the array with a for(;;) statement? ie. I'd like this to work: foreach(@array) { if ($_

Re: Accessing previous element of an array in a 'foreach' loop

2002-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, Brett W. McCoy said: On Wed, 6 Feb 2002, Carl Rogers wrote: foreach(@array) { if ($_ =~/somecondition/) { # I want to do something to the element prior to $_ ($_ - 1) } } The problem here is that $_ is a *copy* of the element in the array -- modifying it does not

Installing Perl

2002-02-06 Thread Chi Lin
Have you had any trouble installing Perl on 98 or 2000? I couldn't install Windows installer 1.1 in Win2K. When I tried to install the executable file, the following error is displayed: Windows Installer installed completely I tried to see the files, but there are no perl executable files on

  1   2   >